summaryrefslogtreecommitdiffstats
path: root/konq-plugins/sidebar/metabar/src/defaultplugin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'konq-plugins/sidebar/metabar/src/defaultplugin.cpp')
-rw-r--r--konq-plugins/sidebar/metabar/src/defaultplugin.cpp80
1 files changed, 40 insertions, 40 deletions
diff --git a/konq-plugins/sidebar/metabar/src/defaultplugin.cpp b/konq-plugins/sidebar/metabar/src/defaultplugin.cpp
index d6c44c1..6c3982e 100644
--- a/konq-plugins/sidebar/metabar/src/defaultplugin.cpp
+++ b/konq-plugins/sidebar/metabar/src/defaultplugin.cpp
@@ -41,11 +41,11 @@
#include <dcopclient.h>
#include <dcopref.h>
-#include <qdir.h>
-#include <qfile.h>
-#include <qrect.h>
-#include <qpoint.h>
-#include <qbuffer.h>
+#include <tqdir.h>
+#include <tqfile.h>
+#include <tqrect.h>
+#include <tqpoint.h>
+#include <tqbuffer.h>
#include <dom_string.h>
#include <html_image.h>
@@ -92,26 +92,26 @@ void DefaultPlugin::loadActions(DOM::HTMLElement node)
DOM::DOMString innerHTML;
- QStringList actions = config.readListEntry("Actions");
+ TQStringList actions = config.readListEntry("Actions");
int maxActions = config.readNumEntry("MaxActions", 5);
int actionCount = 0;
- for(QStringList::Iterator it = actions.begin(); it != actions.end(); ++it){
+ 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", QString::null, actionCount < maxActions ? QString::null : QString("hiddenaction"), actionCount >= maxActions);
+ MetabarWidget::addEntry(innerHTML, i18n("Share"), "action://" + *it, "network", TQString::null, actionCount < maxActions ? TQString::null : TQString("hiddenaction"), actionCount >= maxActions);
actionCount++;
}
}
else{
- DCOPRef action(kapp->dcopClient()->appId(), QCString(m_html->view()->topLevelWidget()->name()).append("/action/").append((*it).utf8()));
+ DCOPRef action(kapp->dcopClient()->appId(), TQCString(m_html->view()->topLevelWidget()->name()).append("/action/").append((*it).utf8()));
if(!action.isNull()){
if(action.call("enabled()")){
- QString text = action.call("plainText()");
- QString icon = iconConfig.readEntry(*it, action.call("icon()"));
+ TQString text = action.call("plainText()");
+ TQString icon = iconConfig.readEntry(*it, action.call("icon()"));
- MetabarWidget::addEntry(innerHTML, text, "action://" + *it, icon, QString::null, actionCount < maxActions ? QString::null : QString("hiddenaction"), actionCount >= maxActions);
+ MetabarWidget::addEntry(innerHTML, text, "action://" + *it, icon, TQString::null, actionCount < maxActions ? TQString::null : TQString("hiddenaction"), actionCount >= maxActions);
actionCount++;
}
}
@@ -142,7 +142,7 @@ void DefaultPlugin::loadApplications(DOM::HTMLElement node)
KFileItem *item = m_items.getFirst();
KURL url = item->url();
- QDir dir(url.path());
+ TQDir dir(url.path());
dir = dir.canonicalPath();
if(item->isDir() || dir.isRoot()){
@@ -180,11 +180,11 @@ void DefaultPlugin::loadApplications(DOM::HTMLElement node)
KTrader::OfferList::ConstIterator it = offers.begin();
for(; it != offers.end(); it++){
- QString nam;
+ TQString nam;
nam.setNum(id);
bool hide = id >= max;
- MetabarWidget::addEntry(innerHTML, (*it)->name(), "exec://" + nam, (*it)->icon(), QString::null, hide ? QString("hiddenapp") : QString::null, hide);
+ MetabarWidget::addEntry(innerHTML, (*it)->name(), "exec://" + nam, (*it)->icon(), TQString::null, hide ? TQString("hiddenapp") : TQString::null, hide);
runMap.insert(id, *it);
id++;
@@ -241,21 +241,21 @@ void DefaultPlugin::loadInformation(DOM::HTMLElement node)
if(!item->isDir()){
const KFileMetaInfo &metaInfo = item->metaInfo();
if(metaInfo.isValid()){
- QStringList groups = metaInfo.supportedGroups();
+ TQStringList groups = metaInfo.supportedGroups();
int id = 0;
- QString nam;
+ TQString nam;
- for(QStringList::ConstIterator it = groups.begin(); it != groups.end(); ++it){
+ for(TQStringList::ConstIterator it = groups.begin(); it != groups.end(); ++it){
KFileMetaInfoGroup group = metaInfo.group(*it);
if(group.isValid()){
nam.setNum(id);
innerHTML += "<ul class=\"info\"><a class=\"infotitle\" id=\"info_" + nam + "\" href=\"more://info_" + nam + "\">" + group.translatedName() + "</a></ul>";
- QStringList keys = group.supportedKeys();
+ TQStringList keys = group.supportedKeys();
- for(QStringList::ConstIterator it = keys.begin(); it != keys.end(); ++it){
+ for(TQStringList::ConstIterator it = keys.begin(); it != keys.end(); ++it){
const KFileMetaInfoItem metaInfoItem = group.item(*it);
if(metaInfoItem.isValid()){
@@ -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 += QString().setNum(files);
+ innerHTML += TQString().setNum(files);
innerHTML += "</ul><ul class=\"info\"><b>" + i18n("Folders") + ": </b>";
- innerHTML += QString().setNum(dirs);
+ innerHTML += TQString().setNum(dirs);
innerHTML += "</ul><ul class=\"info\"><b>" + i18n("Total Entries") + ": </b>";
- innerHTML += QString().setNum(m_items.count());
+ innerHTML += TQString().setNum(m_items.count());
innerHTML += "</ul>";
node.setInnerHTML(innerHTML);
}
@@ -311,7 +311,7 @@ void DefaultPlugin::loadPreview(DOM::HTMLElement node)
KFileItem *item = m_items.getFirst();
KURL url = item->url();
- QDir dir(url.path());
+ TQDir dir(url.path());
dir = dir.canonicalPath();
if(item->isDir() || dir.isRoot()){
@@ -336,9 +336,9 @@ void DefaultPlugin::loadPreview(DOM::HTMLElement node)
preview_job = KIO::filePreview(KURL::List(url), m_html->view()->width() - 30);
- connect(preview_job, SIGNAL(gotPreview(const KFileItem*, const QPixmap&)), this, SLOT(slotSetPreview(const KFileItem*, const QPixmap&)));
- connect(preview_job, SIGNAL(failed(const KFileItem *)), this, SLOT(slotPreviewFailed(const KFileItem *)));
- connect(preview_job, SIGNAL(result(KIO::Job *)), this, SLOT(slotJobFinished(KIO::Job *)));
+ connect(preview_job, TQT_SIGNAL(gotPreview(const KFileItem*, const TQPixmap&)), this, TQT_SLOT(slotSetPreview(const KFileItem*, const TQPixmap&)));
+ connect(preview_job, TQT_SIGNAL(failed(const KFileItem *)), this, TQT_SLOT(slotPreviewFailed(const KFileItem *)));
+ connect(preview_job, TQT_SIGNAL(result(KIO::Job *)), this, TQT_SLOT(slotJobFinished(KIO::Job *)));
}
m_functions->show("preview");
@@ -354,22 +354,22 @@ void DefaultPlugin::loadBookmarks(DOM::HTMLElement node)
m_functions->hide("bookmarks");
}
-void DefaultPlugin::slotSetPreview(const KFileItem *item, const QPixmap &pix)
+void DefaultPlugin::slotSetPreview(const KFileItem *item, const TQPixmap &pix)
{
DOM::HTMLDocument doc = m_html->htmlDocument();
DOM::HTMLElement node = doc.getElementById("preview");
- QByteArray data;
- QBuffer buffer(data);
+ TQByteArray data;
+ TQBuffer buffer(data);
buffer.open(IO_WriteOnly);
pix.save(&buffer, "PNG");
- QString src = QString::fromLatin1("data:image/png;base64,%1").arg(KCodecs::base64Encode(data));
+ TQString src = TQString::fromLatin1("data:image/png;base64,%1").arg(KCodecs::base64Encode(data));
bool media = item->mimetype().startsWith("video/");
DOM::DOMString innerHTML;
- innerHTML += QString("<ul style=\"height: %1px\"><a class=\"preview\"").arg(pix.height() + 15);
+ innerHTML += TQString("<ul style=\"height: %1px\"><a class=\"preview\"").arg(pix.height() + 15);
if(media){
innerHTML += " href=\"preview:///\"";
@@ -377,9 +377,9 @@ void DefaultPlugin::slotSetPreview(const KFileItem *item, const QPixmap &pix)
innerHTML +="><img id=\"previewimage\" src=\"";
innerHTML += src;
innerHTML += "\" width=\"";
- innerHTML += QString().setNum(pix.width());
+ innerHTML += TQString().setNum(pix.width());
innerHTML += "\" height=\"";
- innerHTML += QString().setNum(pix.height());
+ innerHTML += TQString().setNum(pix.height());
innerHTML += "\" /></a></ul>";
if(media){
@@ -413,12 +413,12 @@ void DefaultPlugin::slotJobFinished(KIO::Job *job)
bool DefaultPlugin::handleRequest(const KURL &url)
{
- QString protocol = url.protocol();
+ TQString protocol = url.protocol();
if(protocol == "exec"){
int id = url.host().toInt();
- QMap<int,KService::Ptr>::Iterator it = runMap.find(id);
+ TQMap<int,KService::Ptr>::Iterator it = runMap.find(id);
if(it != runMap.end()){
KFileItem *item = m_items.getFirst();
@@ -430,21 +430,21 @@ bool DefaultPlugin::handleRequest(const KURL &url)
}
else if(protocol == "service"){
- QString name = url.url().right(url.url().length() - 10);
+ TQString name = url.url().right(url.url().length() - 10);
services->runAction(name);
return true;
}
else if(protocol == "servicepopup"){
- QString id = url.host();
+ TQString id = url.host();
DOM::HTMLDocument doc = m_html->htmlDocument();
DOM::HTMLElement node = static_cast<DOM::HTMLElement>(doc.getElementById("popup" + id));
if(!node.isNull()){
- QRect rect = node.getRect();
- QPoint p = m_html->view()->mapToGlobal(rect.bottomLeft());
+ TQRect rect = node.getRect();
+ TQPoint p = m_html->view()->mapToGlobal(rect.bottomLeft());
services->showPopup(id, p);
}