ExtensionSystem: Remove Qt4 support

Remove usage of the Q_EXPORT_PLUGIN macros, which do not exist in Qt 5.

Change-Id: I678c3cf10b9c5d5c1b9f252b0ecd1c97dc810a47
Reviewed-by: hjk <hjk121@nokiamail.com>
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
This commit is contained in:
Eike Ziller
2014-08-26 15:42:40 +02:00
committed by hjk
parent 38d69ae4ef
commit aa6495a261
70 changed files with 6 additions and 166 deletions

View File

@@ -80,7 +80,3 @@ void ExamplePlugin::triggerAction()
tr("This is an action from Example.")); tr("This is an action from Example."));
} }
//! [slot implementation] //! [slot implementation]
//! [export plugin]
Q_EXPORT_PLUGIN2(Example, ExamplePlugin)
//! [export plugin]

View File

@@ -321,11 +321,4 @@
This part defines the code that is called when the menu item is triggered. This part defines the code that is called when the menu item is triggered.
It uses the Qt API to open a message box that displays informative text and It uses the Qt API to open a message box that displays informative text and
an \gui OK button. an \gui OK button.
\snippet exampleplugin/exampleplugin.cpp export plugin
At the end of the file, the Qt macro \c{Q_EXPORT_PLUGIN2} is used to register
the plugin with Qt's plugin loader system. This is necessary for Qt to
be able to load your plugin.
*/ */

View File

@@ -75,5 +75,3 @@ void %PluginName%Plugin::triggerAction()
tr("Action triggered"), tr("Action triggered"),
tr("This is an action from %PluginName%.")); tr("This is an action from %PluginName%."));
} }
Q_EXPORT_PLUGIN2(%PluginName%, %PluginName%Plugin)

View File

@@ -55,9 +55,9 @@
Plugins must provide one implementation of the IPlugin class, located Plugins must provide one implementation of the IPlugin class, located
in a library that matches the \c name attribute given in their in a library that matches the \c name attribute given in their
XML description. The IPlugin implementation must be exported and XML description. The IPlugin implementation must be exported and
made known to Qt's plugin system, see the Qt Documentation on the made known to Qt's plugin system, using the \c Q_PLUGIN_METADATA macro with
\l{http://qt-project.org/doc/qt-4.8/qtplugin.html#Q_EXPORT_PLUGIN2} an IID set to \c "org.qt-project.Qt.QtCreatorPlugin".
{Q_EXPORT_PLUGIN2 macro}.
After the plugins' XML files have been read, and dependencies have been After the plugins' XML files have been read, and dependencies have been
found, the plugin loading is done in three phases: found, the plugin loading is done in three phases:

View File

@@ -33,9 +33,7 @@
#include "extensionsystem_global.h" #include "extensionsystem_global.h"
#include <QObject> #include <QObject>
#if QT_VERSION >= 0x050000
#include <QtPlugin> #include <QtPlugin>
#endif
namespace ExtensionSystem { namespace ExtensionSystem {
@@ -83,16 +81,4 @@ private:
} // namespace ExtensionSystem } // namespace ExtensionSystem
// The macros Q_EXPORT_PLUGIN, Q_EXPORT_PLUGIN2 become obsolete in Qt 5.
#if QT_VERSION >= 0x050000
# if defined(Q_EXPORT_PLUGIN)
# undef Q_EXPORT_PLUGIN
# undef Q_EXPORT_PLUGIN2
# endif
# define Q_EXPORT_PLUGIN(plugin)
# define Q_EXPORT_PLUGIN2(function, plugin)
#else
# define Q_PLUGIN_METADATA(x)
#endif
#endif // IPLUGIN_H #endif // IPLUGIN_H

View File

@@ -90,7 +90,8 @@ enum { debugLeaks = 0 };
\section1 Plugins \section1 Plugins
Plugins consist of an XML descriptor file, and of a library that contains a Qt plugin Plugins consist of an XML descriptor file, and of a library that contains a Qt plugin
(declared via Q_EXPORT_PLUGIN) that must derive from the IPlugin class. that must derive from the IPlugin class and has an IID of
\c "org.qt-project.Qt.QtCreatorPlugin".
The plugin manager is used to set a list of file system directories to search for The plugin manager is used to set a list of file system directories to search for
plugins, retrieve information about the state of these plugins, and to load them. plugins, retrieve information about the state of these plugins, and to load them.

View File

@@ -81,5 +81,3 @@ AnalyzerPlugin *AnalyzerPlugin::instance()
{ {
return m_instance; return m_instance;
} }
Q_EXPORT_PLUGIN(AnalyzerPlugin)

View File

@@ -124,5 +124,3 @@ void AndroidPlugin::updateDevice()
} }
} // namespace Android } // namespace Android
Q_EXPORT_PLUGIN(Android::AndroidPlugin)

