summaryrefslogtreecommitdiffstats
path: root/src/helpers
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-04 19:54:24 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-04 19:54:24 +0000
commitd7633c195a464e4d344ada9eea61afd10110598a (patch)
tree1f2da0b135f3ed84955e340cae823f00c4ce7284 /src/helpers
parent3fa7eb804f67b2789f128075cc2522f398640250 (diff)
downloadtdesvn-d7633c195a464e4d344ada9eea61afd10110598a.tar.gz
tdesvn-d7633c195a464e4d344ada9eea61afd10110598a.zip
Port kdesvn to TQt4
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kdesvn@1230412 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/helpers')
-rw-r--r--src/helpers/ktranslateurl.cpp46
-rw-r--r--src/helpers/ktranslateurl.h6
-rw-r--r--src/helpers/sshagent.cpp52
-rw-r--r--src/helpers/sshagent.h21
-rw-r--r--src/helpers/stringhelper.h8
-rw-r--r--src/helpers/sub2qt.cpp6
-rw-r--r--src/helpers/sub2qt.h12
7 files changed, 76 insertions, 75 deletions
diff --git a/src/helpers/ktranslateurl.cpp b/src/helpers/ktranslateurl.cpp
index 8c5e903..41f9af7 100644
--- a/src/helpers/ktranslateurl.cpp
+++ b/src/helpers/ktranslateurl.cpp
@@ -25,8 +25,8 @@
#include <kfileitem.h>
#include <kdesktopfile.h>
-#include <qstringlist.h>
-#include <qdir.h>
+#include <tqstringlist.h>
+#include <tqdir.h>
namespace helpers {
@@ -41,16 +41,16 @@ KTranslateUrl::~KTranslateUrl()
KURL KTranslateUrl::translateSystemUrl(const KURL&_url)
{
- QString proto = _url.protocol();
+ TQString proto = _url.protocol();
KURL res;
- QString name,path;
+ TQString name,path;
if (proto!="system") {
return _url;
}
KGlobal::dirs()->addResourceType("system_entries",
KStandardDirs::kde_default("data") + "systemview");
- QStringList dirList = KGlobal::dirs()->resourceDirs("system_entries");
+ TQStringList dirList = KGlobal::dirs()->resourceDirs("system_entries");
if (!parseURL(_url,name,path)) {
return _url;
}
@@ -63,10 +63,10 @@ KURL KTranslateUrl::translateSystemUrl(const KURL&_url)
return res;
}
-bool KTranslateUrl::parseURL(const KURL&url,QString&name,QString&path)
+bool KTranslateUrl::parseURL(const KURL&url,TQString&name,TQString&path)
{
- QString url_path = url.path();
- int i = url_path.find('/', 1);
+ TQString url_path = url.path();
+ int i = url_path.tqfind('/', 1);
if (i > 0)
{
name = url_path.mid(1, i-1);
@@ -75,31 +75,31 @@ bool KTranslateUrl::parseURL(const KURL&url,QString&name,QString&path)
else
{
name = url_path.mid(1);
- path = QString::null;
+ path = TQString();
}
- return name != QString::null;
+ return name != TQString();
}
-KURL KTranslateUrl::findSystemBase(const QString&filename)
+KURL KTranslateUrl::findSystemBase(const TQString&filename)
{
- QStringList dirList = KGlobal::dirs()->resourceDirs("system_entries");
+ TQStringList dirList = KGlobal::dirs()->resourceDirs("system_entries");
- QStringList::ConstIterator dirpath = dirList.begin();
- QStringList::ConstIterator end = dirList.end();
+ TQStringList::ConstIterator dirpath = dirList.begin();
+ TQStringList::ConstIterator end = dirList.end();
for(; dirpath!=end; ++dirpath)
{
- QDir dir = *dirpath;
+ TQDir dir = *dirpath;
if (!dir.exists()) continue;
- QStringList filenames
- = dir.entryList( QDir::Files | QDir::Readable );
+ TQStringList filenames
+ = dir.entryList( TQDir::Files | TQDir::Readable );
KIO::UDSEntry entry;
- QStringList::ConstIterator name = filenames.begin();
- QStringList::ConstIterator endf = filenames.end();
+ TQStringList::ConstIterator name = filenames.begin();
+ TQStringList::ConstIterator endf = filenames.end();
for(; name!=endf; ++name)
{
@@ -125,14 +125,14 @@ KURL KTranslateUrl::findSystemBase(const QString&filename)
/*!
- \fn helpers::KTranslateUrl::makeKdeUrl(const QString&inUrl)
+ \fn helpers::KTranslateUrl::makeKdeUrl(const TQString&inUrl)
*/
-QString helpers::KTranslateUrl::makeKdeUrl(const QString&_proto)
+TQString helpers::KTranslateUrl::makeKdeUrl(const TQString&_proto)
{
- QString proto;
+ TQString proto;
if (_proto.startsWith("svn+")){
proto = "k"+_proto;
- } else if (_proto== QString("svn")){
+ } else if (_proto== TQString("svn")){
proto = "ksvn";
} else {
proto = "ksvn+"+_proto;
diff --git a/src/helpers/ktranslateurl.h b/src/helpers/ktranslateurl.h
index bad6a6a..8e6eec5 100644
--- a/src/helpers/ktranslateurl.h
+++ b/src/helpers/ktranslateurl.h
@@ -33,9 +33,9 @@ public:
~KTranslateUrl();
static KURL translateSystemUrl(const KURL&);
- static bool parseURL(const KURL&,QString&name,QString&path);
- static KURL findSystemBase(const QString&name);
- static QString makeKdeUrl(const QString&inUrl);
+ static bool parseURL(const KURL&,TQString&name,TQString&path);
+ static KURL findSystemBase(const TQString&name);
+ static TQString makeKdeUrl(const TQString&inUrl);
};
}
diff --git a/src/helpers/sshagent.cpp b/src/helpers/sshagent.cpp
index ccde212..c4fee85 100644
--- a/src/helpers/sshagent.cpp
+++ b/src/helpers/sshagent.cpp
@@ -21,7 +21,7 @@
#include "sshagent.h"
#include "kdesvn-config.h"
-#include <qregexp.h>
+#include <tqregexp.h>
#include <kapplication.h>
#include <kdeversion.h>
#include <kprocess.h>
@@ -34,12 +34,12 @@
bool SshAgent::m_isRunning = false;
bool SshAgent::m_isOurAgent = false;
bool SshAgent::m_addIdentitiesDone = false;
-QString SshAgent::m_authSock = QString::null;
-QString SshAgent::m_pid = QString::null;
+TQString SshAgent::m_authSock = TQString();
+TQString SshAgent::m_pid = TQString();
-SshAgent::SshAgent(QObject* parent, const char* name)
- : QObject(parent, name)
+SshAgent::SshAgent(TQObject* tqparent, const char* name)
+ : TQObject(tqparent, name)
{
}
@@ -58,11 +58,11 @@ bool SshAgent::querySshAgent()
char* pid;
if( (pid = ::getenv("SSH_AGENT_PID")) != 0 )
{
- m_pid = QString::fromLocal8Bit(pid);
+ m_pid = TQString::fromLocal8Bit(pid);
char* sock = ::getenv("SSH_AUTH_SOCK");
if( sock )
- m_authSock = QString::fromLocal8Bit(sock);
+ m_authSock = TQString::fromLocal8Bit(sock);
/* make sure that we have a askpass program.
* on some systems something like that isn't installed.*/
#ifdef FORCE_ASKPASS
@@ -134,10 +134,10 @@ bool SshAgent::addSshIdentities(bool force)
proc << "ssh-add";
- connect(&proc, SIGNAL(receivedStdout(KProcess*, char*, int)),
- SLOT(slotReceivedStdout(KProcess*, char*, int)));
- connect(&proc, SIGNAL(receivedStderr(KProcess*, char*, int)),
- SLOT(slotReceivedStderr(KProcess*, char*, int)));
+ connect(&proc, TQT_SIGNAL(receivedStdout(KProcess*, char*, int)),
+ TQT_SLOT(slotReceivedStdout(KProcess*, char*, int)));
+ connect(&proc, TQT_SIGNAL(receivedStderr(KProcess*, char*, int)),
+ TQT_SLOT(slotReceivedStderr(KProcess*, char*, int)));
proc.start(KProcess::DontCare, KProcess::AllOutput);
@@ -165,15 +165,15 @@ void SshAgent::killSshAgent()
void SshAgent::slotProcessExited(KProcess*)
{
- QRegExp cshPidRx("setenv SSH_AGENT_PID (\\d*);");
- QRegExp cshSockRx("setenv SSH_AUTH_SOCK (.*);");
+ TQRegExp cshPidRx("setenv SSH_AGENT_PID (\\d*);");
+ TQRegExp cshSockRx("setenv SSH_AUTH_SOCK (.*);");
- QRegExp bashPidRx("SSH_AGENT_PID=(\\d*).*");
- QRegExp bashSockRx("SSH_AUTH_SOCK=(.*\\.\\d*);.*");
- QStringList m_outputLines = QStringList::split("\n",m_Output);
+ TQRegExp bashPidRx("SSH_AGENT_PID=(\\d*).*");
+ TQRegExp bashSockRx("SSH_AUTH_SOCK=(.*\\.\\d*);.*");
+ TQStringList m_outputLines = TQStringList::split("\n",m_Output);
- QStringList::Iterator it = m_outputLines.begin();
- QStringList::Iterator end = m_outputLines.end();
+ TQStringList::Iterator it = m_outputLines.begin();
+ TQStringList::Iterator end = m_outputLines.end();
for( ; it != end; ++it )
{
if( m_pid.isEmpty() )
@@ -218,7 +218,7 @@ void SshAgent::slotReceivedStdout(KProcess* proc, char* buffer, int buflen)
{
Q_UNUSED(proc);
- QString output = QString::fromLocal8Bit(buffer, buflen);
+ TQString output = TQString::fromLocal8Bit(buffer, buflen);
m_Output+=output;
}
@@ -227,7 +227,7 @@ void SshAgent::slotReceivedStderr(KProcess* proc, char* buffer, int buflen)
{
Q_UNUSED(proc);
- QString output = QString::fromLocal8Bit(buffer, buflen);
+ TQString output = TQString::fromLocal8Bit(buffer, buflen);
m_Output+=output;
}
@@ -238,12 +238,12 @@ bool SshAgent::startSshAgent()
proc << "ssh-agent";
- connect(&proc, SIGNAL(processExited(KProcess*)),
- SLOT(slotProcessExited(KProcess*)));
- connect(&proc, SIGNAL(receivedStdout(KProcess*, char*, int)),
- SLOT(slotReceivedStdout(KProcess*, char*, int)));
- connect(&proc, SIGNAL(receivedStderr(KProcess*, char*, int)),
- SLOT(slotReceivedStderr(KProcess*, char*, int)) );
+ connect(&proc, TQT_SIGNAL(processExited(KProcess*)),
+ TQT_SLOT(slotProcessExited(KProcess*)));
+ connect(&proc, TQT_SIGNAL(receivedStdout(KProcess*, char*, int)),
+ TQT_SLOT(slotReceivedStdout(KProcess*, char*, int)));
+ connect(&proc, TQT_SIGNAL(receivedStderr(KProcess*, char*, int)),
+ TQT_SLOT(slotReceivedStderr(KProcess*, char*, int)) );
proc.start(KProcess::NotifyOnExit, KProcess::All);
diff --git a/src/helpers/sshagent.h b/src/helpers/sshagent.h
index f5738fb..ed9ff1a 100644
--- a/src/helpers/sshagent.h
+++ b/src/helpers/sshagent.h
@@ -21,19 +21,20 @@
#ifndef SSHAGENT_H
#define SSHAGENT_H
-#include <qobject.h>
-#include <qstring.h>
-#include <qstringlist.h>
+#include <tqobject.h>
+#include <tqstring.h>
+#include <tqstringlist.h>
class KProcess;
-class SshAgent : public QObject
+class SshAgent : public TQObject
{
Q_OBJECT
+ TQ_OBJECT
public:
- SshAgent(QObject* parent = 0, const char* name = 0);
+ SshAgent(TQObject* tqparent = 0, const char* name = 0);
~SshAgent();
bool querySshAgent();
@@ -41,8 +42,8 @@ public:
void killSshAgent();
bool isRunning() const { return m_isRunning; }
- QString pid() const { return m_pid; }
- QString authSock() const { return m_authSock; }
+ TQString pid() const { return m_pid; }
+ TQString authSock() const { return m_authSock; }
private slots:
void slotProcessExited(KProcess*);
@@ -52,13 +53,13 @@ private slots:
private:
bool startSshAgent();
- QString m_Output;
+ TQString m_Output;
static bool m_isRunning;
static bool m_isOurAgent;
static bool m_addIdentitiesDone;
- static QString m_authSock;
- static QString m_pid;
+ static TQString m_authSock;
+ static TQString m_pid;
};
diff --git a/src/helpers/stringhelper.h b/src/helpers/stringhelper.h
index 263f418..80ad576 100644
--- a/src/helpers/stringhelper.h
+++ b/src/helpers/stringhelper.h
@@ -20,8 +20,8 @@
#ifndef STRINGHELPER_H
#define STRINGHELPER_H
-#include <qstring.h>
-#include <qtextstream.h>
+#include <tqstring.h>
+#include <tqtextstream.h>
namespace helpers
{
@@ -33,7 +33,7 @@ protected:
public:
ByteToString(){};
- QString operator()(long value)
+ TQString operator()(long value)
{
char pre = 0;
double v = (double)value;
@@ -57,7 +57,7 @@ public:
}
v /= 1024.0;
}
- return QString("%1 %2Byte").arg(v,0,'f',pre?2:0).arg(pre?QString(QChar(pre)):QString(""));
+ return TQString("%1 %2Byte").tqarg(v,0,'f',pre?2:0).tqarg(pre?TQString(TQChar(pre)):TQString(""));
}
};
diff --git a/src/helpers/sub2qt.cpp b/src/helpers/sub2qt.cpp
index 1ca0c28..77c7e66 100644
--- a/src/helpers/sub2qt.cpp
+++ b/src/helpers/sub2qt.cpp
@@ -22,7 +22,7 @@
#include "src/svnqt/datetime.hpp"
#include "kglobal.h"
#include "klocale.h"
-#include <qmap.h>
+#include <tqmap.h>
namespace helpers {
@@ -35,12 +35,12 @@ sub2qt::~sub2qt()
{
}
-QString sub2qt::apr_time2qtString(apr_time_t _time)
+TQString sub2qt::apr_time2qtString(apr_time_t _time)
{
return DateTime2qtString(_time);
}
-QString sub2qt::DateTime2qtString(const svn::DateTime&_time)
+TQString sub2qt::DateTime2qtString(const svn::DateTime&_time)
{
return KGlobal::locale()->formatDateTime(_time);
}
diff --git a/src/helpers/sub2qt.h b/src/helpers/sub2qt.h
index 23eda5f..c6ddb6d 100644
--- a/src/helpers/sub2qt.h
+++ b/src/helpers/sub2qt.h
@@ -17,12 +17,12 @@
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-#ifndef HELPERSSUB2QT_H
-#define HELPERSSUB2QT_H
+#ifndef HELPERSSUB2TQT_H
+#define HELPERSSUB2TQT_H
#include "src/svnqt/datetime.hpp"
-#include <qdatetime.h>
-#include <qstring.h>
+#include <tqdatetime.h>
+#include <tqstring.h>
#include <svn_time.h>
namespace helpers {
@@ -35,8 +35,8 @@ public:
sub2qt();
~sub2qt();
- static QString apr_time2qtString(apr_time_t _time);
- static QString DateTime2qtString(const svn::DateTime&_time);
+ static TQString apr_time2qtString(apr_time_t _time);
+ static TQString DateTime2qtString(const svn::DateTime&_time);
};
}