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/sidebar/metabar/src | |
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/sidebar/metabar/src')
18 files changed, 122 insertions, 112 deletions
diff --git a/konq-plugins/sidebar/metabar/src/configdialog.cpp b/konq-plugins/sidebar/metabar/src/configdialog.cpp index 3d4850f..ebcf170 100644 --- a/konq-plugins/sidebar/metabar/src/configdialog.cpp +++ b/konq-plugins/sidebar/metabar/src/configdialog.cpp @@ -56,9 +56,9 @@ ActionListItem::ActionListItem(TQListBox *listbox, const TQString &action, const setText(text); } -ConfigDialog::ConfigDialog(TQWidget *parent, const char *name) : TQDialog(parent, name) +ConfigDialog::ConfigDialog(TQWidget *tqparent, const char *name) : TQDialog(tqparent, name) { - topWidgetName = parent->topLevelWidget()->name(); + topWidgetName = tqparent->tqtopLevelWidget()->name(); config = new KConfig("metabarrc"); iconConfig = new KConfig(locate("data", "metabar/iconsrc")); @@ -78,7 +78,7 @@ ConfigDialog::ConfigDialog(TQWidget *parent, const char *name) : TQDialog(parent TQWidget *general = new TQWidget; TQGroupBox *entries_group = new TQGroupBox(2, Qt::Horizontal, i18n("Items"), general); - entries_group->setSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Preferred); + entries_group->tqsetSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Preferred); TQLabel *entries_label = new TQLabel(i18n("Open with:"), entries_group); max_entries = new KIntSpinBox(entries_group); @@ -98,7 +98,7 @@ ConfigDialog::ConfigDialog(TQWidget *parent, const char *name) : TQDialog(parent TQGroupBox *appearance_group = new TQGroupBox(1, Qt::Horizontal, i18n("Appearance"), general); - appearance_group->setSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Preferred); + appearance_group->tqsetSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Preferred); animate = new TQCheckBox(i18n("Animate resize"), appearance_group); animate->setChecked(config->readBoolEntry("AnimateResize", false)); @@ -110,13 +110,13 @@ ConfigDialog::ConfigDialog(TQWidget *parent, const char *name) : TQDialog(parent showframe->setChecked(config->readBoolEntry("ShowFrame", true)); TQGroupBox *theme_group = new TQGroupBox(2, Qt::Horizontal, i18n("Themes"), general); - theme_group->setSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Preferred); + theme_group->tqsetSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Preferred); themes = new KComboBox(theme_group); - themes->setSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Preferred); + themes->tqsetSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Preferred); install_theme = new KPushButton(i18n("Install New Theme..."), theme_group); - install_theme->setSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Preferred); + install_theme->tqsetSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Preferred); connect(install_theme, TQT_SIGNAL(clicked()), this, TQT_SLOT(installTheme())); loadThemes(); @@ -144,7 +144,7 @@ ConfigDialog::ConfigDialog(TQWidget *parent, const char *name) : TQDialog(parent connect(link_down, TQT_SIGNAL(clicked()), this, TQT_SLOT(moveLinkDown())); link_list = new KListView(links); - link_list->setSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Expanding); + link_list->tqsetSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Expanding); link_list->setSorting(-1); link_list->setItemsMovable(TRUE); link_list->addColumn(i18n("Name")); @@ -161,7 +161,7 @@ ConfigDialog::ConfigDialog(TQWidget *parent, const char *name) : TQDialog(parent tab->addTab(actionPage, i18n("Actions")); tab->addTab(links, i18n("Links")); - //layout + //tqlayout TQGridLayout *general_layout = new TQGridLayout(general, 2, 2, 5, 5); general_layout->addWidget(entries_group, 0, 0); general_layout->addWidget(appearance_group, 0, 1); @@ -222,7 +222,7 @@ ConfigDialog::ConfigDialog(TQWidget *parent, const char *name) : TQDialog(parent ActionListItem *item = new ActionListItem(actionSelector->selectedListBox(), *it, text, SmallIcon("network")); - TQListBoxItem *avItem = actionSelector->availableListBox()->findItem(text, Qt::ExactMatch); + TQListBoxItem *avItem = actionSelector->availableListBox()->tqfindItem(text, TQt::ExactMatch); if(avItem){ delete avItem; } @@ -236,7 +236,7 @@ ConfigDialog::ConfigDialog(TQWidget *parent, const char *name) : TQDialog(parent ActionListItem *item = new ActionListItem(actionSelector->selectedListBox(), TQString(*it), text, SmallIcon(icon)); - TQListBoxItem *avItem = actionSelector->availableListBox()->findItem(text, Qt::ExactMatch); + TQListBoxItem *avItem = actionSelector->availableListBox()->tqfindItem(text, TQt::ExactMatch); if(avItem){ delete avItem; } @@ -320,7 +320,7 @@ void ConfigDialog::createLink() TQLineEdit *url = new TQLineEdit("file:/", main); KIconButton *icon = new KIconButton(main); - icon->setSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Minimum); + icon->tqsetSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Minimum); icon->setIconType(KIcon::Small, KIcon::Any); icon->setStrictIconSize(true); icon->setIcon("folder"); @@ -330,19 +330,19 @@ void ConfigDialog::createLink() bottom_layout->addWidget(ok); bottom_layout->addWidget(cancel); - TQGridLayout *layout = new TQGridLayout(0, 2, 3, 0, 5); - layout->addMultiCellWidget(icon, 0, 1, 0, 0); - layout->addWidget(new TQLabel(i18n("Name:"), main), 0, 1); - layout->addWidget(name, 0, 2); - layout->addWidget(new TQLabel(i18n("URL:"), main), 1, 1); - layout->addWidget(url, 1, 2); + TQGridLayout *tqlayout = new TQGridLayout(0, 2, 3, 0, 5); + tqlayout->addMultiCellWidget(icon, 0, 1, 0, 0); + tqlayout->addWidget(new TQLabel(i18n("Name:"), main), 0, 1); + tqlayout->addWidget(name, 0, 2); + tqlayout->addWidget(new TQLabel(i18n("URL:"), main), 1, 1); + tqlayout->addWidget(url, 1, 2); TQVBoxLayout *main_layout = new TQVBoxLayout(main, 5, 5); - main_layout->addLayout(layout); + main_layout->addLayout(tqlayout); main_layout->addItem(new TQSpacerItem(10, 10, TQSizePolicy::Minimum, TQSizePolicy::Expanding)); main_layout->addLayout(bottom_layout); - main->resize(300, main->sizeHint().height()); + main->resize(300, main->tqsizeHint().height()); if(main->exec() == TQDialog::Accepted){ TQString name_str = name->text(); @@ -403,7 +403,7 @@ void ConfigDialog::editLink(TQListViewItem *item) TQLineEdit *url = new TQLineEdit(linkList[item]->url, main); KIconButton *icon = new KIconButton(main); - icon->setSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Minimum); + icon->tqsetSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Minimum); icon->setIconType(KIcon::Small, KIcon::Any); icon->setStrictIconSize(true); icon->setIcon(linkList[item]->icon); @@ -413,19 +413,19 @@ void ConfigDialog::editLink(TQListViewItem *item) bottom_layout->addWidget(ok); bottom_layout->addWidget(cancel); - TQGridLayout *layout = new TQGridLayout(0, 2, 3, 0, 5); - layout->addMultiCellWidget(icon, 0, 1, 0, 0); - layout->addWidget(new TQLabel(i18n("Name:"), main), 0, 1); - layout->addWidget(name, 0, 2); - layout->addWidget(new TQLabel(i18n("URL:"), main), 1, 1); - layout->addWidget(url, 1, 2); + TQGridLayout *tqlayout = new TQGridLayout(0, 2, 3, 0, 5); + tqlayout->addMultiCellWidget(icon, 0, 1, 0, 0); + tqlayout->addWidget(new TQLabel(i18n("Name:"), main), 0, 1); + tqlayout->addWidget(name, 0, 2); + tqlayout->addWidget(new TQLabel(i18n("URL:"), main), 1, 1); + tqlayout->addWidget(url, 1, 2); TQVBoxLayout *main_layout = new TQVBoxLayout(main, 5, 5); - main_layout->addLayout(layout); + main_layout->addLayout(tqlayout); main_layout->addItem(new TQSpacerItem(10, 10, TQSizePolicy::Minimum, TQSizePolicy::Expanding)); main_layout->addLayout(bottom_layout); - main->resize(300, main->sizeHint().height()); + main->resize(300, main->tqsizeHint().height()); if(main->exec() == TQDialog::Accepted){ TQString name_str = name->text(); @@ -576,7 +576,7 @@ void ConfigDialog::loadThemes() theme_list.remove(".."); themes->insertStringList(theme_list); - if(theme_list.find(theme) != theme_list.end()){ + if(theme_list.tqfind(theme) != theme_list.end()){ foundTheme = true; } } diff --git a/konq-plugins/sidebar/metabar/src/configdialog.h b/konq-plugins/sidebar/metabar/src/configdialog.h index 94f5fee..8417d15 100644 --- a/konq-plugins/sidebar/metabar/src/configdialog.h +++ b/konq-plugins/sidebar/metabar/src/configdialog.h @@ -42,12 +42,13 @@ class LinkEntry{ TQString icon; }; -class ConfigDialog : public QDialog +class ConfigDialog : public TQDialog { Q_OBJECT + TQ_OBJECT public: - ConfigDialog(TQWidget *parent = 0, const char *name = 0); + ConfigDialog(TQWidget *tqparent = 0, const char *name = 0); ~ConfigDialog(); protected: @@ -98,7 +99,7 @@ class ConfigDialog : public QDialog void loadThemes(); }; -class ActionListItem : public QListBoxPixmap +class ActionListItem : public TQListBoxPixmap { public: ActionListItem(TQListBox *listbox, const TQString &action, const TQString &text, const TQPixmap &pixmap); diff --git a/konq-plugins/sidebar/metabar/src/defaultplugin.cpp b/konq-plugins/sidebar/metabar/src/defaultplugin.cpp index 6c3982e..5839a64 100644 --- a/konq-plugins/sidebar/metabar/src/defaultplugin.cpp +++ b/konq-plugins/sidebar/metabar/src/defaultplugin.cpp @@ -99,19 +99,19 @@ void DefaultPlugin::loadActions(DOM::HTMLElement node) for(TQStringList::Iterator it = actions.begin(); it != actions.end(); ++it){ if((*it).startsWith("metabar/")){ if((*it).right((*it).length() - 8) == "share"){ - MetabarWidget::addEntry(innerHTML, i18n("Share"), "action://" + *it, "network", TQString::null, actionCount < maxActions ? TQString::null : TQString("hiddenaction"), actionCount >= maxActions); + MetabarWidget::addEntry(innerHTML, i18n("Share"), "action://" + *it, "network", TQString(), actionCount < maxActions ? TQString() : TQString("hiddenaction"), actionCount >= maxActions); actionCount++; } } else{ - DCOPRef action(kapp->dcopClient()->appId(), TQCString(m_html->view()->topLevelWidget()->name()).append("/action/").append((*it).utf8())); + DCOPRef action(kapp->dcopClient()->appId(), TQCString(m_html->view()->tqtopLevelWidget()->name()).append("/action/").append((*it).utf8())); if(!action.isNull()){ if(action.call("enabled()")){ TQString text = action.call("plainText()"); TQString icon = iconConfig.readEntry(*it, action.call("icon()")); - MetabarWidget::addEntry(innerHTML, text, "action://" + *it, icon, TQString::null, actionCount < maxActions ? TQString::null : TQString("hiddenaction"), actionCount >= maxActions); + MetabarWidget::addEntry(innerHTML, text, "action://" + *it, icon, TQString(), actionCount < maxActions ? TQString() : TQString("hiddenaction"), actionCount >= maxActions); actionCount++; } } @@ -156,7 +156,7 @@ void DefaultPlugin::loadApplications(DOM::HTMLElement node) KDesktopFile desktop(url.path(), TRUE); if(desktop.hasApplicationType ()){ - MetabarWidget::addEntry(innerHTML, i18n("Run %1").arg(desktop.readName()), "desktop://" + url.path(), desktop.readIcon()); + MetabarWidget::addEntry(innerHTML, i18n("Run %1").tqarg(desktop.readName()), "desktop://" + url.path(), desktop.readIcon()); m_functions->show("open"); } @@ -184,7 +184,7 @@ void DefaultPlugin::loadApplications(DOM::HTMLElement node) nam.setNum(id); bool hide = id >= max; - MetabarWidget::addEntry(innerHTML, (*it)->name(), "exec://" + nam, (*it)->icon(), TQString::null, hide ? TQString("hiddenapp") : TQString::null, hide); + MetabarWidget::addEntry(innerHTML, (*it)->name(), "exec://" + nam, (*it)->icon(), TQString(), hide ? TQString("hiddenapp") : TQString(), hide); runMap.insert(id, *it); id++; @@ -294,11 +294,11 @@ void DefaultPlugin::loadInformation(DOM::HTMLElement node) innerHTML += "<ul class=\"info\"><b>" + i18n("Size") + ": </b>"; innerHTML += KIO::convertSize(size); innerHTML += "</ul><ul class=\"info\"><b>" + i18n("Files") + ": </b>"; - innerHTML += TQString().setNum(files); + innerHTML += TQString(TQString().setNum(files)); innerHTML += "</ul><ul class=\"info\"><b>" + i18n("Folders") + ": </b>"; - innerHTML += TQString().setNum(dirs); + innerHTML += TQString(TQString().setNum(dirs)); innerHTML += "</ul><ul class=\"info\"><b>" + i18n("Total Entries") + ": </b>"; - innerHTML += TQString().setNum(m_items.count()); + innerHTML += TQString(TQString().setNum(m_items.count())); innerHTML += "</ul>"; node.setInnerHTML(innerHTML); } @@ -364,12 +364,12 @@ void DefaultPlugin::slotSetPreview(const KFileItem *item, const TQPixmap &pix) buffer.open(IO_WriteOnly); pix.save(&buffer, "PNG"); - TQString src = TQString::fromLatin1("data:image/png;base64,%1").arg(KCodecs::base64Encode(data)); + TQString src = TQString::tqfromLatin1("data:image/png;base64,%1").tqarg(KCodecs::base64Encode(data).data()); bool media = item->mimetype().startsWith("video/"); DOM::DOMString innerHTML; - innerHTML += TQString("<ul style=\"height: %1px\"><a class=\"preview\"").arg(pix.height() + 15); + innerHTML += TQString("<ul style=\"height: %1px\"><a class=\"preview\"").tqarg(pix.height() + 15); if(media){ innerHTML += " href=\"preview:///\""; @@ -377,9 +377,9 @@ void DefaultPlugin::slotSetPreview(const KFileItem *item, const TQPixmap &pix) innerHTML +="><img id=\"previewimage\" src=\""; innerHTML += src; innerHTML += "\" width=\""; - innerHTML += TQString().setNum(pix.width()); + innerHTML += TQString(TQString().setNum(pix.width())); innerHTML += "\" height=\""; - innerHTML += TQString().setNum(pix.height()); + innerHTML += TQString(TQString().setNum(pix.height())); innerHTML += "\" /></a></ul>"; if(media){ @@ -418,7 +418,7 @@ bool DefaultPlugin::handleRequest(const KURL &url) if(protocol == "exec"){ int id = url.host().toInt(); - TQMap<int,KService::Ptr>::Iterator it = runMap.find(id); + TQMap<int,KService::Ptr>::Iterator it = runMap.tqfind(id); if(it != runMap.end()){ KFileItem *item = m_items.getFirst(); diff --git a/konq-plugins/sidebar/metabar/src/defaultplugin.h b/konq-plugins/sidebar/metabar/src/defaultplugin.h index 319d771..7705728 100644 --- a/konq-plugins/sidebar/metabar/src/defaultplugin.h +++ b/konq-plugins/sidebar/metabar/src/defaultplugin.h @@ -32,6 +32,7 @@ class DefaultPlugin : public ProtocolPlugin { Q_OBJECT + TQ_OBJECT public: DefaultPlugin(KHTMLPart* html, MetabarFunctions *functions, const char *name = 0); diff --git a/konq-plugins/sidebar/metabar/src/httpplugin.cpp b/konq-plugins/sidebar/metabar/src/httpplugin.cpp index bbfb9e2..b90852d 100644 --- a/konq-plugins/sidebar/metabar/src/httpplugin.cpp +++ b/konq-plugins/sidebar/metabar/src/httpplugin.cpp @@ -60,10 +60,10 @@ void HTTPPlugin::killJobs() void HTTPPlugin::loadInformation(DOM::HTMLElement node) { /*DOM::DOMString innerHTML; - innerHTML += "<form action=\"find:///\" method=\"GET\">"; + innerHTML += "<form action=\"tqfind:///\" method=\"GET\">"; innerHTML += "<ul>"; innerHTML += i18n("Keyword"); - innerHTML += " <input onFocus=\"this.value = ''\" type=\"text\" name=\"find\" id=\"find_text\" value=\""; + innerHTML += " <input onFocus=\"this.value = ''\" type=\"text\" name=\"tqfind\" id=\"find_text\" value=\""; innerHTML += i18n("Web search"); innerHTML += "\"></ul>"; innerHTML += "<ul><input type=\"submit\" id=\"find_button\" value=\""; @@ -99,15 +99,15 @@ void HTTPPlugin::loadBookmarks(DOM::HTMLElement node) bool HTTPPlugin::handleRequest(const KURL &url) { - if(url.protocol() == "find"){ - TQString keyword = url.queryItem("find"); + if(url.protocol() == "tqfind"){ + TQString keyword = url.queryItem("tqfind"); TQString type = url.queryItem("type"); if(!keyword.isNull() && !keyword.isEmpty()){ KURL url("http://www.google.com/search"); url.addQueryItem("q", keyword); - DCOPRef ref(kapp->dcopClient()->appId(), m_html->view()->topLevelWidget()->name()); + DCOPRef ref(kapp->dcopClient()->appId(), m_html->view()->tqtopLevelWidget()->name()); DCOPReply reply = ref.call("openURL", url.url()); } diff --git a/konq-plugins/sidebar/metabar/src/httpplugin.h b/konq-plugins/sidebar/metabar/src/httpplugin.h index 0d7d3ab..a654816 100644 --- a/konq-plugins/sidebar/metabar/src/httpplugin.h +++ b/konq-plugins/sidebar/metabar/src/httpplugin.h @@ -31,6 +31,7 @@ class HTTPPlugin : public ProtocolPlugin { Q_OBJECT + TQ_OBJECT public: HTTPPlugin(KHTMLPart* html, MetabarFunctions *functions, const char *name = 0); diff --git a/konq-plugins/sidebar/metabar/src/metabar.cpp b/konq-plugins/sidebar/metabar/src/metabar.cpp index 6a020f0..bc7d978 100644 --- a/konq-plugins/sidebar/metabar/src/metabar.cpp +++ b/konq-plugins/sidebar/metabar/src/metabar.cpp @@ -7,8 +7,8 @@ #include "metabar.h" #include "metabar.moc" -Metabar::Metabar(KInstance *inst,TQObject *parent,TQWidget *widgetParent, TQString &desktopName, const char* name): - KonqSidebarPlugin(inst,parent,widgetParent,desktopName,name) +Metabar::Metabar(KInstance *inst,TQObject *tqparent,TQWidget *widgetParent, TQString &desktopName, const char* name): + KonqSidebarPlugin(inst,tqparent,widgetParent,desktopName,name) { KImageIO::registerFormats(); KGlobal::locale()->insertCatalogue( "konqsidebar_metabar" ); diff --git a/konq-plugins/sidebar/metabar/src/metabar.h b/konq-plugins/sidebar/metabar/src/metabar.h index d4bb63f..bb2387b 100644 --- a/konq-plugins/sidebar/metabar/src/metabar.h +++ b/konq-plugins/sidebar/metabar/src/metabar.h @@ -13,9 +13,10 @@ class Metabar : public KonqSidebarPlugin { Q_OBJECT + TQ_OBJECT public: - Metabar(KInstance *inst,TQObject *parent,TQWidget *widgetParent, TQString &desktopName, const char* name=0); + Metabar(KInstance *inst,TQObject *tqparent,TQWidget *widgetParent, TQString &desktopName, const char* name=0); ~Metabar(); virtual TQWidget *getWidget(){ return widget; } diff --git a/konq-plugins/sidebar/metabar/src/metabarfunctions.cpp b/konq-plugins/sidebar/metabar/src/metabarfunctions.cpp index 1aaf9e8..d184f58 100644 --- a/konq-plugins/sidebar/metabar/src/metabarfunctions.cpp +++ b/konq-plugins/sidebar/metabar/src/metabarfunctions.cpp @@ -32,7 +32,7 @@ #define RESIZE_SPEED 5 #define RESIZE_STEP 2 -MetabarFunctions::MetabarFunctions(KHTMLPart *html, TQObject *parent, const char* name) : TQObject(parent, name), m_html(html) +MetabarFunctions::MetabarFunctions(KHTMLPart *html, TQObject *tqparent, const char* name) : TQObject(tqparent, name), m_html(html) { timer = new TQTimer(this); connect(timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(animate())); @@ -81,7 +81,7 @@ void MetabarFunctions::toggle(DOM::DOMString item) DOM::HTMLElement node = static_cast<DOM::HTMLElement>(doc.getElementById(item)); if(!node.isNull()){ - DOM::NodeList children = node.childNodes(); + DOM::NodeList tqchildren = node.childNodes(); DOM::CSSStyleDeclaration style = node.style(); DOM::DOMString expanded = node.getAttribute("expanded"); @@ -106,7 +106,7 @@ void MetabarFunctions::toggle(DOM::DOMString item) } } else{ - style.setProperty("height", TQString("%1px").arg(height), CSS_PRIORITY); + style.setProperty("height", TQString("%1px").tqarg(height), CSS_PRIORITY); } } } @@ -117,7 +117,7 @@ void MetabarFunctions::adjustSize(DOM::DOMString item) DOM::HTMLElement node = static_cast<DOM::HTMLElement>(doc.getElementById(item)); if(!node.isNull()){ - DOM::NodeList children = node.childNodes(); + DOM::NodeList tqchildren = node.childNodes(); DOM::CSSStyleDeclaration style = node.style(); DOM::DOMString expanded = node.getAttribute("expanded"); @@ -137,7 +137,7 @@ void MetabarFunctions::adjustSize(DOM::DOMString item) } } else{ - style.setProperty("height", TQString("%1px").arg(height), CSS_PRIORITY); + style.setProperty("height", TQString("%1px").tqarg(height), CSS_PRIORITY); } } } @@ -176,7 +176,7 @@ void MetabarFunctions::animate() } int change = currentHeight < height ? changeValue : -changeValue; - style.setProperty("height", TQString("%1px").arg(currentHeight + change), CSS_PRIORITY); + style.setProperty("height", TQString("%1px").tqarg(currentHeight + change), CSS_PRIORITY); doc.updateRendering(); } } @@ -187,9 +187,9 @@ void MetabarFunctions::show(DOM::DOMString item) DOM::HTMLDocument doc = m_html->htmlDocument(); DOM::HTMLElement node = static_cast<DOM::HTMLElement>(doc.getElementById(item)); if(!node.isNull()){ - DOM::HTMLElement parent = static_cast<DOM::HTMLElement>(node.parentNode()); + DOM::HTMLElement tqparent = static_cast<DOM::HTMLElement>(node.parentNode()); - DOM::CSSStyleDeclaration style = parent.style(); + DOM::CSSStyleDeclaration style = tqparent.style(); style.setProperty("display", "block", CSS_PRIORITY); } } @@ -199,9 +199,9 @@ void MetabarFunctions::hide(DOM::DOMString item) DOM::HTMLDocument doc = m_html->htmlDocument(); DOM::HTMLElement node = static_cast<DOM::HTMLElement>(doc.getElementById(item)); if(!node.isNull()){ - DOM::HTMLElement parent = static_cast<DOM::HTMLElement>(node.parentNode()); + DOM::HTMLElement tqparent = static_cast<DOM::HTMLElement>(node.parentNode()); - DOM::CSSStyleDeclaration style = parent.style(); + DOM::CSSStyleDeclaration style = tqparent.style(); style.setProperty("display", "none", CSS_PRIORITY); } } @@ -209,9 +209,9 @@ void MetabarFunctions::hide(DOM::DOMString item) int MetabarFunctions::getHeight(DOM::HTMLElement &element) { int height = 0; - DOM::NodeList children = element.childNodes(); - for(uint i = 0; i < children.length(); i++){ - DOM::HTMLElement node = static_cast<DOM::HTMLElement>(children.item(i)); + DOM::NodeList tqchildren = element.childNodes(); + for(uint i = 0; i < tqchildren.length(); i++){ + DOM::HTMLElement node = static_cast<DOM::HTMLElement>(tqchildren.item(i)); DOM::CSSStyleDeclaration style = node.style(); DOM::DOMString css_height = style.getPropertyValue("height"); diff --git a/konq-plugins/sidebar/metabar/src/metabarfunctions.h b/konq-plugins/sidebar/metabar/src/metabarfunctions.h index 1ccce3c..96742e5 100644 --- a/konq-plugins/sidebar/metabar/src/metabarfunctions.h +++ b/konq-plugins/sidebar/metabar/src/metabarfunctions.h @@ -29,12 +29,13 @@ #include <kurl.h> #include <khtml_part.h> -class MetabarFunctions : public QObject +class MetabarFunctions : public TQObject { Q_OBJECT + TQ_OBJECT public: - MetabarFunctions(KHTMLPart *html, TQObject *parent = 0, const char* name=0); + MetabarFunctions(KHTMLPart *html, TQObject *tqparent = 0, const char* name=0); ~MetabarFunctions(); void toggle(DOM::DOMString item); diff --git a/konq-plugins/sidebar/metabar/src/metabarwidget.cpp b/konq-plugins/sidebar/metabar/src/metabarwidget.cpp index bf074e8..965319e 100644 --- a/konq-plugins/sidebar/metabar/src/metabarwidget.cpp +++ b/konq-plugins/sidebar/metabar/src/metabarwidget.cpp @@ -73,7 +73,7 @@ #define EVENT_TYPE DOM::DOMString("click") #define ACTIVATION 1 -MetabarWidget::MetabarWidget(TQWidget *parent, const char *name) : TQWidget(parent, name) +MetabarWidget::MetabarWidget(TQWidget *tqparent, const char *name) : TQWidget(tqparent, name) { skip = false; loadComplete = false; @@ -94,14 +94,14 @@ MetabarWidget::MetabarWidget(TQWidget *parent, const char *name) : TQWidget(pare html->setCaretVisible(false); html->setDNDEnabled(false); html->setJavaEnabled(false); - html->view()->setSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Expanding); + html->view()->tqsetSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Expanding); html->view()->hide(); connect(html->browserExtension(), TQT_SIGNAL(openURLRequest( const KURL &, const KParts::URLArgs & )), this, TQT_SLOT(handleURLRequest(const KURL &, const KParts::URLArgs &))); connect(html, TQT_SIGNAL(completed()), this, TQT_SLOT(loadCompleted())); connect(html, TQT_SIGNAL(popupMenu(const TQString &, const TQPoint &)), this, TQT_SLOT(slotShowPopup(const TQString&, const TQPoint &))); - functions = new MetabarFunctions(html, this); + functions = new MetabarFunctions(html, TQT_TQOBJECT(this)); currentPlugin = 0; defaultPlugin = new DefaultPlugin(html, functions); @@ -114,14 +114,14 @@ MetabarWidget::MetabarWidget(TQWidget *parent, const char *name) : TQWidget(pare plugins.insert("http", httpPlugin); plugins.insert("https", httpPlugin); - TQVBoxLayout *layout = new TQVBoxLayout(this); - layout->addWidget(html->view()); + TQVBoxLayout *tqlayout = new TQVBoxLayout(this); + tqlayout->addWidget(html->view()); popup = new KPopupMenu(0); - KAction *configAction = new KAction(i18n("Configure %1...").arg("Metabar"), "configure", KShortcut(), this, TQT_SLOT(slotShowConfig()), html->actionCollection(), "configure"); + KAction *configAction = new KAction(i18n("Configure %1...").tqarg("Metabar"), "configure", KShortcut(), TQT_TQOBJECT(this), TQT_SLOT(slotShowConfig()), html->actionCollection(), "configure"); configAction->plug(popup); - KAction *reloadAction = new KAction(i18n("Reload Theme"), "reload", KShortcut(), this, TQT_SLOT(setTheme()), html->actionCollection(), "reload"); + KAction *reloadAction = new KAction(i18n("Reload Theme"), "reload", KShortcut(), TQT_TQOBJECT(this), TQT_SLOT(setTheme()), html->actionCollection(), "reload"); reloadAction->plug(popup); setTheme(); @@ -210,12 +210,12 @@ void MetabarWidget::setFileItems(const KFileItemList &items, bool check) TQString MetabarWidget::getCurrentURL() { - DCOPRef ref(kapp->dcopClient()->appId(), this->topLevelWidget()->name()); + DCOPRef ref(kapp->dcopClient()->appId(), this->tqtopLevelWidget()->name()); DCOPReply reply = ref.call("currentURL()"); if (reply.isValid()) { TQString url; - reply.get(url, "TQString"); + reply.get(url, TQSTRING_OBJECT_NAME_STRING); if(!url.isNull() && !url.isEmpty()){ return url; @@ -226,19 +226,19 @@ TQString MetabarWidget::getCurrentURL() void MetabarWidget::openURL(const TQString &url) { - DCOPRef ref(kapp->dcopClient()->appId(), this->topLevelWidget()->name()); + DCOPRef ref(kapp->dcopClient()->appId(), this->tqtopLevelWidget()->name()); DCOPReply reply = ref.call("openURL", url); } void MetabarWidget::openTab(const TQString &url) { - DCOPRef ref(kapp->dcopClient()->appId(), this->topLevelWidget()->name()); + DCOPRef ref(kapp->dcopClient()->appId(), this->tqtopLevelWidget()->name()); DCOPReply reply = ref.call("newTab", url); } void MetabarWidget::callAction(const TQString &action) { - DCOPRef ref(kapp->dcopClient()->appId(), TQString(this->topLevelWidget()->name()).append("/action/").append(action).utf8()); + DCOPRef ref(kapp->dcopClient()->appId(), TQString(TQString(this->tqtopLevelWidget()->name()).append("/action/").append(action)).utf8()); if(ref.call("enabled()")){ ref.call("activate()"); } @@ -289,7 +289,7 @@ void MetabarWidget::loadCompleted() if(node.hasAttribute("image")){ TQString icon = node.getAttribute("image").string(); TQString url = getIconPath(icon); - TQString style = TQString("background-image: url(%1);").arg(url); + TQString style = TQString("background-image: url(%1);").tqarg(url); node.setAttribute("style", style); } @@ -308,7 +308,7 @@ void MetabarWidget::loadCompleted() } config->setGroup("General"); - TQString file = locate("data", TQString("metabar/themes/%1/default.css").arg(config->readEntry("Theme", "default"))); + TQString file = locate("data", TQString("metabar/themes/%1/default.css").tqarg(config->readEntry("Theme", "default"))); if(file.isNull()){ file = locate("data", TQString("metabar/themes/default/default.css")); } @@ -319,7 +319,7 @@ void MetabarWidget::loadCompleted() TQString tmp = stream.read(); cssfile.close(); - tmp.replace("./", KURL::fromPathOrURL(file).directory(false)); + tmp.tqreplace("./", KURL::fromPathOrURL(file).directory(false)); html->setUserStyleSheet(tmp); } @@ -393,15 +393,15 @@ void MetabarWidget::handleURLRequest(const KURL &url, const KParts::URLArgs &arg skip = true; //needed to prevent some weired reload DOM::DOMString innerHTML; - innerHTML += TQString("<ul style=\"width: %1px; height: %1px\">").arg(image.width(), image.height()); + innerHTML += TQString("<ul style=\"width: %1px; height: %1px\">").tqarg(image.width(), image.height()); innerHTML += "<object class=\"preview\" type=\""; innerHTML += item->mimetype(); innerHTML += "\" data=\""; innerHTML += item->url().url(); innerHTML += "\" width=\""; - innerHTML += TQString().setNum(image.width()); + innerHTML += TQString(TQString().setNum(image.width())); innerHTML += "\" height=\""; - innerHTML += TQString().setNum(image.height()); + innerHTML += TQString(TQString().setNum(image.height())); innerHTML += "\" /></ul>"; node.setInnerHTML(innerHTML); } @@ -419,8 +419,8 @@ void MetabarWidget::handleURLRequest(const KURL &url, const KParts::URLArgs &arg for(uint i = 0; i < list.length(); i++){ DOM::HTMLElement node = static_cast<DOM::HTMLElement>(list.item(i)); if(!node.isNull()){ - DOM::HTMLElement parent = static_cast<DOM::HTMLElement>(node.parentNode()); - DOM::CSSStyleDeclaration style = parent.style(); + DOM::HTMLElement tqparent = static_cast<DOM::HTMLElement>(node.parentNode()); + DOM::CSSStyleDeclaration style = tqparent.style(); DOM::DOMString display = style.getPropertyValue("display"); DOM::DOMString newDisplay = display == "none" ? "block" : "none"; @@ -431,13 +431,13 @@ void MetabarWidget::handleURLRequest(const KURL &url, const KParts::URLArgs &arg } if(element.id().string().startsWith("hidden")){ - TQString style = TQString("background-image: url(%1);").arg(getIconPath(showMore ? "1downarrow" : "1uparrow")); + TQString style = TQString("background-image: url(%1);").tqarg(getIconPath(showMore ? "1downarrow" : "1uparrow")); element.setInnerText( showMore ? i18n("More") : i18n("Less") ); element.setAttribute("style", style); } - DOM::HTMLElement parent = static_cast<DOM::HTMLElement>(element.parentNode().parentNode()); - functions->adjustSize(parent.id()); + DOM::HTMLElement tqparent = static_cast<DOM::HTMLElement>(element.parentNode().parentNode()); + functions->adjustSize(tqparent.id()); } else if(protocol == "function"){ @@ -475,7 +475,7 @@ TQString MetabarWidget::getIconPath(const TQString &name) buffer.open(IO_WriteOnly); icon.save(&buffer, "PNG"); - return TQString::fromLatin1("data:image/png;base64,%1").arg(KCodecs::base64Encode(data)); + return TQString::tqfromLatin1("data:image/png;base64,%1").tqarg(KCodecs::base64Encode(data).data()); } void MetabarWidget::slotShowSharingDialog() @@ -584,7 +584,7 @@ void MetabarWidget::setTheme() loadComplete = false; config->setGroup("General"); - TQString file = locate("data", TQString("metabar/themes/%1/layout.html").arg(config->readEntry("Theme", "default"))); + TQString file = locate("data", TQString("metabar/themes/%1/tqlayout.html").tqarg(config->readEntry("Theme", "default"))); html->openURL(KURL(file)); } diff --git a/konq-plugins/sidebar/metabar/src/metabarwidget.h b/konq-plugins/sidebar/metabar/src/metabarwidget.h index e88a003..4f6d21b 100644 --- a/konq-plugins/sidebar/metabar/src/metabarwidget.h +++ b/konq-plugins/sidebar/metabar/src/metabarwidget.h @@ -35,18 +35,19 @@ #include "protocolplugin.h" #include "metabarfunctions.h" -class MetabarWidget : public QWidget +class MetabarWidget : public TQWidget { Q_OBJECT + TQ_OBJECT public: - MetabarWidget(TQWidget *parent = 0, const char* name=0); + MetabarWidget(TQWidget *tqparent = 0, const char* name=0); ~MetabarWidget(); void setFileItems(const KFileItemList &items, bool check = true); static TQString getIconPath(const TQString &name); - static void addEntry(DOM::DOMString &html, const TQString name, const TQString url, const TQString icon, const TQString id = TQString::null, const TQString nameatt = TQString::null, bool hidden = false); + static void addEntry(DOM::DOMString &html, const TQString name, const TQString url, const TQString icon, const TQString id = TQString(), const TQString nameatt = TQString(), bool hidden = false); private: KFileItemList *currentItems; diff --git a/konq-plugins/sidebar/metabar/src/protocolplugin.cpp b/konq-plugins/sidebar/metabar/src/protocolplugin.cpp index 99f5b31..333aab5 100644 --- a/konq-plugins/sidebar/metabar/src/protocolplugin.cpp +++ b/konq-plugins/sidebar/metabar/src/protocolplugin.cpp @@ -71,7 +71,7 @@ void ProtocolPlugin::setFileItems(const KFileItemList &items) TQBuffer buffer(data); buffer.open(IO_WriteOnly); pix.save(&buffer, "PNG"); - TQString icondata = TQString::fromLatin1("data:image/png;base64,%1").arg(KCodecs::base64Encode(data)); + TQString icondata = TQString::tqfromLatin1("data:image/png;base64,%1").tqarg(KCodecs::base64Encode(data).data()); icon.setSrc(icondata); } @@ -81,7 +81,7 @@ void ProtocolPlugin::setFileItems(const KFileItemList &items) name.setInnerText(m_items.getFirst()->name()); } else{ - name.setInnerText(i18n("%1 Elements").arg(m_items.count())); + name.setInnerText(i18n("%1 Elements").tqarg(m_items.count())); } } @@ -105,7 +105,7 @@ void ProtocolPlugin::setFileItems(const KFileItemList &items) } } - type.setInnerText(i18n("%1 Folders, %2 Files").arg(dirs).arg(files)); + type.setInnerText(i18n("%1 Folders, %2 Files").tqarg(dirs).tqarg(files)); } diff --git a/konq-plugins/sidebar/metabar/src/protocolplugin.h b/konq-plugins/sidebar/metabar/src/protocolplugin.h index 7fb76b3..81ed149 100644 --- a/konq-plugins/sidebar/metabar/src/protocolplugin.h +++ b/konq-plugins/sidebar/metabar/src/protocolplugin.h @@ -28,8 +28,9 @@ #include "metabarfunctions.h" -class ProtocolPlugin : public QObject{ +class ProtocolPlugin : public TQObject{ Q_OBJECT + TQ_OBJECT public: static ProtocolPlugin* activePlugin; diff --git a/konq-plugins/sidebar/metabar/src/remoteplugin.h b/konq-plugins/sidebar/metabar/src/remoteplugin.h index dc42bed..61a1b00 100644 --- a/konq-plugins/sidebar/metabar/src/remoteplugin.h +++ b/konq-plugins/sidebar/metabar/src/remoteplugin.h @@ -26,6 +26,7 @@ class RemotePlugin : public DefaultPlugin { Q_OBJECT + TQ_OBJECT public: RemotePlugin(KHTMLPart* html, MetabarFunctions *functions, const char *name = 0); diff --git a/konq-plugins/sidebar/metabar/src/serviceloader.cpp b/konq-plugins/sidebar/metabar/src/serviceloader.cpp index 1b59527..c9ac8b4 100644 --- a/konq-plugins/sidebar/metabar/src/serviceloader.cpp +++ b/konq-plugins/sidebar/metabar/src/serviceloader.cpp @@ -37,7 +37,7 @@ #include <kstandarddirs.h> -ServiceLoader::ServiceLoader(TQWidget *parent, const char *name) : TQObject(parent, name) +ServiceLoader::ServiceLoader(TQWidget *tqparent, const char *name) : TQObject(tqparent, name) { popups.setAutoDelete(true); } @@ -52,7 +52,7 @@ void ServiceLoader::loadServices(const KFileItem item, DOM::DOMString &html, int KURL url = item.url(); TQString mimeType = item.mimetype(); - TQString mimeGroup = mimeType.left(mimeType.find('/')); + TQString mimeGroup = mimeType.left(mimeType.tqfind('/')); urlList.clear(); urlList.append(url); @@ -96,7 +96,7 @@ void ServiceLoader::loadServices(const KFileItem item, DOM::DOMString &html, int if(cfg.hasKey("X-KDE-Require")){ const TQStringList capabilities = cfg.readListEntry( "X-KDE-Require" ); - if (capabilities.contains( "Write" )){ + if (capabilities.tqcontains( "Write" )){ continue; } } @@ -123,7 +123,7 @@ void ServiceLoader::loadServices(const KFileItem item, DOM::DOMString &html, int // if we have a mimetype, see if we have an exact or a type globbed match if(!ok && (!mimeType.isEmpty() && *it == mimeType) || - (!mimeGroup.isEmpty() && ((*it).right(1) == "*" && (*it).left((*it).find('/')) == mimeGroup))) + (!mimeGroup.isEmpty() && ((*it).right(1) == "*" && (*it).left((*it).tqfind('/')) == mimeGroup))) { checkTheMimetypes = true; } @@ -132,7 +132,7 @@ void ServiceLoader::loadServices(const KFileItem item, DOM::DOMString &html, int ok = true; for(TQStringList::ConstIterator itex = excludeTypes.begin(); itex != excludeTypes.end(); ++itex){ - if( ((*itex).right(1) == "*" && (*itex).left((*itex).find('/')) == mimeGroup) || + if( ((*itex).right(1) == "*" && (*itex).left((*itex).tqfind('/')) == mimeGroup) || ((*itex) == mimeType)) { ok = false; @@ -154,7 +154,7 @@ void ServiceLoader::loadServices(const KFileItem item, DOM::DOMString &html, int popup = popups[submenuName]; } else{ - MetabarWidget::addEntry(html, submenuName, "servicepopup://" + idString, "1rightarrow", "popup" + idString, count < maxActions ? TQString::null : TQString("hiddenaction"), count >= maxActions); + MetabarWidget::addEntry(html, submenuName, "servicepopup://" + idString, "1rightarrow", "popup" + idString, count < maxActions ? TQString() : TQString("hiddenaction"), count >= maxActions); popup = new KPopupMenu(); popups.insert(idString, popup); @@ -168,11 +168,11 @@ void ServiceLoader::loadServices(const KFileItem item, DOM::DOMString &html, int for (TQValueList<KDEDesktopMimeType::Service>::iterator it = list.begin(); it != list.end(); ++it){ if(usePopup){ - KAction *action = new KAction((*it).m_strName, (*it).m_strIcon, KShortcut(), this, TQT_SLOT(runAction()), popup, idString.utf8()); + KAction *action = new KAction((*it).m_strName, (*it).m_strIcon, KShortcut(), TQT_TQOBJECT(this), TQT_SLOT(runAction()), TQT_TQOBJECT(popup), idString.utf8()); action->plug(popup); } else{ - MetabarWidget::addEntry(html, (*it).m_strName, "service://" + idString, (*it).m_strIcon, TQString::null, count < maxActions ? TQString::null : TQString("hiddenaction"), count >= maxActions); + MetabarWidget::addEntry(html, (*it).m_strName, "service://" + idString, (*it).m_strIcon, TQString(), count < maxActions ? TQString() : TQString("hiddenaction"), count >= maxActions); count++; } @@ -188,7 +188,7 @@ void ServiceLoader::loadServices(const KFileItem item, DOM::DOMString &html, int void ServiceLoader::runAction() { - KDEDesktopMimeType::Service s = services[sender()->name()]; + KDEDesktopMimeType::Service s = services[TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>(sender()))->name()]; if(!s.isEmpty()){ KDEDesktopMimeType::executeService(urlList, s); } diff --git a/konq-plugins/sidebar/metabar/src/serviceloader.h b/konq-plugins/sidebar/metabar/src/serviceloader.h index 527ea97..31f1366 100644 --- a/konq-plugins/sidebar/metabar/src/serviceloader.h +++ b/konq-plugins/sidebar/metabar/src/serviceloader.h @@ -35,12 +35,13 @@ #include "metabarwidget.h" -class ServiceLoader : public QObject +class ServiceLoader : public TQObject { Q_OBJECT + TQ_OBJECT public: - ServiceLoader(TQWidget *parent, const char *name = 0); + ServiceLoader(TQWidget *tqparent, const char *name = 0); ~ServiceLoader(); void loadServices(const KFileItem item, DOM::DOMString &html, int &count); diff --git a/konq-plugins/sidebar/metabar/src/settingsplugin.h b/konq-plugins/sidebar/metabar/src/settingsplugin.h index c1d1cb8..9581e1e 100644 --- a/konq-plugins/sidebar/metabar/src/settingsplugin.h +++ b/konq-plugins/sidebar/metabar/src/settingsplugin.h @@ -29,6 +29,7 @@ class SettingsPlugin : public ProtocolPlugin { Q_OBJECT + TQ_OBJECT public: SettingsPlugin(KHTMLPart* html, MetabarFunctions *functions, const char *name = 0); |