View File

@@ -70,5 +70,3 @@ bool AutotoolsProjectPlugin::initialize(const QStringList &arguments,
return true; return true;
} }
Q_EXPORT_PLUGIN(AutotoolsProjectPlugin)

View File

@@ -73,5 +73,3 @@ bool BareMetalPlugin::initialize(const QStringList &arguments, QString *errorStr
} // namespace Internal } // namespace Internal
} // namespace BareMetal } // namespace BareMetal
Q_EXPORT_PLUGIN(BareMetal::Internal::BareMetalPlugin)

View File

@@ -784,5 +784,3 @@ void BazaarPlugin::updateActions(VcsBase::VcsBasePlugin::ActionState as)
} // namespace Internal } // namespace Internal
} // namespace Bazaar } // namespace Bazaar
Q_EXPORT_PLUGIN(Bazaar::Internal::BazaarPlugin)

View File

@@ -422,5 +422,3 @@ QString BeautifierPlugin::msgCommandPromptDialogTitle(const QString &command)
} // namespace Internal } // namespace Internal
} // namespace Beautifier } // namespace Beautifier
Q_EXPORT_PLUGIN(Beautifier::Internal::BeautifierPlugin)

View File

@@ -559,6 +559,4 @@ void BinEditorPlugin::selectAllAction()
} // namespace Internal } // namespace Internal
} // namespace BinEditor } // namespace BinEditor
Q_EXPORT_PLUGIN(BinEditor::Internal::BinEditorPlugin)
#include "bineditorplugin.moc" #include "bineditorplugin.moc"

View File

@@ -202,5 +202,3 @@ void BookmarksPlugin::editBookmarkActionTriggered()
{ {
m_bookmarkManager->edit(m_bookmarkMarginActionFileName, m_bookmarkMarginActionLineNumber); m_bookmarkManager->edit(m_bookmarkMarginActionFileName, m_bookmarkMarginActionLineNumber);
} }
Q_EXPORT_PLUGIN(BookmarksPlugin)

View File

@@ -90,5 +90,3 @@ void ClangCodeModelPlugin::extensionsInitialized()
} // namespace Internal } // namespace Internal
} // namespace Clang } // namespace Clang
Q_EXPORT_PLUGIN(ClangCodeModel::Internal::ClangCodeModelPlugin)

View File

@@ -62,5 +62,3 @@ bool Plugin::initialize(const QStringList &arguments, QString *errorMessage)
} // namespace Internal } // namespace Internal
} // namespace ClassView } // namespace ClassView
Q_EXPORT_PLUGIN(ClassView::Internal::Plugin)

View File

@@ -2480,5 +2480,3 @@ void ClearCasePlugin::testVcsStatusDynamicNotManaged()
} // namespace Internal } // namespace Internal
} // namespace ClearCase } // namespace ClearCase
Q_EXPORT_PLUGIN(ClearCase::Internal::ClearCasePlugin)

View File

