summaryrefslogtreecommitdiffstats
path: root/src/gui/application/StartupTester.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-06 20:59:29 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-06 20:59:29 +0000
commit11f31c37e5fa4889d9989f10272f44845449cb7b (patch)
tree4383da04a76c497950d957fc6120b0fd0d9082c2 /src/gui/application/StartupTester.cpp
parent832eb69d571e8e518db45d0c0e6fbc0f00690209 (diff)
downloadrosegarden-11f31c37e5fa4889d9989f10272f44845449cb7b.tar.gz
rosegarden-11f31c37e5fa4889d9989f10272f44845449cb7b.zip
Initial TQt conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/rosegarden@1172292 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/gui/application/StartupTester.cpp')
-rw-r--r--src/gui/application/StartupTester.cpp70
1 files changed, 35 insertions, 35 deletions
diff --git a/src/gui/application/StartupTester.cpp b/src/gui/application/StartupTester.cpp
index 15940b6..5e1813d 100644
--- a/src/gui/application/StartupTester.cpp
+++ b/src/gui/application/StartupTester.cpp
@@ -29,9 +29,9 @@
#include "gui/dialogs/LilyPondOptionsDialog.h"
#include <kprocess.h>
-#include <qmutex.h>
-#include <qthread.h>
-#include <qregexp.h>
+#include <tqmutex.h>
+#include <tqthread.h>
+#include <tqregexp.h>
namespace Rosegarden
@@ -43,11 +43,11 @@ StartupTester::StartupTester() :
m_haveLilyPondView(false),
m_haveAudioFileImporter(false)
{
- QHttp *http = new QHttp();
- connect(http, SIGNAL(responseHeaderReceived(const QHttpResponseHeader &)),
- this, SLOT(slotHttpResponseHeaderReceived(const QHttpResponseHeader &)));
- connect(http, SIGNAL(done(bool)),
- this, SLOT(slotHttpDone(bool)));
+ TQHttp *http = new TQHttp();
+ connect(http, TQT_SIGNAL(responseHeaderReceived(const TQHttpResponseHeader &)),
+ this, TQT_SLOT(slotHttpResponseHeaderReceived(const TQHttpResponseHeader &)));
+ connect(http, TQT_SIGNAL(done(bool)),
+ this, TQT_SLOT(slotHttpDone(bool)));
m_versionHttpFailed = false;
http->setHost("www.rosegardenmusic.com");
http->get("/latest-version.txt");
@@ -67,8 +67,8 @@ StartupTester::run()
KProcess *proc = new KProcess();
m_stdoutBuffer = "";
- QObject::connect(proc, SIGNAL(receivedStdout(KProcess *, char *, int)),
- this, SLOT(stdoutReceived(KProcess *, char *, int)));
+ TQObject::connect(proc, TQT_SIGNAL(receivedStdout(KProcess *, char *, int)),
+ this, TQT_SLOT(stdoutReceived(KProcess *, char *, int)));
*proc << "rosegarden-audiofile-importer";
*proc << "--conftest";
proc->start(KProcess::Block, KProcess::All);
@@ -85,8 +85,8 @@ StartupTester::run()
proc = new KProcess;
m_stdoutBuffer = "";
- QObject::connect(proc, SIGNAL(receivedStdout(KProcess *, char *, int)),
- this, SLOT(stdoutReceived(KProcess *, char *, int)));
+ TQObject::connect(proc, TQT_SIGNAL(receivedStdout(KProcess *, char *, int)),
+ this, TQT_SLOT(stdoutReceived(KProcess *, char *, int)));
*proc << "rosegarden-project-package";
*proc << "--conftest";
proc->start(KProcess::Block, KProcess::All);
@@ -105,8 +105,8 @@ StartupTester::run()
proc = new KProcess();
m_stdoutBuffer = "";
- QObject::connect(proc, SIGNAL(receivedStdout(KProcess *, char *, int)),
- this, SLOT(stdoutReceived(KProcess *, char *, int)));
+ TQObject::connect(proc, TQT_SIGNAL(receivedStdout(KProcess *, char *, int)),
+ this, TQT_SLOT(stdoutReceived(KProcess *, char *, int)));
*proc << "rosegarden-lilypondview";
*proc << "--conftest";
proc->start(KProcess::Block, KProcess::All);
@@ -117,7 +117,7 @@ StartupTester::run()
} else {
RG_DEBUG << "StartupTester - lilypondview OK" << endl;
m_haveLilyPondView = true;
- QRegExp re("LilyPond version: ([^\n]*)");
+ TQRegExp re("LilyPond version: ([^\n]*)");
if (re.search(m_stdoutBuffer) != -1) {
LilyPondOptionsDialog::setDefaultLilyPondVersion(re.cap(1));
}
@@ -147,54 +147,54 @@ StartupTester::isReady()
void
StartupTester::stdoutReceived(KProcess *, char *buffer, int len)
{
- m_stdoutBuffer += QString::fromLatin1(buffer, len);
+ m_stdoutBuffer += TQString::fromLatin1(buffer, len);
}
void
-StartupTester::parseStdoutBuffer(QStringList &target)
+StartupTester::parseStdoutBuffer(TQStringList &target)
{
- QRegExp re("Required: ([^\n]*)");
+ TQRegExp re("Required: ([^\n]*)");
if (re.search(m_stdoutBuffer) != -1) {
- target = QStringList::split(", ", re.cap(1));
+ target = TQStringList::split(", ", re.cap(1));
}
}
bool
-StartupTester::haveProjectPackager(QStringList *missing)
+StartupTester::haveProjectPackager(TQStringList *missing)
{
while (!m_ready)
usleep(10000);
- QMutexLocker locker(&m_projectPackagerMutex);
+ TQMutexLocker locker(&m_projectPackagerMutex);
if (missing) *missing = m_projectPackagerMissing;
return m_haveProjectPackager;
}
bool
-StartupTester::haveLilyPondView(QStringList *missing)
+StartupTester::haveLilyPondView(TQStringList *missing)
{
while (!m_ready)
usleep(10000);
- QMutexLocker locker(&m_lilyPondViewMutex);
+ TQMutexLocker locker(&m_lilyPondViewMutex);
if (missing) *missing = m_lilyPondViewMissing;
return m_haveLilyPondView;
}
bool
-StartupTester::haveAudioFileImporter(QStringList *missing)
+StartupTester::haveAudioFileImporter(TQStringList *missing)
{
while (!m_ready)
usleep(10000);
- QMutexLocker locker(&m_audioFileImporterMutex);
+ TQMutexLocker locker(&m_audioFileImporterMutex);
if (missing) *missing = m_audioFileImporterMissing;
return m_haveAudioFileImporter;
}
bool
-StartupTester::isVersionNewerThan(QString a, QString b)
+StartupTester::isVersionNewerThan(TQString a, TQString b)
{
- QRegExp re("[._-]");
- QStringList alist = QStringList::split(re, a);
- QStringList blist = QStringList::split(re, b);
+ TQRegExp re("[._-]");
+ TQStringList alist = TQStringList::split(re, a);
+ TQStringList blist = TQStringList::split(re, b);
int ae = alist.size();
int be = blist.size();
int e = std::max(ae, be);
@@ -215,7 +215,7 @@ StartupTester::isVersionNewerThan(QString a, QString b)
}
void
-StartupTester::slotHttpResponseHeaderReceived(const QHttpResponseHeader &h)
+StartupTester::slotHttpResponseHeaderReceived(const TQHttpResponseHeader &h)
{
if (h.statusCode() / 100 != 2) m_versionHttpFailed = true;
}
@@ -223,17 +223,17 @@ StartupTester::slotHttpResponseHeaderReceived(const QHttpResponseHeader &h)
void
StartupTester::slotHttpDone(bool error)
{
- QHttp *http = const_cast<QHttp *>(dynamic_cast<const QHttp *>(sender()));
+ TQHttp *http = const_cast<TQHttp *>(dynamic_cast<const TQHttp *>(sender()));
if (!http) return;
http->deleteLater();
if (error) return;
- QByteArray responseData = http->readAll();
- QString str = QString::fromUtf8(responseData.data());
- QStringList lines = QStringList::split('\n', str);
+ TQByteArray responseData = http->readAll();
+ TQString str = TQString::fromUtf8(responseData.data());
+ TQStringList lines = TQStringList::split('\n', str);
if (lines.empty()) return;
- QString latestVersion = lines[0];
+ TQString latestVersion = lines[0];
std::cerr << "Comparing current version \"" << VERSION
<< "\" with latest version \"" << latestVersion << "\""
<< std::endl;