summaryrefslogtreecommitdiffstats
path: root/klinkstatus/src/ui/treeview.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-16 19:02:47 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-16 19:02:47 +0000
commite985f7e545f4739493965aad69bbecb136dc9346 (patch)
tree54afd409d8acd6202dd8ab611d24e78c28e4c0a0 /klinkstatus/src/ui/treeview.cpp
parentf7670c198945adc3b95ad69a959fe5f8ae55b493 (diff)
downloadtdewebdev-e985f7e545f4739493965aad69bbecb136dc9346.tar.gz
tdewebdev-e985f7e545f4739493965aad69bbecb136dc9346.zip
TQt4 port kdewebdev
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdewebdev@1237029 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'klinkstatus/src/ui/treeview.cpp')
-rw-r--r--klinkstatus/src/ui/treeview.cpp160
1 files changed, 80 insertions, 80 deletions
diff --git a/klinkstatus/src/ui/treeview.cpp b/klinkstatus/src/ui/treeview.cpp
index 14e0e12a..3adec065 100644
--- a/klinkstatus/src/ui/treeview.cpp
+++ b/klinkstatus/src/ui/treeview.cpp
@@ -39,8 +39,8 @@
#include "../cfg/klsconfig.h"
-TreeView::TreeView(TQWidget *parent, const char *name)
- : KListView(parent, name),
+TreeView::TreeView(TQWidget *tqparent, const char *name)
+ : KListView(tqparent, name),
ResultView(),
current_column_(0)
{
@@ -76,9 +76,9 @@ void TreeView::setColumns(TQStringList const& columns)
setColumnWidthMode(i, TQListView::Manual);
}
- setColumnAlignment(col_status_ - 1, Qt::AlignCenter);
+ setColumnAlignment(col_status_ - 1, TQt::AlignCenter);
if(KLSConfig::showMarkupStatus())
- setColumnAlignment(col_markup_ - 1, Qt::AlignCenter);
+ setColumnAlignment(col_markup_ - 1, TQt::AlignCenter);
}
void TreeView::resetColumns()
@@ -114,36 +114,36 @@ void TreeView::removeColunas()
clear();
}
-void TreeView::show(ResultView::Status const& status)
+void TreeView::show(ResultView::tqStatus const& status)
{
TQListViewItemIterator it(static_cast<KListView*> (this));
while(it.current())
{
TreeViewItem* item = myItem(it.current());
- if(!ResultView::displayableWithStatus(item->linkStatus(), status))
+ if(!ResultView::displayableWithtqStatus(item->linktqStatus(), status))
{
item->setVisible(false);
- //kdDebug(23100) << "Hide: " << item->linkStatus()->absoluteUrl().url() << endl;
+ //kdDebug(23100) << "Hide: " << item->linktqStatus()->absoluteUrl().url() << endl;
}
else
{
item->setVisible(true);
//item->setEnabled(true);
/*
- if(KLSConfig::displayTreeView() && status != ResultView::good && item->parent())
+ if(KLSConfig::displayTreeView() && status != ResultView::good && item->tqparent())
{
- TreeViewItem* parent = myItem(item->parent());
- while(parent)
+ TreeViewItem* tqparent = myItem(item->tqparent());
+ while(tqparent)
{
- kdDebug(23100) << "Show: " << parent->linkStatus()->absoluteUrl().url() << endl;
+ kdDebug(23100) << "Show: " << tqparent->linktqStatus()->absoluteUrl().url() << endl;
- parent->setVisible(true);
- //parent->setEnabled(false);
+ tqparent->setVisible(true);
+ //tqparent->setEnabled(false);
- if(parent->parent())
- parent = myItem(parent->parent());
+ if(tqparent->tqparent())
+ tqparent = myItem(tqparent->tqparent());
else
- parent = 0;
+ tqparent = 0;
}
}
*/
@@ -159,7 +159,7 @@ void TreeView::show(LinkMatcher link_matcher)
while(it.current())
{
TreeViewItem* item = myItem(it.current());
- bool match = link_matcher.matches(*(item->linkStatus()));
+ bool match = link_matcher.matches(*(item->linktqStatus()));
if(tree_display_)
item->setEnabled(match);
@@ -199,7 +199,7 @@ void TreeView::resizeEvent(TQResizeEvent *e)
{
KListView::resizeEvent(e);
resetColumns();
- clipper()->repaint();
+ clipper()->tqrepaint();
}
void TreeView::slotPopupContextMenu(TQListViewItem* item, const TQPoint& pos, int col)
@@ -209,8 +209,8 @@ void TreeView::slotPopupContextMenu(TQListViewItem* item, const TQPoint& pos, in
TreeViewItem* tree_item = myItem(item);
if(tree_item)
{
- TQValueVector<KURL> referrers = tree_item->linkStatus()->referrers();
- loadContextTableMenu(referrers, tree_item->linkStatus()->isRoot());
+ TQValueVector<KURL> referrers = tree_item->linktqStatus()->referrers();
+ loadContextTableMenu(referrers, tree_item->linktqStatus()->isRoot());
context_table_menu_.popup(pos);
}
}
@@ -218,16 +218,16 @@ void TreeView::slotPopupContextMenu(TQListViewItem* item, const TQPoint& pos, in
void TreeView::slotCopyUrlToClipboard() const
{
TreeViewItem* _item = myItem(currentItem());
- TQString content(_item->linkStatus()->absoluteUrl().prettyURL());
- QClipboard* cb = kapp->clipboard();
+ TQString content(_item->linktqStatus()->absoluteUrl().prettyURL());
+ TQClipboard* cb = kapp->tqclipboard();
cb->setText(content);
}
void TreeView::slotCopyParentUrlToClipboard() const
{
TreeViewItem* _item = myItem(currentItem());
- TQString content(_item->linkStatus()->parent()->absoluteUrl().prettyURL());
- QClipboard* cb = kapp->clipboard();
+ TQString content(_item->linktqStatus()->tqparent()->absoluteUrl().prettyURL());
+ TQClipboard* cb = kapp->tqclipboard();
cb->setText(content);
}
@@ -235,14 +235,14 @@ void TreeView::slotCopyCellTextToClipboard() const
{
TreeViewItem* _item = myItem(currentItem());
TQString cell_text(_item->text(current_column_));
- QClipboard* cb = kapp->clipboard();
+ TQClipboard* cb = kapp->tqclipboard();
cb->setText(cell_text);
}
void TreeView::slotEditReferrersWithQuanta()
{
TreeViewItem* _item = myItem(currentItem());
- TQValueVector<KURL> referrers = _item->linkStatus()->referrers();
+ TQValueVector<KURL> referrers = _item->linktqStatus()->referrers();
if(Global::isQuantaAvailableViaDCOP())
{
@@ -275,7 +275,7 @@ void TreeView::slotEditReferrerWithQuanta(int id)
index -= 2; // The list of referrers starts on index = 2
TreeViewItem* _item = myItem(currentItem());
- TQValueVector<KURL> referrers = _item->linkStatus()->referrers();
+ TQValueVector<KURL> referrers = _item->linktqStatus()->referrers();
Q_ASSERT(index >= 0 && (uint)index < referrers.size());
slotEditReferrerWithQuanta(referrers[index]);
@@ -292,8 +292,8 @@ void TreeView::slotEditReferrerWithQuanta(KURL const& url)
if(!success)
{
- TQString message = i18n("<qt>File <b>%1</b> cannot be opened. Might be a DCOP problem.</qt>").arg(filePath);
- KMessageBox::error(parentWidget(), message);
+ TQString message = i18n("<qt>File <b>%1</b> cannot be opened. Might be a DCOP problem.</qt>").tqarg(filePath);
+ KMessageBox::error(tqparentWidget(), message);
}
}
else
@@ -306,7 +306,7 @@ void TreeView::slotEditReferrerWithQuanta(KURL const& url)
void TreeView::slotViewUrlInBrowser()
{
TreeViewItem* _item = myItem(currentItem());
- KURL url = _item->linkStatus()->absoluteUrl();
+ KURL url = _item->linktqStatus()->absoluteUrl();
if(url.isValid())
{
@@ -320,13 +320,13 @@ void TreeView::slotViewParentUrlInBrowser()
{
TreeViewItem* _item = myItem(currentItem());
- if(_item->linkStatus()->isRoot())
+ if(_item->linktqStatus()->isRoot())
{
KMessageBox::sorry(this, i18n("ROOT URL."));
}
else
{
- LinkStatus const* ls_parent = _item->linkStatus()->parent();
+ LinktqStatus const* ls_parent = _item->linktqStatus()->tqparent();
Q_ASSERT(ls_parent);
KURL url = ls_parent->absoluteUrl();
@@ -392,16 +392,16 @@ TreeViewItem* TreeView::myItem(TQListViewItem* item) const
/* ******************************* TreeViewItem ******************************* */
-TreeViewItem::TreeViewItem(TreeView* parent, TQListViewItem* after,
- LinkStatus const* linkstatus)
- : KListViewItem(parent, after),
- last_child_(0), root_(parent)
+TreeViewItem::TreeViewItem(TreeView* tqparent, TQListViewItem* after,
+ LinktqStatus const* linkstatus)
+ : KListViewItem(tqparent, after),
+ last_child_(0), root_(tqparent)
{
init(linkstatus);
}
TreeViewItem::TreeViewItem(TreeView* root, TQListViewItem* listview_item, TQListViewItem* after,
- LinkStatus const* linkstatus)
+ LinktqStatus const* linkstatus)
: KListViewItem(listview_item, after),
last_child_(0), root_(root)
@@ -412,7 +412,7 @@ TreeViewItem::TreeViewItem(TreeView* root, TQListViewItem* listview_item, TQList
TreeViewItem::~TreeViewItem()
{}
-void TreeViewItem::init(LinkStatus const* linkstatus)
+void TreeViewItem::init(LinktqStatus const* linkstatus)
{
setOpen(true);
@@ -450,15 +450,15 @@ TQString TreeViewItem::key(int column, bool) const
switch(column)
{
case 1: // status column
- return linkStatus()->statusText();
+ return linktqStatus()->statusText();
}
return text(column);
}
-LinkStatus const* TreeViewItem::linkStatus() const
+LinktqStatus const* TreeViewItem::linktqStatus() const
{
- return column_items_[0].linkStatus();
+ return column_items_[0].linktqStatus();
}
void TreeViewItem::paintCell(TQPainter * p, const TQColorGroup & cg, int column, int width, int align)
@@ -478,7 +478,7 @@ void TreeViewItem::paintCell(TQPainter * p, const TQColorGroup & cg, int column,
/* ******************************* TreeColumnViewItem ******************************* */
-TreeColumnViewItem::TreeColumnViewItem(TreeView* root, LinkStatus const* linkstatus, int column_index)
+TreeColumnViewItem::TreeColumnViewItem(TreeView* root, LinktqStatus const* linkstatus, int column_index)
: root_(root), ls_(linkstatus), column_index_(column_index)
{
Q_ASSERT(ls_);
@@ -501,7 +501,7 @@ int TreeColumnViewItem::columnIndex() const
return column_index_;
}
-LinkStatus const* TreeColumnViewItem::linkStatus() const
+LinktqStatus const* TreeColumnViewItem::linktqStatus() const
{
Q_ASSERT(ls_);
return ls_;
@@ -511,29 +511,29 @@ TQColor const& TreeColumnViewItem::textStatusColor() const
{
if(columnIndex() == root_->urlColumnIndex() || columnIndex() == root_->statusColumnIndex())
{
- if(linkStatus()->status() == LinkStatus::BROKEN)
- return Qt::red;
- else if(linkStatus()->status() == LinkStatus::HTTP_CLIENT_ERROR)
- return Qt::red;
- else if(linkStatus()->status() == LinkStatus::HTTP_REDIRECTION)
- return Qt::black;
- else if(linkStatus()->status() == LinkStatus::HTTP_SERVER_ERROR)
- return Qt::darkMagenta;
- else if(linkStatus()->status() == LinkStatus::MALFORMED)
- return Qt::red;
- else if(linkStatus()->status() == LinkStatus::NOT_SUPPORTED)
- return Qt::lightGray;
- else if(linkStatus()->status() == LinkStatus::SUCCESSFULL)
- return Qt::black;
- else if(linkStatus()->status() == LinkStatus::TIMEOUT)
- return Qt::darkMagenta;
- else if(linkStatus()->status() == LinkStatus::UNDETERMINED)
- return Qt::blue;
+ if(linktqStatus()->status() == LinktqStatus::BROKEN)
+ return TQt::red;
+ else if(linktqStatus()->status() == LinktqStatus::HTTP_CLIENT_ERROR)
+ return TQt::red;
+ else if(linktqStatus()->status() == LinktqStatus::HTTP_REDIRECTION)
+ return TQt::black;
+ else if(linktqStatus()->status() == LinktqStatus::HTTP_SERVER_ERROR)
+ return TQt::darkMagenta;
+ else if(linktqStatus()->status() == LinktqStatus::MALFORMED)
+ return TQt::red;
+ else if(linktqStatus()->status() == LinktqStatus::NOT_SUPPORTED)
+ return TQt::lightGray;
+ else if(linktqStatus()->status() == LinktqStatus::SUCCESSFULL)
+ return TQt::black;
+ else if(linktqStatus()->status() == LinktqStatus::TIMEOUT)
+ return TQt::darkMagenta;
+ else if(linktqStatus()->status() == LinktqStatus::UNDETERMINED)
+ return TQt::blue;
- return Qt::red;
+ return TQt::red;
}
else
- return Qt::black;
+ return TQt::black;
}
@@ -544,17 +544,17 @@ TQString TreeColumnViewItem::text(int column) const
if(column == root_->urlColumnIndex())
{
- if(linkStatus()->node() && linkStatus()->malformed())
+ if(linktqStatus()->node() && linktqStatus()->malformed())
{
- if(linkStatus()->node()->url().isEmpty())
- return linkStatus()->node()->content().simplifyWhiteSpace();
+ if(linktqStatus()->node()->url().isEmpty())
+ return linktqStatus()->node()->content().simplifyWhiteSpace();
else
- return linkStatus()->node()->url();
+ return linktqStatus()->node()->url();
}
else
{
- KURL url = linkStatus()->absoluteUrl();
- return Url::convertToLocal(linkStatus());
+ KURL url = linktqStatus()->absoluteUrl();
+ return Url::convertToLocal(linktqStatus());
}
}
else if(column == root_->statusColumnIndex())
@@ -563,7 +563,7 @@ TQString TreeColumnViewItem::text(int column) const
}
else if(column == root_->labelColumnIndex())
{
- TQString label(linkStatus()->label());
+ TQString label(linktqStatus()->label());
if(!label.isNull())
return label.simplifyWhiteSpace();
}
@@ -577,28 +577,28 @@ TQPixmap TreeColumnViewItem::pixmap(int column) const
if(column == root_->statusColumnIndex())
{
- if(linkStatus()->status() == LinkStatus::BROKEN)
+ if(linktqStatus()->status() == LinktqStatus::BROKEN)
return SmallIcon("no");
- else if(linkStatus()->status() == LinkStatus::HTTP_CLIENT_ERROR)
+ else if(linktqStatus()->status() == LinktqStatus::HTTP_CLIENT_ERROR)
return SmallIcon("no");
- else if(linkStatus()->status() == LinkStatus::HTTP_REDIRECTION)
+ else if(linktqStatus()->status() == LinktqStatus::HTTP_REDIRECTION)
{
- if(linkStatus()->statusText() == "304")
+ if(linktqStatus()->statusText() == "304")
return UserIcon("304");
else
return SmallIcon("redo");
}
- else if(linkStatus()->status() == LinkStatus::HTTP_SERVER_ERROR)
+ else if(linktqStatus()->status() == LinktqStatus::HTTP_SERVER_ERROR)
return SmallIcon("no");
- else if(linkStatus()->status() == LinkStatus::MALFORMED)
+ else if(linktqStatus()->status() == LinktqStatus::MALFORMED)
return SmallIcon("editdelete");
- else if(linkStatus()->status() == LinkStatus::NOT_SUPPORTED)
+ else if(linktqStatus()->status() == LinktqStatus::NOT_SUPPORTED)
return SmallIcon("help");
- else if(linkStatus()->status() == LinkStatus::SUCCESSFULL)
+ else if(linktqStatus()->status() == LinktqStatus::SUCCESSFULL)
return SmallIcon("ok");
- else if(linkStatus()->status() == LinkStatus::TIMEOUT)
+ else if(linktqStatus()->status() == LinktqStatus::TIMEOUT)
return SmallIcon("history_clear");
- else if(linkStatus()->status() == LinkStatus::UNDETERMINED)
+ else if(linktqStatus()->status() == LinktqStatus::UNDETERMINED)
return SmallIcon("help");
}