@@ -76,5 +76,3 @@ bool CMakeProjectPlugin::initialize(const QStringList & /*arguments*/, QString *
void CMakeProjectPlugin::extensionsInitialized() void CMakeProjectPlugin::extensionsInitialized()
{ {
} }
Q_EXPORT_PLUGIN(CMakeProjectPlugin)

View File

@@ -151,5 +151,3 @@ ExtensionSystem::IPlugin::ShutdownFlag CorePlugin::aboutToShutdown()
m_mainWindow->aboutToShutdown(); m_mainWindow->aboutToShutdown();
return SynchronousShutdown; return SynchronousShutdown;
} }
Q_EXPORT_PLUGIN(CorePlugin)

View File

@@ -390,5 +390,3 @@ CodepasterPlugin *CodepasterPlugin::instance()
} }
} // namespace CodePaster } // namespace CodePaster
Q_EXPORT_PLUGIN(CodePaster::CodepasterPlugin)

View File

@@ -425,5 +425,3 @@ void CppEditorPlugin::openIncludeHierarchy()
emit includeHierarchyRequested(); emit includeHierarchyRequested();
} }
} }
Q_EXPORT_PLUGIN(CppEditorPlugin)

View File

@@ -449,5 +449,3 @@ QString correspondingHeaderOrSource(const QString &fileName, bool *wasHeader)
} }
} // namespace CppTools } // namespace CppTools
Q_EXPORT_PLUGIN(CppTools::Internal::CppToolsPlugin)

View File

@@ -1355,5 +1355,3 @@ void CvsPlugin::testLogResolving()
} // namespace Internal } // namespace Internal
} // namespace Cvs } // namespace Cvs
Q_EXPORT_PLUGIN(Cvs::Internal::CvsPlugin)

View File

@@ -3697,5 +3697,3 @@ void DebuggerPluginPrivate::testBenchmark1()
} // namespace Debugger } // namespace Debugger
#include "debuggerplugin.moc" #include "debuggerplugin.moc"
Q_EXPORT_PLUGIN(Debugger::DebuggerPlugin)

View File

@@ -200,5 +200,3 @@ void FormEditorPlugin::switchSourceForm()
if (!fileToOpen.isEmpty()) if (!fileToOpen.isEmpty())
Core::EditorManager::openEditor(fileToOpen); Core::EditorManager::openEditor(fileToOpen);
} }
Q_EXPORT_PLUGIN(FormEditorPlugin)

View File

@@ -863,7 +863,4 @@ void DiffEditor::Internal::DiffEditorPlugin::testReadPatch()
#endif // WITH_TESTS #endif // WITH_TESTS
Q_EXPORT_PLUGIN(DiffEditor::Internal::DiffEditorPlugin)
#include "diffeditorplugin.moc" #include "diffeditorplugin.moc"

View File

@@ -386,5 +386,3 @@ void EmacsKeysPlugin::genericVScroll(int direction)
m_currentEditorWidget->setTextCursor(cursor); m_currentEditorWidget->setTextCursor(cursor);
m_currentState->endOwnAction(KeysActionOther); m_currentState->endOwnAction(KeysActionOther);
} }
Q_EXPORT_PLUGIN2(EmacsKeys, EmacsKeysPlugin)

View File

@@ -2319,5 +2319,3 @@ void FakeVimPlugin::setupTest(QString *title, FakeVimHandler **handler, QWidget
} // namespace FakeVim } // namespace FakeVim
#include "fakevimplugin.moc" #include "fakevimplugin.moc"
Q_EXPORT_PLUGIN(FakeVim::Internal::FakeVimPlugin)

View File

@@ -101,5 +101,3 @@ void GenericProjectPlugin::editFiles()
} // namespace Internal } // namespace Internal
} // namespace GenericProjectManager } // namespace GenericProjectManager
Q_EXPORT_PLUGIN(GenericProjectManager::Internal::GenericProjectPlugin)

View File

@@ -1582,5 +1582,3 @@ void GitPlugin::testCloneWizard_directoryFromRepository_data()
} // namespace Internal } // namespace Internal
} // namespace Git } // namespace Git
Q_EXPORT_PLUGIN(GitPlugin)

