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.cpp194
1 files changed, 97 insertions, 97 deletions
diff --git a/klinkstatus/src/ui/tablelinkstatus.cpp b/klinkstatus/src/ui/tablelinkstatus.cpp
index 66cd06be..d640f7bd 100644
--- a/klinkstatus/src/ui/tablelinkstatus.cpp
+++ b/klinkstatus/src/ui/tablelinkstatus.cpp
@@ -46,11 +46,11 @@
*/
-TableLinkstatus::TableLinkstatus(TQWidget * parent, const char * name,
+TableLinkstatus::TableLinkstatus(TQWidget * tqparent, const char * name,
int column_index_status,
int column_index_label,
int column_index_URL)
- : TQTable(parent, name),
+ : TQTable(tqparent, name),
ResultView(column_index_status, column_index_label, column_index_URL)
//context_table_menu_(this, "context_table_menu")
{
@@ -88,7 +88,7 @@ void TableLinkstatus::setColumns(TQStringList const& columns)
{
if(i == 0)
{
- Q_ASSERT(columns[i] == i18n("Status") && col_status_ == 1);
+ Q_ASSERT(columns[i] == i18n("tqStatus") && col_status_ == 1);
setColumnWidth(i, STATUS_COLUMN_WIDTH);
}
else if(i == 1)
@@ -106,17 +106,17 @@ void TableLinkstatus::setColumns(TQStringList const& columns)
horizontal_header->adjustHeaderSize();
}
-void TableLinkstatus::insertResult(LinkStatus const* linkstatus)
+void TableLinkstatus::insertResult(LinktqStatus const* linkstatus)
{
insereLinha(generateRowOfTableItems(linkstatus));
}
-vector<TableItem*> TableLinkstatus::generateRowOfTableItems(LinkStatus const* linkstatus)
+vector<TableItem*> TableLinkstatus::generateRowOfTableItems(LinktqStatus const* linkstatus)
{
vector<TableItem*> items;
int column = 1;
- TableItem* item1 = new TableItemStatus(this, TQTableItem::Never,
+ TableItem* item1 = new TableItemtqStatus(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]->sizeHint().width() > columnWidth(col_url_ - 1))
+ if(items[col_url_ - 1]->tqsizeHint().width() > columnWidth(col_url_ - 1))
{
setColumnStretchable(col_url_ - 1, false);
- setColumnWidth(col_url_ - 1, items[col_url_ - 1]->sizeHint().width());
+ setColumnWidth(col_url_ - 1, items[col_url_ - 1]->tqsizeHint().width());
}
ensureCellVisible(row, 0);
@@ -178,14 +178,14 @@ void TableLinkstatus::removeColunas()
Q_ASSERT(numCols() == 0);
}
-void TableLinkstatus::show(ResultView::Status const& status)
+void TableLinkstatus::show(ResultView::tqStatus const& status)
{
for(int i = 0; i != numRows(); ++i)
{
int row = i;
TableItem* _item = myItem(row, col_status_);
- if(!ResultView::displayableWithStatus(_item->linkStatus(), status))
+ if(!ResultView::displayableWithtqStatus(_item->linktqStatus(), 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->sizeHint());
+ TQSize size_hint(itm->tqsizeHint());
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->linkStatus()->referrers();
- loadContextTableMenu(referrers, table_item->linkStatus()->isRoot());
+ TQValueVector<KURL> referrers = table_item->linktqStatus()->referrers();
+ loadContextTableMenu(referrers, table_item->linktqStatus()->isRoot());
context_table_menu_.popup(pos);
}
}
@@ -313,30 +313,30 @@ void TableLinkstatus::loadContextTableMenu(TQValueVector<KURL> const& referrers,
void TableLinkstatus::slotCopyUrlToClipboard() const
{
TableItem* _item = myItem(currentRow(), currentColumn());
- TQString content(_item->linkStatus()->absoluteUrl().prettyURL());
- QClipboard* cb = kapp->clipboard();
+ TQString content(_item->linktqStatus()->absoluteUrl().prettyURL());
+ TQClipboard* cb = kapp->clipboard();
cb->setText(content);
}
void TableLinkstatus::slotCopyParentUrlToClipboard() const
{
TableItem* _item = myItem(currentRow(), currentColumn());
- TQString content(_item->linkStatus()->parent()->absoluteUrl().prettyURL());
- QClipboard* cb = kapp->clipboard();
+ TQString content(_item->linktqStatus()->tqparent()->absoluteUrl().prettyURL());
+ TQClipboard* cb = kapp->clipboard();
cb->setText(content);
}
void TableLinkstatus::slotCopyCellTextToClipboard() const
{
TQString cell_text(text(currentRow(), currentColumn()));
- QClipboard* cb = kapp->clipboard();
+ TQClipboard* cb = kapp->clipboard();
cb->setText(cell_text);
}
void TableLinkstatus::slotEditReferrersWithQuanta()
{
TableItem* _item = myItem(currentRow(), currentColumn());
- TQValueVector<KURL> referrers = _item->linkStatus()->referrers();
+ TQValueVector<KURL> referrers = _item->linktqStatus()->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->linkStatus()->referrers();
+ TQValueVector<KURL> referrers = _item->linktqStatus()->referrers();
Q_ASSERT(index >= 0 && (uint)index < referrers.size());
slotEditReferrerWithQuanta(referrers[index]);
@@ -386,8 +386,8 @@ 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>").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
@@ -400,7 +400,7 @@ void TableLinkstatus::slotEditReferrerWithQuanta(KURL const& url)
void TableLinkstatus::slotViewUrlInBrowser()
{
TableItem* _item = myItem(currentRow(), currentColumn());
- KURL url = _item->linkStatus()->absoluteUrl();
+ KURL url = _item->linktqStatus()->absoluteUrl();
if(url.isValid())
{
@@ -414,13 +414,13 @@ void TableLinkstatus::slotViewParentUrlInBrowser()
{
TableItem* _item = myItem(currentRow(), currentColumn());
- 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();
@@ -439,11 +439,11 @@ void TableLinkstatus::slotViewParentUrlInBrowser()
*/
TableItem::TableItem(TQTable* table, EditType et,
- LinkStatus const* linkstatus,
- int column_index, int alignment)
+ LinktqStatus const* linkstatus,
+ int column_index, int tqalignment)
: TQTableItem(table, et, ""), ResultViewItem(linkstatus, column_index),
- /*ls_((LinkStatus*)linkstatus),
- column_index_(column_index),*/ alignment_(alignment)
+ /*ls_((LinktqStatus*)linkstatus),
+ column_index_(column_index),*/ tqalignment_(tqalignment)
{
//Q_ASSERT(ls_);
//Q_ASSERT(column_index_ > 0);
@@ -467,17 +467,17 @@ int TableItem::columnIndex() const
return ResultViewItem::columnIndex();
}
-void TableItem::setAlignment(int aFlags)
+void TableItem::tqsetAlignment(int aFlags)
{
- alignment_ = aFlags;
+ tqalignment_ = aFlags;
}
-int TableItem::alignment() const
+int TableItem::tqalignment() const
{
- return alignment_;
+ return tqalignment_;
}
/*
-LinkStatus const* const TableItem::linkStatus() const
+LinktqStatus const* const TableItem::linktqStatus() const
{
Q_ASSERT(ls_);
return ls_;
@@ -485,48 +485,48 @@ LinkStatus const* const TableItem::linkStatus() const
TQColor const& TableItem::textStatusColor() const
{
- if(linkStatus()->errorOccurred())
+ if(linktqStatus()->errorOccurred())
{
- //kdDebug(23100) << "ERROR: " << linkStatus()->error() << ": " << linkStatus()->absoluteUrl().prettyURL() << endl;
- if(linkStatus()->error() == i18n( "Javascript not supported" ))
- return Qt::lightGray;
+ //kdDebug(23100) << "ERROR: " << linktqStatus()->error() << ": " << linktqStatus()->absoluteUrl().prettyURL() << endl;
+ if(linktqStatus()->error() == i18n( "Javascript not supported" ))
+ return TQt::lightGray;
else
- return Qt::red;
+ return TQt::red;
}
- else if(linkStatus()->absoluteUrl().hasRef())
- return Qt::blue;
+ else if(linktqStatus()->absoluteUrl().hasRef())
+ return TQt::blue;
- else if(linkStatus()->absoluteUrl().protocol() != "http" &&
- linkStatus()->absoluteUrl().protocol() != "https")
- return Qt::darkGreen;
+ else if(linktqStatus()->absoluteUrl().protocol() != "http" &&
+ linktqStatus()->absoluteUrl().protocol() != "https")
+ return TQt::darkGreen;
else
{
- TQString status_code(TQString::number(linkStatus()->httpHeader().statusCode()));
+ TQString status_code(TQString::number(linktqStatus()->httpHeader().statusCode()));
if(status_code[0] == '0')
{
kdWarning(23100) << "status code == 0: " << endl;
- kdWarning(23100) << linkStatus()->toString() << endl;
- kdWarning(23100) << linkStatus()->httpHeader().toString() << endl;
+ kdWarning(23100) << linktqStatus()->toString() << endl;
+ kdWarning(23100) << linktqStatus()->httpHeader().toString() << endl;
}
//Q_ASSERT(status_code[0] != '0');
if(status_code[0] == '5')
- return Qt::darkMagenta;
+ return TQt::darkMagenta;
else if(status_code[0] == '4')
- return Qt::red;
+ return TQt::red;
else if(status_code[0] == '3')
- return Qt::blue;
+ return TQt::blue;
else if(status_code[0] == '2')
- return Qt::darkGreen;
+ return TQt::darkGreen;
else
- return Qt::red;
+ return TQt::red;
}
}
*/
@@ -538,7 +538,7 @@ TQColor const& TableItem::textStatusColor() const
*/
TableItemURL::TableItemURL(TQTable* table, EditType et,
- LinkStatus const* linkstatus, int column_index)
+ LinktqStatus 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(linkStatus()->node() && linkStatus()->malformed())
+ if(linktqStatus()->node() && linktqStatus()->malformed())
{
- if(linkStatus()->node()->url().isEmpty())
- TQTableItem::setText( linkStatus()->node()->content().simplifyWhiteSpace() );
+ if(linktqStatus()->node()->url().isEmpty())
+ TQTableItem::setText( linktqStatus()->node()->content().simplifyWhiteSpace() );
else
- TQTableItem::setText( linkStatus()->node()->url() );
+ TQTableItem::setText( linktqStatus()->node()->url() );
}
else
{
- KURL url = linkStatus()->absoluteUrl();
- TQTableItem::setText(::convertToLocal(linkStatus()));
+ KURL url = linktqStatus()->absoluteUrl();
+ TQTableItem::setText(::convertToLocal(linktqStatus()));
}
}
@@ -583,19 +583,19 @@ TQColor const& TableItemURL::textStatusColor() const
{
// TODO clean this code
- TQString status_code(TQString::number(linkStatus()->httpHeader().statusCode()));
+ TQString status_code(TQString::number(linktqStatus()->httpHeader().statusCode()));
- if(linkStatus()->errorOccurred())
+ if(linktqStatus()->errorOccurred())
{
- if(linkStatus()->error().contains(i18n( "Timeout" )))
+ if(linktqStatus()->error().tqcontains(i18n( "Timeout" )))
return darkMagenta;
- else if(linkStatus()->error().contains(i18n( "not supported" )))
+ else if(linktqStatus()->error().tqcontains(i18n( "not supported" )))
return lightGray;
else
return red;
}
- else if(linkStatus()->absoluteUrl().protocol() != "http" &&
- linkStatus()->absoluteUrl().protocol() != "https")
+ else if(linktqStatus()->absoluteUrl().protocol() != "http" &&
+ linktqStatus()->absoluteUrl().protocol() != "https")
return black;
else if(status_code[0] == '5')
@@ -610,53 +610,53 @@ TQColor const& TableItemURL::textStatusColor() const
/*
-********************* TableItemStatus ***************************
+********************* TableItemtqStatus ***************************
*/
-TableItemStatus::TableItemStatus(TQTable* table, EditType et,
- LinkStatus const* linkstatus, int column_index)
+TableItemtqStatus::TableItemtqStatus(TQTable* table, EditType et,
+ LinktqStatus const* linkstatus, int column_index)
: TableItem(table, et, linkstatus, column_index)
{
- setAlignment(Qt::AlignHCenter /*| Qt :: AlignVCenter*/);
+ tqsetAlignment(TQt::AlignHCenter /*| TQt :: AlignVCenter*/);
setText();
setPixmap();
}
-void TableItemStatus::setText()
+void TableItemtqStatus::setText()
{
- if(linkStatus()->errorOccurred() ||
- linkStatus()->status() == "OK" ||
- linkStatus()->status() == "304")
+ if(linktqStatus()->errorOccurred() ||
+ linktqStatus()->status() == "OK" ||
+ linktqStatus()->status() == "304")
{
TQTableItem::setText("");
}
else
{
/*
- if(linkStatus()->httpHeader().statusCode() == 0)
+ if(linktqStatus()->httpHeader().statusCode() == 0)
{
- kdDebug(23100) << "TableItemStatus::setText : statusCode() == 0" << endl;
- kdDebug(23100) << linkStatus()->toString() << endl;
- kdDebug(23100) << linkStatus()->docHtml() << endl;
+ kdDebug(23100) << "TableItemtqStatus::setText : statusCode() == 0" << endl;
+ kdDebug(23100) << linktqStatus()->toString() << endl;
+ kdDebug(23100) << linktqStatus()->docHtml() << endl;
}
*/
- //Q_ASSERT(linkStatus()->httpHeader().statusCode() != 0); //<------------------------------------------------------------
- //TQTableItem::setText( TQString::number(linkStatus()->httpHeader().statusCode()) );
- TQTableItem::setText( linkStatus()->status() );
+ //Q_ASSERT(linktqStatus()->httpHeader().statusCode() != 0); //<------------------------------------------------------------
+ //TQTableItem::setText( TQString::number(linktqStatus()->httpHeader().statusCode()) );
+ TQTableItem::setText( linktqStatus()->status() );
}
}
-void TableItemStatus::setPixmap()
+void TableItemtqStatus::setPixmap()
{
- if(linkStatus()->errorOccurred())
+ if(linktqStatus()->errorOccurred())
{
- if(linkStatus()->error().contains(i18n( "Timeout" )))
+ if(linktqStatus()->error().tqcontains(i18n( "Timeout" )))
{
TQTableItem::setPixmap(SmallIcon("kalarm"));
}
- else if(linkStatus()->error() == i18n( "Malformed" ))
+ else if(linktqStatus()->error() == i18n( "Malformed" ))
{
TQTableItem::setPixmap(SmallIcon("bug"));
}
@@ -665,27 +665,27 @@ void TableItemStatus::setPixmap()
TQTableItem::setPixmap(SmallIcon("no"));
}
}
- else if(linkStatus()->status() == "304")
+ else if(linktqStatus()->status() == "304")
TQTableItem::setPixmap(UserIcon("304"));
- else if(linkStatus()->status() == "OK")
+ else if(linktqStatus()->status() == "OK")
TQTableItem::setPixmap(SmallIcon("ok"));
}
-TQString TableItemStatus::toolTip() const
+TQString TableItemtqStatus::toolTip() const
{
- if(linkStatus()->errorOccurred() ||
- linkStatus()->absoluteUrl().hasRef() ||
- (linkStatus()->absoluteUrl().protocol() != "http" &&
- linkStatus()->absoluteUrl().protocol() != "https"))
+ if(linktqStatus()->errorOccurred() ||
+ linktqStatus()->absoluteUrl().hasRef() ||
+ (linktqStatus()->absoluteUrl().protocol() != "http" &&
+ linktqStatus()->absoluteUrl().protocol() != "https"))
{
- return i18n("%1").arg(linkStatus()->status());
+ return i18n("%1").tqarg(linktqStatus()->status());
}
else
- return i18n("%1").arg(linkStatus()->httpHeader().reasonPhrase());
+ return i18n("%1").tqarg(linktqStatus()->httpHeader().reasonPhrase());
}
-void TableItemStatus::paint( TQPainter *p, const TQColorGroup &cg,
+void TableItemtqStatus::paint( TQPainter *p, const TQColorGroup &cg,
const TQRect &cr, bool selected )
{
p->fillRect( 0, 0, cr.width(), cr.height(),
@@ -716,7 +716,7 @@ void TableItemStatus::paint( TQPainter *p, const TQColorGroup &cg,
else
p->setPen( m_cg.text() );
p->drawText( x + 2, 0, w - x - 4, h,
- wordWrap() ? (alignment() | WordBreak) : alignment(), text() );
+ wordWrap() ? (tqalignment() | WordBreak) : tqalignment(), text() );
}
/*
@@ -726,7 +726,7 @@ void TableItemStatus::paint( TQPainter *p, const TQColorGroup &cg,
*/
TableItemNome::TableItemNome(TQTable* table, EditType et,
- LinkStatus const* linkstatus, int column_index)
+ LinktqStatus 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(linkStatus()->label());
+ TQString label(linktqStatus()->label());
if(!label.isNull())
TQTableItem::setText(label.simplifyWhiteSpace());
}