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 --- parts/regexptest/regexptestdlg.cpp | 14 +++-------- parts/regexptest/regexptestdlg.h | 3 ++- parts/regexptest/regexptestdlgbase.ui | 46 +++++++++++++++++------------------ parts/regexptest/regexptestpart.cpp | 4 +-- parts/regexptest/regexptestpart.h | 3 ++- 5 files changed, 32 insertions(+), 38 deletions(-) (limited to 'parts/regexptest') diff --git a/parts/regexptest/regexptestdlg.cpp b/parts/regexptest/regexptestdlg.cpp index 834b7a1e..5d9b6e88 100644 --- a/parts/regexptest/regexptestdlg.cpp +++ b/parts/regexptest/regexptestdlg.cpp @@ -66,23 +66,19 @@ void RegexpTestDialog::somethingChanged() subgroups_listview->clear(); if ( qregexp_button->isChecked() || qregexp_min_button->isChecked() ) - checkQRegExp(); + checkTQRegExp(); else if ( kregexp_button->isChecked() ) checkKRegExp(); else checkPOSIX(); } -void RegexpTestDialog::checkQRegExp() +void RegexpTestDialog::checkTQRegExp() { TQRegExp rx( pattern_edit->text() ); rx.setMinimal( qregexp_min_button->isChecked() ); if ( !rx.isValid() ) { -#if QT_VERSION >= 0x030100 success_label->setText( rx.errorString() ); -#else - success_label->setText( i18n("Error compiling the regular expression.") ); -#endif return; } if ( rx.search( teststring_edit->text() ) < 0 ) { @@ -90,11 +86,7 @@ void RegexpTestDialog::checkQRegExp() return; } success_label->setText( i18n("Successfully matched") ); -#if QT_VERSION >= 0x030100 int numCaptures = rx.numCaptures() + 1; -#else - int numCaptures = 10; -#endif for ( int i = 0; i < numCaptures; ++i ) { new TQListViewItem( subgroups_listview, TQString::number( i ), rx.cap( i ) ); } @@ -152,7 +144,7 @@ void RegexpTestDialog::checkPOSIX() regcompMessage = i18n("Invalid collating element"); break; case REG_EPAREN: - regcompMessage = i18n("Unmatched parenthesis group operators"); + regcompMessage = i18n("Unmatched tqparenthesis group operators"); break; case REG_ESUBREG: regcompMessage = i18n("Invalid back reference to subexpression"); diff --git a/parts/regexptest/regexptestdlg.h b/parts/regexptest/regexptestdlg.h index 6b02ea02..457e53fb 100644 --- a/parts/regexptest/regexptestdlg.h +++ b/parts/regexptest/regexptestdlg.h @@ -20,6 +20,7 @@ class KDevPlugin; class RegexpTestDialog : public RegexpTestDialogBase { Q_OBJECT + TQ_OBJECT public: RegexpTestDialog( KDevPlugin *part ); @@ -34,7 +35,7 @@ protected slots: private: virtual void somethingChanged(); virtual void checkPOSIX(); - virtual void checkQRegExp(); + virtual void checkTQRegExp(); virtual void checkKRegExp(); virtual void insertQuoted(); diff --git a/parts/regexptest/regexptestdlgbase.ui b/parts/regexptest/regexptestdlgbase.ui index 7b52620a..1b5b01f9 100644 --- a/parts/regexptest/regexptestdlgbase.ui +++ b/parts/regexptest/regexptestdlgbase.ui @@ -1,6 +1,6 @@ RegexpTestDialogBase - + regexp_test_dialog @@ -22,7 +22,7 @@ unnamed - + pattern_label @@ -33,7 +33,7 @@ pattern_edit - + teststring_label @@ -52,7 +52,7 @@ Enter a string which will be matched against the regular expression - + success_label @@ -68,7 +68,7 @@ - + Layout4 @@ -79,7 +79,7 @@ 0 - + insertbutton @@ -103,14 +103,14 @@ Expanding - + 20 20 - + cancelbutton @@ -134,7 +134,7 @@ enter a regular expression, for example <tt>KD.*</tt>, which matches all strings beginning with "KD" - + flavor_group @@ -153,7 +153,7 @@ unnamed - + basicposix_button @@ -167,7 +167,7 @@ A description of this syntax can be found in the grep manpage - + extendedposix_button @@ -178,7 +178,7 @@ A description of this syntax can be found in the grep manpage - + qregexp_button @@ -189,7 +189,7 @@ A description of this syntax can be found in the documentation of the QRegExp class - + qregexp_min_button @@ -200,7 +200,7 @@ Matches a QRegExp non-greedy. Please read the QRegExp::setMinimal documentation for more details. - + kregexp_button @@ -213,7 +213,7 @@ - + rxedit_button @@ -224,15 +224,15 @@ true - + - layout2 + tqlayout2 unnamed - + subgroups_label @@ -240,7 +240,7 @@ Matched subgroups: - + Group @@ -339,13 +339,13 @@ kdialog.h - + insertQuoted() somethingChanged() showRegExpEditor() - - - + + + klineedit.h diff --git a/parts/regexptest/regexptestpart.cpp b/parts/regexptest/regexptestpart.cpp index 8a3c8bd5..a991171a 100644 --- a/parts/regexptest/regexptestpart.cpp +++ b/parts/regexptest/regexptestpart.cpp @@ -24,8 +24,8 @@ static const KDevPluginInfo data("kdevregexptest"); typedef KDevGenericFactory RegexpTestFactory; K_EXPORT_COMPONENT_FACTORY( libkdevregexptest, RegexpTestFactory( data ) ) -RegexpTestPart::RegexpTestPart(TQObject *parent, const char *name, const TQStringList &) - : KDevPlugin(&data, parent, name ? name : "RegexpTestPart") +RegexpTestPart::RegexpTestPart(TQObject *tqparent, const char *name, const TQStringList &) + : KDevPlugin(&data, tqparent, name ? name : "RegexpTestPart") { setInstance(RegexpTestFactory::instance()); setXMLFile("kdevregexptest.rc"); diff --git a/parts/regexptest/regexptestpart.h b/parts/regexptest/regexptestpart.h index d0446cef..5318b86e 100644 --- a/parts/regexptest/regexptestpart.h +++ b/parts/regexptest/regexptestpart.h @@ -22,9 +22,10 @@ class RegexpTestDialog; class RegexpTestPart : public KDevPlugin { Q_OBJECT + TQ_OBJECT public: - RegexpTestPart( TQObject *parent, const char *name, const TQStringList & ); + RegexpTestPart( TQObject *tqparent, const char *name, const TQStringList & ); ~RegexpTestPart(); private slots: -- cgit v1.2.1