From e985f7e545f4739493965aad69bbecb136dc9346 Mon Sep 17 00:00:00 2001 From: tpearson Date: Thu, 16 Jun 2011 19:02:47 +0000 Subject: TQt4 port kdewebdev This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdewebdev@1237029 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- quanta/plugins/pluginconfig.ui | 46 ++++++++++++++++---------------- quanta/plugins/plugineditor.ui | 26 +++++++++--------- quanta/plugins/quantaplugin.cpp | 10 +++---- quanta/plugins/quantaplugin.h | 5 ++-- quanta/plugins/quantapluginconfig.cpp | 2 +- quanta/plugins/quantapluginconfig.h | 1 + quanta/plugins/quantaplugineditor.cpp | 12 ++++----- quanta/plugins/quantaplugineditor.h | 3 ++- quanta/plugins/quantaplugininterface.cpp | 14 +++++----- quanta/plugins/quantaplugininterface.h | 9 ++++--- 10 files changed, 66 insertions(+), 62 deletions(-) (limited to 'quanta/plugins') diff --git a/quanta/plugins/pluginconfig.ui b/quanta/plugins/pluginconfig.ui index a4cc6052..03f6de6d 100644 --- a/quanta/plugins/pluginconfig.ui +++ b/quanta/plugins/pluginconfig.ui @@ -11,7 +11,7 @@ (C) 2002 by Marc Britton <consume@optushome.com.au>, (C) 2003 by Andras Mantia <amantia@kde.org> - + PluginConfig @@ -23,7 +23,7 @@ 281 - + 560 280 @@ -36,7 +36,7 @@ unnamed - + validateCheckBox @@ -57,14 +57,14 @@ Expanding - + 247 20 - + GroupBox2 @@ -89,7 +89,7 @@ unnamed - + TextLabel3_2 @@ -97,7 +97,7 @@ Name: - + pluginName @@ -117,13 +117,13 @@ 0 - + 48 48 - + 48 48 @@ -133,7 +133,7 @@ - + TextLabel3 @@ -141,7 +141,7 @@ Location: - + location @@ -149,7 +149,7 @@ The exact location of the plugin. If not set the global search paths setting is used. - + pluginFileName @@ -157,7 +157,7 @@ The plugin executable or library name (with extension). - + TextLabel4_2 @@ -165,7 +165,7 @@ File name: - + outputWindow @@ -178,7 +178,7 @@ - + TextLabel1 @@ -186,11 +186,11 @@ Output window: - + locationButton - + 28 32767 @@ -200,7 +200,7 @@ ... - + readOnlyBox @@ -208,7 +208,7 @@ &Read only part - + textLabel1 @@ -216,7 +216,7 @@ Input: - + None @@ -259,11 +259,11 @@ kicondialog.h - + pluginType_highlighted(const QString&) slotPluginTypeHighlighted(const QString&) - - + + kicondialog.h diff --git a/quanta/plugins/plugineditor.ui b/quanta/plugins/plugineditor.ui index 104d9923..5188166c 100644 --- a/quanta/plugins/plugineditor.ui +++ b/quanta/plugins/plugineditor.ui @@ -10,7 +10,7 @@ ***************************************************************************/ - + pluginEditor @@ -22,7 +22,7 @@ 306 - + 500 224 @@ -41,7 +41,7 @@ 6 - + TextLabel6 @@ -49,7 +49,7 @@ Search paths: - + GroupBox3 @@ -66,7 +66,7 @@ 6 - + Name @@ -126,7 +126,7 @@ pluginList - + addButton @@ -137,7 +137,7 @@ true - + configureButton @@ -145,7 +145,7 @@ Configure... - + removeButton @@ -163,14 +163,14 @@ Expanding - + 20 67 - + refreshButton @@ -180,7 +180,7 @@ - + addSearchPathButton @@ -188,7 +188,7 @@ Add... - + searchPaths @@ -204,5 +204,5 @@ refreshButton pluginList - + diff --git a/quanta/plugins/quantaplugin.cpp b/quanta/plugins/quantaplugin.cpp index 628f38a7..bfed02c1 100644 --- a/quanta/plugins/quantaplugin.cpp +++ b/quanta/plugins/quantaplugin.cpp @@ -114,19 +114,19 @@ bool QuantaPlugin::load() TQString ow = outputWindow(); m_targetWidget = new TQWidget(quantaApp); if (m_readOnlyPart) - m_part = KParts::ComponentFactory::createPartInstanceFromLibrary(partInfo.baseName().latin1(), m_targetWidget, 0, m_targetWidget, 0 ); + m_part = KParts::ComponentFactory::createPartInstanceFromLibrary(partInfo.baseName().latin1(), m_targetWidget, 0, TQT_TQOBJECT(m_targetWidget), 0 ); else - m_part = KParts::ComponentFactory::createPartInstanceFromLibrary(partInfo.baseName().latin1(), m_targetWidget, 0, m_targetWidget, 0 ); + m_part = KParts::ComponentFactory::createPartInstanceFromLibrary(partInfo.baseName().latin1(), m_targetWidget, 0, TQT_TQOBJECT(m_targetWidget), 0 ); if(!m_part) { - KMessageBox::error(quantaApp, i18n("The %1 plugin could not be loaded.
Possible reasons are:
- %2 is not installed;
- the file %3 is not installed or it is not reachable.").arg(m_name).arg(m_name).arg(m_fileName)); + KMessageBox::error(quantaApp, i18n("The %1 plugin could not be loaded.
Possible reasons are:
- %2 is not installed;
- the file %3 is not installed or it is not reachable.").tqarg(m_name).tqarg(m_name).tqarg(m_fileName)); delete m_targetWidget; m_targetWidget = 0L; return false; } m_part->setName(m_name.ascii()); // for better debug output m_part->widget()->setName(m_name.ascii()); //needed to be able to dock the same plugin twice in separate toolviews - m_part->widget()->setFocusPolicy(TQWidget::ClickFocus); + m_part->widget()->setFocusPolicy(TQ_ClickFocus); quantaApp->slotNewPart(m_part, false); // register the part in the partmanager return true; } @@ -155,7 +155,7 @@ bool QuantaPlugin::run() } case 3: { KURL url; if ( Project::ref()->hasProject() && - (Project::ref()->contains(view->document()->url()) || + (Project::ref()->tqcontains(view->document()->url()) || view->document()->isUntitled()) ) { diff --git a/quanta/plugins/quantaplugin.h b/quanta/plugins/quantaplugin.h index e3cd1758..969268da 100644 --- a/quanta/plugins/quantaplugin.h +++ b/quanta/plugins/quantaplugin.h @@ -36,9 +36,10 @@ class KMdiToolViewAccessor; class QuantaView; -class QuantaPlugin : public QObject +class QuantaPlugin : public TQObject { Q_OBJECT + TQ_OBJECT public: QuantaPlugin(); ~QuantaPlugin(); @@ -122,7 +123,7 @@ protected: private: // Private attributes TQString m_standardName; KMdiToolViewAccessor* m_pluginToolView; - TQWidget *m_targetWidget; //this will be the parent, used only to make the plugin widget hidden until addWidget is called + TQWidget *m_targetWidget; //this will be the tqparent, used only to make the plugin widget hidden until addWidget is called }; #endif diff --git a/quanta/plugins/quantapluginconfig.cpp b/quanta/plugins/quantapluginconfig.cpp index 30fd6ee2..62f25553 100644 --- a/quanta/plugins/quantapluginconfig.cpp +++ b/quanta/plugins/quantapluginconfig.cpp @@ -77,7 +77,7 @@ void QuantaPluginConfig::accept() /** Gets the plugin location */ void QuantaPluginConfig::selectLocation() { - TQString pluginLocation = KFileDialog::getExistingDirectory(TQString::null, this, i18n("Select Plugin Folder")); + TQString pluginLocation = KFileDialog::getExistingDirectory(TQString(), this, i18n("Select Plugin Folder")); if(!pluginLocation.isNull()) { m_pluginConfigWidget->location->setText(pluginLocation); diff --git a/quanta/plugins/quantapluginconfig.h b/quanta/plugins/quantapluginconfig.h index 26cf53e5..9390b61e 100644 --- a/quanta/plugins/quantapluginconfig.h +++ b/quanta/plugins/quantapluginconfig.h @@ -30,6 +30,7 @@ class TQString; class QuantaPluginConfig : public KDialogBase { Q_OBJECT + TQ_OBJECT public: QuantaPluginConfig(TQWidget *, const char *); ~QuantaPluginConfig(); diff --git a/quanta/plugins/quantaplugineditor.cpp b/quanta/plugins/quantaplugineditor.cpp index 42f6a237..db7f73ed 100644 --- a/quanta/plugins/quantaplugineditor.cpp +++ b/quanta/plugins/quantaplugineditor.cpp @@ -50,7 +50,7 @@ QuantaPluginEditor::QuantaPluginEditor(TQWidget *a_parent, const char *a_name) setMainWidget(m_pluginEditorWidget); m_pluginEditorWidget->pluginList->setSelectionMode(TQListView::Single); m_pluginEditorWidget->pluginList->setAllColumnsShowFocus(true); - m_pluginEditorWidget->pluginList->setColumnAlignment(2, Qt::AlignHCenter); + m_pluginEditorWidget->pluginList->setColumnAlignment(2, TQt::AlignHCenter); connect(this, TQT_SIGNAL(pluginsChanged()), TQT_SLOT(refreshPlugins())); connect(m_pluginEditorWidget->refreshButton, TQT_SIGNAL(clicked()), TQT_SLOT(refreshPlugins())); @@ -100,7 +100,7 @@ void QuantaPluginEditor::addPlugin() void QuantaPluginEditor::addSearchPath() { // Get a dir and append it to the line edit - TQString appendDir = KFileDialog::getExistingDirectory(TQString::null, 0, i18n("Select Folder")); + TQString appendDir = KFileDialog::getExistingDirectory(TQString(), 0, i18n("Select Folder")); if(!appendDir.isNull()) { m_pluginEditorWidget->searchPaths->setText(m_pluginEditorWidget->searchPaths->text()+appendDir+":"); @@ -115,10 +115,10 @@ void QuantaPluginEditor::configurePlugin() if(item) key = item->text(0); - if(!key.isNull() && m_plugins.find(key)) + if(!key.isNull() && m_plugins.tqfind(key)) { QuantaPluginConfig *configDlg = new QuantaPluginConfig(this, "pluginConfig"); - QuantaPlugin *curPlugin = m_plugins.find(key); + QuantaPlugin *curPlugin = m_plugins.tqfind(key); PluginConfig *configWidget = static_cast(configDlg->mainWidget()); configWidget->outputWindow->setCurrentText(curPlugin->outputWindow()); @@ -186,7 +186,7 @@ void QuantaPluginEditor::removePlugin() TQListViewItem *currentItem = m_pluginEditorWidget->pluginList->currentItem(); if (currentItem) { - QuantaPlugin *plugin = m_plugins.find(currentItem->text(0)); + QuantaPlugin *plugin = m_plugins.tqfind(currentItem->text(0)); if(plugin) { m_plugins.remove(plugin->pluginName()); @@ -212,7 +212,7 @@ void PluginEditorItem::paintCell(TQPainter *a_painter, const TQColorGroup &a_cg, { /* if(a_column == 2) - a_align = Qt::AlignCenter; + a_align = TQt::AlignCenter; FIXME : Why won't QT let us align cell contents? */ TQListViewItem::paintCell(a_painter, a_cg, a_column, a_width, a_align); diff --git a/quanta/plugins/quantaplugineditor.h b/quanta/plugins/quantaplugineditor.h index 9f66e519..e26ad53f 100644 --- a/quanta/plugins/quantaplugineditor.h +++ b/quanta/plugins/quantaplugineditor.h @@ -42,6 +42,7 @@ class PluginEditor; class QuantaPluginEditor : public KDialogBase { Q_OBJECT + TQ_OBJECT public: QuantaPluginEditor(TQWidget *, const char *); @@ -69,7 +70,7 @@ protected: PluginEditor *m_pluginEditorWidget; }; -class PluginEditorItem : public QListViewItem +class PluginEditorItem : public TQListViewItem { public: PluginEditorItem(TQListView *); diff --git a/quanta/plugins/quantaplugininterface.cpp b/quanta/plugins/quantaplugininterface.cpp index 098c7828..73ba5a48 100644 --- a/quanta/plugins/quantaplugininterface.cpp +++ b/quanta/plugins/quantaplugininterface.cpp @@ -38,12 +38,12 @@ #include "resource.h" #include "quantacommon.h" -QuantaPluginInterface::QuantaPluginInterface(TQWidget *parent) +QuantaPluginInterface::QuantaPluginInterface(TQWidget *tqparent) { - m_parent = parent; + m_parent = tqparent; (void) new KAction( i18n( "Configure &Plugins..." ), 0, 0, this, TQT_SLOT( slotPluginsEdit() ), - ((KMainWindow*)parent)->actionCollection(), "configure_plugins" ); + ((KMainWindow*)tqparent)->actionCollection(), "configure_plugins" ); m_pluginMenu = 0L; // m_plugins.setAutoDelete(true); } @@ -71,7 +71,7 @@ void QuantaPluginInterface::readConfigFile(const TQString& configFile) // now that we have a list of the plugins, go through and get the details of them for(TQStringList::Iterator it = pList.begin();it != pList.end();++it) { - if (m_plugins.find(*it)) + if (m_plugins.tqfind(*it)) continue; config->setGroup(*it); @@ -90,7 +90,7 @@ void QuantaPluginInterface::readConfigFile(const TQString& configFile) if (pluginType == "Command Line") { emit hideSplash(); - KMessageBox::information(m_parent, i18n("%1 is a command line plugin. We have removed support for command-line plugins. However, the functionality has not been lost as script actions can still be used to run command-line tools. ").arg(*it), i18n("Unsupported Plugin Type"), "CommandLinePluginWarning"); + KMessageBox::information(m_parent, i18n("%1 is a command line plugin. We have removed support for command-line plugins. However, the functionality has not been lost as script actions can still be used to run command-line tools. ").tqarg(*it), i18n("Unsupported Plugin Type"), "CommandLinePluginWarning"); continue; } @@ -176,7 +176,7 @@ bool QuantaPluginInterface::pluginAvailable(const TQString &a_name) { if (a_name.isEmpty()) return false; - QuantaPlugin *availPlugin = m_plugins.find(a_name); + QuantaPlugin *availPlugin = m_plugins.tqfind(a_name); if(availPlugin && QuantaPlugin::validatePlugin(availPlugin)) return true; @@ -257,7 +257,7 @@ void QuantaPluginInterface::slotPluginsValidate() { invalidNames += "
" + invalidPlugins[i]->name(); } - int answer = KMessageBox::questionYesNo(m_parent, i18n("The following plugins seems to be invalid:%1.

Do you want to edit the plugins?
").arg(invalidNames), i18n("Invalid Plugins"), i18n("Edit Plugins"), i18n("Do Not Edit")); + int answer = KMessageBox::questionYesNo(m_parent, i18n("The following plugins seems to be invalid:%1.

Do you want to edit the plugins?
").tqarg(invalidNames), i18n("Invalid Plugins"), i18n("Edit Plugins"), i18n("Do Not Edit")); if(answer == KMessageBox::Yes) { slotPluginsEdit(); diff --git a/quanta/plugins/quantaplugininterface.h b/quanta/plugins/quantaplugininterface.h index 2749fbd0..6711e9e0 100644 --- a/quanta/plugins/quantaplugininterface.h +++ b/quanta/plugins/quantaplugininterface.h @@ -35,9 +35,10 @@ class QuantaPlugin; /**Provides an interface to the installed plugins *@author Marc Britton */ -class QuantaPluginInterface : public QObject +class QuantaPluginInterface : public TQObject { Q_OBJECT + TQ_OBJECT public: /** * since this class is a singleton you must use this function to access it @@ -45,10 +46,10 @@ public: * the parameters are only used at the first call to create the class * */ - static QuantaPluginInterface* const ref(TQWidget *parent = 0L) + static QuantaPluginInterface* const ref(TQWidget *tqparent = 0L) { static QuantaPluginInterface *m_ref; - if (!m_ref) m_ref = new QuantaPluginInterface (parent); + if (!m_ref) m_ref = new QuantaPluginInterface (tqparent); return m_ref; } @@ -76,7 +77,7 @@ private: * If you need the class use QuantaPluginInterface::ref() for * construction and reference */ - QuantaPluginInterface(TQWidget *parent); + QuantaPluginInterface(TQWidget *tqparent); protected slots: /** slot for the menu: validate */ -- cgit v1.2.1