summaryrefslogtreecommitdiffstats
path: root/lib/util/urlutil.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-14 16:45:05 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-14 16:45:05 +0000
commit48d4a26399959121f33d2bc3bfe51c7827b654fc (patch)
tree5ae5e6e00d3ba330b7b8be9bc097154b6bc739e8 /lib/util/urlutil.cpp
parent7e701ace6592d09e1f2c0cf28c7d6d872d78f4f5 (diff)
downloadtdevelop-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 'lib/util/urlutil.cpp')
-rw-r--r--lib/util/urlutil.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/lib/util/urlutil.cpp b/lib/util/urlutil.cpp
index 849cc555..5f4d2dcd 100644
--- a/lib/util/urlutil.cpp
+++ b/lib/util/urlutil.cpp
@@ -37,14 +37,14 @@
///////////////////////////////////////////////////////////////////////////////
TQString URLUtil::filename(const TQString & name) {
- int slashPos = name.findRev("/");
+ int slashPos = name.tqfindRev("/");
return slashPos<0 ? name : name.mid(slashPos+1);
}
///////////////////////////////////////////////////////////////////////////////
TQString URLUtil::directory(const TQString & name) {
- int slashPos = name.findRev("/");
+ int slashPos = name.tqfindRev("/");
return slashPos<0 ? TQString("") : name.left(slashPos);
}
@@ -82,29 +82,29 @@ TQString URLUtil::getRelativePath(const TQString& basepath, const TQString& dest
///////////////////////////////////////////////////////////////////////////////
-TQString URLUtil::relativePath(const KURL & parent, const KURL & child, uint slashPolicy) {
+TQString URLUtil::relativePath(const KURL & tqparent, const KURL & child, uint slashPolicy) {
bool slashPrefix = slashPolicy & SLASH_PREFIX;
bool slashSuffix = slashPolicy & SLASH_SUFFIX;
- if (parent.equals(child,true))
+ if (tqparent.equals(child,true))
return slashPrefix ? TQString("/") : TQString("");
- if (!parent.isParentOf(child)) return TQString();
+ if (!tqparent.isParentOf(child)) return TQString();
int a=slashPrefix ? -1 : 1;
int b=slashSuffix ? 1 : -1;
- return child.path(b).mid(parent.path(a).length());
+ return child.path(b).mid(tqparent.path(a).length());
}
///////////////////////////////////////////////////////////////////////////////
-TQString URLUtil::relativePath(const TQString & parent, const TQString & child, uint slashPolicy) {
- return relativePath(KURL(parent), KURL(child), slashPolicy);
+TQString URLUtil::relativePath(const TQString & tqparent, const TQString & child, uint slashPolicy) {
+ return relativePath(KURL(tqparent), KURL(child), slashPolicy);
}
///////////////////////////////////////////////////////////////////////////////
TQString URLUtil::upDir(const TQString & path, bool slashSuffix) {
- int slashPos = path.findRev("/");
- if (slashPos<1) return TQString::null;
+ int slashPos = path.tqfindRev("/");
+ if (slashPos<1) return TQString();
return path.mid(0,slashPos+ (slashSuffix ? 1 : 0) );
}
@@ -132,7 +132,7 @@ KURL URLUtil::mergeURL(const KURL & source, const KURL & dest, const KURL & chil
///////////////////////////////////////////////////////////////////////////////
TQString URLUtil::getExtension(const TQString & path) {
- int dotPos = path.findRev('.');
+ int dotPos = path.tqfindRev('.');
if (dotPos<0) return TQString("");
return path.mid(dotPos+1);
}
@@ -143,7 +143,7 @@ TQString URLUtil::extractPathNameRelative(const KURL &baseDirUrl, const KURL &ur
{
TQString absBase = extractPathNameAbsolute( baseDirUrl ),
absRef = extractPathNameAbsolute( url );
- int i = absRef.find( absBase, 0, true );
+ int i = absRef.tqfind( absBase, 0, true );
if (i == -1)
return TQString();
@@ -151,7 +151,7 @@ TQString URLUtil::extractPathNameRelative(const KURL &baseDirUrl, const KURL &ur
if (absRef == absBase)
return TQString( "." );
else
- return absRef.replace( 0, absBase.length(), TQString() );
+ return absRef.tqreplace( 0, absBase.length(), TQString() );
}
///////////////////////////////////////////////////////////////////////////////
@@ -298,12 +298,12 @@ TQString URLUtil::envExpand ( const TQString& str )
if (len > 1 && str[0] == '$')
{
- int pos = str.find ('/');
+ int pos = str.tqfind ('/');
if (pos < 0)
pos = len;
- char* ret = getenv( TQConstString(str.unicode()+1, pos-1).string().local8Bit().data() );
+ char* ret = getenv( TQConstString(str.tqunicode()+1, pos-1).string().local8Bit().data() );
if (ret)
{