summaryrefslogtreecommitdiffstats
path: root/klinkstatus/src/ui/tablelinkstatus.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'klinkstatus/src/ui/tablelinkstatus.cpp')
-rw-r--r--klinkstatus/src/ui/tablelinkstatus.cpp158
1 files changed, 79 insertions, 79 deletions
diff --git a/klinkstatus/src/ui/tablelinkstatus.cpp b/klinkstatus/src/ui/tablelinkstatus.cpp
index 6aef2c97..dd72dd9f 100644
--- a/klinkstatus/src/ui/tablelinkstatus.cpp
+++ b/klinkstatus/src/ui/tablelinkstatus.cpp
@@ -26,7 +26,7 @@
#include <tqmemarray.h>
#include <tqtooltip.h>
#include <tqpixmap.h>
-#include <tqclipboard.h>
+#include <clipboard.h>
#include <tqpainter.h>
#include <tqprocess.h>
@@ -106,17 +106,17 @@ void TableLinkstatus::setColumns(TQStringList const& columns)
horizontal_header->adjustHeaderSize();
}
-void TableLinkstatus::insertResult(LinktqStatus const* linkstatus)
+void TableLinkstatus::insertResult(LinkStatus const* linkstatus)
{
insereLinha(generateRowOfTableItems(linkstatus));
}
-vector<TableItem*> TableLinkstatus::generateRowOfTableItems(LinktqStatus const* linkstatus)
+vector<TableItem*> TableLinkstatus::generateRowOfTableItems(LinkStatus const* linkstatus)
{
vector<TableItem*> items;
int column = 1;
- TableItem* item1 = new TableItemtqStatus(this, TQTableItem::Never,
+ TableItem* item1 = new TableItemStatus(this, TQTableItem::Never,
linkstatus, column++);
TableItem* item2 = new TableItemNome(this, TQTableItem::Never,
linkstatus, column++);
@@ -147,10 +147,10 @@ void TableLinkstatus::insereLinha(vector<TableItem*> items)
setItem(row, col, items[i]);
}
- if(items[col_url_ - 1]->tqsizeHint().width() > columnWidth(col_url_ - 1))
+ if(items[col_url_ - 1]->sizeHint().width() > columnWidth(col_url_ - 1))
{
setColumnStretchable(col_url_ - 1, false);
- setColumnWidth(col_url_ - 1, items[col_url_ - 1]->tqsizeHint().width());
+ setColumnWidth(col_url_ - 1, items[col_url_ - 1]->sizeHint().width());
}
ensureCellVisible(row, 0);
@@ -178,14 +178,14 @@ void TableLinkstatus::removeColunas()
Q_ASSERT(numCols() == 0);
}
-void TableLinkstatus::show(ResultView::tqStatus const& status)
+void TableLinkstatus::show(ResultView::Status const& status)
{
for(int i = 0; i != numRows(); ++i)
{
int row = i;
TableItem* _item = myItem(row, col_status_);
- if(!ResultView::displayableWithtqStatus(_item->linktqStatus(), status))
+ if(!ResultView::displayableWithStatus(_item->linkStatus(), status))
hideRow(row);
else
showRow(row);
@@ -230,7 +230,7 @@ bool TableLinkstatus::textFitsInCell(int row, int col) const
TQTableItem* itm(myItem(row, col));
Q_ASSERT(itm);
- TQSize size_hint(itm->tqsizeHint());
+ TQSize size_hint(itm->sizeHint());
int visible_width = 0;
if(col == numCols() - 1)
@@ -261,8 +261,8 @@ void TableLinkstatus::slotPopupContextMenu(int r, int w, const TQPoint& pos)
TableItem* table_item = myItem(r, w);
if(table_item)
{
- TQValueVector<KURL> referrers = table_item->linktqStatus()->referrers();
- loadContextTableMenu(referrers, table_item->linktqStatus()->isRoot());
+ TQValueVector<KURL> referrers = table_item->linkStatus()->referrers();
+ loadContextTableMenu(referrers, table_item->linkStatus()->isRoot());
context_table_menu_.popup(pos);
}
}
@@ -313,7 +313,7 @@ void TableLinkstatus::loadContextTableMenu(TQValueVector<KURL> const& referrers,
void TableLinkstatus::slotCopyUrlToClipboard() const
{
TableItem* _item = myItem(currentRow(), currentColumn());
- TQString content(_item->linktqStatus()->absoluteUrl().prettyURL());
+ TQString content(_item->linkStatus()->absoluteUrl().prettyURL());
TQClipboard* cb = kapp->clipboard();
cb->setText(content);
}
@@ -321,7 +321,7 @@ void TableLinkstatus::slotCopyUrlToClipboard() const
void TableLinkstatus::slotCopyParentUrlToClipboard() const
{
TableItem* _item = myItem(currentRow(), currentColumn());
- TQString content(_item->linktqStatus()->parent()->absoluteUrl().prettyURL());
+ TQString content(_item->linkStatus()->parent()->absoluteUrl().prettyURL());
TQClipboard* cb = kapp->clipboard();
cb->setText(content);
}
@@ -336,7 +336,7 @@ void TableLinkstatus::slotCopyCellTextToClipboard() const
void TableLinkstatus::slotEditReferrersWithQuanta()
{
TableItem* _item = myItem(currentRow(), currentColumn());
- TQValueVector<KURL> referrers = _item->linktqStatus()->referrers();
+ TQValueVector<KURL> referrers = _item->linkStatus()->referrers();
if(Global::isQuantaAvailableViaDCOP())
{
@@ -369,7 +369,7 @@ void TableLinkstatus::slotEditReferrerWithQuanta(int id)
index -= 2; // The list of referrers starts on index = 2
TableItem* _item = myItem(currentRow(), currentColumn());
- TQValueVector<KURL> referrers = _item->linktqStatus()->referrers();
+ TQValueVector<KURL> referrers = _item->linkStatus()->referrers();
Q_ASSERT(index >= 0 && (uint)index < referrers.size());
slotEditReferrerWithQuanta(referrers[index]);
@@ -386,7 +386,7 @@ void TableLinkstatus::slotEditReferrerWithQuanta(KURL const& url)
if(!success)
{
- TQString message = i18n("<qt>File <b>%1</b> cannot be opened. Might be a DCOP problem.</qt>").tqarg(filePath);
+ TQString message = i18n("<qt>File <b>%1</b> cannot be opened. Might be a DCOP problem.</qt>").arg(filePath);
KMessageBox::error(parentWidget(), message);
}
}
@@ -400,7 +400,7 @@ void TableLinkstatus::slotEditReferrerWithQuanta(KURL const& url)
void TableLinkstatus::slotViewUrlInBrowser()
{
TableItem* _item = myItem(currentRow(), currentColumn());
- KURL url = _item->linktqStatus()->absoluteUrl();
+ KURL url = _item->linkStatus()->absoluteUrl();
if(url.isValid())
{
@@ -414,13 +414,13 @@ void TableLinkstatus::slotViewParentUrlInBrowser()
{
TableItem* _item = myItem(currentRow(), currentColumn());
- if(_item->linktqStatus()->isRoot())
+ if(_item->linkStatus()->isRoot())
{
KMessageBox::sorry(this, i18n("ROOT URL."));
}
else
{
- LinktqStatus const* ls_parent = _item->linktqStatus()->parent();
+ LinkStatus const* ls_parent = _item->linkStatus()->parent();
Q_ASSERT(ls_parent);
KURL url = ls_parent->absoluteUrl();
@@ -439,11 +439,11 @@ void TableLinkstatus::slotViewParentUrlInBrowser()
*/
TableItem::TableItem(TQTable* table, EditType et,
- LinktqStatus const* linkstatus,
- int column_index, int tqalignment)
+ LinkStatus const* linkstatus,
+ int column_index, int alignment)
: TQTableItem(table, et, ""), ResultViewItem(linkstatus, column_index),
- /*ls_((LinktqStatus*)linkstatus),
- column_index_(column_index),*/ alignment_(tqalignment)
+ /*ls_((LinkStatus*)linkstatus),
+ column_index_(column_index),*/ alignment_(alignment)
{
//Q_ASSERT(ls_);
//Q_ASSERT(column_index_ > 0);
@@ -467,17 +467,17 @@ int TableItem::columnIndex() const
return ResultViewItem::columnIndex();
}
-void TableItem::tqsetAlignment(int aFlags)
+void TableItem::setAlignment(int aFlags)
{
alignment_ = aFlags;
}
-int TableItem::tqalignment() const
+int TableItem::alignment() const
{
return alignment_;
}
/*
-LinktqStatus const* const TableItem::linktqStatus() const
+LinkStatus const* const TableItem::linkStatus() const
{
Q_ASSERT(ls_);
return ls_;
@@ -485,31 +485,31 @@ LinktqStatus const* const TableItem::linktqStatus() const
TQColor const& TableItem::textStatusColor() const
{
- if(linktqStatus()->errorOccurred())
+ if(linkStatus()->errorOccurred())
{
- //kdDebug(23100) << "ERROR: " << linkStatus()->error() << ": " << linktqStatus()->absoluteUrl().prettyURL() << endl;
- if(linktqStatus()->error() == i18n( "Javascript not supported" ))
+ //kdDebug(23100) << "ERROR: " << linkStatus()->error() << ": " << linkStatus()->absoluteUrl().prettyURL() << endl;
+ if(linkStatus()->error() == i18n( "Javascript not supported" ))
return TQt::lightGray;
else
return TQt::red;
}
- else if(linktqStatus()->absoluteUrl().hasRef())
+ else if(linkStatus()->absoluteUrl().hasRef())
return TQt::blue;
- else if(linktqStatus()->absoluteUrl().protocol() != "http" &&
- linktqStatus()->absoluteUrl().protocol() != "https")
+ else if(linkStatus()->absoluteUrl().protocol() != "http" &&
+ linkStatus()->absoluteUrl().protocol() != "https")
return TQt::darkGreen;
else
{
- TQString status_code(TQString::number(linktqStatus()->httpHeader().statusCode()));
+ TQString status_code(TQString::number(linkStatus()->httpHeader().statusCode()));
if(status_code[0] == '0')
{
kdWarning(23100) << "status code == 0: " << endl;
- kdWarning(23100) << linktqStatus()->toString() << endl;
- kdWarning(23100) << linktqStatus()->httpHeader().toString() << endl;
+ kdWarning(23100) << linkStatus()->toString() << endl;
+ kdWarning(23100) << linkStatus()->httpHeader().toString() << endl;
}
//Q_ASSERT(status_code[0] != '0');
@@ -538,7 +538,7 @@ TQColor const& TableItem::textStatusColor() const
*/
TableItemURL::TableItemURL(TQTable* table, EditType et,
- LinktqStatus const* linkstatus, int column_index)
+ LinkStatus const* linkstatus, int column_index)
: TableItem(table, et, linkstatus, column_index)
{
setText();
@@ -546,17 +546,17 @@ TableItemURL::TableItemURL(TQTable* table, EditType et,
void TableItemURL::setText()
{
- if(linktqStatus()->node() && linktqStatus()->malformed())
+ if(linkStatus()->node() && linkStatus()->malformed())
{
- if(linktqStatus()->node()->url().isEmpty())
- TQTableItem::setText( linktqStatus()->node()->content().simplifyWhiteSpace() );
+ if(linkStatus()->node()->url().isEmpty())
+ TQTableItem::setText( linkStatus()->node()->content().simplifyWhiteSpace() );
else
- TQTableItem::setText( linktqStatus()->node()->url() );
+ TQTableItem::setText( linkStatus()->node()->url() );
}
else
{
- KURL url = linktqStatus()->absoluteUrl();
- TQTableItem::setText(::convertToLocal(linktqStatus()));
+ KURL url = linkStatus()->absoluteUrl();
+ TQTableItem::setText(::convertToLocal(linkStatus()));
}
}
@@ -583,19 +583,19 @@ TQColor const& TableItemURL::textStatusColor() const
{
// TODO clean this code
- TQString status_code(TQString::number(linktqStatus()->httpHeader().statusCode()));
+ TQString status_code(TQString::number(linkStatus()->httpHeader().statusCode()));
- if(linktqStatus()->errorOccurred())
+ if(linkStatus()->errorOccurred())
{
- if(linktqStatus()->error().contains(i18n( "Timeout" )))
+ if(linkStatus()->error().contains(i18n( "Timeout" )))
return darkMagenta;
- else if(linktqStatus()->error().contains(i18n( "not supported" )))
+ else if(linkStatus()->error().contains(i18n( "not supported" )))
return lightGray;
else
return red;
}
- else if(linktqStatus()->absoluteUrl().protocol() != "http" &&
- linktqStatus()->absoluteUrl().protocol() != "https")
+ else if(linkStatus()->absoluteUrl().protocol() != "http" &&
+ linkStatus()->absoluteUrl().protocol() != "https")
return black;
else if(status_code[0] == '5')
@@ -610,53 +610,53 @@ TQColor const& TableItemURL::textStatusColor() const
/*
-********************* TableItemtqStatus ***************************
+********************* TableItemStatus ***************************
*/
-TableItemtqStatus::TableItemtqStatus(TQTable* table, EditType et,
- LinktqStatus const* linkstatus, int column_index)
+TableItemStatus::TableItemStatus(TQTable* table, EditType et,
+ LinkStatus const* linkstatus, int column_index)
: TableItem(table, et, linkstatus, column_index)
{
- tqsetAlignment(TQt::AlignHCenter /*| TQt :: AlignVCenter*/);
+ setAlignment(TQt::AlignHCenter /*| TQt :: AlignVCenter*/);
setText();
setPixmap();
}
-void TableItemtqStatus::setText()
+void TableItemStatus::setText()
{
- if(linktqStatus()->errorOccurred() ||
- linktqStatus()->status() == "OK" ||
- linktqStatus()->status() == "304")
+ if(linkStatus()->errorOccurred() ||
+ linkStatus()->status() == "OK" ||
+ linkStatus()->status() == "304")
{
TQTableItem::setText("");
}
else
{
/*
- if(linktqStatus()->httpHeader().statusCode() == 0)
+ if(linkStatus()->httpHeader().statusCode() == 0)
{
kdDebug(23100) << "TableItemStatus::setText : statusCode() == 0" << endl;
- kdDebug(23100) << linktqStatus()->toString() << endl;
- kdDebug(23100) << linktqStatus()->docHtml() << endl;
+ kdDebug(23100) << linkStatus()->toString() << endl;
+ kdDebug(23100) << linkStatus()->docHtml() << endl;
}
*/
- //Q_ASSERT(linktqStatus()->httpHeader().statusCode() != 0); //<------------------------------------------------------------
- //TQTableItem::setText( TQString::number(linktqStatus()->httpHeader().statusCode()) );
- TQTableItem::setText( linktqStatus()->status() );
+ //Q_ASSERT(linkStatus()->httpHeader().statusCode() != 0); //<------------------------------------------------------------
+ //TQTableItem::setText( TQString::number(linkStatus()->httpHeader().statusCode()) );
+ TQTableItem::setText( linkStatus()->status() );
}
}
-void TableItemtqStatus::setPixmap()
+void TableItemStatus::setPixmap()
{
- if(linktqStatus()->errorOccurred())
+ if(linkStatus()->errorOccurred())
{
- if(linktqStatus()->error().contains(i18n( "Timeout" )))
+ if(linkStatus()->error().contains(i18n( "Timeout" )))
{
TQTableItem::setPixmap(SmallIcon("kalarm"));
}
- else if(linktqStatus()->error() == i18n( "Malformed" ))
+ else if(linkStatus()->error() == i18n( "Malformed" ))
{
TQTableItem::setPixmap(SmallIcon("bug"));
}
@@ -665,27 +665,27 @@ void TableItemtqStatus::setPixmap()
TQTableItem::setPixmap(SmallIcon("no"));
}
}
- else if(linktqStatus()->status() == "304")
+ else if(linkStatus()->status() == "304")
TQTableItem::setPixmap(UserIcon("304"));
- else if(linktqStatus()->status() == "OK")
+ else if(linkStatus()->status() == "OK")
TQTableItem::setPixmap(SmallIcon("ok"));
}
-TQString TableItemtqStatus::toolTip() const
+TQString TableItemStatus::toolTip() const
{
- if(linktqStatus()->errorOccurred() ||
- linktqStatus()->absoluteUrl().hasRef() ||
- (linktqStatus()->absoluteUrl().protocol() != "http" &&
- linktqStatus()->absoluteUrl().protocol() != "https"))
+ if(linkStatus()->errorOccurred() ||
+ linkStatus()->absoluteUrl().hasRef() ||
+ (linkStatus()->absoluteUrl().protocol() != "http" &&
+ linkStatus()->absoluteUrl().protocol() != "https"))
{
- return i18n("%1").tqarg(linktqStatus()->status());
+ return i18n("%1").arg(linkStatus()->status());
}
else
- return i18n("%1").tqarg(linktqStatus()->httpHeader().reasonPhrase());
+ return i18n("%1").arg(linkStatus()->httpHeader().reasonPhrase());
}
-void TableItemtqStatus::paint( TQPainter *p, const TQColorGroup &cg,
+void TableItemStatus::paint( TQPainter *p, const TQColorGroup &cg,
const TQRect &cr, bool selected )
{
p->fillRect( 0, 0, cr.width(), cr.height(),
@@ -716,7 +716,7 @@ void TableItemtqStatus::paint( TQPainter *p, const TQColorGroup &cg,
else
p->setPen( m_cg.text() );
p->drawText( x + 2, 0, w - x - 4, h,
- wordWrap() ? (tqalignment() | WordBreak) : tqalignment(), text() );
+ wordWrap() ? (alignment() | WordBreak) : alignment(), text() );
}
/*
@@ -726,7 +726,7 @@ void TableItemtqStatus::paint( TQPainter *p, const TQColorGroup &cg,
*/
TableItemNome::TableItemNome(TQTable* table, EditType et,
- LinktqStatus const* linkstatus, int column_index)
+ LinkStatus const* linkstatus, int column_index)
: TableItem(table, et, linkstatus, column_index)
{
setText();
@@ -734,7 +734,7 @@ TableItemNome::TableItemNome(TQTable* table, EditType et,
void TableItemNome::setText()
{
- TQString label(linktqStatus()->label());
+ TQString label(linkStatus()->label());
if(!label.isNull())
TQTableItem::setText(label.simplifyWhiteSpace());
}