View File

@@ -288,5 +288,3 @@ const GlslEditorPlugin::InitFile *GlslEditorPlugin::shaderInit(int variant)
} // namespace Internal } // namespace Internal
} // namespace GlslEditor } // namespace GlslEditor
Q_EXPORT_PLUGIN(GlslEditor::Internal::GlslEditorPlugin)

View File

@@ -153,5 +153,3 @@ void HelloWorldPlugin::sayHelloWorld()
} // namespace Internal } // namespace Internal
} // namespace HelloWorld } // namespace HelloWorld
Q_EXPORT_PLUGIN(HelloWorld::Internal::HelloWorldPlugin)

View File

@@ -1054,5 +1054,3 @@ void HelpPlugin::setupNavigationMenus(QAction *back, QAction *next, QWidget *par
back->setMenu(m_backMenu); back->setMenu(m_backMenu);
next->setMenu(m_nextMenu); next->setMenu(m_nextMenu);
} }
Q_EXPORT_PLUGIN(HelpPlugin)

View File

@@ -63,5 +63,3 @@ void ImageViewerPlugin::extensionsInitialized()
} // namespace Internal } // namespace Internal
} // namespace ImageViewer } // namespace ImageViewer
Q_EXPORT_PLUGIN(ImageViewer::Internal::ImageViewerPlugin)

View File

@@ -100,5 +100,3 @@ void IosPlugin::kitsRestored()
} }
} // namespace Ios } // namespace Ios
Q_EXPORT_PLUGIN(Ios::IosPlugin)

View File

@@ -112,5 +112,3 @@ bool MacrosPlugin::initialize(const QStringList &arguments, QString *errorMessag
void MacrosPlugin::extensionsInitialized() void MacrosPlugin::extensionsInitialized()
{ {
} }
Q_EXPORT_PLUGIN(MacrosPlugin)

View File

@@ -756,5 +756,3 @@ void MercurialPlugin::testLogResolving()
} // namespace Internal } // namespace Internal
} // namespace Mercurial } // namespace Mercurial
Q_EXPORT_PLUGIN(MercurialPlugin)

View File

@@ -1567,6 +1567,4 @@ void PerforcePlugin::testLogResolving()
} // namespace Internal } // namespace Internal
} // namespace Perforce } // namespace Perforce
Q_EXPORT_PLUGIN(Perforce::Internal::PerforcePlugin)
#include "perforceplugin.moc" #include "perforceplugin.moc"

View File

@@ -3236,5 +3236,3 @@ QList<QPair<QString, QString> > ProjectExplorerPlugin::recentProjects()
{ {
return d->m_recentProjects; return d->m_recentProjects;
} }
Q_EXPORT_PLUGIN(ProjectExplorerPlugin)

View File

@@ -253,5 +253,3 @@ QSet<QString> PythonEditorPlugin::builtins()
} // namespace Internal } // namespace Internal
} // namespace PythonEditor } // namespace PythonEditor
Q_EXPORT_PLUGIN(PythonEditor::Internal::PythonEditorPlugin)

View File

@@ -515,5 +515,3 @@ void QbsProjectManagerPlugin::reparseProject(QbsProject *project)
} // namespace Internal } // namespace Internal
} // namespace QbsProjectManager } // namespace QbsProjectManager
Q_EXPORT_PLUGIN(QbsProjectManager::Internal::QbsProjectManagerPlugin)

View File

@@ -66,5 +66,3 @@ bool QmakeAndroidSupportPlugin::initialize(const QStringList &arguments, QString
void QmakeAndroidSupportPlugin::extensionsInitialized() void QmakeAndroidSupportPlugin::extensionsInitialized()
{ } { }
Q_EXPORT_PLUGIN(QmakeAndroidSupportPlugin)

View File

@@ -421,5 +421,3 @@ void QmakeProjectManagerPlugin::updateBuildFileAction()
m_buildFileAction->setVisible(visible); m_buildFileAction->setVisible(visible);
m_buildFileAction->setEnabled(enabled); m_buildFileAction->setEnabled(enabled);
} }
Q_EXPORT_PLUGIN(QmakeProjectManagerPlugin)

