From 48d4a26399959121f33d2bc3bfe51c7827b654fc Mon Sep 17 00:00:00 2001 From: tpearson Date: Tue, 14 Jun 2011 16:45:05 +0000 Subject: TQt4 port kdevelop This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1236710 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- .../pcsimporter/qt4importer/kdevqt4importer.cpp | 42 +++++++++++----------- .../cpp/pcsimporter/qt4importer/kdevqt4importer.h | 15 ++++---- .../cpp/pcsimporter/qt4importer/settingsdialog.cpp | 28 +++++++-------- .../cpp/pcsimporter/qt4importer/settingsdialog.h | 5 +-- .../pcsimporter/qt4importer/settingsdialogbase.ui | 22 ++++++------ 5 files changed, 57 insertions(+), 55 deletions(-) (limited to 'languages/cpp/pcsimporter/qt4importer') diff --git a/languages/cpp/pcsimporter/qt4importer/kdevqt4importer.cpp b/languages/cpp/pcsimporter/qt4importer/kdevqt4importer.cpp index d4635ba4..5864659c 100644 --- a/languages/cpp/pcsimporter/qt4importer/kdevqt4importer.cpp +++ b/languages/cpp/pcsimporter/qt4importer/kdevqt4importer.cpp @@ -22,15 +22,15 @@ #include #include -K_EXPORT_COMPONENT_FACTORY( libkdevqt4importer, KGenericFactory( "kdevqt4importer" ) ) +K_EXPORT_COMPONENT_FACTORY( libkdevqt4importer, KGenericFactory( "kdevqt4importer" ) ) -KDevQt4Importer::KDevQt4Importer( TQObject * parent, const char * name, const TQStringList& ) - : KDevPCSImporter( parent, name ) +KDevTQt4Importer::KDevTQt4Importer( TQObject * tqparent, const char * name, const TQStringList& ) + : KDevPCSImporter( tqparent, name ) { m_qtfile = 0; } -KDevQt4Importer::~KDevQt4Importer() +KDevTQt4Importer::~KDevTQt4Importer() { if (m_qtfile) delete m_qtfile; @@ -38,7 +38,7 @@ KDevQt4Importer::~KDevQt4Importer() m_qtfile = 0; } -TQStringList KDevQt4Importer::fileList() +TQStringList KDevTQt4Importer::fileList() { if( !m_settings ) return TQStringList(); @@ -49,18 +49,18 @@ TQStringList KDevQt4Importer::fileList() KTempFile ifile; TQTextStream &is = *ifile.textStream(); - is << "#include \n" - << "#undef Q_SLOTS\n#undef Q_SIGNALS\n#undef slots\n#undef signals" - << "#define Q_SLOTS slots\n" - << "#define Q_SIGNALS signals\n" - << "#include \n" - << "#include \n" - << "#include \n" - << "#include \n" - << "#include \n" - << "#include \n" - << "#include \n" - << "#include \n"; + is << "#include \n" + << "#undef slots\n#undef signals\n#undef slots\n#undef signals" + << "#define slots slots\n" + << "#define signals signals\n" + << "#include \n" + << "#include \n" + << "#include \n" + << "#include \n" + << "#include \n" + << "#include \n" + << "#include \n" + << "#include \n"; @@ -86,22 +86,22 @@ TQStringList KDevQt4Importer::fileList() return m_qtfile->name(); } -TQStringList KDevQt4Importer::includePaths() +TQStringList KDevTQt4Importer::includePaths() { if( !m_settings || !m_qtfile) return TQStringList(); TQStringList includePaths; includePaths.push_back( m_settings->qtDir() ); - includePaths.push_back( m_settings->qtDir() + "/Qt" ); + includePaths.push_back( m_settings->qtDir() + "/TQt" ); /// @todo add mkspec return includePaths; } -TQWidget * KDevQt4Importer::createSettingsPage( TQWidget * parent, const char * name ) +TQWidget * KDevTQt4Importer::createSettingsPage( TQWidget * tqparent, const char * name ) { - m_settings = new SettingsDialog( parent, name ); + m_settings = new SettingsDialog( tqparent, name ); return m_settings; } diff --git a/languages/cpp/pcsimporter/qt4importer/kdevqt4importer.h b/languages/cpp/pcsimporter/qt4importer/kdevqt4importer.h index c430db19..5a365bf6 100644 --- a/languages/cpp/pcsimporter/qt4importer/kdevqt4importer.h +++ b/languages/cpp/pcsimporter/qt4importer/kdevqt4importer.h @@ -9,8 +9,8 @@ * * ***************************************************************************/ -#ifndef KDEVQTIMPORTER_H -#define KDEVQTIMPORTER_H +#ifndef KDEVTQTIMPORTER_H +#define KDEVTQTIMPORTER_H #include #include @@ -18,18 +18,19 @@ class SettingsDialog; class KTempFile; -class KDevQt4Importer : public KDevPCSImporter +class KDevTQt4Importer : public KDevPCSImporter { Q_OBJECT + TQ_OBJECT public: - KDevQt4Importer( TQObject* parent=0, const char* name=0, const TQStringList& args=TQStringList() ); - virtual ~KDevQt4Importer(); + KDevTQt4Importer( TQObject* tqparent=0, const char* name=0, const TQStringList& args=TQStringList() ); + virtual ~KDevTQt4Importer(); - virtual TQString dbName() const { return TQString::fromLatin1("Qt4"); } + virtual TQString dbName() const { return TQString::tqfromLatin1("TQt4"); } virtual TQStringList fileList(); virtual TQStringList includePaths(); - virtual TQWidget* createSettingsPage( TQWidget* parent, const char* name=0 ); + virtual TQWidget* createSettingsPage( TQWidget* tqparent, const char* name=0 ); private: TQGuardedPtr m_settings; diff --git a/languages/cpp/pcsimporter/qt4importer/settingsdialog.cpp b/languages/cpp/pcsimporter/qt4importer/settingsdialog.cpp index 755b14c4..1b8e46f2 100644 --- a/languages/cpp/pcsimporter/qt4importer/settingsdialog.cpp +++ b/languages/cpp/pcsimporter/qt4importer/settingsdialog.cpp @@ -27,20 +27,20 @@ #include "settingsdialog.h" -TQListBoxItem* QListBox_selectedItem(TQListBox* cpQListBox) +TQListBoxItem* TQListBox_selectedItem(TQListBox* cpTQListBox) { - if ( cpQListBox->selectionMode() != TQListBox::Single ) + if ( cpTQListBox->selectionMode() != TQListBox::Single ) return 0; - if ( cpQListBox->isSelected( cpQListBox->currentItem() ) ) - return cpQListBox->item(cpQListBox->currentItem()); + if ( cpTQListBox->isSelected( cpTQListBox->currentItem() ) ) + return cpTQListBox->item(cpTQListBox->currentItem()); return 0; } -SettingsDialog::SettingsDialog(TQWidget* parent, const char* name, WFlags fl) - : SettingsDialogBase(parent,name,fl) +SettingsDialog::SettingsDialog(TQWidget* tqparent, const char* name, WFlags fl) + : SettingsDialogBase(tqparent,name,fl) { TQStringList qtdirs; - qtdirs.push_back( ::getenv("QTDIR") + TQString("/include") ); + qtdirs.push_back( ::getenv("TQTDIR") + TQString("/include") ); qtdirs.push_back( TQString::fromLocal8Bit(::getenv("HOME")) + "/dev/qt/include" ); qtdirs.push_back( TQString::fromLocal8Bit(::getenv("HOME")) + "/dev/qt-main/include" ); qtdirs.push_back( "/usr/qt/4/include" ); @@ -48,8 +48,8 @@ SettingsDialog::SettingsDialog(TQWidget* parent, const char* name, WFlags fl) for( TQStringList::Iterator it=qtdirs.begin(); it!=qtdirs.end(); ++it ) { TQString qtdir = *it; - if( !qtdir.isEmpty() && isValidQtDir(qtdir) ) - if (!qtListBox->findItem(qtdir, ExactMatch)) + if( !qtdir.isEmpty() && isValidTQtDir(qtdir) ) + if (!qtListBox->tqfindItem(qtdir, ExactMatch)) qtListBox->insertItem( qtdir ); } @@ -74,9 +74,9 @@ void SettingsDialog::slotSelectionChanged(TQListBoxItem* item) emit enabled( true ); } -bool SettingsDialog::isValidQtDir( const TQString & path ) const +bool SettingsDialog::isValidTQtDir( const TQString & path ) const { - return TQFile::exists( path + "/QtCore/QtCore" ); + return TQFile::exists( path + "/TQtCore/TQtCore" ); } TQString SettingsDialog::qtDir( ) const @@ -93,10 +93,10 @@ void SettingsDialog::addUrlButton_clicked( ) { kdDebug(9000) << k_funcinfo << endl; - if ( isValidQtDir( qtUrl->url() ) ) + if ( isValidTQtDir( qtUrl->url() ) ) { qtListBox->insertItem( qtUrl->url() ); - if ( TQListBoxItem * item = qtListBox->findItem( qtUrl->url(), ExactMatch ) ) + if ( TQListBoxItem * item = qtListBox->tqfindItem( qtUrl->url(), ExactMatch ) ) { qtListBox->setSelected( item, true ); } @@ -104,7 +104,7 @@ void SettingsDialog::addUrlButton_clicked( ) } else { - KMessageBox::error( this, i18n("This does not appear to be a valid Qt4 include directory.\nPlease select a different directory."), i18n("Invalid Directory") ); + KMessageBox::error( this, i18n("This does not appear to be a valid TQt4 include directory.\nPlease select a different directory."), i18n("Invalid Directory") ); } } diff --git a/languages/cpp/pcsimporter/qt4importer/settingsdialog.h b/languages/cpp/pcsimporter/qt4importer/settingsdialog.h index 118564fb..9a28b2ad 100644 --- a/languages/cpp/pcsimporter/qt4importer/settingsdialog.h +++ b/languages/cpp/pcsimporter/qt4importer/settingsdialog.h @@ -17,13 +17,14 @@ class SettingsDialog : public SettingsDialogBase { Q_OBJECT + TQ_OBJECT public: - SettingsDialog(TQWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + SettingsDialog(TQWidget* tqparent = 0, const char* name = 0, WFlags fl = 0 ); ~SettingsDialog(); /*$PUBLIC_FUNCTIONS$*/ - bool isValidQtDir( const TQString& path ) const; + bool isValidTQtDir( const TQString& path ) const; TQString qtDir() const; TQString configuration() const; diff --git a/languages/cpp/pcsimporter/qt4importer/settingsdialogbase.ui b/languages/cpp/pcsimporter/qt4importer/settingsdialogbase.ui index f655e4f9..d3314b40 100644 --- a/languages/cpp/pcsimporter/qt4importer/settingsdialogbase.ui +++ b/languages/cpp/pcsimporter/qt4importer/settingsdialogbase.ui @@ -1,6 +1,6 @@ SettingsDialogBase - + SettingsDialogBase @@ -16,7 +16,7 @@ unnamed - + textLabel1_2 @@ -25,7 +25,7 @@ Only the selected entry will be used - + addUrlButton @@ -58,18 +58,18 @@ Only the selected entry will be used qtListBox - selectionChanged(QListBoxItem*) + selectionChanged(TQListBoxItem*) SettingsDialogBase - slotSelectionChanged(QListBoxItem*) + slotSelectionChanged(TQListBoxItem*) - + enabled(int) - - - slotSelectionChanged(QListBoxItem*) - - + + + slotSelectionChanged(TQListBoxItem*) + + kurlrequester.h klineedit.h -- cgit v1.2.1