diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-18 17:00:31 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-18 17:00:31 +0000 |
commit | 395a904bff7b4d6ead445c342f7ac0c5fbf29121 (patch) | |
tree | 9829cadb79d2cc7c29a940627fadb28b11e54150 /konq-plugins/rellinks | |
parent | 399f47c376fdf4d19192732a701ea9578d11619d (diff) | |
download | tdeaddons-395a904bff7b4d6ead445c342f7ac0c5fbf29121.tar.gz tdeaddons-395a904bff7b4d6ead445c342f7ac0c5fbf29121.zip |
TQt4 port kdeaddons
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeaddons@1237404 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'konq-plugins/rellinks')
-rw-r--r-- | konq-plugins/rellinks/plugin_rellinks.cpp | 36 | ||||
-rw-r--r-- | konq-plugins/rellinks/plugin_rellinks.h | 5 |
2 files changed, 21 insertions, 20 deletions
diff --git a/konq-plugins/rellinks/plugin_rellinks.cpp b/konq-plugins/rellinks/plugin_rellinks.cpp index 14a47a3..e77e1e3 100644 --- a/konq-plugins/rellinks/plugin_rellinks.cpp +++ b/konq-plugins/rellinks/plugin_rellinks.cpp @@ -1,6 +1,6 @@ /*************************************************************************** * Copyright (C) 2002, Anders Lund <anders@alweb.dk> * - * Copyright (C) 2003, 2004, Franck Quélain <shift@free.fr> * + * Copyright (C) 2003, 2004, Franck Qu�lain <shift@free.fr> * * Copyright (C) 2004, Kevin Krammer <kevin.krammer@gmx.at> * * Copyright (C) 2004, 2006, Oliviet Goffart <ogoffart @ kde.org> * * * @@ -23,7 +23,7 @@ -// Qt includes +// TQt includes #include <tqapplication.h> #include <tqtimer.h> @@ -61,8 +61,8 @@ K_EXPORT_COMPONENT_FACTORY( librellinksplugin, RelLinksFactory("rellinks") ) #endif /** Constructor of the plugin. */ -RelLinksPlugin::RelLinksPlugin(TQObject *parent, const char *name, const TQStringList &) - : KParts::Plugin( parent, name ), +RelLinksPlugin::RelLinksPlugin(TQObject *tqparent, const char *name, const TQStringList &) + : KParts::Plugin( tqparent, name ), m_part(0), m_viewVisible(false) { @@ -74,7 +74,7 @@ RelLinksPlugin::RelLinksPlugin(TQObject *parent, const char *name, const TQStrin kaction_map["home"]->setWhatsThis( i18n("<p>This link references a home page or the top of some hierarchy.</p>") ); kaction_map["up"] = new KAction( i18n("&Up"), "1uparrow", KShortcut("Ctrl+Alt+U"), this, TQT_SLOT(goUp()), actionCollection(), "rellinks_up" ); - kaction_map["up"]->setWhatsThis( i18n("<p>This link references the immediate parent of the current document.</p>") ); + kaction_map["up"]->setWhatsThis( i18n("<p>This link references the immediate tqparent of the current document.</p>") ); bool isRTL = TQApplication::reverseLayout(); @@ -91,7 +91,7 @@ RelLinksPlugin::RelLinksPlugin(TQObject *parent, const char *name, const TQStrin kaction_map["last"]->setWhatsThis( i18n("<p>This link references the end of a sequence of documents.</p>") ); // ------------ special items -------------------------- - kaction_map["search"] = new KAction( i18n("&Search"), "filefind", KShortcut("Ctrl+Alt+S"), this, TQT_SLOT(goSearch()), actionCollection(), "rellinks_search" ); + kaction_map["search"] = new KAction( i18n("&Search"), "filetqfind", KShortcut("Ctrl+Alt+S"), this, TQT_SLOT(goSearch()), actionCollection(), "rellinks_search" ); kaction_map["search"]->setWhatsThis( i18n("<p>This link references the search.</p>") ); // ------------ Document structure links --------------- @@ -175,7 +175,7 @@ RelLinksPlugin::RelLinksPlugin(TQObject *parent, const char *name, const TQStrin disableAll(); // When the rendering of the HTML is done, we update the site navigation bar - m_part = dynamic_cast<KHTMLPart *>(parent); + m_part = dynamic_cast<KHTMLPart *>(tqparent); if (!m_part) return; @@ -199,7 +199,7 @@ bool RelLinksPlugin::eventFilter(TQObject *watched, TQEvent* event) { if (watched == 0 || event == 0) return false; - if (watched == m_view) + if (TQT_BASE_OBJECT(watched) == TQT_BASE_OBJECT(m_view)) { switch (event->type()) { @@ -310,7 +310,7 @@ void RelLinksPlugin::updateToolbar() { // escape ampersand before settings as action title, otherwise the menu entry will interpret it as an // accelerator - title.replace('&', "&&"); + title.tqreplace('&', "&&"); // -- Menus activation -- @@ -364,7 +364,7 @@ void RelLinksPlugin::updateToolbar() { void RelLinksPlugin::guessRelations() { - m_part = dynamic_cast<KHTMLPart *>(parent()); + m_part = dynamic_cast<KHTMLPart *>(tqparent()); if (!m_part || m_part->document().isNull() ) return; @@ -394,7 +394,7 @@ void RelLinksPlugin::guessRelations() TQString href=rx.cap(1)+ nval_str + rx.cap(3); KURL ref( m_part->url(), href ); - TQString title = i18n("[Autodetected] %1").arg(ref.prettyURL()); + TQString title = i18n("[Autodetected] %1").tqarg(ref.prettyURL()); DOM::Element e= m_part->document().createElement("link"); e.setAttribute("href",href); element_map["next"][0] = e; @@ -408,7 +408,7 @@ void RelLinksPlugin::guessRelations() nval_str.prepend(zeros.left(lenval-nval_str.length())); TQString href=rx.cap(1)+ nval_str + rx.cap(3); KURL ref( m_part->url(), href ); - TQString title = i18n("[Autodetected] %1").arg(ref.prettyURL()); + TQString title = i18n("[Autodetected] %1").tqarg(ref.prettyURL()); e= m_part->document().createElement("link"); e.setAttribute("href",href); element_map["prev"][0] = e; @@ -422,7 +422,7 @@ void RelLinksPlugin::guessRelations() /** Menu links */ void RelLinksPlugin::goToLink(const TQString & rel, int id) { // have the KHTML part open it - KHTMLPart *part = dynamic_cast<KHTMLPart *>(parent()); + KHTMLPart *part = dynamic_cast<KHTMLPart *>(tqparent()); if (!part) return; @@ -561,17 +561,17 @@ void RelLinksPlugin::disableAll() { TQString RelLinksPlugin::getLinkType(const TQString &lrel) { // Relations to ignore... - if (lrel.contains("stylesheet") + if (lrel.tqcontains("stylesheet") || lrel == "script" || lrel == "icon" || lrel == "shortcut icon" || lrel == "prefetch" ) - return TQString::null; + return TQString(); // ...known relations... if (lrel == "top" || lrel == "origin" || lrel == "start") return "home"; - if (lrel == "parent") + if (lrel == "tqparent") return "up"; if (lrel == "first") return "begin"; @@ -583,7 +583,7 @@ TQString RelLinksPlugin::getLinkType(const TQString &lrel) { return "last"; if (lrel == "toc") return "contents"; - if (lrel == "find") + if (lrel == "tqfind") return "search"; if (lrel == "alternative stylesheet") return "alternate stylesheet"; @@ -612,7 +612,7 @@ TQString RelLinksPlugin::transformRevToRel(const TQString &rev) { return getLinkType("sibling"); //...unknown inverse relation => ignore for the moment - return TQString::null; + return TQString(); } #include "plugin_rellinks.moc" diff --git a/konq-plugins/rellinks/plugin_rellinks.h b/konq-plugins/rellinks/plugin_rellinks.h index 9c38795..c6e0942 100644 --- a/konq-plugins/rellinks/plugin_rellinks.h +++ b/konq-plugins/rellinks/plugin_rellinks.h @@ -30,7 +30,7 @@ This plugin create a toolbar similar to the Site Navigation Bar of Mozilla */ -// Qt includes +// TQt includes #include <tqmap.h> // KDE includes @@ -57,9 +57,10 @@ class TQTimer; */ class RelLinksPlugin : public KParts::Plugin { Q_OBJECT + TQ_OBJECT public: /** Constructor */ - RelLinksPlugin( TQObject *parent, const char *name, const TQStringList & ); + RelLinksPlugin( TQObject *tqparent, const char *name, const TQStringList & ); /** Destructor */ virtual ~RelLinksPlugin(); |