View File

@@ -58,7 +58,3 @@ QString ComponentsPlugin::metaInfo() const
} }
#if QT_VERSION < 0x050000
Q_EXPORT_PLUGIN(QmlDesigner::ComponentsPlugin)
#endif

View File

@@ -512,5 +512,3 @@ void QmlDesignerPlugin::setSettings(const DesignerSettings &s)
} }
} }
Q_EXPORT_PLUGIN(QmlDesigner::QmlDesignerPlugin)

View File

@@ -50,7 +50,3 @@ QString QtQuickPlugin::metaInfo() const
} }
#if QT_VERSION < 0x050000
Q_EXPORT_PLUGIN(QmlDesigner::QtQuickPlugin)
#endif

View File

@@ -341,5 +341,3 @@ void QmlJSEditorPlugin::checkCurrentEditorSemanticInfoUpToDate()
} }
} // namespace QmlJSEditor } // namespace QmlJSEditor
Q_EXPORT_PLUGIN(QmlJSEditor::Internal::QmlJSEditorPlugin)

View File

@@ -140,5 +140,3 @@ void QmlJSToolsPlugin::onAllTasksFinished(Core::Id type)
if (type == QmlJS::Constants::TASK_INDEX) if (type == QmlJS::Constants::TASK_INDEX)
m_resetCodeModelAction->setEnabled(true); m_resetCodeModelAction->setEnabled(true);
} }
Q_EXPORT_PLUGIN(QmlJSToolsPlugin)

View File

@@ -109,5 +109,3 @@ QList<AbstractTimelineModel *> QmlProfilerPlugin::getModels() const
} // namespace Internal } // namespace Internal
} // namespace QmlProfiler } // namespace QmlProfiler
Q_EXPORT_PLUGIN(QmlProfiler::Internal::QmlProfilerPlugin)

View File

@@ -77,5 +77,3 @@ void QmlProjectPlugin::extensionsInitialized()
} }
} // namespace QmlProjectManager } // namespace QmlProjectManager
Q_EXPORT_PLUGIN(QmlProjectManager::QmlProjectPlugin)

View File

@@ -533,5 +533,3 @@ void QnxPlugin::testConfigurationManager()
} }
#endif #endif
Q_EXPORT_PLUGIN2(QNX, QnxPlugin)

View File

@@ -127,5 +127,3 @@ bool QtSupportPlugin::delayedInitialize()
{ {
return QtVersionManager::delayedInitialize(); return QtVersionManager::delayedInitialize();
} }
Q_EXPORT_PLUGIN(QtSupportPlugin)

View File

@@ -75,5 +75,3 @@ void RemoteLinuxPlugin::extensionsInitialized()
} // namespace Internal } // namespace Internal
} // namespace RemoteLinux } // namespace RemoteLinux
Q_EXPORT_PLUGIN(RemoteLinux::Internal::RemoteLinuxPlugin)

View File

@@ -377,6 +377,4 @@ ResourceEditorW * ResourceEditorPlugin::currentEditor() const
return focusEditor; return focusEditor;
} }
Q_EXPORT_PLUGIN(ResourceEditorPlugin)
#include "resourceeditorplugin.moc" #include "resourceeditorplugin.moc"

View File

@@ -1315,5 +1315,3 @@ void SubversionPlugin::testLogResolving()
} // Internal } // Internal
} // Subversion } // Subversion
Q_EXPORT_PLUGIN(Subversion::Internal::SubversionPlugin)

View File

@@ -261,5 +261,3 @@ void TaskListPlugin::loadDataFromSession()
} // namespace Internal } // namespace Internal
} // namespace TaskList } // namespace TaskList
Q_EXPORT_PLUGIN(TaskList::Internal::TaskListPlugin)

