diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
commit | f008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch) | |
tree | 8e9244c4d4957c36be81e15b566b4aa5ea26c982 /kugar/part | |
parent | 1210f27b660efb7b37ff43ec68763e85a403471f (diff) | |
download | koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip |
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kugar/part')
-rw-r--r-- | kugar/part/Makefile.am | 2 | ||||
-rw-r--r-- | kugar/part/kugar_factory.cpp | 18 | ||||
-rw-r--r-- | kugar/part/kugar_factory.h | 9 | ||||
-rw-r--r-- | kugar/part/kugar_part.cpp | 70 | ||||
-rw-r--r-- | kugar/part/kugar_part.h | 25 | ||||
-rw-r--r-- | kugar/part/kugar_view.cpp | 26 | ||||
-rw-r--r-- | kugar/part/kugar_view.h | 9 |
7 files changed, 81 insertions, 78 deletions
diff --git a/kugar/part/Makefile.am b/kugar/part/Makefile.am index 65abd539..9d204553 100644 --- a/kugar/part/Makefile.am +++ b/kugar/part/Makefile.am @@ -29,7 +29,7 @@ CLEANFILES = kugarpart_meta_unload.cpp kdeinit_LTLIBRARIES = kugar.la bin_PROGRAMS = kugar_la_SOURCES = main.cpp -kugar_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN) +kugar_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN) $(LIB_QT) kugar_la_LIBADD = $(LIB_KOFFICECORE) kde_services_DATA = kugarpart.desktop diff --git a/kugar/part/kugar_factory.cpp b/kugar/part/kugar_factory.cpp index 19db5a96..69d16f21 100644 --- a/kugar/part/kugar_factory.cpp +++ b/kugar/part/kugar_factory.cpp @@ -29,7 +29,7 @@ K_EXPORT_COMPONENT_FACTORY( libkugarpart, KugarFactory ) // The factory ctor. -KugarFactory::KugarFactory( QObject *parent, const char* name ) : KoFactory( parent, name ) +KugarFactory::KugarFactory( TQObject *tqparent, const char* name ) : KoFactory( tqparent, name ) { global(); } @@ -65,27 +65,27 @@ KAboutData *KugarFactory::aboutData() // Create a new part. -KParts::Part* KugarFactory::createPartObject( QWidget *parentWidget, const char *widgetName, - QObject* parent, const char* name, const char* classname, const QStringList & data ) +KParts::Part* KugarFactory::createPartObject( TQWidget *tqparentWidget, const char *widgetName, + TQObject* tqparent, const char* name, const char* classname, const TQStringList & data ) { - QString forcedUserTemplate; - for ( QStringList::const_iterator it = data.begin();it != data.end();++it ) + TQString forcedUserTemplate; + for ( TQStringList::const_iterator it = data.begin();it != data.end();++it ) { - QString tmp = ( *it ); + TQString tmp = ( *it ); if ( tmp.startsWith( "template=" ) ) forcedUserTemplate = tmp.right( tmp.length() - 9 ); } bool bWantKoDocument = ( strcmp( classname, "KoDocument" ) == 0 ); - // parentWidget and widgetName are used by KoDocument for the "readonly+singleView" case. - KugarPart *part = new KugarPart( parentWidget, widgetName, parent, name, !bWantKoDocument ); + // tqparentWidget and widgetName are used by KoDocument for the "readonly+singleView" case. + KugarPart *part = new KugarPart( tqparentWidget, widgetName, tqparent, name, !bWantKoDocument ); // if ( !bWantKoDocument ) part->setReadWrite( false ); part->setForcedUserTemplate( forcedUserTemplate ); return part; - //return ( new KugarPart(parentWidget,name,forcedUserTemplate)); + //return ( new KugarPart(tqparentWidget,name,forcedUserTemplate)); } diff --git a/kugar/part/kugar_factory.h b/kugar/part/kugar_factory.h index 70ad6317..1acb2920 100644 --- a/kugar/part/kugar_factory.h +++ b/kugar/part/kugar_factory.h @@ -16,13 +16,14 @@ class KInstance; class KugarFactory : public KoFactory { Q_OBJECT + TQ_OBJECT public: - KugarFactory( QObject* parent = 0, const char* name = 0 ); + KugarFactory( TQObject* tqparent = 0, const char* name = 0 ); ~KugarFactory(); - virtual KParts::Part *createPartObject( QWidget *parentWidget = 0, const char *widgetName = 0, - QObject *parent = 0, const char *name = 0, const char *classname = "KoDocument", - const QStringList &args = QStringList() ); + virtual KParts::Part *createPartObject( TQWidget *tqparentWidget = 0, const char *widgetName = 0, + TQObject *tqparent = 0, const char *name = 0, const char *classname = "KoDocument", + const TQStringList &args = TQStringList() ); static KInstance* global(); diff --git a/kugar/part/kugar_part.cpp b/kugar/part/kugar_part.cpp index 158f26db..fa6644e2 100644 --- a/kugar/part/kugar_part.cpp +++ b/kugar/part/kugar_part.cpp @@ -12,10 +12,10 @@ #include <kstdaction.h> #include <kmessagebox.h> #include <kio/netaccess.h> -#include <qfile.h> +#include <tqfile.h> #include <kglobal.h> #include <kiconloader.h> -#include <qwidget.h> +#include <tqwidget.h> #include <kfiledialog.h> #include <kdebug.h> #include <KoStore.h> @@ -30,15 +30,15 @@ #include <KoFilterManager.h> -KugarPart::KugarPart( QWidget *parentWidget, const char *widgetName, - QObject* parent, const char* name, bool singleViewMode ) - : KoDocument( parentWidget, widgetName, parent, name, singleViewMode ), +KugarPart::KugarPart( TQWidget *tqparentWidget, const char *widgetName, + TQObject* tqparent, const char* name, bool singleViewMode ) + : KoDocument( tqparentWidget, widgetName, tqparent, name, singleViewMode ), m_templateOk( false ) { setInstance( KugarFactory::global(), false ); m_reportEngine = new Kugar::MReportEngine(); - connect( m_reportEngine, SIGNAL( preferedTemplate( const QString & ) ), - SLOT( slotPreferredTemplate( const QString & ) ) ); + connect( m_reportEngine, TQT_SIGNAL( preferedTemplate( const TQString & ) ), + TQT_SLOT( slotPreferredTemplate( const TQString & ) ) ); } KugarPart::~KugarPart() @@ -47,8 +47,8 @@ KugarPart::~KugarPart() // closeURL(); } -bool KugarPart::loadOasis( const QDomDocument&, KoOasisStyles&, - const QDomDocument&, KoStore* ) +bool KugarPart::loadOasis( const TQDomDocument&, KoOasisStyles&, + const TQDomDocument&, KoStore* ) { return false; } @@ -58,14 +58,14 @@ bool KugarPart::saveOasis( KoStore*, KoXmlWriter* ) return false; } -bool KugarPart::loadXML( QIODevice *file, const QDomDocument & /*doc*/ ) +bool KugarPart::loadXML( TQIODevice *file, const TQDomDocument & /*doc*/ ) { m_docURL = url(); bool ok = true; if ( file ) { file->reset(); - m_reportData=QString(file->readAll()); + m_reportData=TQString(file->readAll()); if ( m_reportData.length() != 0 ) { @@ -76,7 +76,7 @@ bool KugarPart::loadXML( QIODevice *file, const QDomDocument & /*doc*/ ) m_reportEngine->renderReport(); if ( ok ) { - QPtrList<KoView> vs = views(); + TQPtrList<KoView> vs = views(); if ( vs.count() ) { for ( KoView * v = vs.first();v;v = vs.next() ) @@ -89,34 +89,34 @@ bool KugarPart::loadXML( QIODevice *file, const QDomDocument & /*doc*/ ) } } if ( !ok ) - KMessageBox::sorry( 0, i18n( "Invalid data file %1" ).arg( m_file ) ); + KMessageBox::sorry( 0, i18n( "Invalid data file %1" ).tqarg( m_file ) ); } else { ok = false; - KMessageBox::sorry( 0, i18n( "The zero sized data file %1 can't be rendered" ).arg( m_file ) ); + KMessageBox::sorry( 0, i18n( "The zero sized data file %1 can't be rendered" ).tqarg( m_file ) ); } } else { ok = false; - KMessageBox::sorry( 0, i18n( "Unable to open data file: %1" ).arg( m_file ) ); + KMessageBox::sorry( 0, i18n( "Unable to open data file: %1" ).tqarg( m_file ) ); } return ok; } -bool KugarPart::initDoc( InitDocFlags /*flags*/, QWidget* /*parentWidget*/ ) +bool KugarPart::initDoc( InitDocFlags /*flags*/, TQWidget* /*tqparentWidget*/ ) { - QString filename; + TQString filename; bool ok = false; KFileDialog *dialog = - new KFileDialog( QString::null, QString::null, 0L, "file dialog", true ); + new KFileDialog( TQString(), TQString(), 0L, "file dialog", true ); dialog->setMimeFilter( KoFilterManager::mimeFilter( KoDocument::readNativeFormatMimeType(), KoFilterManager::Import ) ); - if ( dialog->exec() != QDialog::Accepted ) + if ( dialog->exec() != TQDialog::Accepted ) { delete dialog; return false; @@ -138,25 +138,25 @@ bool KugarPart::initDoc( InitDocFlags /*flags*/, QWidget* /*parentWidget*/ ) return TRUE; } -KoView* KugarPart::createViewInstance( QWidget* parent, const char* name ) +KoView* KugarPart::createViewInstance( TQWidget* tqparent, const char* name ) { - KugarView * v = new KugarView( this, parent, name ); + KugarView * v = new KugarView( this, tqparent, name ); if ( m_templateOk ) v->renderReport(); return v; } -void KugarPart::slotPreferredTemplate( const QString &tpl ) +void KugarPart::slotPreferredTemplate( const TQString &tpl ) { KURL url( tpl ); - QString localtpl; + TQString localtpl; bool isTemp = false; if ( !url.isValid() ) { /* kdDebug() << "mailformed url" << endl;*/ - if ( tpl.find( '/' ) >= 0 ) + if ( tpl.tqfind( '/' ) >= 0 ) { if ( tpl.startsWith( "." ) ) { @@ -166,14 +166,14 @@ void KugarPart::slotPreferredTemplate( const QString &tpl ) if ( KIO::NetAccess::download( tmpURL, localtpl ) ) isTemp = true; else - KMessageBox::sorry( 0, i18n( "Unable to download template file: %1" ).arg( url.prettyURL() ) ); + KMessageBox::sorry( 0, i18n( "Unable to download template file: %1" ).tqarg( url.prettyURL() ) ); } else localtpl = tpl; } else { - QString former_localtpl = localtpl; + TQString former_localtpl = localtpl; localtpl = kapp -> dirs() -> findResource( "data", "kugar/templates/" + tpl ); if ( localtpl.isEmpty() ) { @@ -183,7 +183,7 @@ void KugarPart::slotPreferredTemplate( const QString &tpl ) if ( KIO::NetAccess::download( tmpURL, localtpl ) ) isTemp = true; else - KMessageBox::sorry( 0, i18n( "Unable to download template file: %1" ).arg( url.prettyURL() ) ); + KMessageBox::sorry( 0, i18n( "Unable to download template file: %1" ).tqarg( url.prettyURL() ) ); } } } @@ -192,13 +192,13 @@ void KugarPart::slotPreferredTemplate( const QString &tpl ) if ( KIO::NetAccess::download( url, localtpl ) ) isTemp = true; else - KMessageBox::sorry( 0, i18n( "Unable to download template file: %1" ).arg( url.prettyURL() ) ); + KMessageBox::sorry( 0, i18n( "Unable to download template file: %1" ).tqarg( url.prettyURL() ) ); } /* kdDebug() << "localtpl: " << localtpl.latin1() << endl;*/ if ( !localtpl.isEmpty() ) { - QFile f( localtpl ); + TQFile f( localtpl ); if ( f.open( IO_ReadOnly ) ) { @@ -214,8 +214,8 @@ void KugarPart::slotPreferredTemplate( const QString &tpl ) { /* kdDebug() << "RawXML" << endl;*/ f.open( IO_ReadOnly ); - if ( !m_reportEngine -> setReportTemplate( &f ) ) - KMessageBox::sorry( 0, i18n( "Invalid template file: %1" ).arg( localtpl ) ); + if ( !m_reportEngine -> setReportTemplate( TQT_TQIODEVICE(&f) ) ) + KMessageBox::sorry( 0, i18n( "Invalid template file: %1" ).tqarg( localtpl ) ); else { m_templateOk = true; @@ -229,13 +229,13 @@ void KugarPart::slotPreferredTemplate( const QString &tpl ) if ( tmpStore->open( "maindoc.xml" ) ) { if ( !m_reportEngine -> setReportTemplate( tmpStore->device() ) ) - KMessageBox::sorry( 0, i18n( "%1 is not a valid Kugar Designer template file." ).arg( localtpl ) ); + KMessageBox::sorry( 0, i18n( "%1 is not a valid Kugar Designer template file." ).tqarg( localtpl ) ); else m_templateOk = true; tmpStore->close(); } else - KMessageBox::sorry( 0, i18n( "%1 is not a valid Kugar Designer template file." ).arg( localtpl ) ); + KMessageBox::sorry( 0, i18n( "%1 is not a valid Kugar Designer template file." ).tqarg( localtpl ) ); delete tmpStore; } @@ -244,12 +244,12 @@ void KugarPart::slotPreferredTemplate( const QString &tpl ) else { f.close(); - KMessageBox::sorry( 0, i18n( "Couldn't read the beginning of the template file: %1" ).arg( localtpl ) ); + KMessageBox::sorry( 0, i18n( "Couldn't read the beginning of the template file: %1" ).tqarg( localtpl ) ); } } else - KMessageBox::sorry( 0, i18n( "Unable to open template file: %1" ).arg( localtpl ) ); + KMessageBox::sorry( 0, i18n( "Unable to open template file: %1" ).tqarg( localtpl ) ); if ( isTemp ) KIO::NetAccess::removeTempFile( localtpl ); diff --git a/kugar/part/kugar_part.h b/kugar/part/kugar_part.h index 3f54e42c..cc778bf8 100644 --- a/kugar/part/kugar_part.h +++ b/kugar/part/kugar_part.h @@ -17,23 +17,24 @@ class KugarBrowserExtension; class KugarPart: public KoDocument { Q_OBJECT + TQ_OBJECT public: - KugarPart( QWidget *parentWidget = 0, const char *widgetName = 0, - QObject* parent = 0, + KugarPart( TQWidget *tqparentWidget = 0, const char *widgetName = 0, + TQObject* tqparent = 0, const char* name = 0, bool singleViewMode = false ); virtual ~KugarPart(); - virtual bool initDoc( InitDocFlags flags, QWidget* parentWidget = 0 ); + virtual bool initDoc( InitDocFlags flags, TQWidget* tqparentWidget = 0 ); - virtual bool loadOasis( const QDomDocument&, KoOasisStyles&, - const QDomDocument&, KoStore* ); + virtual bool loadOasis( const TQDomDocument&, KoOasisStyles&, + const TQDomDocument&, KoStore* ); virtual bool saveOasis( KoStore*, KoXmlWriter* ); - virtual bool loadXML( QIODevice *, const QDomDocument & ); - // virtual QDomDocument saveXML(); + virtual bool loadXML( TQIODevice *, const TQDomDocument & ); + // virtual TQDomDocument saveXML(); - virtual void paintContent( QPainter&, const QRect&, + virtual void paintContent( TQPainter&, const TQRect&, bool /*transparent*/ = false, double /*zoomX*/ = 1.0, double /*zoomY*/ = 1.0 ) { @@ -46,19 +47,19 @@ public: } protected: - virtual KoView* createViewInstance( QWidget* parent, const char* name ); + virtual KoView* createViewInstance( TQWidget* tqparent, const char* name ); public slots: - void setForcedUserTemplate( const QString &/*name*/ ) + void setForcedUserTemplate( const TQString &/*name*/ ) { ; } private slots: - void slotPreferredTemplate( const QString & ); + void slotPreferredTemplate( const TQString & ); private: - QString m_reportData; + TQString m_reportData; Kugar::MReportEngine *m_reportEngine; bool m_templateOk; KURL m_docURL; diff --git a/kugar/part/kugar_view.cpp b/kugar/part/kugar_view.cpp index 14a32bca..28f0d871 100644 --- a/kugar/part/kugar_view.cpp +++ b/kugar/part/kugar_view.cpp @@ -12,10 +12,10 @@ #include <kstdaction.h> #include <kmessagebox.h> #include <kio/netaccess.h> -#include <qfile.h> +#include <tqfile.h> #include <kglobal.h> #include <kiconloader.h> -#include <qlayout.h> +#include <tqlayout.h> #if defined(HAVE_CONFIG_H) #include "config.h" @@ -28,15 +28,15 @@ // The view ctor. -KugarView::KugarView( KugarPart *part, QWidget *parent, const char *name ) - : KoView( part, parent, name ) +KugarView::KugarView( KugarPart *part, TQWidget *tqparent, const char *name ) + : KoView( part, tqparent, name ) { setInstance( KugarFactory::global() ); - ( new QVBoxLayout( this ) ) ->setAutoAdd( true ); + ( new TQVBoxLayout( this ) ) ->setAutoAdd( true ); view = new Kugar::MReportViewer( part->reportEngine(), this ); - view -> setFocusPolicy( QWidget::ClickFocus ); + view -> setFocusPolicy( TQ_ClickFocus ); view -> show(); // setWidget(view); @@ -46,10 +46,10 @@ KugarView::KugarView( KugarPart *part, QWidget *parent, const char *name ) // Define the actions. - KStdAction::prior( view, SLOT( slotPrevPage() ), actionCollection(), "kuPrevPage" ); - KStdAction::next( view, SLOT( slotNextPage() ), actionCollection(), "kuNextPage" ); - KStdAction::firstPage( view, SLOT( slotFirstPage() ), actionCollection(), "kuFirstPage" ); - KStdAction::lastPage( view, SLOT( slotLastPage() ), actionCollection(), "kuLastPage" ); + KStdAction::prior( TQT_TQOBJECT(view), TQT_SLOT( slotPrevPage() ), actionCollection(), "kuPrevPage" ); + KStdAction::next( TQT_TQOBJECT(view), TQT_SLOT( slotNextPage() ), actionCollection(), "kuNextPage" ); + KStdAction::firstPage( TQT_TQOBJECT(view), TQT_SLOT( slotFirstPage() ), actionCollection(), "kuFirstPage" ); + KStdAction::lastPage( TQT_TQOBJECT(view), TQT_SLOT( slotLastPage() ), actionCollection(), "kuLastPage" ); setXMLFile( "kugarpart.rc" ); @@ -80,7 +80,7 @@ void KugarView::print( KPrinter &printer ) bool KugarPart::openFile() { bool ok = false; - QFile f( m_file ); + TQFile f( m_file ); if ( f.open( IO_ReadOnly ) ) { @@ -90,12 +90,12 @@ bool KugarPart::openFile() ok = true; } else - KMessageBox::sorry( this, i18n( "Invalid data file: %1" ).arg( m_file ) ); + KMessageBox::sorry( this, i18n( "Invalid data file: %1" ).tqarg( m_file ) ); f.close(); } else - KMessageBox::sorry( this, i18n( "Unable to open data file: %1" ).arg( m_file ) ); + KMessageBox::sorry( this, i18n( "Unable to open data file: %1" ).tqarg( m_file ) ); return ok; } diff --git a/kugar/part/kugar_view.h b/kugar/part/kugar_view.h index a6838737..b29ea624 100644 --- a/kugar/part/kugar_view.h +++ b/kugar/part/kugar_view.h @@ -15,12 +15,13 @@ class KugarPart; class KugarView: public KoView { Q_OBJECT + TQ_OBJECT public: - KugarView( KugarPart *part, QWidget *parent, const char *name ); + KugarView( KugarPart *part, TQWidget *tqparent, const char *name ); virtual ~KugarView(); - void setForcedUserTemplate( const QString &name ); + void setForcedUserTemplate( const TQString &name ); void updateReadWrite( bool ) { @@ -29,7 +30,7 @@ public: bool renderReport(); - bool setReportTemplate( const QString &data ) + bool setReportTemplate( const TQString &data ) { return view -> setReportTemplate( data ); } @@ -47,7 +48,7 @@ public: private: Kugar::MReportViewer *view; - QString m_forcedUserTemplate; + TQString m_forcedUserTemplate; }; #endif |