diff options
Diffstat (limited to 'klinkstatus/src/ui/treeview.cpp')
-rw-r--r-- | klinkstatus/src/ui/treeview.cpp | 110 |
1 files changed, 55 insertions, 55 deletions
diff --git a/klinkstatus/src/ui/treeview.cpp b/klinkstatus/src/ui/treeview.cpp index 7ad92d8e..14e0e12a 100644 --- a/klinkstatus/src/ui/treeview.cpp +++ b/klinkstatus/src/ui/treeview.cpp @@ -28,9 +28,9 @@ #include <dcopclient.h> #include <kcharsets.h> -#include <qvaluevector.h> -#include <qheader.h> -#include <qclipboard.h> +#include <tqvaluevector.h> +#include <tqheader.h> +#include <tqclipboard.h> #include "treeview.h" #include "../global.h" @@ -39,7 +39,7 @@ #include "../cfg/klsconfig.h" -TreeView::TreeView(QWidget *parent, const char *name) +TreeView::TreeView(TQWidget *parent, const char *name) : KListView(parent, name), ResultView(), current_column_(0) @@ -50,12 +50,12 @@ TreeView::TreeView(QWidget *parent, const char *name) setShowSortIndicator(true); //setFocusPolicy( WheelFocus ); setRootIsDecorated(KLSConfig::displayTreeView()); -// setResizeMode(QListView::LastColumn); +// setResizeMode(TQListView::LastColumn); - sub_menu_ = new QPopupMenu(this, "sub_menu_referrers"); + sub_menu_ = new TQPopupMenu(this, "sub_menu_referrers"); - connect(this, SIGNAL( rightButtonClicked ( QListViewItem *, const QPoint &, int )), - this, SLOT( slotPopupContextMenu( QListViewItem *, const QPoint &, int )) ); + connect(this, TQT_SIGNAL( rightButtonClicked ( TQListViewItem *, const TQPoint &, int )), + this, TQT_SLOT( slotPopupContextMenu( TQListViewItem *, const TQPoint &, int )) ); } @@ -64,7 +64,7 @@ TreeView::~TreeView() saveLayout(KLSConfig::self()->config(), "klinkstatus"); } -void TreeView::setColumns(QStringList const& columns) +void TreeView::setColumns(TQStringList const& columns) { ResultView::setColumns(columns); removeColunas(); @@ -73,7 +73,7 @@ void TreeView::setColumns(QStringList const& columns) for(uint i = 0; i != columns.size(); ++i) { addColumn(i18n(columns[i])); - setColumnWidthMode(i, QListView::Manual); + setColumnWidthMode(i, TQListView::Manual); } setColumnAlignment(col_status_ - 1, Qt::AlignCenter); @@ -85,10 +85,10 @@ void TreeView::resetColumns() { setColumnWidth(col_url_ - 1, (int)(0.45 * width())); - setResizeMode(QListView::LastColumn); // fit to the window + setResizeMode(TQListView::LastColumn); // fit to the window // resize again - setColumnWidthMode(col_label_ - 1, QListView::Manual); - setResizeMode(QListView::NoColumn); + setColumnWidthMode(col_label_ - 1, TQListView::Manual); + setResizeMode(TQListView::NoColumn); } double TreeView::columnsWidth() const @@ -116,7 +116,7 @@ void TreeView::removeColunas() void TreeView::show(ResultView::Status const& status) { - QListViewItemIterator it(static_cast<KListView*> (this)); + TQListViewItemIterator it(static_cast<KListView*> (this)); while(it.current()) { TreeViewItem* item = myItem(it.current()); @@ -155,7 +155,7 @@ void TreeView::show(ResultView::Status const& status) void TreeView::show(LinkMatcher link_matcher) { - QListViewItemIterator it(this); + TQListViewItemIterator it(this); while(it.current()) { TreeViewItem* item = myItem(it.current()); @@ -172,7 +172,7 @@ void TreeView::show(LinkMatcher link_matcher) void TreeView::showAll() { - QListViewItemIterator it(this); + TQListViewItemIterator it(this); while(it.current()) { it.current()->setVisible(true); @@ -181,9 +181,9 @@ void TreeView::showAll() } } -void TreeView::ensureRowVisible(const QListViewItem * i, bool tree_display) +void TreeView::ensureRowVisible(const TQListViewItem * i, bool tree_display) { - QScrollBar* vertical_scroll_bar = verticalScrollBar(); + TQScrollBar* vertical_scroll_bar = verticalScrollBar(); if(tree_display || vertical_scroll_bar->value() > (vertical_scroll_bar->maxValue() - vertical_scroll_bar->lineStep())) @@ -195,21 +195,21 @@ bool TreeView::isEmpty() const return !childCount(); } -void TreeView::resizeEvent(QResizeEvent *e) +void TreeView::resizeEvent(TQResizeEvent *e) { KListView::resizeEvent(e); resetColumns(); clipper()->repaint(); } -void TreeView::slotPopupContextMenu(QListViewItem* item, const QPoint& pos, int col) +void TreeView::slotPopupContextMenu(TQListViewItem* item, const TQPoint& pos, int col) { current_column_ = col; TreeViewItem* tree_item = myItem(item); if(tree_item) { - QValueVector<KURL> referrers = tree_item->linkStatus()->referrers(); + TQValueVector<KURL> referrers = tree_item->linkStatus()->referrers(); loadContextTableMenu(referrers, tree_item->linkStatus()->isRoot()); context_table_menu_.popup(pos); } @@ -218,7 +218,7 @@ void TreeView::slotPopupContextMenu(QListViewItem* item, const QPoint& pos, int void TreeView::slotCopyUrlToClipboard() const { TreeViewItem* _item = myItem(currentItem()); - QString content(_item->linkStatus()->absoluteUrl().prettyURL()); + TQString content(_item->linkStatus()->absoluteUrl().prettyURL()); QClipboard* cb = kapp->clipboard(); cb->setText(content); } @@ -226,7 +226,7 @@ void TreeView::slotCopyUrlToClipboard() const void TreeView::slotCopyParentUrlToClipboard() const { TreeViewItem* _item = myItem(currentItem()); - QString content(_item->linkStatus()->parent()->absoluteUrl().prettyURL()); + TQString content(_item->linkStatus()->parent()->absoluteUrl().prettyURL()); QClipboard* cb = kapp->clipboard(); cb->setText(content); } @@ -234,7 +234,7 @@ void TreeView::slotCopyParentUrlToClipboard() const void TreeView::slotCopyCellTextToClipboard() const { TreeViewItem* _item = myItem(currentItem()); - QString cell_text(_item->text(current_column_)); + TQString cell_text(_item->text(current_column_)); QClipboard* cb = kapp->clipboard(); cb->setText(cell_text); } @@ -242,7 +242,7 @@ void TreeView::slotCopyCellTextToClipboard() const void TreeView::slotEditReferrersWithQuanta() { TreeViewItem* _item = myItem(currentItem()); - QValueVector<KURL> referrers = _item->linkStatus()->referrers(); + TQValueVector<KURL> referrers = _item->linkStatus()->referrers(); if(Global::isQuantaAvailableViaDCOP()) { @@ -251,7 +251,7 @@ void TreeView::slotEditReferrersWithQuanta() } else { - QStringList list_urls; + TQStringList list_urls; for(uint i = 0; i != referrers.size(); ++i) list_urls.append(referrers[i].url()); @@ -275,7 +275,7 @@ void TreeView::slotEditReferrerWithQuanta(int id) index -= 2; // The list of referrers starts on index = 2 TreeViewItem* _item = myItem(currentItem()); - QValueVector<KURL> referrers = _item->linkStatus()->referrers(); + TQValueVector<KURL> referrers = _item->linkStatus()->referrers(); Q_ASSERT(index >= 0 && (uint)index < referrers.size()); slotEditReferrerWithQuanta(referrers[index]); @@ -283,7 +283,7 @@ void TreeView::slotEditReferrerWithQuanta(int id) void TreeView::slotEditReferrerWithQuanta(KURL const& url) { - QString filePath = url.url(); + TQString filePath = url.url(); if(Global::isQuantaAvailableViaDCOP()) { @@ -292,13 +292,13 @@ void TreeView::slotEditReferrerWithQuanta(KURL const& url) if(!success) { - QString message = i18n("<qt>File <b>%1</b> cannot be opened. Might be a DCOP problem.</qt>").arg(filePath); + TQString message = i18n("<qt>File <b>%1</b> cannot be opened. Might be a DCOP problem.</qt>").arg(filePath); KMessageBox::error(parentWidget(), message); } } else { - QStringList args(url.url()); + TQStringList args(url.url()); Global::openQuanta(args); } } @@ -338,21 +338,21 @@ void TreeView::slotViewParentUrlInBrowser() } } -void TreeView::loadContextTableMenu(QValueVector<KURL> const& referrers, bool is_root) +void TreeView::loadContextTableMenu(TQValueVector<KURL> const& referrers, bool is_root) { context_table_menu_.clear(); sub_menu_->clear(); if(!is_root) { - sub_menu_->insertItem(i18n("All"), this, SLOT(slotEditReferrersWithQuanta())); + sub_menu_->insertItem(i18n("All"), this, TQT_SLOT(slotEditReferrersWithQuanta())); sub_menu_->insertSeparator(); for(uint i = 0; i != referrers.size(); ++i) { sub_menu_->insertItem(referrers[i].prettyURL()); } - connect(sub_menu_, SIGNAL(activated(int)), this, SLOT(slotEditReferrerWithQuanta(int))); + connect(sub_menu_, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotEditReferrerWithQuanta(int))); context_table_menu_.insertItem(SmallIconSet("edit"), i18n("Edit Referrer with Quanta"), sub_menu_); @@ -365,24 +365,24 @@ void TreeView::loadContextTableMenu(QValueVector<KURL> const& referrers, bool is } context_table_menu_.insertItem(SmallIconSet("fileopen"), i18n("Open URL"), - this, SLOT(slotViewUrlInBrowser())); + this, TQT_SLOT(slotViewUrlInBrowser())); context_table_menu_.insertItem(/*SmallIconSet("fileopen"), */i18n("Open Referrer URL"), - this, SLOT(slotViewParentUrlInBrowser())); + this, TQT_SLOT(slotViewParentUrlInBrowser())); context_table_menu_.insertSeparator(); context_table_menu_.insertItem(SmallIconSet("editcopy"), i18n("Copy URL"), - this, SLOT(slotCopyUrlToClipboard())); + this, TQT_SLOT(slotCopyUrlToClipboard())); context_table_menu_.insertItem(/*SmallIconSet("editcopy"), */i18n("Copy Referrer URL"), - this, SLOT(slotCopyParentUrlToClipboard())); + this, TQT_SLOT(slotCopyParentUrlToClipboard())); context_table_menu_.insertItem(/*SmallIconSet("editcopy"), */i18n("Copy Cell Text"), - this, SLOT(slotCopyCellTextToClipboard())); + this, TQT_SLOT(slotCopyCellTextToClipboard())); } -TreeViewItem* TreeView::myItem(QListViewItem* item) const +TreeViewItem* TreeView::myItem(TQListViewItem* item) const { TreeViewItem* _item = dynamic_cast<TreeViewItem*> (item); Q_ASSERT(_item); @@ -392,7 +392,7 @@ TreeViewItem* TreeView::myItem(QListViewItem* item) const /* ******************************* TreeViewItem ******************************* */ -TreeViewItem::TreeViewItem(TreeView* parent, QListViewItem* after, +TreeViewItem::TreeViewItem(TreeView* parent, TQListViewItem* after, LinkStatus const* linkstatus) : KListViewItem(parent, after), last_child_(0), root_(parent) @@ -400,7 +400,7 @@ TreeViewItem::TreeViewItem(TreeView* parent, QListViewItem* after, init(linkstatus); } -TreeViewItem::TreeViewItem(TreeView* root, QListViewItem* listview_item, QListViewItem* after, +TreeViewItem::TreeViewItem(TreeView* root, TQListViewItem* listview_item, TQListViewItem* after, LinkStatus const* linkstatus) : KListViewItem(listview_item, after), last_child_(0), root_(root) @@ -433,18 +433,18 @@ void TreeViewItem::init(LinkStatus const* linkstatus) } } -void TreeViewItem::setLastChild(QListViewItem* last_child) +void TreeViewItem::setLastChild(TQListViewItem* last_child) { Q_ASSERT(last_child); last_child_ = last_child; } -QListViewItem* TreeViewItem::lastChild() const +TQListViewItem* TreeViewItem::lastChild() const { return last_child_; } -QString TreeViewItem::key(int column, bool) const +TQString TreeViewItem::key(int column, bool) const { // FIXME magic numbers switch(column) @@ -461,14 +461,14 @@ LinkStatus const* TreeViewItem::linkStatus() const return column_items_[0].linkStatus(); } -void TreeViewItem::paintCell(QPainter * p, const QColorGroup & cg, int column, int width, int align) +void TreeViewItem::paintCell(TQPainter * p, const TQColorGroup & cg, int column, int width, int align) { TreeColumnViewItem item = column_items_[column]; // Get a color to draw the text - QColorGroup m_cg(cg); - QColor color(item.textStatusColor()); - m_cg.setColor(QColorGroup::Text, color); + TQColorGroup m_cg(cg); + TQColor color(item.textStatusColor()); + m_cg.setColor(TQColorGroup::Text, color); KListViewItem::paintCell(p, m_cg, column, width, align); @@ -507,7 +507,7 @@ LinkStatus const* TreeColumnViewItem::linkStatus() const return ls_; } -QColor const& TreeColumnViewItem::textStatusColor() const +TQColor const& TreeColumnViewItem::textStatusColor() const { if(columnIndex() == root_->urlColumnIndex() || columnIndex() == root_->statusColumnIndex()) { @@ -537,7 +537,7 @@ QColor const& TreeColumnViewItem::textStatusColor() const } -QString TreeColumnViewItem::text(int column) const +TQString TreeColumnViewItem::text(int column) const { Q_ASSERT(column > 0); @@ -559,19 +559,19 @@ QString TreeColumnViewItem::text(int column) const } else if(column == root_->statusColumnIndex()) { - return QString(); + return TQString(); } else if(column == root_->labelColumnIndex()) { - QString label(linkStatus()->label()); + TQString label(linkStatus()->label()); if(!label.isNull()) return label.simplifyWhiteSpace(); } - return QString(); + return TQString(); } -QPixmap TreeColumnViewItem::pixmap(int column) const +TQPixmap TreeColumnViewItem::pixmap(int column) const { Q_ASSERT(column > 0); @@ -602,7 +602,7 @@ QPixmap TreeColumnViewItem::pixmap(int column) const return SmallIcon("help"); } - return QPixmap(); + return TQPixmap(); } |