summaryrefslogtreecommitdiffstats
path: root/klinkstatus/src/engine
diff options
context:
space:
mode:
Diffstat (limited to 'klinkstatus/src/engine')
-rw-r--r--klinkstatus/src/engine/linkchecker.cpp90
-rw-r--r--klinkstatus/src/engine/linkchecker.h19
-rw-r--r--klinkstatus/src/engine/linkfilter.cpp12
-rw-r--r--klinkstatus/src/engine/linkfilter.h10
-rw-r--r--klinkstatus/src/engine/linkstatus.cpp62
-rw-r--r--klinkstatus/src/engine/linkstatus.h44
-rw-r--r--klinkstatus/src/engine/linkstatus_impl.h164
-rw-r--r--klinkstatus/src/engine/searchmanager.cpp96
-rw-r--r--klinkstatus/src/engine/searchmanager.h41
-rw-r--r--klinkstatus/src/engine/searchmanager_impl.h4
10 files changed, 272 insertions, 270 deletions
diff --git a/klinkstatus/src/engine/linkchecker.cpp b/klinkstatus/src/engine/linkchecker.cpp
index 8186bda8..32e17329 100644
--- a/klinkstatus/src/engine/linkchecker.cpp
+++ b/klinkstatus/src/engine/linkchecker.cpp
@@ -43,9 +43,9 @@
int LinkChecker::count_ = 0;
-LinkChecker::LinkChecker(LinkStatus* linkstatus, int time_out,
- TQObject *parent, const char *name)
- : TQObject(parent, name), search_manager_(0),
+LinkChecker::LinkChecker(LinktqStatus* linkstatus, int time_out,
+ TQObject *tqparent, const char *name)
+ : TQObject(tqparent, name), search_manager_(0),
linkstatus_(linkstatus), t_job_(0), time_out_(time_out), checker_(0), document_charset_(),
redirection_(false), header_checked_(false), finnished_(false),
parsing_(false), is_charset_checked_(false), has_defined_charset_(false)
@@ -69,7 +69,7 @@ void LinkChecker::check()
{
Q_ASSERT(!finnished_);
- KURL url(linkStatus()->absoluteUrl());
+ KURL url(linktqStatus()->absoluteUrl());
Q_ASSERT(url.isValid());
if(url.hasRef()) {
@@ -84,8 +84,8 @@ void LinkChecker::check()
t_job_->addMetaData("PropagateHttpHeader", "true"); // to have the http header
- if (linkstatus_->parent()) {
- t_job_->addMetaData("referrer", linkstatus_->parent()->absoluteUrl().prettyURL());
+ if (linkstatus_->tqparent()) {
+ t_job_->addMetaData("referrer", linkstatus_->tqparent()->absoluteUrl().prettyURL());
}
if(search_manager_->sendIdentification())
@@ -128,7 +128,7 @@ void LinkChecker::slotTimeOut()
linkstatus_->setErrorOccurred(true);
linkstatus_->setChecked(true);
linkstatus_->setError(i18n("Timeout"));
- linkstatus_->setStatus(LinkStatus::TIMEOUT);
+ linkstatus_->settqStatus(LinktqStatus::TIMEOUT);
killJob();
finnish();
@@ -146,9 +146,9 @@ void LinkChecker::slotMimetype (KIO::Job* /*job*/, const TQString &type)
Q_ASSERT(t_job_);
- LinkStatus* ls = 0;
+ LinktqStatus* ls = 0;
/* if(redirection_)
- ls = linkStatus()->redirection();
+ ls = linktqStatus()->redirection();
else*/
ls = linkstatus_;
Q_ASSERT(ls);
@@ -168,7 +168,7 @@ void LinkChecker::slotMimetype (KIO::Job* /*job*/, const TQString &type)
if(!url.protocol().startsWith("http"))
{
ls->setStatusText("OK");
- ls->setStatus(LinkStatus::SUCCESSFULL);
+ ls->settqStatus(LinktqStatus::SUCCESSFULL);
killJob();
finnish();
@@ -186,7 +186,7 @@ void LinkChecker::slotMimetype (KIO::Job* /*job*/, const TQString &type)
{
//kdDebug(23100) << "mimetype: " << type << endl;
ls->setStatusText("OK");
- ls->setStatus(LinkStatus::SUCCESSFULL);
+ ls->settqStatus(LinktqStatus::SUCCESSFULL);
killJob();
finnish();
@@ -206,9 +206,9 @@ void LinkChecker::slotData(KIO::Job* /*job*/, const TQByteArray& data)
Q_ASSERT(t_job_);
- LinkStatus* ls = 0;
+ LinktqStatus* ls = 0;
/* if(redirection_)
- ls = linkStatus()->redirection();
+ ls = linktqStatus()->redirection();
else*/
ls = linkstatus_;
Q_ASSERT(ls);
@@ -235,7 +235,7 @@ void LinkChecker::slotData(KIO::Job* /*job*/, const TQByteArray& data)
if(header_checked_)
{
killJob();
- linkstatus_->setStatus(getHttpStatus());
+ linkstatus_->settqStatus(getHttptqStatus());
linkstatus_->setChecked(true);
finnish();
return;
@@ -253,7 +253,7 @@ void LinkChecker::slotData(KIO::Job* /*job*/, const TQByteArray& data)
if(ls->mimeType() != "text/html" && header_checked_)
{
//kdDebug(23100) << "mimetype of " << ls->absoluteUrl().prettyURL() << ": " << ls->mimeType() << endl;
- ls->setStatus(getHttpStatus());
+ ls->settqStatus(getHttptqStatus());
killJob();
finnish(); // if finnish is called before kill what you get is a segfault, don't know why
return;
@@ -262,7 +262,7 @@ void LinkChecker::slotData(KIO::Job* /*job*/, const TQByteArray& data)
{
//kdDebug(23100) << "ERROR PAGE" << endl;
ls->setIsErrorPage(true);
- ls->setStatus(getHttpStatus());
+ ls->settqStatus(getHttptqStatus());
killJob();
finnish();
return;
@@ -339,9 +339,9 @@ void LinkChecker::slotResult(KIO::Job* /*job*/)
return;
}
- LinkStatus* ls = 0;
+ LinktqStatus* ls = 0;
if(redirection_)
- ls = linkStatus()->redirection();
+ ls = linktqStatus()->redirection();
else
ls = linkstatus_;
Q_ASSERT(ls);
@@ -366,15 +366,15 @@ void LinkChecker::slotResult(KIO::Job* /*job*/)
if(job->error() == KIO::ERR_IS_DIRECTORY)
{
ls->setStatusText("OK");
- ls->setStatus(LinkStatus::SUCCESSFULL);
+ ls->settqStatus(LinktqStatus::SUCCESSFULL);
}
else
{
ls->setErrorOccurred(true);
if(job->error() == KIO::ERR_SERVER_TIMEOUT)
- ls->setStatus(LinkStatus::TIMEOUT);
+ ls->settqStatus(LinktqStatus::TIMEOUT);
else
- ls->setStatus(LinkStatus::BROKEN);
+ ls->settqStatus(LinktqStatus::BROKEN);
if(job->errorString().isEmpty())
kdWarning(23100) << "\n\nError string is empty, error = " << job->error() << "\n\n\n";
@@ -389,7 +389,7 @@ void LinkChecker::slotResult(KIO::Job* /*job*/)
{
if(!ls->absoluteUrl().protocol().startsWith("http")) {
ls->setStatusText("OK");
- ls->setStatus(LinkStatus::SUCCESSFULL);
+ ls->settqStatus(LinktqStatus::SUCCESSFULL);
}
else
{
@@ -402,7 +402,7 @@ void LinkChecker::slotResult(KIO::Job* /*job*/)
}
Q_ASSERT(header_checked_);
- ls->setStatus(getHttpStatus());
+ ls->settqStatus(getHttptqStatus());
}
if(!doc_html_.isNull() && !doc_html_.isEmpty())
@@ -449,10 +449,10 @@ bool LinkChecker::processRedirection(KURL const& toUrl)
linkstatus_->setHttpHeader(getHttpHeader(t_job_, false));
linkstatus_->setIsRedirection(true);
linkstatus_->setStatusText("redirection");
- linkstatus_->setStatus(LinkStatus::HTTP_REDIRECTION);
+ linkstatus_->settqStatus(LinktqStatus::HTTP_REDIRECTION);
linkstatus_->setChecked(true);
- LinkStatus* ls_red = new LinkStatus(*linkstatus_);
+ LinktqStatus* ls_red = new LinktqStatus(*linkstatus_);
ls_red->setAbsoluteUrl(toUrl);
ls_red->setRootUrl(linkstatus_->rootUrl());
@@ -534,33 +534,33 @@ HttpResponseHeader LinkChecker::getHttpHeader(KIO::Job* /*job*/, bool remember_c
void LinkChecker::checkRef()
{
- KURL url(linkStatus()->absoluteUrl());
+ KURL url(linktqStatus()->absoluteUrl());
Q_ASSERT(url.hasRef());
TQString ref = url.ref();
if(ref == "" || ref == "top") {
linkstatus_->setStatusText("OK");
- linkstatus_->setStatus(LinkStatus::SUCCESSFULL);
+ linkstatus_->settqStatus(LinktqStatus::SUCCESSFULL);
finnish();
return;
}
TQString url_base;
- LinkStatus const* ls_parent = 0;
+ LinktqStatus const* ls_parent = 0;
int i_ref = -1;
- if(linkStatus()->originalUrl().startsWith("#"))
- ls_parent = linkStatus()->parent();
+ if(linktqStatus()->originalUrl().startsWith("#"))
+ ls_parent = linktqStatus()->tqparent();
else
{
- i_ref = url.url().find("#");
+ i_ref = url.url().tqfind("#");
url_base = url.url().left(i_ref);
//kdDebug(23100) << "url_base: " << url_base << endl;
Q_ASSERT(search_manager_);
- ls_parent = search_manager_->linkStatus(url_base);
+ ls_parent = search_manager_->linktqStatus(url_base);
}
if(ls_parent)
@@ -603,22 +603,22 @@ void LinkChecker::checkRef(KURL const& url)
search_manager_->addHtmlPart(url_string, html_part);
}
- if(hasAnchor(html_part, linkStatus()->absoluteUrl().ref()))
+ if(hasAnchor(html_part, linktqStatus()->absoluteUrl().ref()))
{
linkstatus_->setStatusText("OK");
- linkstatus_->setStatus(LinkStatus::SUCCESSFULL);
+ linkstatus_->settqStatus(LinktqStatus::SUCCESSFULL);
}
else
{
linkstatus_->setErrorOccurred(true);
linkstatus_->setError(i18n( "Link destination not found." ));
- linkstatus_->setStatus(LinkStatus::BROKEN);
+ linkstatus_->settqStatus(LinktqStatus::BROKEN);
}
finnish();
}
-void LinkChecker::checkRef(LinkStatus const* linkstatus_parent)
+void LinkChecker::checkRef(LinktqStatus const* linkstatus_parent)
{
Q_ASSERT(search_manager_);
@@ -638,16 +638,16 @@ void LinkChecker::checkRef(LinkStatus const* linkstatus_parent)
search_manager_->addHtmlPart(url_string, html_part);
}
- if(hasAnchor(html_part, linkStatus()->absoluteUrl().ref()))
+ if(hasAnchor(html_part, linktqStatus()->absoluteUrl().ref()))
{
linkstatus_->setStatusText("OK");
- linkstatus_->setStatus(LinkStatus::SUCCESSFULL);
+ linkstatus_->settqStatus(LinktqStatus::SUCCESSFULL);
}
else
{
linkstatus_->setErrorOccurred(true);
linkstatus_->setError(i18n( "Link destination not found." ));
- linkstatus_->setStatus(LinkStatus::BROKEN);
+ linkstatus_->settqStatus(LinktqStatus::BROKEN);
}
finnish();
@@ -684,20 +684,20 @@ void LinkChecker::killJob()
aux->kill(true); // quietly
}
-LinkStatus::Status LinkChecker::getHttpStatus() const
+LinktqStatus::tqStatus LinkChecker::getHttptqStatus() const
{
TQString status_code = TQString::number(linkstatus_->httpHeader().statusCode());
if(status_code[0] == '2')
- return LinkStatus::SUCCESSFULL;
+ return LinktqStatus::SUCCESSFULL;
else if(status_code[0] == '3')
- return LinkStatus::HTTP_REDIRECTION;
+ return LinktqStatus::HTTP_REDIRECTION;
else if(status_code[0] == '4')
- return LinkStatus::HTTP_CLIENT_ERROR;
+ return LinktqStatus::HTTP_CLIENT_ERROR;
else if(status_code[0] == '5')
- return LinkStatus::HTTP_SERVER_ERROR;
+ return LinktqStatus::HTTP_SERVER_ERROR;
else
- return LinkStatus::UNDETERMINED;
+ return LinktqStatus::UNDETERMINED;
}
#include "linkchecker.moc"
diff --git a/klinkstatus/src/engine/linkchecker.h b/klinkstatus/src/engine/linkchecker.h
index 168776d9..74cf9eb9 100644
--- a/klinkstatus/src/engine/linkchecker.h
+++ b/klinkstatus/src/engine/linkchecker.h
@@ -37,25 +37,26 @@ using namespace std;
/**
@author Paulo Moura Guedes
*/
-class LinkChecker : public QObject
+class LinkChecker : public TQObject
{
Q_OBJECT
+ TQ_OBJECT
public:
- LinkChecker(LinkStatus* linkstatus, int time_out = 50,
- TQObject *parent = 0, const char *name = 0);
+ LinkChecker(LinktqStatus* linkstatus, int time_out = 50,
+ TQObject *tqparent = 0, const char *name = 0);
~LinkChecker();
//virtual void run();
void check();
void setSearchManager(SearchManager* search_manager);
- LinkStatus const* linkStatus() const;
+ LinktqStatus const* linktqStatus() const;
static bool hasAnchor(KHTMLPart* html_part, TQString const& anchor);
signals:
- void transactionFinished(const LinkStatus * linkstatus,
+ void transactionFinished(const LinktqStatus * linkstatus,
LinkChecker * checker);
void jobFinnished(LinkChecker * checker);
@@ -75,8 +76,8 @@ protected:
private:
- LinkStatus::Status getHttpStatus() const;
- void checkRef(LinkStatus const* linkstatus_parent);
+ LinktqStatus::tqStatus getHttptqStatus() const;
+ void checkRef(LinktqStatus const* linkstatus_parent);
void checkRef(KURL const& url);
void killJob();
/**
@@ -90,7 +91,7 @@ private:
private:
SearchManager* search_manager_;
- LinkStatus* const linkstatus_;
+ LinktqStatus* const linkstatus_;
KIO::TransferJob* t_job_;
int time_out_;
LinkChecker* checker_;
@@ -119,7 +120,7 @@ private:
static int count_; // debug attribute that counts how many links were checked
};
-inline LinkStatus const* LinkChecker::linkStatus() const
+inline LinktqStatus const* LinkChecker::linktqStatus() const
{
return linkstatus_;
}
diff --git a/klinkstatus/src/engine/linkfilter.cpp b/klinkstatus/src/engine/linkfilter.cpp
index 1c7a3844..92dee430 100644
--- a/klinkstatus/src/engine/linkfilter.cpp
+++ b/klinkstatus/src/engine/linkfilter.cpp
@@ -22,7 +22,7 @@
#include "linkstatus.h"
-LinkMatcher::LinkMatcher(TQString const& text, ResultView::Status status)
+LinkMatcher::LinkMatcher(TQString const& text, ResultView::tqStatus status)
: m_text(text), m_status(status)
{
}
@@ -31,15 +31,15 @@ LinkMatcher::~LinkMatcher()
{
}
-bool LinkMatcher::matches(LinkStatus const& link ) const
+bool LinkMatcher::matches(LinktqStatus const& link ) const
{
/* kdDebug() << link.absoluteUrl().url() << endl;
kdDebug() << link.label() << endl;
- kdDebug() << link.absoluteUrl().url().contains(m_text) << endl;
- kdDebug() << link.label().contains(m_text) << endl;
+ kdDebug() << link.absoluteUrl().url().tqcontains(m_text) << endl;
+ kdDebug() << link.label().tqcontains(m_text) << endl;
*/
- return (link.absoluteUrl().url().contains(m_text, false) || link.label().contains(m_text, false)) &&
- ResultView::displayableWithStatus(&link, m_status);
+ return (link.absoluteUrl().url().tqcontains(m_text, false) || link.label().tqcontains(m_text, false)) &&
+ ResultView::displayableWithtqStatus(&link, m_status);
}
diff --git a/klinkstatus/src/engine/linkfilter.h b/klinkstatus/src/engine/linkfilter.h
index 6d211aa6..908649d2 100644
--- a/klinkstatus/src/engine/linkfilter.h
+++ b/klinkstatus/src/engine/linkfilter.h
@@ -28,22 +28,22 @@
class LinkMatcher
{
public:
- LinkMatcher(TQString const& text, ResultView::Status status);
+ LinkMatcher(TQString const& text, ResultView::tqStatus status);
~LinkMatcher();
- bool matches(LinkStatus const& link) const;
+ bool matches(LinktqStatus const& link) const;
void setText(const TQString& text) { m_text = text; }
TQString text() const { return m_text; }
- void setStatus(ResultView::Status status) { m_status = status; }
- ResultView::Status status() const { return m_status; }
+ void settqStatus(ResultView::tqStatus status) { m_status = status; }
+ ResultView::tqStatus status() const { return m_status; }
bool nullFilter() const { return m_text.isEmpty() && m_status == ResultView::none; }
private:
TQString m_text;
- ResultView::Status m_status;
+ ResultView::tqStatus m_status;
};
#endif
diff --git a/klinkstatus/src/engine/linkstatus.cpp b/klinkstatus/src/engine/linkstatus.cpp
index 58841a63..cec4cd52 100644
--- a/klinkstatus/src/engine/linkstatus.cpp
+++ b/klinkstatus/src/engine/linkstatus.cpp
@@ -28,20 +28,20 @@
#include <tqdom.h>
-LinkStatus::~LinkStatus()
+LinktqStatus::~LinktqStatus()
{
//kdDebug(23100) << "|";
- for(uint i = 0; i != children_nodes_.size(); ++i)
+ for(uint i = 0; i != tqchildren_nodes_.size(); ++i)
{
- if(children_nodes_[i])
+ if(tqchildren_nodes_[i])
{
- delete children_nodes_[i];
- children_nodes_[i] = 0;
+ delete tqchildren_nodes_[i];
+ tqchildren_nodes_[i] = 0;
}
}
- children_nodes_.clear();
+ tqchildren_nodes_.clear();
if(isRedirection())
{
@@ -53,7 +53,7 @@ LinkStatus::~LinkStatus()
}
}
-void LinkStatus::reset()
+void LinktqStatus::reset()
{
depth_ = -1;
external_domain_depth_ = -1;
@@ -71,16 +71,16 @@ void LinkStatus::reset()
http_header_ = HttpResponseHeader();
error_ = "";
- for(uint i = 0; i != children_nodes_.size(); ++i)
+ for(uint i = 0; i != tqchildren_nodes_.size(); ++i)
{
- if(children_nodes_[i])
+ if(tqchildren_nodes_[i])
{
- delete children_nodes_[i];
- children_nodes_[i] = 0;
+ delete tqchildren_nodes_[i];
+ tqchildren_nodes_[i] = 0;
}
}
- children_nodes_.clear();
+ tqchildren_nodes_.clear();
if(isRedirection())
{
@@ -90,31 +90,31 @@ void LinkStatus::reset()
redirection_ = 0;
}
}
- Q_ASSERT(!parent_);
+ Q_ASSERT(!tqparent_);
base_URI_ = "";
}
-TQString const LinkStatus::toString() const
+TQString const LinktqStatus::toString() const
{
TQString aux;
if(!is_root_)
{
- Q_ASSERT(parent_);
- aux += i18n( "Parent: %1" ).arg( parent()->absoluteUrl().prettyURL() ) + "\n";
+ Q_ASSERT(tqparent_);
+ aux += i18n( "Parent: %1" ).tqarg( tqparent()->absoluteUrl().prettyURL() ) + "\n";
}
Q_ASSERT(!original_url_.isNull());
- aux += i18n( "URL: %1" ).arg( absoluteUrl().prettyURL() ) + "\n";
- aux += i18n( "Original URL: %1" ).arg( originalUrl() ) + "\n";
+ aux += i18n( "URL: %1" ).tqarg( absoluteUrl().prettyURL() ) + "\n";
+ aux += i18n( "Original URL: %1" ).tqarg( originalUrl() ) + "\n";
if(node())
- aux += i18n( "Node: %1" ).arg( node()->content() ) + "\n";
+ aux += i18n( "Node: %1" ).tqarg( node()->content() ) + "\n";
return aux;
}
-LinkStatus* LinkStatus::lastRedirection(LinkStatus* ls)
+LinktqStatus* LinktqStatus::lastRedirection(LinktqStatus* ls)
{
if(ls->isRedirection())
if(ls->redirection())
@@ -125,7 +125,7 @@ LinkStatus* LinkStatus::lastRedirection(LinkStatus* ls)
return ls;
}
-void LinkStatus::loadNode()
+void LinktqStatus::loadNode()
{
Q_ASSERT(node_);
@@ -136,32 +136,32 @@ void LinkStatus::loadNode()
{
setErrorOccurred(true);
setError(i18n( "Malformed" ));
- setStatus(LinkStatus::MALFORMED);
+ settqStatus(LinktqStatus::MALFORMED);
kdDebug(23100) << "Malformed:" << endl;
kdDebug(23100) << "Node: " << node()->content() << endl;
//kdDebug(23100) << toString() << endl; // probable segfault
}
}
-bool LinkStatus::malformed() const // don't inline please (#include "node.h")
+bool LinktqStatus::malformed() const // don't inline please (#include "node.h")
{
return (malformed_ || node_->malformed());
}
-void LinkStatus::setChildrenNodes(vector<Node*> const& nodes) // don't inline please (#include "node.h")
+void LinktqStatus::setChildrenNodes(vector<Node*> const& nodes) // don't inline please (#include "node.h")
{
- children_nodes_.reserve(nodes.size());
- children_nodes_ = nodes;
+ tqchildren_nodes_.reserve(nodes.size());
+ tqchildren_nodes_ = nodes;
}
-void LinkStatus::setMalformed(bool flag)
+void LinktqStatus::setMalformed(bool flag)
{
malformed_ = flag;
if(flag)
{
setErrorOccurred(true);
setError(i18n( "Malformed" ));
- setStatus(LinkStatus::MALFORMED);
+ settqStatus(LinktqStatus::MALFORMED);
kdDebug(23100) << "Malformed!" << endl;
kdDebug(23100) << node()->content() << endl;
//kdDebug(23100) << toString() << endl; // probable segfault
@@ -170,11 +170,11 @@ void LinkStatus::setMalformed(bool flag)
{
setErrorOccurred(false);
setError("");
- setStatus(LinkStatus::UNDETERMINED);
+ settqStatus(LinktqStatus::UNDETERMINED);
}
}
-void LinkStatus::save(TQDomElement& element) const
+void LinktqStatus::save(TQDomElement& element) const
{
TQDomElement child_element = element.ownerDocument().createElement("link");
@@ -186,7 +186,7 @@ void LinkStatus::save(TQDomElement& element) const
// <status>
tmp_1 = element.ownerDocument().createElement("status");
tmp_1.setAttribute("broken",
- ResultView::displayableWithStatus(this, ResultView::bad) ?
+ ResultView::displayableWithtqStatus(this, ResultView::bad) ?
"true" : "false");
tmp_1.appendChild(element.ownerDocument().createTextNode(statusText()));
child_element.appendChild(tmp_1);
diff --git a/klinkstatus/src/engine/linkstatus.h b/klinkstatus/src/engine/linkstatus.h
index 59a45751..7ec26ca9 100644
--- a/klinkstatus/src/engine/linkstatus.h
+++ b/klinkstatus/src/engine/linkstatus.h
@@ -43,11 +43,11 @@ using namespace std;
class Node;
-class LinkStatus
+class LinktqStatus
{
public:
- enum Status {
+ enum tqStatus {
UNDETERMINED,
SUCCESSFULL,
BROKEN,
@@ -59,29 +59,29 @@ public:
MALFORMED
};
- LinkStatus();
- LinkStatus(KURL const& absolute_url);
- LinkStatus(Node* node, LinkStatus* parent);
- ~LinkStatus();
+ LinktqStatus();
+ LinktqStatus(KURL const& absolute_url);
+ LinktqStatus(Node* node, LinktqStatus* tqparent);
+ ~LinktqStatus();
void save(TQDomElement& element) const;
void reset();
void setRootUrl(KURL const& url);
- void setStatus(Status status);
+ void settqStatus(tqStatus status);
void setDepth(uint depth);
- void setParent(LinkStatus* parent);
+ void setParent(LinktqStatus* tqparent);
void setOriginalUrl(TQString const& url_original);
void setLabel(TQString const& label);
void setAbsoluteUrl(KURL const& url_absoluto);
void setDocHtml(TQString const& doc_html);
void setHttpHeader(HttpResponseHeader const& cabecalho_http);
- void setStatusText(TQString const& statusText); // FIXME Legacy. This should be eliminated in favor of LinkStatus::Status
+ void setStatusText(TQString const& statusText); // FIXME Legacy. This should be eliminated in favor of LinktqStatus::tqStatus
void setError(TQString const& error);
void setIsRoot(bool flag);
void setErrorOccurred(bool houve_error);
void setIsRedirection(bool e_redirection);
- void setRedirection(LinkStatus* redirection);
+ void setRedirection(LinktqStatus* redirection);
void setNode(Node* node);
void setChildrenNodes(vector<Node*> const& nodes);
void addChildNode(Node* node);
@@ -102,25 +102,25 @@ public:
void addReferrer(KURL const& url);
KURL const& rootUrl() const;
- Status const& status() const;
+ tqStatus const& status() const;
uint depth() const;
bool local() const; // linkstatus.paradigma.co.pt == paradigma.co.pt
bool isLocalRestrict() const; // linkstatus.paradigma.co.pt != paradigma.co.pt
- LinkStatus const* parent() const;
+ LinktqStatus const* tqparent() const;
TQString const& originalUrl() const;
TQString const& label() const;
KURL const& absoluteUrl() const;
TQString const& docHtml() const;
HttpResponseHeader const& httpHeader() const;
HttpResponseHeader& httpHeader();
- TQString statusText() const; // FIXME Legacy. This should be eliminated in favor of LinkStatus::Status
+ TQString statusText() const; // FIXME Legacy. This should be eliminated in favor of LinktqStatus::tqStatus
TQString const& error() const;
bool isRoot() const;
bool errorOccurred() const;
bool isRedirection() const;
- LinkStatus* redirection() const;
+ LinktqStatus* redirection() const;
Node* node() const;
- vector<Node*> const& childrenNodes() const;
+ vector<Node*> const& tqchildrenNodes() const;
TQString const toString() const;
bool checked() const;
int externalDomainDepth() const;
@@ -137,19 +137,19 @@ public:
TreeViewItem* treeViewItem() const;
TQValueVector<KURL> const& referrers() const;
- static LinkStatus* lastRedirection(LinkStatus* ls);
+ static LinktqStatus* lastRedirection(LinktqStatus* ls);
private:
/**
- Load some atributes in function of his parent node.
+ Load some atributes in function of his tqparent node.
*/
void loadNode();
private:
KURL root_url_; // The URL which made the search start
- Status status_;
+ tqStatus status_;
int depth_;
int external_domain_depth_; // Para se poder escolher explorar domains diferentes ate n depth
TQString original_url_;
@@ -157,14 +157,14 @@ private:
KURL absolute_url_;
TQString doc_html_;
HttpResponseHeader http_header_;
- TQString status_text_; // FIXME Legacy. This should be eliminated in favor of LinkStatus::Status
+ TQString status_text_; // FIXME Legacy. This should be eliminated in favor of LinktqStatus::tqStatus
TQString error_;
bool is_root_;
bool error_occurred_;
bool is_redirection_;
- vector<Node*> children_nodes_;
- LinkStatus* parent_;
- LinkStatus* redirection_;
+ vector<Node*> tqchildren_nodes_;
+ LinktqStatus* tqparent_;
+ LinktqStatus* redirection_;
bool checked_;
bool only_check_header_;
bool malformed_;
diff --git a/klinkstatus/src/engine/linkstatus_impl.h b/klinkstatus/src/engine/linkstatus_impl.h
index 5a875b2e..4d3faf36 100644
--- a/klinkstatus/src/engine/linkstatus_impl.h
+++ b/klinkstatus/src/engine/linkstatus_impl.h
@@ -18,17 +18,17 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-inline LinkStatus::LinkStatus()
- : status_(LinkStatus::UNDETERMINED), depth_(-1), external_domain_depth_(-1), is_root_(false),
- error_occurred_(false), is_redirection_(false), parent_(0), redirection_(0), checked_(false),
+inline LinktqStatus::LinktqStatus()
+ : status_(LinktqStatus::UNDETERMINED), depth_(-1), external_domain_depth_(-1), is_root_(false),
+ error_occurred_(false), is_redirection_(false), tqparent_(0), redirection_(0), checked_(false),
only_check_header_(true), malformed_(false),
node_(0), has_base_URI_(false), has_html_doc_title_(false), ignored_(false),
mimetype_(""), is_error_page_(false), tree_view_item_(0)
{}
-inline LinkStatus::LinkStatus(KURL const& absolute_url)
- : status_(LinkStatus::UNDETERMINED), depth_(-1), external_domain_depth_(-1), is_root_(false),
- error_occurred_(false), is_redirection_(false), parent_(0), redirection_(0), checked_(false),
+inline LinktqStatus::LinktqStatus(KURL const& absolute_url)
+ : status_(LinktqStatus::UNDETERMINED), depth_(-1), external_domain_depth_(-1), is_root_(false),
+ error_occurred_(false), is_redirection_(false), tqparent_(0), redirection_(0), checked_(false),
only_check_header_(true), malformed_(false),
node_(0), has_base_URI_(false), has_html_doc_title_(false), ignored_(false),
mimetype_(""), is_error_page_(false), tree_view_item_(0)
@@ -36,147 +36,147 @@ inline LinkStatus::LinkStatus(KURL const& absolute_url)
setAbsoluteUrl(absolute_url);
}
-inline LinkStatus::LinkStatus(Node* node, LinkStatus* parent)
- : status_(LinkStatus::UNDETERMINED), depth_(-1), external_domain_depth_(-1), is_root_(false),
- error_occurred_(false), is_redirection_(false), parent_(0), redirection_(0), checked_(false),
+inline LinktqStatus::LinktqStatus(Node* node, LinktqStatus* tqparent)
+ : status_(LinktqStatus::UNDETERMINED), depth_(-1), external_domain_depth_(-1), is_root_(false),
+ error_occurred_(false), is_redirection_(false), tqparent_(0), redirection_(0), checked_(false),
only_check_header_(true), malformed_(false),
node_(node), has_base_URI_(false), has_html_doc_title_(false), ignored_(false),
mimetype_(""), is_error_page_(false), tree_view_item_(0)
{
loadNode();
- setDepth(parent->depth() + 1);
- setParent(parent);
- setRootUrl(parent->rootUrl());
+ setDepth(tqparent->depth() + 1);
+ setParent(tqparent);
+ setRootUrl(tqparent->rootUrl());
}
-inline void LinkStatus::setRootUrl(KURL const& url)
+inline void LinktqStatus::setRootUrl(KURL const& url)
{
root_url_ = url;
}
-inline void LinkStatus::setStatus(Status status)
+inline void LinktqStatus::settqStatus(tqStatus status)
{
status_ = status;
}
-inline void LinkStatus::setDepth(uint depth)
+inline void LinktqStatus::setDepth(uint depth)
{
depth_ = depth;
}
-inline void LinkStatus::setParent(LinkStatus* parent)
+inline void LinktqStatus::setParent(LinktqStatus* tqparent)
{
- Q_ASSERT(parent);
+ Q_ASSERT(tqparent);
- parent_ = parent;
- addReferrer(parent->absoluteUrl());
+ tqparent_ = tqparent;
+ addReferrer(tqparent->absoluteUrl());
}
-inline void LinkStatus::setAbsoluteUrl(KURL const& url_absoluto)
+inline void LinktqStatus::setAbsoluteUrl(KURL const& url_absoluto)
{
absolute_url_ = url_absoluto;
}
-inline void LinkStatus::setOriginalUrl(TQString const& url_original)
+inline void LinktqStatus::setOriginalUrl(TQString const& url_original)
{
original_url_ = url_original;
}
-inline void LinkStatus::setLabel(TQString const& label)
+inline void LinktqStatus::setLabel(TQString const& label)
{
label_ = label;
}
-inline void LinkStatus::setDocHtml(TQString const& doc_html)
+inline void LinktqStatus::setDocHtml(TQString const& doc_html)
{
Q_ASSERT(!doc_html.isEmpty());
doc_html_ = doc_html;
}
-inline void LinkStatus::setHttpHeader(HttpResponseHeader const& cabecalho_http)
+inline void LinktqStatus::setHttpHeader(HttpResponseHeader const& cabecalho_http)
{
http_header_ = cabecalho_http;
}
-inline void LinkStatus::setStatusText(TQString const& status)
+inline void LinktqStatus::setStatusText(TQString const& status)
{
Q_ASSERT(!status.isEmpty());
status_text_ = status;
}
-inline void LinkStatus::setError(TQString const& error)
+inline void LinktqStatus::setError(TQString const& error)
{
Q_ASSERT(!error.isEmpty());
error_ = error;
}
-inline void LinkStatus::setErrorOccurred(bool houve_error)
+inline void LinktqStatus::setErrorOccurred(bool houve_error)
{
error_occurred_ = houve_error;
}
-inline void LinkStatus::setIsRoot(bool flag)
+inline void LinktqStatus::setIsRoot(bool flag)
{
is_root_ = flag;
label_ = i18n("ROOT");
}
-inline void LinkStatus::setRedirection(LinkStatus* redirection)
+inline void LinktqStatus::setRedirection(LinktqStatus* redirection)
{
Q_ASSERT(redirection != NULL);
Q_ASSERT(isRedirection());
redirection_ = redirection;
}
-inline void LinkStatus::setIsRedirection(bool e_redirection)
+inline void LinktqStatus::setIsRedirection(bool e_redirection)
{
is_redirection_ = e_redirection;
}
-inline void LinkStatus::addChildNode(Node* node)
+inline void LinktqStatus::addChildNode(Node* node)
{
- children_nodes_.push_back(node);
+ tqchildren_nodes_.push_back(node);
}
-inline void LinkStatus::reserveMemoryForChildrenNodes(int n)
+inline void LinktqStatus::reserveMemoryForChildrenNodes(int n)
{
Q_ASSERT(n > 0);
- children_nodes_.reserve(n);
+ tqchildren_nodes_.reserve(n);
}
-inline void LinkStatus::setChecked(bool flag)
+inline void LinktqStatus::setChecked(bool flag)
{
checked_ = flag;
}
-inline void LinkStatus::setExternalDomainDepth(int p)
+inline void LinktqStatus::setExternalDomainDepth(int p)
{
Q_ASSERT(p >= -1);
external_domain_depth_ = p;
}
-inline void LinkStatus::setOnlyCheckHeader(bool flag)
+inline void LinktqStatus::setOnlyCheckHeader(bool flag)
{
only_check_header_= flag;
}
-inline void LinkStatus::setHasBaseURI(bool flag)
+inline void LinktqStatus::setHasBaseURI(bool flag)
{
has_base_URI_ = flag;
}
-inline void LinkStatus::setHasHtmlDocTitle(bool flag)
+inline void LinktqStatus::setHasHtmlDocTitle(bool flag)
{
has_html_doc_title_ = flag;
}
-inline void LinkStatus::setBaseURI(KURL const& base_url)
+inline void LinktqStatus::setBaseURI(KURL const& base_url)
{
if(!base_url.isValid())
{
kdWarning(23100) << "base url not valid: " << endl
- << "parent: " << parent()->absoluteUrl().prettyURL() << endl
+ << "tqparent: " << tqparent()->absoluteUrl().prettyURL() << endl
<< "url: " << absoluteUrl().prettyURL() << endl
<< "base url resolved: " << base_url.prettyURL() << endl;
}
@@ -186,7 +186,7 @@ inline void LinkStatus::setBaseURI(KURL const& base_url)
base_URI_ = base_url;
}
-inline void LinkStatus::setHtmlDocTitle(TQString const& title)
+inline void LinktqStatus::setHtmlDocTitle(TQString const& title)
{
if(title.isNull() || title.isEmpty())
{
@@ -199,34 +199,34 @@ inline void LinkStatus::setHtmlDocTitle(TQString const& title)
html_doc_title_ = title;
}
-inline void LinkStatus::setIgnored(bool flag)
+inline void LinktqStatus::setIgnored(bool flag)
{
ignored_ = flag;
}
-inline void LinkStatus::setMimeType(TQString const& mimetype)
+inline void LinktqStatus::setMimeType(TQString const& mimetype)
{
Q_ASSERT(!mimetype.isNull() && !mimetype.isEmpty());
mimetype_ = mimetype;
}
-inline void LinkStatus::setIsErrorPage(bool flag)
+inline void LinktqStatus::setIsErrorPage(bool flag)
{
is_error_page_ = flag;
}
-inline void LinkStatus::setIsLocalRestrict(bool flag)
+inline void LinktqStatus::setIsLocalRestrict(bool flag)
{
is_local_restrict_ = flag;
}
-inline void LinkStatus::setTreeViewItem(TreeViewItem* tree_view_item)
+inline void LinktqStatus::setTreeViewItem(TreeViewItem* tree_view_item)
{
Q_ASSERT(tree_view_item);
tree_view_item_ = tree_view_item;
}
-inline void LinkStatus::addReferrer(KURL const& url)
+inline void LinktqStatus::addReferrer(KURL const& url)
{
Q_ASSERT(url.isValid());
@@ -236,67 +236,67 @@ inline void LinkStatus::addReferrer(KURL const& url)
-inline KURL const& LinkStatus::rootUrl() const
+inline KURL const& LinktqStatus::rootUrl() const
{
return root_url_;
}
-inline LinkStatus::Status const& LinkStatus::status() const
+inline LinktqStatus::tqStatus const& LinktqStatus::status() const
{
return status_;
}
-inline uint LinkStatus::depth() const
+inline uint LinktqStatus::depth() const
{
return depth_;
}
-inline bool LinkStatus::local() const
+inline bool LinktqStatus::local() const
{
return external_domain_depth_ == -1;
}
-inline bool LinkStatus::isLocalRestrict() const
+inline bool LinktqStatus::isLocalRestrict() const
{
return is_local_restrict_;
}
-inline LinkStatus const* LinkStatus::parent() const
+inline LinktqStatus const* LinktqStatus::tqparent() const
{
- return parent_;
+ return tqparent_;
}
-inline TQString const& LinkStatus::originalUrl() const
+inline TQString const& LinktqStatus::originalUrl() const
{
return original_url_;
}
-inline TQString const& LinkStatus::label() const
+inline TQString const& LinktqStatus::label() const
{
return label_;
}
-inline KURL const& LinkStatus::absoluteUrl() const
+inline KURL const& LinktqStatus::absoluteUrl() const
{
return absolute_url_;
}
-inline TQString const& LinkStatus::docHtml() const
+inline TQString const& LinktqStatus::docHtml() const
{
return doc_html_;
}
-inline HttpResponseHeader const& LinkStatus::httpHeader() const
+inline HttpResponseHeader const& LinktqStatus::httpHeader() const
{
return http_header_;
}
-inline HttpResponseHeader& LinkStatus::httpHeader()
+inline HttpResponseHeader& LinktqStatus::httpHeader()
{
return http_header_;
}
-inline TQString LinkStatus::statusText() const
+inline TQString LinktqStatus::statusText() const
{
if(errorOccurred())
return error();
@@ -314,103 +314,103 @@ inline TQString LinkStatus::statusText() const
}
}
-inline TQString const& LinkStatus::error() const
+inline TQString const& LinktqStatus::error() const
{
return error_;
}
-inline bool LinkStatus::isRoot() const
+inline bool LinktqStatus::isRoot() const
{
return is_root_;
}
-inline bool LinkStatus::errorOccurred() const
+inline bool LinktqStatus::errorOccurred() const
{
return error_occurred_;
}
-inline bool LinkStatus::isRedirection() const
+inline bool LinktqStatus::isRedirection() const
{
return is_redirection_;
}
-inline LinkStatus* LinkStatus::redirection() const
+inline LinktqStatus* LinktqStatus::redirection() const
{
Q_ASSERT(isRedirection());
return redirection_;
}
-inline Node* LinkStatus::node() const
+inline Node* LinktqStatus::node() const
{
//Q_ASSERT(node_);
return node_;
}
-inline vector<Node*> const& LinkStatus::childrenNodes() const
+inline vector<Node*> const& LinktqStatus::tqchildrenNodes() const
{
- return children_nodes_;
+ return tqchildren_nodes_;
}
-inline bool LinkStatus::checked() const
+inline bool LinktqStatus::checked() const
{
return checked_;
}
-inline int LinkStatus::externalDomainDepth() const
+inline int LinktqStatus::externalDomainDepth() const
{
return external_domain_depth_;
}
-inline bool LinkStatus::onlyCheckHeader() const
+inline bool LinktqStatus::onlyCheckHeader() const
{
return only_check_header_;
}
-inline bool LinkStatus::hasBaseURI() const
+inline bool LinktqStatus::hasBaseURI() const
{
return has_base_URI_;
}
-inline bool LinkStatus::hasHtmlDocTitle() const
+inline bool LinktqStatus::hasHtmlDocTitle() const
{
return has_html_doc_title_;
}
-inline KURL const& LinkStatus::baseURI() const
+inline KURL const& LinktqStatus::baseURI() const
{
Q_ASSERT(hasBaseURI());
return base_URI_;
}
-inline TQString const& LinkStatus::htmlDocTitle() const
+inline TQString const& LinktqStatus::htmlDocTitle() const
{
Q_ASSERT(has_html_doc_title_);
return html_doc_title_;
}
-inline bool LinkStatus::ignored() const
+inline bool LinktqStatus::ignored() const
{
return ignored_;
}
-inline TQString LinkStatus::mimeType() const
+inline TQString LinktqStatus::mimeType() const
{
Q_ASSERT(!mimetype_.isNull());
return mimetype_;
}
-inline bool LinkStatus::isErrorPage() const
+inline bool LinktqStatus::isErrorPage() const
{
return is_error_page_;
}
-inline TreeViewItem* LinkStatus::treeViewItem() const
+inline TreeViewItem* LinktqStatus::treeViewItem() const
{
return tree_view_item_;
}
-inline TQValueVector<KURL> const& LinkStatus::referrers() const
+inline TQValueVector<KURL> const& LinktqStatus::referrers() const
{
return referrers_;
}
diff --git a/klinkstatus/src/engine/searchmanager.cpp b/klinkstatus/src/engine/searchmanager.cpp
index c64c3a89..3a34d04c 100644
--- a/klinkstatus/src/engine/searchmanager.cpp
+++ b/klinkstatus/src/engine/searchmanager.cpp
@@ -37,8 +37,8 @@
SearchManager::SearchManager(int max_simultaneous_connections, int time_out,
- TQObject *parent, const char *name)
- : TQObject(parent, name),
+ TQObject *tqparent, const char *name)
+ : TQObject(tqparent, name),
max_simultaneous_connections_(max_simultaneous_connections), has_document_root_(false),
depth_(-1), current_depth_(0), external_domain_depth_(0),
current_node_(0), current_index_(0), links_being_checked_(0),
@@ -106,7 +106,7 @@ void SearchManager::cleanItems()
((search_results_[i])[j])[l] = 0;
}
else
- kdDebug(23100) << "LinkStatus NULL!!" << endl;
+ kdDebug(23100) << "LinktqStatus NULL!!" << endl;
}
search_results_[i][j].clear();
}
@@ -148,7 +148,7 @@ void SearchManager::startSearch(KURL const& root, SearchMode const& modo)
searching_ = true;
- //Q_ASSERT(domain_ != TQString::null);
+ //Q_ASSERT(domain_ != TQString());
checkRoot();
}
@@ -191,8 +191,8 @@ void SearchManager::checkRoot()
LinkChecker* checker = new LinkChecker(&root_, time_out_, this, "link_checker");
checker->setSearchManager(this);
- connect(checker, TQT_SIGNAL(transactionFinished(const LinkStatus *, LinkChecker *)),
- this, TQT_SLOT(slotRootChecked(const LinkStatus *, LinkChecker *)));
+ connect(checker, TQT_SIGNAL(transactionFinished(const LinktqStatus *, LinkChecker *)),
+ this, TQT_SLOT(slotRootChecked(const LinktqStatus *, LinkChecker *)));
/*
connect(checker, TQT_SIGNAL(jobFinnished(LinkChecker *)),
this, TQT_SLOT(slotLinkCheckerFinnished(LinkChecker *)));
@@ -200,11 +200,11 @@ void SearchManager::checkRoot()
checker->check();
}
-void SearchManager::slotRootChecked(const LinkStatus * link, LinkChecker * checker)
+void SearchManager::slotRootChecked(const LinktqStatus * link, LinkChecker * checker)
{
kdDebug(23100) << "SearchManager::slotRootChecked:" << endl;
kdDebug(23100) << link->absoluteUrl().url() << " -> " <<
- LinkStatus::lastRedirection(&root_)->absoluteUrl().url() << endl;
+ LinktqStatus::lastRedirection(&root_)->absoluteUrl().url() << endl;
Q_ASSERT(checked_links_ == 0);
Q_ASSERT(search_results_.size() == 0);
@@ -217,11 +217,11 @@ void SearchManager::slotRootChecked(const LinkStatus * link, LinkChecker * check
{
current_depth_ = 1;
- vector<LinkStatus*> no = children(LinkStatus::lastRedirection(&root_));
+ vector<LinktqStatus*> no = tqchildren(LinktqStatus::lastRedirection(&root_));
emit signalLinksToCheckTotalSteps(no.size());
- vector< vector<LinkStatus*> > nivel;
+ vector< vector<LinktqStatus*> > nivel;
nivel.push_back(no);
search_results_.push_back(nivel);
@@ -255,14 +255,14 @@ void SearchManager::slotRootChecked(const LinkStatus * link, LinkChecker * check
checker = 0;
}
-vector<LinkStatus*> SearchManager::children(LinkStatus* link)
+vector<LinktqStatus*> SearchManager::tqchildren(LinktqStatus* link)
{
- vector<LinkStatus*> children;
+ vector<LinktqStatus*> tqchildren;
if(!link || link->absoluteUrl().hasRef())
- return children;
+ return tqchildren;
- vector<Node*> const& nodes = link->childrenNodes();
+ vector<Node*> const& nodes = link->tqchildrenNodes();
int count = 0;
for(uint i = 0; i != nodes.size(); ++i)
@@ -278,12 +278,12 @@ vector<LinkStatus*> SearchManager::children(LinkStatus* link)
if( (node->isLink() &&
checkable(url, *link) &&
- !Url::existUrl(url, children) &&
+ !Url::existUrl(url, tqchildren) &&
!node->url().isEmpty())
||
node->malformed() )
{
- LinkStatus* ls = new LinkStatus(node, link);
+ LinktqStatus* ls = new LinktqStatus(node, link);
ls->setAbsoluteUrl(url);
if(localDomain(ls->absoluteUrl()))
@@ -310,7 +310,7 @@ vector<LinkStatus*> SearchManager::children(LinkStatus* link)
}
Q_ASSERT(link->externalDomainDepth() <= external_domain_depth_);
- children.push_back(ls);
+ tqchildren.push_back(ls);
}
if(count == 50)
{
@@ -319,7 +319,7 @@ vector<LinkStatus*> SearchManager::children(LinkStatus* link)
}
}
- return children;
+ return tqchildren;
}
bool SearchManager::existUrl(KURL const& url, KURL const& url_parent) const
@@ -331,7 +331,7 @@ bool SearchManager::existUrl(KURL const& url, KURL const& url_parent) const
for(uint j = 0; j != search_results_[i].size(); ++j)
for(uint l = 0; l != (search_results_[i])[j].size(); ++l)
{
- LinkStatus* tmp = search_results_[i][j][l];
+ LinktqStatus* tmp = search_results_[i][j][l];
Q_ASSERT(tmp);
if(tmp->absoluteUrl() == url)
{ // URL exists
@@ -352,7 +352,7 @@ bool SearchManager::existUrl(KURL const& url, KURL const& url_parent) const
return false;
}
-LinkStatus const* SearchManager::linkStatus(TQString const& s_url) const
+LinktqStatus const* SearchManager::linktqStatus(TQString const& s_url) const
{
Q_ASSERT(!s_url.isEmpty());
@@ -366,7 +366,7 @@ LinkStatus const* SearchManager::linkStatus(TQString const& s_url) const
{
++count;
- LinkStatus* ls = search_results_[i][j][l];
+ LinktqStatus* ls = search_results_[i][j][l];
Q_ASSERT(ls);
if(ls->absoluteUrl().url() == s_url && ls->checked())
return ls;
@@ -402,7 +402,7 @@ void SearchManager::continueSearch()
{
Q_ASSERT(!links_being_checked_);
- vector<LinkStatus*> const& no = nodeToAnalize();
+ vector<LinktqStatus*> const& no = nodeToAnalize();
if((uint)current_index_ < no.size())
checkVectorLinks(no);
@@ -442,7 +442,7 @@ void SearchManager::continueSearch()
}
}
-vector<LinkStatus*> const& SearchManager::nodeToAnalize() const
+vector<LinktqStatus*> const& SearchManager::nodeToAnalize() const
{
Q_ASSERT( (uint)current_depth_ == search_results_.size() );
Q_ASSERT( (uint)current_node_ < (search_results_[current_depth_ - 1]).size() );
@@ -450,14 +450,14 @@ vector<LinkStatus*> const& SearchManager::nodeToAnalize() const
return (search_results_[current_depth_ - 1])[current_node_];
}
-void SearchManager::checkVectorLinks(vector<LinkStatus*> const& links)
+void SearchManager::checkVectorLinks(vector<LinktqStatus*> const& links)
{
checkLinksSimultaneously(chooseLinks(links));
}
-vector<LinkStatus*> SearchManager::chooseLinks(vector<LinkStatus*> const& links)
+vector<LinktqStatus*> SearchManager::chooseLinks(vector<LinktqStatus*> const& links)
{
- vector<LinkStatus*> escolha;
+ vector<LinktqStatus*> escolha;
for(int i = 0; i != max_simultaneous_connections_; ++i)
{
if((uint)current_index_ < links.size())
@@ -466,7 +466,7 @@ vector<LinkStatus*> SearchManager::chooseLinks(vector<LinkStatus*> const& links)
return escolha;
}
-void SearchManager::checkLinksSimultaneously(vector<LinkStatus*> const& links)
+void SearchManager::checkLinksSimultaneously(vector<LinktqStatus*> const& links)
{
Q_ASSERT(finished_connections_ <= max_simultaneous_connections_);
finished_connections_ = 0;
@@ -480,7 +480,7 @@ void SearchManager::checkLinksSimultaneously(vector<LinkStatus*> const& links)
for(uint i = 0; i != links.size(); ++i)
{
- LinkStatus* ls(links[i]);
+ LinktqStatus* ls(links[i]);
Q_ASSERT(ls);
TQString protocol = ls->absoluteUrl().protocol();
@@ -491,19 +491,19 @@ void SearchManager::checkLinksSimultaneously(vector<LinkStatus*> const& links)
if(ls->malformed())
{
Q_ASSERT(ls->errorOccurred());
- Q_ASSERT(ls->status() == LinkStatus::MALFORMED);
+ Q_ASSERT(ls->status() == LinktqStatus::MALFORMED);
ls->setChecked(true);
slotLinkChecked(ls, 0);
}
- else if(ls->absoluteUrl().prettyURL().contains("javascript:", false))
+ else if(ls->absoluteUrl().prettyURL().tqcontains("javascript:", false))
{
++ignored_links_;
ls->setIgnored(true);
ls->setErrorOccurred(true);
ls->setError(i18n( "Javascript not supported" ));
- ls->setStatus(LinkStatus::NOT_SUPPORTED);
+ ls->settqStatus(LinktqStatus::NOT_SUPPORTED);
ls->setChecked(true);
slotLinkChecked(ls, 0);
}
@@ -513,8 +513,8 @@ void SearchManager::checkLinksSimultaneously(vector<LinkStatus*> const& links)
++ignored_links_;
ls->setIgnored(true);
ls->setErrorOccurred(true);
- ls->setError(i18n("Protocol %1 not supported").arg(protocol));
- ls->setStatus(LinkStatus::MALFORMED);
+ ls->setError(i18n("Protocol %1 not supported").tqarg(protocol));
+ ls->settqStatus(LinktqStatus::MALFORMED);
ls->setChecked(true);
slotLinkChecked(ls, 0);
}
@@ -524,8 +524,8 @@ void SearchManager::checkLinksSimultaneously(vector<LinkStatus*> const& links)
LinkChecker* checker = new LinkChecker(ls, time_out_, this, "link_checker");
checker->setSearchManager(this);
- connect(checker, TQT_SIGNAL(transactionFinished(const LinkStatus *, LinkChecker *)),
- this, TQT_SLOT(slotLinkChecked(const LinkStatus *, LinkChecker *)));
+ connect(checker, TQT_SIGNAL(transactionFinished(const LinktqStatus *, LinkChecker *)),
+ this, TQT_SLOT(slotLinkChecked(const LinktqStatus *, LinkChecker *)));
/*
connect(checker, TQT_SIGNAL(jobFinnished(LinkChecker *)),
this, TQT_SLOT(slotLinkCheckerFinnished(LinkChecker *)));
@@ -535,11 +535,11 @@ void SearchManager::checkLinksSimultaneously(vector<LinkStatus*> const& links)
}
}
-void SearchManager::slotLinkChecked(const LinkStatus * link, LinkChecker * checker)
+void SearchManager::slotLinkChecked(const LinktqStatus * link, LinkChecker * checker)
{
kdDebug(23100) << "SearchManager::slotLinkChecked:" << endl;
// kdDebug(23100) << link->absoluteUrl().url() << " -> " <<
-// LinkStatus::lastRedirection((const_cast<LinkStatus*> (link)))->absoluteUrl().url() << endl;
+// LinktqStatus::lastRedirection((const_cast<LinktqStatus*> (link)))->absoluteUrl().url() << endl;
Q_ASSERT(link);
emit signalLinkChecked(link, checker);
@@ -569,8 +569,8 @@ void SearchManager::slotLinkChecked(const LinkStatus * link, LinkChecker * check
void SearchManager::addLevel()
{
- search_results_.push_back(vector< vector <LinkStatus*> >());
- vector< vector <LinkStatus*> >& ultimo_nivel(search_results_[search_results_.size() - 2]);
+ search_results_.push_back(vector< vector <LinktqStatus*> >());
+ vector< vector <LinktqStatus*> >& ultimo_nivel(search_results_[search_results_.size() - 2]);
number_of_level_links_ = 0;
number_of_links_to_check_ = 0;
@@ -591,7 +591,7 @@ void SearchManager::addLevel()
uint end_sub1 = ultimo_nivel[i].size();
for(uint j = 0; j != end_sub1; ++j) // links
{
- vector <LinkStatus*> f(children( LinkStatus::lastRedirection(((ultimo_nivel[i])[j])) ));
+ vector <LinktqStatus*> f(tqchildren( LinktqStatus::lastRedirection(((ultimo_nivel[i])[j])) ));
if(f.size() != 0)
{
search_results_[search_results_.size() - 1].push_back(f);
@@ -608,7 +608,7 @@ void SearchManager::addLevel()
emit signalLinksToCheckTotalSteps(number_of_links_to_check_);
}
-bool SearchManager::checkable(KURL const& url, LinkStatus const& link_parent) const
+bool SearchManager::checkable(KURL const& url, LinktqStatus const& link_parent) const
{
if(existUrl(url, link_parent.absoluteUrl()))
return false;
@@ -618,7 +618,7 @@ bool SearchManager::checkable(KURL const& url, LinkStatus const& link_parent) co
if(!check_parent_dirs_)
{
- if(Url::parentDir(root_.absoluteUrl(), url))
+ if(Url::tqparentDir(root_.absoluteUrl(), url))
return false;
}
if(!check_external_links_)
@@ -638,7 +638,7 @@ bool SearchManager::checkable(KURL const& url, LinkStatus const& link_parent) co
return true;
}
-bool SearchManager::checkableByDomain(KURL const& url, LinkStatus const& link_parent) const
+bool SearchManager::checkableByDomain(KURL const& url, LinktqStatus const& link_parent) const
{
bool result = false;
if(localDomain(url))
@@ -749,7 +749,7 @@ bool SearchManager::generalDomain() const
if(!check_parent_dirs_)
return false;
- int barra = domain_.find('/');
+ int barra = domain_.tqfind('/');
if(barra != -1 && (uint)barra != domain_.length() - 1)
{
kdDebug(23100) << "Domain nao vago" << endl;
@@ -781,7 +781,7 @@ bool SearchManager::generalDomain() const
}
}
-bool SearchManager::onlyCheckHeader(LinkStatus* ls) const
+bool SearchManager::onlyCheckHeader(LinktqStatus* ls) const
{
if(search_mode_ == depth)
return current_depth_ == depth_;
@@ -805,7 +805,7 @@ void SearchManager::slotLinkCheckerFinnished(LinkChecker * checker)
kdDebug(23100) << "deleting linkchecker" << endl;
Q_ASSERT(checker);
- //Q_ASSERT(checker->linkStatus()->checked());
+ //Q_ASSERT(checker->linktqStatus()->checked());
delete checker;
checker = 0;
@@ -813,7 +813,7 @@ void SearchManager::slotLinkCheckerFinnished(LinkChecker * checker)
KHTMLPart* SearchManager::htmlPart(TQString const& key_url) const
{
- if(!html_parts_.contains(key_url))
+ if(!html_parts_.tqcontains(key_url))
return 0;
return html_parts_[key_url];
@@ -891,7 +891,7 @@ void SearchManager::save(TQDomElement& element) const
{
for(uint l = 0; l != (search_results_[i])[j].size(); ++l)
{
- LinkStatus* ls = ((search_results_[i])[j])[l];
+ LinktqStatus* ls = ((search_results_[i])[j])[l];
if(ls->checked())
ls->save(child_element);
}
diff --git a/klinkstatus/src/engine/searchmanager.h b/klinkstatus/src/engine/searchmanager.h
index 5f2410ac..e977eae4 100644
--- a/klinkstatus/src/engine/searchmanager.h
+++ b/klinkstatus/src/engine/searchmanager.h
@@ -18,8 +18,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-#ifndef GESTOR_PESQUISA_H
-#define GESTOR_PESQUISA_H
+#ifndef GESTOR_PESTQUISA_H
+#define GESTOR_PESTQUISA_H
#include <kurl.h>
@@ -41,9 +41,10 @@ using namespace std;
typedef TQMap<TQString, KHTMLPart*> KHTMLPartMap;
-class SearchManager: public QObject
+class SearchManager: public TQObject
{
Q_OBJECT
+ TQ_OBJECT
public:
@@ -54,7 +55,7 @@ public:
};
SearchManager(int max_simultaneous_connections = 3, int time_out = 50,
- TQObject *parent = 0, const char *name = 0);
+ TQObject *tqparent = 0, const char *name = 0);
~SearchManager();
TQString toXML() const;
@@ -94,12 +95,12 @@ public:
SearchMode const& searchMode() const;
bool checkRegularExpressions() const { return check_regular_expressions_; }
bool existUrl(KURL const& url, KURL const& url_parent) const;
- LinkStatus const* linkStatus(TQString const& s_url) const;
+ LinktqStatus const* linktqStatus(TQString const& s_url) const;
int checkedLinks() const;
TQTime timeElapsed() const;
bool checkParentDirs() const;
bool checkExternalLinks() const;
- LinkStatus const* linkStatusRoot() const;
+ LinktqStatus const* linkStatusRoot() const;
int maxSimultaneousConnections() const;
int timeOut() const;
@@ -109,20 +110,20 @@ public:
private:
void checkRoot();
- void checkVectorLinks(vector<LinkStatus*> const& links); // corresponde a um no de um nivel de depth
- vector<LinkStatus*> children(LinkStatus* link);
+ void checkVectorLinks(vector<LinktqStatus*> const& links); // corresponde a um no de um nivel de depth
+ vector<LinktqStatus*> tqchildren(LinktqStatus* link);
void startSearch();
void continueSearch();
void finnish();
void pause();
- vector<LinkStatus*> const& nodeToAnalize() const;
- vector<LinkStatus*> chooseLinks(vector<LinkStatus*> const& links);
- void checkLinksSimultaneously(vector<LinkStatus*> const& links);
+ vector<LinktqStatus*> const& nodeToAnalize() const;
+ vector<LinktqStatus*> chooseLinks(vector<LinktqStatus*> const& links);
+ void checkLinksSimultaneously(vector<LinktqStatus*> const& links);
void addLevel();
- bool checkableByDomain(KURL const& url, LinkStatus const& link_parent) const;
- bool checkable(KURL const& url, LinkStatus const& link_parent) const;
+ bool checkableByDomain(KURL const& url, LinktqStatus const& link_parent) const;
+ bool checkable(KURL const& url, LinktqStatus const& link_parent) const;
int maximumCurrentConnections() const;
- bool onlyCheckHeader(LinkStatus* ls) const;
+ bool onlyCheckHeader(LinktqStatus* ls) const;
/*
Entende-se por domain vago um domain do tipo www.google.pt ou google.pt, pelo que,
@@ -134,15 +135,15 @@ private:
private slots:
- void slotRootChecked(const LinkStatus * link, LinkChecker * checker);
- void slotLinkChecked(const LinkStatus * link, LinkChecker * checker);
+ void slotRootChecked(const LinktqStatus * link, LinkChecker * checker);
+ void slotLinkChecked(const LinktqStatus * link, LinkChecker * checker);
void slotSearchFinished();
void slotLinkCheckerFinnished(LinkChecker * checker);
signals:
- void signalRootChecked(const LinkStatus * link, LinkChecker * checker);
- void signalLinkChecked(const LinkStatus * link, LinkChecker * checker);
+ void signalRootChecked(const LinktqStatus * link, LinkChecker * checker);
+ void signalLinkChecked(const LinktqStatus * link, LinkChecker * checker);
void signalSearchFinished();
void signalSearchPaused();
void signalAddingLevelTotalSteps(uint number_of_links);
@@ -154,7 +155,7 @@ private:
int max_simultaneous_connections_;
SearchMode search_mode_;
- LinkStatus root_;
+ LinktqStatus root_;
bool has_document_root_;
KURL document_root_url_; // in case of non http protocols the document root must be explicitly given
int depth_;
@@ -184,7 +185,7 @@ private:
bool check_regular_expressions_;
uint number_of_level_links_;
uint number_of_links_to_check_;
- vector< vector< vector <LinkStatus*> > > search_results_;
+ vector< vector< vector <LinktqStatus*> > > search_results_;
KHTMLPartMap html_parts_;
};
diff --git a/klinkstatus/src/engine/searchmanager_impl.h b/klinkstatus/src/engine/searchmanager_impl.h
index e472ccbb..0342428a 100644
--- a/klinkstatus/src/engine/searchmanager_impl.h
+++ b/klinkstatus/src/engine/searchmanager_impl.h
@@ -67,7 +67,7 @@ inline void SearchManager::setExternalDomainDepth(int depth)
inline void SearchManager::setDomain(TQString const& domain)
{
- Q_ASSERT(domain.find("http://") == -1);
+ Q_ASSERT(domain.tqfind("http://") == -1);
domain_ = domain;
general_domain_ = generalDomain();
checked_general_domain_ = true;
@@ -111,7 +111,7 @@ inline bool SearchManager::checkExternalLinks() const
return check_external_links_;
}
-inline LinkStatus const* SearchManager::linkStatusRoot() const
+inline LinktqStatus const* SearchManager::linkStatusRoot() const
{
return &root_;
}