diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-14 16:45:05 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-14 16:45:05 +0000 |
commit | 48d4a26399959121f33d2bc3bfe51c7827b654fc (patch) | |
tree | 5ae5e6e00d3ba330b7b8be9bc097154b6bc739e8 /parts/distpart/specsupport.cpp | |
parent | 7e701ace6592d09e1f2c0cf28c7d6d872d78f4f5 (diff) | |
download | tdevelop-48d4a26399959121f33d2bc3bfe51c7827b654fc.tar.gz tdevelop-48d4a26399959121f33d2bc3bfe51c7827b654fc.zip |
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
Diffstat (limited to 'parts/distpart/specsupport.cpp')
-rw-r--r-- | parts/distpart/specsupport.cpp | 36 |
1 files changed, 11 insertions, 25 deletions
diff --git a/parts/distpart/specsupport.cpp b/parts/distpart/specsupport.cpp index ab4d684f..985c7c0f 100644 --- a/parts/distpart/specsupport.cpp +++ b/parts/distpart/specsupport.cpp @@ -38,23 +38,9 @@ #include <tqmessagebox.h> /// \FIXME This is at least the fifth place in the kdevelop code something like this exists -TQString QRegExp_escape(const TQString& str ) +TQString TQRegExp_escape(const TQString& str ) { -#if QT_VERSION >= 0x030100 return TQRegExp::escape(str); -#else - // this block is copyrighted by Trolltech AS (GPL) - static const char meta[] = "$()*+.?[\\]^{|}"; - TQString quoted = str; - int i = 0; - - while ( i < (int) quoted.length() ) { - if ( strchr(meta, quoted[i].latin1()) != 0 ) - quoted.insert( i++, "\\" ); - i++; - } - return quoted; -#endif } SpecSupport::SpecSupport(DistpartPart *part) : packageBase(), m_part(part) { @@ -86,7 +72,7 @@ SpecSupport::~SpecSupport() { void SpecSupport::slotbuildAllPushButtonPressed() { TQMap<TQString,TQString>::Iterator it; TQFile file1(dir + "/" + getAppSource()); - TQFile file2(*(map.find("_sourcedir")) + "/" + getAppSource()); + TQFile file2(*(map.tqfind("_sourcedir")) + "/" + getAppSource()); if (!file2.exists()) { if (!file1.exists()) { TQMessageBox::critical(0 ,i18n("Error"),i18n("You need to create a source archive first.")); @@ -95,17 +81,17 @@ void SpecSupport::slotbuildAllPushButtonPressed() { else if (KDevMakeFrontend *makeFrontend = m_part->extension<KDevMakeFrontend>("KDevelop/MakeFrontend")) makeFrontend->queueCommand(dir,"cd " + KProcess::quote(dir) + - " && cp " + KProcess::quote(getAppSource()) + " " + KProcess::quote(*(map.find("_sourcedir")))); + " && cp " + KProcess::quote(getAppSource()) + " " + KProcess::quote(*(map.tqfind("_sourcedir")))); } if (KDevMakeFrontend *makeFrontend = m_part->extension<KDevMakeFrontend>("KDevelop/MakeFrontend")) - makeFrontend->queueCommand(dir,"cd " + KProcess::quote((((it = map.find("_specdir")) != map.end()) ? (*it) : dir)) + + makeFrontend->queueCommand(dir,"cd " + KProcess::quote((((it = map.tqfind("_specdir")) != map.end()) ? (*it) : dir)) + " && rpmbuild -ba " + m_part->project()->projectName() + ".spec"); } // TQPushButton* exportSPECPushButton; void SpecSupport::slotexportSPECPushButtonPressed() { TQMap<TQString,TQString>::Iterator it; - TQString specname = ((it = map.find("_specdir")) != map.end()) ? (*it) : (m_part->project()->projectDirectory()); + TQString specname = ((it = map.tqfind("_specdir")) != map.end()) ? (*it) : (m_part->project()->projectDirectory()); specname += ("/" + m_part->project()->projectName() + ".spec"); TQFile file(specname); @@ -122,7 +108,7 @@ TQString SpecSupport::getInfo(TQString s, TQString motif) { TQRegExp re(motif + "[ \t]*([^ \t].*[^ \t])[ \t]*"); if (re.exactMatch(s)) return re.cap(1); - return TQString::null; + return TQString(); } // TQPushButton* importSPECPushButton; @@ -185,7 +171,7 @@ void SpecSupport::slotsrcPackagePushButtonPressed() { TQMap<TQString,TQString>::Iterator it; TQFile file1(dir + "/" + getAppSource()); - TQFile file2(*(map.find("_sourcedir")) + "/" + getAppSource()); + TQFile file2(*(map.tqfind("_sourcedir")) + "/" + getAppSource()); if (!file2.exists()) { if (!file1.exists()) { TQMessageBox::critical(0,i18n("Error"),i18n("You need to create a source archive first.")); @@ -194,10 +180,10 @@ void SpecSupport::slotsrcPackagePushButtonPressed() { else if (KDevMakeFrontend *makeFrontend = m_part->extension<KDevMakeFrontend>("KDevelop/MakeFrontend")) makeFrontend->queueCommand(dir,"cd " + KProcess::quote(dir) + - " && cp " + KProcess::quote(getAppSource()) + " " + KProcess::quote(*(map.find("_sourcedir")))); + " && cp " + KProcess::quote(getAppSource()) + " " + KProcess::quote(*(map.tqfind("_sourcedir")))); } if (KDevMakeFrontend *makeFrontend = m_part->extension<KDevMakeFrontend>("KDevelop/MakeFrontend")) - makeFrontend->queueCommand(dir,"cd " + KProcess::quote((((it = map.find("_specdir")) != map.end()) ? (*it) : dir)) + + makeFrontend->queueCommand(dir,"cd " + KProcess::quote((((it = map.tqfind("_specdir")) != map.end()) ? (*it) : dir)) + " && rpmbuild -bs " + m_part->project()->projectName() + ".spec"); } @@ -226,7 +212,7 @@ void SpecSupport::parseDotRpmmacros() { TQString value = re.cap(2).stripWhiteSpace(); while(subst.search(value) != -1) { - value.replace(TQRegExp("%\\{"+ QRegExp_escape( subst.cap(1) ) +"\\}"),*map.find(subst.cap(1))); + value.tqreplace(TQRegExp("%\\{"+ TQRegExp_escape( subst.cap(1) ) +"\\}"),*map.tqfind(subst.cap(1))); } map.insert(re.cap(1),value); } @@ -245,7 +231,7 @@ void SpecSupport::parseDotRpmmacros() { bool SpecSupport::createRpmDirectoryFromMacro(const TQString & name) { TQMap<TQString,TQString>::Iterator it; - if((it = map.find(name)) != map.end()) { + if((it = map.tqfind(name)) != map.end()) { TQDir dir(*it); if (!dir.exists()) return dir.mkdir(*it); } |