summaryrefslogtreecommitdiff
path: root/src/libs/extensionsystem/test/manual/pluginview/plugins/plugin1
diff options
context:
space:
mode:
authorcon <qtc-commiter@nokia.com>2008-12-02 12:01:29 +0100
committercon <qtc-commiter@nokia.com>2008-12-02 12:01:29 +0100
commit05c35356abc31549c5db6eba31fb608c0365c2a0 (patch)
treebe044530104267afaff13f8943889cb97f8c8bad /src/libs/extensionsystem/test/manual/pluginview/plugins/plugin1
downloadqt-creator-05c35356abc31549c5db6eba31fb608c0365c2a0.tar.gz
Initial import
Diffstat (limited to 'src/libs/extensionsystem/test/manual/pluginview/plugins/plugin1')
-rw-r--r--src/libs/extensionsystem/test/manual/pluginview/plugins/plugin1/plugin.xml18
-rw-r--r--src/libs/extensionsystem/test/manual/pluginview/plugins/plugin1/plugin1.cpp86
-rw-r--r--src/libs/extensionsystem/test/manual/pluginview/plugins/plugin1/plugin1.h59
-rw-r--r--src/libs/extensionsystem/test/manual/pluginview/plugins/plugin1/plugin1.pro15
4 files changed, 178 insertions, 0 deletions
diff --git a/src/libs/extensionsystem/test/manual/pluginview/plugins/plugin1/plugin.xml b/src/libs/extensionsystem/test/manual/pluginview/plugins/plugin1/plugin.xml
new file mode 100644
index 0000000000..63faecdf52
--- /dev/null
+++ b/src/libs/extensionsystem/test/manual/pluginview/plugins/plugin1/plugin.xml
@@ -0,0 +1,18 @@
+<plugin name="plugin1" version="2.1.0" compatVersion="1.0.0">
+ <vendor>Blablubb Corp</vendor>
+ <copyright>(C) 2023 Blubb</copyright>
+ <license>
+This is a default license bla
+blubbblubb
+end of terms
+ </license>
+ <description>
+This plugin is just a test.
+ it demonstrates the great use of the plugin spec.
+ </description>
+ <url>http://www.blablubb-corp.com/greatplugin</url>
+ <dependencyList>
+ <dependency name="plugin2" version="1.0.0"/>
+ <dependency name="plugin3" version="1.0.0"/>
+ </dependencyList>
+</plugin>
diff --git a/src/libs/extensionsystem/test/manual/pluginview/plugins/plugin1/plugin1.cpp b/src/libs/extensionsystem/test/manual/pluginview/plugins/plugin1/plugin1.cpp
new file mode 100644
index 0000000000..32d3bdf070
--- /dev/null
+++ b/src/libs/extensionsystem/test/manual/pluginview/plugins/plugin1/plugin1.cpp
@@ -0,0 +1,86 @@
+/***************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+**
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+**
+** Non-Open Source Usage
+**
+** Licensees may use this file in accordance with the Qt Beta Version
+** License Agreement, Agreement version 2.2 provided with the Software or,
+** alternatively, in accordance with the terms contained in a written
+** agreement between you and Nokia.
+**
+** GNU General Public License Usage
+**
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the packaging
+** of this file. Please review the following information to ensure GNU
+** General Public Licensing requirements will be met:
+**
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt GPL Exception version
+** 1.2, included in the file GPL_EXCEPTION.txt in this package.
+**
+***************************************************************************/
+#include "plugin1.h"
+
+#include <extensionsystem/pluginmanager.h>
+
+#include <QtCore/qplugin.h>
+#include <QtCore/QObject>
+
+using namespace Plugin1;
+
+MyPlugin1::MyPlugin1()
+ : initializeCalled(false)
+{
+}
+
+bool MyPlugin1::initialize(const QStringList & /*arguments*/, QString *errorString)
+{
+ initializeCalled = true;
+ QObject *obj = new QObject(this);
+ obj->setObjectName("MyPlugin1");
+ addAutoReleasedObject(obj);
+
+ bool found2 = false;
+ bool found3 = false;
+ foreach (QObject *object, ExtensionSystem::PluginManager::instance()->allObjects()) {
+ if (object->objectName() == "MyPlugin2")
+ found2 = true;
+ else if (object->objectName() == "MyPlugin3")
+ found3 = true;
+ }
+ if (found2 && found3)
+ return true;
+ if (errorString) {
+ QString error = "object(s) missing from plugin(s):";
+ if (!found2)
+ error.append(" plugin2");
+ if (!found3)
+ error.append(" plugin3");
+ *errorString = error;
+ }
+ return false;
+}
+
+void MyPlugin1::extensionsInitialized()
+{
+ if (!initializeCalled)
+ return;
+ // don't do this at home, it's just done here for the test
+ QObject *obj = new QObject(this);
+ obj->setObjectName("MyPlugin1_running");
+ addAutoReleasedObject(obj);
+}
+
+Q_EXPORT_PLUGIN(MyPlugin1)
+
diff --git a/src/libs/extensionsystem/test/manual/pluginview/plugins/plugin1/plugin1.h b/src/libs/extensionsystem/test/manual/pluginview/plugins/plugin1/plugin1.h
new file mode 100644
index 0000000000..f993b25c9f
--- /dev/null
+++ b/src/libs/extensionsystem/test/manual/pluginview/plugins/plugin1/plugin1.h
@@ -0,0 +1,59 @@
+/***************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+**
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+**
+** Non-Open Source Usage
+**
+** Licensees may use this file in accordance with the Qt Beta Version
+** License Agreement, Agreement version 2.2 provided with the Software or,
+** alternatively, in accordance with the terms contained in a written
+** agreement between you and Nokia.
+**
+** GNU General Public License Usage
+**
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the packaging
+** of this file. Please review the following information to ensure GNU
+** General Public Licensing requirements will be met:
+**
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt GPL Exception version
+** 1.2, included in the file GPL_EXCEPTION.txt in this package.
+**
+***************************************************************************/
+#ifndef PLUGIN1_H
+#define PLUGIN1_H
+
+#include <extensionsystem/iplugin.h>
+
+#include <QtCore/QObject>
+#include <QtCore/QString>
+
+namespace Plugin1 {
+
+class MyPlugin1 : public ExtensionSystem::IPlugin
+{
+ Q_OBJECT
+
+public:
+ MyPlugin1();
+
+ bool initialize(const QStringList &arguments, QString *errorString);
+ void extensionsInitialized();
+
+private:
+ bool initializeCalled;
+};
+
+} // namespace
+
+#endif // header guard
diff --git a/src/libs/extensionsystem/test/manual/pluginview/plugins/plugin1/plugin1.pro b/src/libs/extensionsystem/test/manual/pluginview/plugins/plugin1/plugin1.pro
new file mode 100644
index 0000000000..9101770f9a
--- /dev/null
+++ b/src/libs/extensionsystem/test/manual/pluginview/plugins/plugin1/plugin1.pro
@@ -0,0 +1,15 @@
+TEMPLATE = lib
+TARGET = plugin1
+
+SOURCES += plugin1.cpp
+HEADERS += plugin1.h
+
+include(../../../../extensionsystem_test.pri)
+
+LIBS += -L$${PWD}/../plugin2 -L$${PWD}/../plugin3 -lplugin2 -lplugin3
+
+macx {
+} else:unix {
+ QMAKE_RPATHDIR += $${PWD}/../plugin2
+ QMAKE_RPATHDIR += $${PWD}/../plugin3
+}