summaryrefslogtreecommitdiffstats
path: root/klinkstatus/src/parser/url.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:54:04 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:54:04 +0000
commitdc6b8e72fed2586239e3514819238c520636c9d9 (patch)
tree88b200df0a0b7fab9d6f147596173556f1ed9a13 /klinkstatus/src/parser/url.cpp
parent6927d4436e54551917f600b706a8d6109e49de1c (diff)
downloadtdewebdev-dc6b8e72fed2586239e3514819238c520636c9d9.tar.gz
tdewebdev-dc6b8e72fed2586239e3514819238c520636c9d9.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdewebdev@1157656 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'klinkstatus/src/parser/url.cpp')
-rw-r--r--klinkstatus/src/parser/url.cpp42
1 files changed, 21 insertions, 21 deletions
diff --git a/klinkstatus/src/parser/url.cpp b/klinkstatus/src/parser/url.cpp
index f7f1f6f8..966bd509 100644
--- a/klinkstatus/src/parser/url.cpp
+++ b/klinkstatus/src/parser/url.cpp
@@ -27,9 +27,9 @@
#include <kcharsets.h>
-Node::LinkType Url::resolveLinkType(QString const& url)
+Node::LinkType Url::resolveLinkType(TQString const& url)
{
- QString aux(url);
+ TQString aux(url);
aux = KURL::decode_string(aux);
if(aux.isNull())
@@ -45,11 +45,11 @@ Node::LinkType Url::resolveLinkType(QString const& url)
return Node::relative;
}
-KURL Url::normalizeUrl(QString const& string_url, LinkStatus const& link_parent, QString const& document_root)
+KURL Url::normalizeUrl(TQString const& string_url, LinkStatus const& link_parent, TQString const& document_root)
{
- QString _string_url = string_url.stripWhiteSpace();
+ TQString _string_url = string_url.stripWhiteSpace();
- QString s_url;
+ TQString s_url;
KURL base_url;
// resolve base url
@@ -101,9 +101,9 @@ KURL Url::normalizeUrl(QString const& string_url, LinkStatus const& link_parent,
}
}
-KURL Url::normalizeUrl(QString const& string_url)
+KURL Url::normalizeUrl(TQString const& string_url)
{
- QString qs_url(KCharsets::resolveEntities(string_url.stripWhiteSpace()));
+ TQString qs_url(KCharsets::resolveEntities(string_url.stripWhiteSpace()));
if(qs_url[0] == '/')
{
@@ -145,7 +145,7 @@ bool Url::existUrl(KURL const& url, vector<LinkStatus*> const& v)
alunos.iscte.pt, iscte.pt => false.
*/
// FIXME - Rename this function to sameDomain
-bool Url::equalHost(QString const& host1, QString const& host2, bool restrict)
+bool Url::equalHost(TQString const& host1, TQString const& host2, bool restrict)
{
//Q_ASSERT(!host1.isEmpty());
//Q_ASSERT(!host2.isEmpty()); // this fails if href="javascript:......."
@@ -155,13 +155,13 @@ bool Url::equalHost(QString const& host1, QString const& host2, bool restrict)
if(host1 == host2)
return true;
- QString host1_(KNetwork::KResolver::normalizeDomain(host1));
- QString host2_(KNetwork::KResolver::normalizeDomain(host2));
+ TQString host1_(KNetwork::KResolver::normalizeDomain(host1));
+ TQString host2_(KNetwork::KResolver::normalizeDomain(host2));
removeLastCharIfExists(host1_, '/');
removeLastCharIfExists(host2_, '/');
- vector<QString> v1 = tokenizeWordsSeparatedByDots(host1_);
- vector<QString> v2 = tokenizeWordsSeparatedByDots(host2_);
+ vector<TQString> v1 = tokenizeWordsSeparatedByDots(host1_);
+ vector<TQString> v2 = tokenizeWordsSeparatedByDots(host2_);
uint const size1 = v1.size();
uint const size2 = v2.size();
@@ -172,8 +172,8 @@ bool Url::equalHost(QString const& host1, QString const& host2, bool restrict)
return false;
}
- vector<QString>::size_type aux = 0;
- vector<QString>::size_type aux2 = 0;
+ vector<TQString>::size_type aux = 0;
+ vector<TQString>::size_type aux2 = 0;
if(v1[0] == "www")
aux = 1;
if(v2[0] == "www")
@@ -198,9 +198,9 @@ bool Url::equalHost(QString const& host1, QString const& host2, bool restrict)
}
/* This should be done by parsing but I wan't to know when some new scheme comes along :) */
-bool Url::hasProtocol(QString const& url)
+bool Url::hasProtocol(TQString const& url)
{
- QString s_url(url);
+ TQString s_url(url);
s_url.stripWhiteSpace();
if(s_url[0] == '/')
@@ -248,7 +248,7 @@ bool Url::hasProtocol(QString const& url)
/**
http://linkstatus.paradigma.co.pt/en/index.html&bix=bix -> /en/index.html&bix=bix
*/
-QString Url::convertToLocal(LinkStatus const* ls)
+TQString Url::convertToLocal(LinkStatus const* ls)
{
KURL url = ls->absoluteUrl();
KURL base_url = ls->rootUrl();
@@ -309,21 +309,21 @@ bool Url::parentDir(KURL const& url1, KURL const& url2)
if(!equalHost(url1.host(), url2.host()))
return false;
- vector<QString> tokens_1 = tokenizeWordsSeparatedBy(url1.directory(true, false), QChar('/'));
- vector<QString> tokens_2 = tokenizeWordsSeparatedBy(url2.directory(true, false), QChar('/'));
+ vector<TQString> tokens_1 = tokenizeWordsSeparatedBy(url1.directory(true, false), TQChar('/'));
+ vector<TQString> tokens_2 = tokenizeWordsSeparatedBy(url2.directory(true, false), TQChar('/'));
if(tokens_1.size() == 0)
return false;
//if(tokens_2.size() > tokens_1.size() or tokens_2.size() == 0)
//return true;
- vector<QString>::size_type size = 0;
+ vector<TQString>::size_type size = 0;
if(tokens_1.size() < tokens_2.size())
size = tokens_1.size();
else
size = tokens_2.size();
- for(vector<QString>::size_type i = 0; i != size; ++i)
+ for(vector<TQString>::size_type i = 0; i != size; ++i)
{
if(tokens_2[i] != tokens_1[i])
return true;