View File

@@ -322,6 +322,4 @@ void TextEditorPlugin::updateCurrentSelection(const QString &text)
} }
} }
Q_EXPORT_PLUGIN(TextEditorPlugin)
#include "texteditorplugin.moc" #include "texteditorplugin.moc"

View File

@@ -124,7 +124,5 @@ void TodoPlugin::createOptionsPage()
connect(m_optionsPage, SIGNAL(settingsChanged(Settings)), SLOT(settingsChanged(Settings))); connect(m_optionsPage, SIGNAL(settingsChanged(Settings)), SLOT(settingsChanged(Settings)));
} }
Q_EXPORT_PLUGIN2(Todo, TodoPlugin)
} // namespace Internal } // namespace Internal
} // namespace Todo } // namespace Todo

View File

@@ -278,5 +278,3 @@ void UpdateInfoPlugin::settingsHelper(T *settings)
} //namespace Internal } //namespace Internal
} //namespace UpdateInfo } //namespace UpdateInfo
Q_EXPORT_PLUGIN(UpdateInfo::Internal::UpdateInfoPlugin)

View File

@@ -199,5 +199,3 @@ void ValgrindPlugin::extensionsInitialized()
} // namespace Internal } // namespace Internal
} // namespace Valgrind } // namespace Valgrind
Q_EXPORT_PLUGIN(Valgrind::Internal::ValgrindPlugin)

View File

@@ -163,5 +163,3 @@ void VcsPlugin::slotSettingsChanged()
} // namespace Internal } // namespace Internal
} // namespace VcsBase } // namespace VcsBase
Q_EXPORT_PLUGIN(VcsBase::Internal::VcsPlugin)

View File

@@ -342,7 +342,4 @@ void WelcomePlugin::extensionsInitialized()
} // namespace Internal } // namespace Internal
} // namespace Welcome } // namespace Welcome
Q_EXPORT_PLUGIN(Welcome::Internal::WelcomePlugin)
#include "welcomeplugin.moc" #include "welcomeplugin.moc"

View File

@@ -72,5 +72,3 @@ void WinRtPlugin::extensionsInitialized()
} // namespace Internal } // namespace Internal
} // namespace WinRt } // namespace WinRt
Q_EXPORT_PLUGIN(WinRt::Internal::WinRtPlugin)

View File

@@ -49,5 +49,3 @@ void MyPlugin1::extensionsInitialized()
{ {
} }
Q_EXPORT_PLUGIN(MyPlugin1)

View File

@@ -46,5 +46,3 @@ void MyPlugin2::extensionsInitialized()
{ {
} }
Q_EXPORT_PLUGIN(MyPlugin2)

View File

@@ -45,5 +45,3 @@ void MyPlugin3::extensionsInitialized()
{ {
} }
Q_EXPORT_PLUGIN(MyPlugin3)

View File

@@ -79,5 +79,3 @@ void MyPlugin1::extensionsInitialized()
addAutoReleasedObject(obj); addAutoReleasedObject(obj);
} }
Q_EXPORT_PLUGIN(MyPlugin1)

View File

@@ -61,5 +61,3 @@ void MyPlugin2::extensionsInitialized()
addAutoReleasedObject(obj); addAutoReleasedObject(obj);
} }
Q_EXPORT_PLUGIN(MyPlugin2)

View File

@@ -69,5 +69,3 @@ void MyPlugin3::extensionsInitialized()
obj->setObjectName(QLatin1String("MyPlugin3_running")); obj->setObjectName(QLatin1String("MyPlugin3_running"));
addAutoReleasedObject(obj); addAutoReleasedObject(obj);
} }
Q_EXPORT_PLUGIN(MyPlugin3)

View File

@@ -49,5 +49,3 @@ void MyPluginImpl::extensionsInitialized()
m_isExtensionsInitialized = true; m_isExtensionsInitialized = true;
} }
Q_EXPORT_PLUGIN(MyPluginImpl)