diff options
Diffstat (limited to 'konq-plugins/adblock')
-rw-r--r-- | konq-plugins/adblock/adblock.cpp | 50 | ||||
-rw-r--r-- | konq-plugins/adblock/adblock.h | 30 | ||||
-rw-r--r-- | konq-plugins/adblock/adblockdialogue.cpp | 70 | ||||
-rw-r--r-- | konq-plugins/adblock/adblockdialogue.h | 28 |
4 files changed, 89 insertions, 89 deletions
diff --git a/konq-plugins/adblock/adblock.cpp b/konq-plugins/adblock/adblock.cpp index 30878fd..c18c061 100644 --- a/konq-plugins/adblock/adblock.cpp +++ b/konq-plugins/adblock/adblock.cpp @@ -49,14 +49,14 @@ #include <dom/dom_node.h> using namespace DOM; -#include <qpixmap.h> -#include <qcursor.h> -#include <qregexp.h> +#include <tqpixmap.h> +#include <tqcursor.h> +#include <tqregexp.h> typedef KGenericFactory<AdBlock> AdBlockFactory; K_EXPORT_COMPONENT_FACTORY( libadblock, AdBlockFactory( "adblock" ) ) -AdBlock::AdBlock(QObject *parent, const char *name, const QStringList &) : +AdBlock::AdBlock(TQObject *parent, const char *name, const TQStringList &) : KParts::Plugin(parent, name), m_label(0), m_menu(0) { @@ -65,10 +65,10 @@ AdBlock::AdBlock(QObject *parent, const char *name, const QStringList &) : m_menu = new KPopupMenu(m_part->widget()); m_menu->insertTitle(i18n("Adblock")); - m_menu->insertItem(i18n("Configure"), this, SLOT(showKCModule())); - m_menu->insertItem(i18n("Show Elements"), this, SLOT(showDialogue())); + m_menu->insertItem(i18n("Configure"), this, TQT_SLOT(showKCModule())); + m_menu->insertItem(i18n("Show Elements"), this, TQT_SLOT(showDialogue())); - connect(m_part, SIGNAL(completed()), this, SLOT(initLabel())); + connect(m_part, TQT_SIGNAL(completed()), this, TQT_SLOT(initLabel())); } AdBlock::~AdBlock() @@ -95,14 +95,14 @@ void AdBlock::initLabel() KIconLoader *loader = instance()->iconLoader(); m_label->setFixedHeight(loader->currentSize(KIcon::Small)); - m_label->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); + m_label->setSizePolicy(TQSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Fixed)); m_label->setUseCursor(false); m_label->setPixmap(loader->loadIcon("filter", KIcon::Small)); statusBarEx->addStatusBarItem(m_label, 0, false); - connect(m_label, SIGNAL(leftClickedURL()), this, SLOT(showDialogue())); - connect(m_label, SIGNAL(rightClickedURL()), this, SLOT(contextMenu())); + connect(m_label, TQT_SIGNAL(leftClickedURL()), this, TQT_SLOT(showDialogue())); + connect(m_label, TQT_SIGNAL(rightClickedURL()), this, TQT_SLOT(contextMenu())); } void AdBlock::showDialogue() @@ -120,9 +120,9 @@ void AdBlock::showDialogue() fillBlockableElements(elements); AdBlockDlg *dialogue = new AdBlockDlg(m_part->widget(), elements); - connect(dialogue, SIGNAL( notEmptyFilter(const QString&) ), this, SLOT( addAdFilter(const QString&) )); - connect(dialogue, SIGNAL( cancelClicked() ), dialogue, SLOT( delayedDestruct() )); - connect(dialogue, SIGNAL( closeClicked() ), dialogue, SLOT( delayedDestruct() )); + connect(dialogue, TQT_SIGNAL( notEmptyFilter(const TQString&) ), this, TQT_SLOT( addAdFilter(const TQString&) )); + connect(dialogue, TQT_SIGNAL( cancelClicked() ), dialogue, TQT_SLOT( delayedDestruct() )); + connect(dialogue, TQT_SIGNAL( closeClicked() ), dialogue, TQT_SLOT( delayedDestruct() )); dialogue->show(); } @@ -130,14 +130,14 @@ void AdBlock::showKCModule() { KCMultiDialog* dialogue = new KCMultiDialog(m_part->widget()); dialogue->addModule("khtml_filter"); - connect(dialogue, SIGNAL( cancelClicked() ), dialogue, SLOT( delayedDestruct() )); - connect(dialogue, SIGNAL( closeClicked() ), dialogue, SLOT( delayedDestruct() )); + connect(dialogue, TQT_SIGNAL( cancelClicked() ), dialogue, TQT_SLOT( delayedDestruct() )); + connect(dialogue, TQT_SIGNAL( closeClicked() ), dialogue, TQT_SLOT( delayedDestruct() )); dialogue->show(); } void AdBlock::contextMenu() { - m_menu->popup(QCursor::pos()); + m_menu->popup(TQCursor::pos()); } void AdBlock::fillBlockableElements(AdElementList &elements) @@ -172,7 +172,7 @@ void AdBlock::fillWithImages(AdElementList &elements) DOMString src = image.src(); - QString url = htmlDoc.completeURL(src).string(); + TQString url = htmlDoc.completeURL(src).string(); if (!url.isEmpty() && url != m_part->baseURL().url()) { AdElement element(url, "image", "IMG", false); @@ -185,7 +185,7 @@ void AdBlock::fillWithImages(AdElementList &elements) void AdBlock::fillWithHtmlTag(AdElementList &elements, const DOMString &tagName, const DOMString &attrName, - const QString &category) + const TQString &category) { Document doc = m_part->document(); @@ -199,7 +199,7 @@ void AdBlock::fillWithHtmlTag(AdElementList &elements, DOMString src = attr.nodeValue(); if (src.isNull()) continue; - QString url = doc.completeURL(src).string(); + TQString url = doc.completeURL(src).string(); if (!url.isEmpty() && url != m_part->baseURL().url()) { AdElement element(url, tagName.string(), category, false); @@ -209,7 +209,7 @@ void AdBlock::fillWithHtmlTag(AdElementList &elements, } } -void AdBlock::addAdFilter(const QString &url) +void AdBlock::addAdFilter(const TQString &url) { //FIXME hackish KHTMLSettings *settings = const_cast<KHTMLSettings *>(m_part->settings()); @@ -221,8 +221,8 @@ void AdBlock::addAdFilter(const QString &url) AdElement::AdElement() : m_url(0), m_category(0), m_type(0), m_blocked(false) {} -AdElement::AdElement(const QString &url, const QString &category, - const QString &type, bool blocked) : +AdElement::AdElement(const TQString &url, const TQString &category, + const TQString &type, bool blocked) : m_url(url), m_category(category), m_type(type), m_blocked(blocked) {} AdElement &AdElement::operator=(const AdElement &obj) @@ -250,17 +250,17 @@ void AdElement::setBlocked(bool blocked) m_blocked = blocked; } -const QString &AdElement::url() const +const TQString &AdElement::url() const { return m_url; } -const QString &AdElement::category() const +const TQString &AdElement::category() const { return m_category; } -const QString &AdElement::type() const +const TQString &AdElement::type() const { return m_type; } diff --git a/konq-plugins/adblock/adblock.h b/konq-plugins/adblock/adblock.h index 4b6154e..0a9b15b 100644 --- a/konq-plugins/adblock/adblock.h +++ b/konq-plugins/adblock/adblock.h @@ -21,8 +21,8 @@ #ifndef KONQ_ADBLOCK_H #define KONQ_ADBLOCK_H -#include <qguardedptr.h> -#include <qvaluelist.h> +#include <tqguardedptr.h> +#include <tqvaluelist.h> #include <kparts/plugin.h> class KHTMLPart; @@ -41,18 +41,18 @@ namespace DOM class DOMString; } -typedef QValueList<AdElement> AdElementList; +typedef TQValueList<AdElement> AdElementList; class AdBlock : public KParts::Plugin { Q_OBJECT public: - AdBlock(QObject *parent, const char *name, const QStringList &); + AdBlock(TQObject *parent, const char *name, const TQStringList &); ~AdBlock(); private: - QGuardedPtr<KHTMLPart> m_part; + TQGuardedPtr<KHTMLPart> m_part; KURLLabel *m_label; KPopupMenu *m_menu; @@ -61,12 +61,12 @@ private: void fillWithHtmlTag(AdElementList &elements, const DOM::DOMString &tagName, const DOM::DOMString &attrName, - const QString &category); + const TQString &category); private slots: void initLabel(); void showDialogue(); - void addAdFilter(const QString &url); + void addAdFilter(const TQString &url); void contextMenu(); void showKCModule(); }; @@ -76,24 +76,24 @@ private slots: class AdElement { private: - QString m_url; - QString m_category; - QString m_type; + TQString m_url; + TQString m_category; + TQString m_type; bool m_blocked; public: AdElement(); - AdElement(const QString &url, const QString &category, - const QString &type, bool blocked); + AdElement(const TQString &url, const TQString &category, + const TQString &type, bool blocked); AdElement &operator=(const AdElement &); bool operator==(const AdElement &e1); bool isBlocked() const; void setBlocked(bool blocked); - const QString &url() const; - const QString &category() const; - const QString &type() const; + const TQString &url() const; + const TQString &category() const; + const TQString &type() const; }; #endif diff --git a/konq-plugins/adblock/adblockdialogue.cpp b/konq-plugins/adblock/adblockdialogue.cpp index 5de6efa..1aff0f6 100644 --- a/konq-plugins/adblock/adblockdialogue.cpp +++ b/konq-plugins/adblock/adblockdialogue.cpp @@ -24,30 +24,30 @@ #include <kpopupmenu.h> #include <klocale.h> -#include <qcursor.h> -#include <qlabel.h> -#include <qvbox.h> -#include <qlineedit.h> -#include <qcolor.h> -#include <qfont.h> -#include <qpainter.h> - -AdBlockDlg::AdBlockDlg(QWidget *parent, AdElementList &elements) : +#include <tqcursor.h> +#include <tqlabel.h> +#include <tqvbox.h> +#include <tqlineedit.h> +#include <tqcolor.h> +#include <tqfont.h> +#include <tqpainter.h> + +AdBlockDlg::AdBlockDlg(TQWidget *parent, AdElementList &elements) : KDialogBase( parent, "Adblock dialogue", true, "Adblock - able Items", Ok|Cancel, Ok, true ) { - QVBox *page = makeVBoxMainWidget(); - m_label1 = new QLabel( i18n("All blockable items in this page:"), page, "label1" ); + TQVBox *page = makeVBoxMainWidget(); + m_label1 = new TQLabel( i18n("All blockable items in this page:"), page, "label1" ); - m_list = new QListView(page); + m_list = new TQListView(page); m_list->setAllColumnsShowFocus( true ); m_list->addColumn( i18n("Source") ); m_list->addColumn( i18n("Category") ); m_list->addColumn( i18n("Node Name") ); - m_list->setColumnWidthMode(0, QListView::Manual); - m_list->setColumnWidthMode(1, QListView::Manual); - m_list->setColumnWidthMode(2, QListView::Manual); + m_list->setColumnWidthMode(0, TQListView::Manual); + m_list->setColumnWidthMode(1, TQListView::Manual); + m_list->setColumnWidthMode(2, TQListView::Manual); m_list->setColumnWidth(0, 600); m_list->setColumnWidth(1, 90); @@ -58,30 +58,30 @@ AdBlockDlg::AdBlockDlg(QWidget *parent, AdElementList &elements) : { AdElement &element = (*it); - QString url = element.url(); + TQString url = element.url(); ListViewItem *item = new ListViewItem( m_list, url, element.category(), element.type() ); item->setBlocked(element.isBlocked()); } - m_label2 = new QLabel( i18n("New filter (use * as a wildcard):"), page, "label2" ); + m_label2 = new TQLabel( i18n("New filter (use * as a wildcard):"), page, "label2" ); - m_filter = new QLineEdit( "", page, "lineedit" ); + m_filter = new TQLineEdit( "", page, "lineedit" ); - connect(this, SIGNAL( okClicked() ), this, SLOT( validateFilter() )); - connect(m_list, SIGNAL( doubleClicked(QListViewItem *, const QPoint &, int) ), this, SLOT(updateFilter(QListViewItem *)) ); + connect(this, TQT_SIGNAL( okClicked() ), this, TQT_SLOT( validateFilter() )); + connect(m_list, TQT_SIGNAL( doubleClicked(TQListViewItem *, const TQPoint &, int) ), this, TQT_SLOT(updateFilter(TQListViewItem *)) ); m_menu = new KPopupMenu(this); - m_menu->insertItem(i18n("Filter this item"), this, SLOT(filterItem())); - m_menu->insertItem(i18n("Filter all items at same path"), this, SLOT(filterPath())); + m_menu->insertItem(i18n("Filter this item"), this, TQT_SLOT(filterItem())); + m_menu->insertItem(i18n("Filter all items at same path"), this, TQT_SLOT(filterPath())); connect(m_list, - SIGNAL( contextMenuRequested( QListViewItem *, const QPoint& , int ) ), + TQT_SIGNAL( contextMenuRequested( TQListViewItem *, const TQPoint& , int ) ), this, - SLOT( showContextMenu(QListViewItem *, const QPoint &) ) ); + TQT_SLOT( showContextMenu(TQListViewItem *, const TQPoint &) ) ); } -void AdBlockDlg::updateFilter(QListViewItem *selected) +void AdBlockDlg::updateFilter(TQListViewItem *selected) { ListViewItem *item = dynamic_cast<ListViewItem *>(selected); @@ -96,7 +96,7 @@ void AdBlockDlg::updateFilter(QListViewItem *selected) void AdBlockDlg::validateFilter() { - const QString text = m_filter->text().stripWhiteSpace(); + const TQString text = m_filter->text().stripWhiteSpace(); if (!text.isEmpty()) emit notEmptyFilter(text); @@ -104,7 +104,7 @@ void AdBlockDlg::validateFilter() delayedDestruct(); } -void AdBlockDlg::showContextMenu(QListViewItem *item, const QPoint &point) +void AdBlockDlg::showContextMenu(TQListViewItem *item, const TQPoint &point) { if (!item) return; m_menu->popup(point); @@ -112,14 +112,14 @@ void AdBlockDlg::showContextMenu(QListViewItem *item, const QPoint &point) void AdBlockDlg::filterItem() { - QListViewItem* item = m_list->selectedItem(); + TQListViewItem* item = m_list->selectedItem(); m_filter->setText( item->text(0) ); } void AdBlockDlg::filterPath() { - QListViewItem* item = m_list->selectedItem(); - QString value = item->text(0); + TQListViewItem* item = m_list->selectedItem(); + TQString value = item->text(0); m_filter->setText( value.section( '/', 0, -2 ).append("/*") ); } @@ -133,20 +133,20 @@ AdBlockDlg::~AdBlockDlg() // ---------------------------------------------------------------------------- -void ListViewItem::paintCell(QPainter *p, const QColorGroup & cg, int column, int width, int align) +void ListViewItem::paintCell(TQPainter *p, const TQColorGroup & cg, int column, int width, int align) { p->save(); - QColorGroup g( cg ); + TQColorGroup g( cg ); if ( isBlocked() ) { - g.setColor(QColorGroup::Text, red); - QFont font; + g.setColor(TQColorGroup::Text, red); + TQFont font; font.setItalic(true); p->setFont(font); } - QListViewItem::paintCell(p, g, column, width, align); + TQListViewItem::paintCell(p, g, column, width, align); p->restore(); } diff --git a/konq-plugins/adblock/adblockdialogue.h b/konq-plugins/adblock/adblockdialogue.h index ab41bc2..8645d65 100644 --- a/konq-plugins/adblock/adblockdialogue.h +++ b/konq-plugins/adblock/adblockdialogue.h @@ -21,7 +21,7 @@ #define KONQ_ADBLOCKDLG_H #include <kdialogbase.h> -#include <qlistview.h> +#include <tqlistview.h> class QLabel; class QLineEdit; @@ -32,25 +32,25 @@ class AdBlockDlg : public KDialogBase Q_OBJECT private: - QLineEdit *m_filter; - QListView *m_list; - QLabel *m_label1; - QLabel *m_label2; + TQLineEdit *m_filter; + TQListView *m_list; + TQLabel *m_label1; + TQLabel *m_label2; KPopupMenu *m_menu; public: - AdBlockDlg(QWidget *parent, AdElementList &elements); + AdBlockDlg(TQWidget *parent, AdElementList &elements); ~AdBlockDlg(); private slots: void validateFilter (); - void updateFilter(QListViewItem *item); - void showContextMenu(QListViewItem *item, const QPoint &point); + void updateFilter(TQListViewItem *item); + void showContextMenu(TQListViewItem *item, const TQPoint &point); void filterPath(); void filterItem(); signals: - void notEmptyFilter (const QString &url); + void notEmptyFilter (const TQString &url); }; // ---------------------------------------------------------------------------- @@ -61,13 +61,13 @@ private: bool m_blocked; public: - ListViewItem(QListView *listView, - const QString &label1, - const QString &label2, - const QString &label3) : QListViewItem(listView, label1, label2, label3), + ListViewItem(TQListView *listView, + const TQString &label1, + const TQString &label2, + const TQString &label3) : TQListViewItem(listView, label1, label2, label3), m_blocked(false){}; - void paintCell(QPainter *p, const QColorGroup & cg, int column, int width, int align); + void paintCell(TQPainter *p, const TQColorGroup & cg, int column, int width, int align); bool isBlocked(); void setBlocked(bool blocked); |