summaryrefslogtreecommitdiffstats
path: root/src/svnqt/url.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/svnqt/url.cpp')
-rw-r--r--src/svnqt/url.cpp98
1 files changed, 35 insertions, 63 deletions
diff --git a/src/svnqt/url.cpp b/src/svnqt/url.cpp
index 185f582..40565f6 100644
--- a/src/svnqt/url.cpp
+++ b/src/svnqt/url.cpp
@@ -36,12 +36,8 @@
#include "pool.hpp"
#include "url.hpp"
-#include <qglobal.h>
-#if QT_VERSION < 0x040000
-#include <qvaluelist.h>
-#else
-#include <QtCore>
-#endif
+#include <tqglobal.h>
+#include <tqvaluelist.h>
// subversion api
#include "svn_ra.h"
@@ -58,42 +54,34 @@ namespace svn
};
static bool mSchemasInitialized = false;
-#if QT_VERSION < 0x040000
- QValueList<QString> mSchemas;
-#else
- QList<QString> mSchemas;
-#endif
+ TQValueList<TQString> mSchemas;
Url::Url () {}
Url::~Url () {}
- bool Url::isLocal(const QString& url)
+ bool Url::isLocal(const TQString& url)
{
-#if QT_VERSION < 0x040000
bool cs = false;
-#else
- Qt::CaseSensitivity cs=Qt::CaseInsensitive;
-#endif
if (
- url.startsWith("file://",cs) ||
- url.startsWith("/") ||
- url.startsWith("svn+file://",cs) ||
- url.startsWith("ksvn+file://",cs) )
+ url.tqstartsWith("file://",cs) ||
+ url.tqstartsWith("/") ||
+ url.tqstartsWith("svn+file://",cs) ||
+ url.tqstartsWith("ksvn+file://",cs) )
{
return true;
}
return false;
}
- bool Url::isValid (const QString& url)
+ bool Url::isValid (const TQString& url)
{
- QString urlTest(url);
+ TQString urlTest(url);
unsigned int index = 0;
while (VALID_SCHEMAS[index]!=0)
{
- QString schema = QString::FROMUTF8(VALID_SCHEMAS[index]);
- QString urlComp = urlTest.mid(0, schema.length());
+ TQString schema = TQString::FROMUTF8(VALID_SCHEMAS[index]);
+ TQString urlComp = urlTest.mid(0, schema.length());
if (schema == urlComp)
{
@@ -105,27 +93,23 @@ namespace svn
return false;
}
- QString
- Url::transformProtokoll(const QString&prot)
+ TQString
+ Url::transformProtokoll(const TQString&prot)
{
-#if QT_VERSION < 0x040000
- QString _prot = prot.lower();
-#else
- QString _prot = prot.toLower();
-#endif
- if (QString::compare(_prot,"svn+http")==0||
- QString::compare(_prot,"ksvn+http")==0) {
- return QString("http");
- } else if (QString::compare(_prot,"svn+https")==0||
- QString::compare(_prot,"ksvn+https")==0) {
- return QString("https");
- }else if (QString::compare(_prot,"svn+file")==0||
- QString::compare(_prot,"ksvn+file")==0) {
- return QString("file");
- } else if (QString::compare(_prot,"ksvn+ssh")==0) {
- return QString("svn+ssh");
- } else if (QString::compare(_prot,"ksvn")==0) {
- return QString("svn");
+ TQString _prot = prot.lower();
+ if (TQString::compare(_prot,"svn+http")==0||
+ TQString::compare(_prot,"ksvn+http")==0) {
+ return TQString("http");
+ } else if (TQString::compare(_prot,"svn+https")==0||
+ TQString::compare(_prot,"ksvn+https")==0) {
+ return TQString("https");
+ }else if (TQString::compare(_prot,"svn+file")==0||
+ TQString::compare(_prot,"ksvn+file")==0) {
+ return TQString("file");
+ } else if (TQString::compare(_prot,"ksvn+ssh")==0) {
+ return TQString("svn+ssh");
+ } else if (TQString::compare(_prot,"ksvn")==0) {
+ return TQString("svn");
}
return _prot;
}
@@ -136,11 +120,7 @@ namespace svn
* url schemas out of the ra layer it rather dirty now since
* we are lacking a higher level of abstraction
*/
-#if QT_VERSION < 0x040000
- QValueList<QString>
-#else
- QList<QString>
-#endif
+ TQValueList<TQString>
Url::supportedSchemas ()
{
if (mSchemasInitialized)
@@ -164,33 +144,25 @@ namespace svn
// schemas are in the following form:
// <schema>:<whitespace><description>\n...
// find the f�st :
- QString descriptions (descr->data);
+ TQString descriptions (descr->data);
int pos=0;
const int not_found = -1;
do
{
- const QString tokenStart ("handles '");
- const QString tokenEnd ("' schem");
-#if QT_VERSION < 0x040000
- pos = descriptions.find (tokenStart, pos);
-#else
- pos = descriptions.indexOf( tokenStart, pos );
-#endif
+ const TQString tokenStart ("handles '");
+ const TQString tokenEnd ("' schem");
+ pos = descriptions.tqfind (tokenStart, pos);
if (pos == not_found)
break;
pos += tokenStart.length ();
-#if QT_VERSION < 0x040000
- int posEnd = descriptions.find (tokenEnd, pos);
-#else
- int posEnd = descriptions.indexOf( tokenEnd, pos );
-#endif
+ int posEnd = descriptions.tqfind (tokenEnd, pos);
if (posEnd == not_found)
break;
// found
- QString schema (descriptions.mid(pos, posEnd-pos) + ":");
+ TQString schema (descriptions.mid(pos, posEnd-pos) + ":");
mSchemas.push_back (schema);
// forward to the next newline