forked from qt-creator/qt-creator
Add <platform> element to pluginspec-files.
The <platform> element may contain a regular expression matching the names of the platforms on which the plugin works. Task-number: QTCREATORBUG-9002 Change-Id: Ic816cfed69a5dd2c4112c976843b9106ba2cbd22 Reviewed-by: Daniel Teske <daniel.teske@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
@@ -101,6 +101,10 @@
|
||||
\row
|
||||
\o copyright
|
||||
\o A short copyright notice, like \c{(C) 2007-2008 MyCompany}.
|
||||
\row
|
||||
\o platform
|
||||
\o A regular expression that matches the names of the platforms the plugin works on.
|
||||
Omitting the tag implies that the plugin is loaded on all platforms.
|
||||
\row
|
||||
\o license
|
||||
\o Possibly multi-line license information about the plugin.
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include "pluginspec.h"
|
||||
|
||||
#include <QDir>
|
||||
#include <QRegExp>
|
||||
|
||||
/*!
|
||||
\class ExtensionSystem::PluginDetailsView
|
||||
@@ -84,6 +85,8 @@ void PluginDetailsView::update(PluginSpec *spec)
|
||||
m_ui->description->setText(spec->description());
|
||||
m_ui->copyright->setText(spec->copyright());
|
||||
m_ui->license->setText(spec->license());
|
||||
const QRegExp platforms = spec->platformSpecification();
|
||||
m_ui->platforms->setText(platforms.isEmpty() ? tr("All") : platforms.pattern());
|
||||
QStringList depStrings;
|
||||
foreach (const PluginDependency &dep, spec->dependencies()) {
|
||||
QString depString = dep.name;
|
||||
|
||||
@@ -11,136 +11,22 @@
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout">
|
||||
<property name="margin">
|
||||
<property name="leftMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Name:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
</widget>
|
||||
<property name="topMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<item row="7" column="1">
|
||||
<widget class="QLabel" name="platforms"/>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="name">
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Version:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLabel" name="version">
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Compatibility version:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLabel" name="compatVersion">
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Vendor:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLabel" name="vendor">
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>URL:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QLabel" name="url">
|
||||
<property name="openExternalLinks">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::TextBrowserInteraction</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="text">
|
||||
<string>Location:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QLabel" name="location">
|
||||
<property name="wordWrap">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::TextBrowserInteraction</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<item row="8" column="0">
|
||||
<layout class="QVBoxLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_8">
|
||||
@@ -170,20 +56,17 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="7" column="1">
|
||||
<widget class="QTextEdit" name="description">
|
||||
<property name="tabChangesFocus">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLabel" name="version">
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Copyright:</string>
|
||||
<string>Name:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
@@ -193,44 +76,20 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="1">
|
||||
<widget class="QLabel" name="copyright">
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Compatibility version:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="0">
|
||||
<layout class="QVBoxLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="text">
|
||||
<string>License:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>17</width>
|
||||
<height>13</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="9" column="1">
|
||||
<item row="10" column="1">
|
||||
<widget class="QTextEdit" name="license">
|
||||
<property name="tabChangesFocus">
|
||||
<bool>true</bool>
|
||||
@@ -240,7 +99,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="0">
|
||||
<item row="11" column="0">
|
||||
<layout class="QVBoxLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_10">
|
||||
@@ -270,9 +129,105 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="10" column="1">
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="name">
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Version:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Vendor:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="1">
|
||||
<widget class="QListWidget" name="dependencies"/>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="text">
|
||||
<string>Location:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QLabel" name="location">
|
||||
<property name="wordWrap">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::TextBrowserInteraction</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="platformsDescriptionLabel">
|
||||
<property name="text">
|
||||
<string>Platforms:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>URL:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QLabel" name="url">
|
||||
<property name="openExternalLinks">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::TextBrowserInteraction</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLabel" name="vendor">
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_11">
|
||||
<property name="text">
|
||||
@@ -286,6 +241,73 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLabel" name="compatVersion">
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="1">
|
||||
<widget class="QTextEdit" name="description">
|
||||
<property name="tabChangesFocus">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Copyright:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="1">
|
||||
<widget class="QLabel" name="copyright">
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="0">
|
||||
<layout class="QVBoxLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="text">
|
||||
<string>License:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>17</width>
|
||||
<height>13</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QLabel" name="component">
|
||||
<property name="text">
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
#include <QEventLoop>
|
||||
#include <QDateTime>
|
||||
#include <QDir>
|
||||
#include <QFile>
|
||||
#include <QMetaProperty>
|
||||
#include <QSettings>
|
||||
#include <QTextStream>
|
||||
@@ -45,6 +46,7 @@
|
||||
#include <QWriteLocker>
|
||||
#include <QDebug>
|
||||
#include <QTimer>
|
||||
#include <QSysInfo>
|
||||
|
||||
#ifdef WITH_TESTS
|
||||
#include <QTest>
|
||||
@@ -1329,6 +1331,77 @@ void PluginManagerPrivate::profilingSummary() const
|
||||
}
|
||||
}
|
||||
|
||||
static inline QString getPlatformName()
|
||||
{
|
||||
#if defined(Q_OS_MAC)
|
||||
QString result = QLatin1String("Mac OS");
|
||||
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_0)
|
||||
result += QLatin1String(" 10.") + QString::number(QSysInfo::MacintoshVersion - QSysInfo::MV_10_0);
|
||||
return result;
|
||||
#elif defined(Q_OS_UNIX)
|
||||
QFile osReleaseFile(QLatin1String("/etc/os-release")); // Newer Linuxes
|
||||
if (osReleaseFile.open(QIODevice::ReadOnly)) {
|
||||
QString name;
|
||||
QString version;
|
||||
forever {
|
||||
const QByteArray line = osReleaseFile.readLine();
|
||||
if (line.isEmpty())
|
||||
break;
|
||||
if (line.startsWith("NAME=\""))
|
||||
name = QString::fromLatin1(line.mid(6, line.size() - 8)).trimmed();
|
||||
if (line.startsWith("VERSION_ID=\""))
|
||||
version = QString::fromLatin1(line.mid(12, line.size() - 14)).trimmed();
|
||||
}
|
||||
if (!name.isEmpty()) {
|
||||
if (!version.isEmpty())
|
||||
name += QLatin1Char(' ') + version;
|
||||
return name;
|
||||
}
|
||||
}
|
||||
QFile issueFile(QLatin1String("/etc/issue")); // Older Linuxes
|
||||
if (issueFile.open(QIODevice::ReadOnly)) {
|
||||
QByteArray issue = issueFile.readAll();
|
||||
const int end = issue.lastIndexOf(" \\n");
|
||||
if (end >= 0)
|
||||
issue.truncate(end);
|
||||
return QString::fromLatin1(issue).trimmed();
|
||||
}
|
||||
# ifdef Q_OS_LINUX
|
||||
return QLatin1String("Linux");
|
||||
# else
|
||||
return QLatin1String("Unix");
|
||||
# endif // Q_OS_LINUX
|
||||
#elif defined(Q_OS_WIN)
|
||||
QString result = QLatin1String("Windows");
|
||||
switch (QSysInfo::WindowsVersion) {
|
||||
case QSysInfo::WV_XP:
|
||||
result += QLatin1String(" XP");
|
||||
break;
|
||||
case QSysInfo::WV_2003:
|
||||
result += QLatin1String(" 2003");
|
||||
break;
|
||||
case QSysInfo::WV_VISTA:
|
||||
result += QLatin1String(" Vista");
|
||||
break;
|
||||
case QSysInfo::WV_WINDOWS7:
|
||||
result += QLatin1String(" 7");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (QSysInfo::WindowsVersion >= QSysInfo::WV_WINDOWS8)
|
||||
result += QLatin1String(" 8");
|
||||
return result;
|
||||
#endif // Q_OS_WIN
|
||||
return QLatin1String("Unknown");
|
||||
}
|
||||
|
||||
QString PluginManager::platformName()
|
||||
{
|
||||
static const QString result = getPlatformName();
|
||||
return result;
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Retrieves one object with a given name from the object pool.
|
||||
\sa addObject()
|
||||
|
||||
@@ -128,6 +128,8 @@ public:
|
||||
|
||||
static void profilingReport(const char *what, const PluginSpec *spec = 0);
|
||||
|
||||
static QString platformName();
|
||||
|
||||
signals:
|
||||
void objectAdded(QObject *obj);
|
||||
void aboutToRemoveObject(QObject *obj);
|
||||
|
||||
@@ -252,6 +252,16 @@ QString PluginSpec::category() const
|
||||
return d->category;
|
||||
}
|
||||
|
||||
/*!
|
||||
A QRegExp matching the platforms this plugin works on. An empty pattern implies all platforms.
|
||||
\since 3.0
|
||||
*/
|
||||
|
||||
QRegExp PluginSpec::platformSpecification() const
|
||||
{
|
||||
return d->platformSpecification;
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns if the plugin has its experimental flag set.
|
||||
*/
|
||||
@@ -287,9 +297,12 @@ bool PluginSpec::isEnabledInSettings() const
|
||||
*/
|
||||
bool PluginSpec::isEffectivelyEnabled() const
|
||||
{
|
||||
return !d->disabledIndirectly
|
||||
&& (d->enabledInSettings || d->forceEnabled)
|
||||
&& !d->forceDisabled;
|
||||
if (d->disabledIndirectly
|
||||
|| (!d->enabledInSettings && !d->forceEnabled)
|
||||
|| d->forceDisabled) {
|
||||
return false;
|
||||
}
|
||||
return d->platformSpecification.isEmpty() || d->platformSpecification.exactMatch(PluginManager::platformName());
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -450,6 +463,7 @@ namespace {
|
||||
const char DESCRIPTION[] = "description";
|
||||
const char URL[] = "url";
|
||||
const char CATEGORY[] = "category";
|
||||
const char PLATFORM[] = "platform";
|
||||
const char DEPENDENCYLIST[] = "dependencyList";
|
||||
const char DEPENDENCY[] = "dependency";
|
||||
const char DEPENDENCY_NAME[] = "name";
|
||||
@@ -647,7 +661,16 @@ void PluginSpecPrivate::readPluginSpec(QXmlStreamReader &reader)
|
||||
url = reader.readElementText().trimmed();
|
||||
else if (element == QLatin1String(CATEGORY))
|
||||
category = reader.readElementText().trimmed();
|
||||
else if (element == QLatin1String(DEPENDENCYLIST))
|
||||
else if (element == QLatin1String(PLATFORM)) {
|
||||
const QString platformSpec = reader.readElementText().trimmed();
|
||||
if (!platformSpec.isEmpty()) {
|
||||
platformSpecification.setPattern(platformSpec);
|
||||
if (!platformSpecification.isValid())
|
||||
reader.raiseError(QLatin1String("Invalid platform specification \"")
|
||||
+ platformSpec + QLatin1String("\": ")
|
||||
+ platformSpecification.errorString());
|
||||
}
|
||||
} else if (element == QLatin1String(DEPENDENCYLIST))
|
||||
readDependencies(reader);
|
||||
else if (element == QLatin1String(ARGUMENTLIST))
|
||||
readArgumentDescriptions(reader);
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QStringList;
|
||||
class QRegExp;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace ExtensionSystem {
|
||||
@@ -90,6 +91,7 @@ public:
|
||||
QString description() const;
|
||||
QString url() const;
|
||||
QString category() const;
|
||||
QRegExp platformSpecification() const;
|
||||
bool isExperimental() const;
|
||||
bool isDisabledByDefault() const;
|
||||
bool isEnabledInSettings() const;
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#include <QObject>
|
||||
#include <QStringList>
|
||||
#include <QXmlStreamReader>
|
||||
#include <QRegExp>
|
||||
|
||||
namespace ExtensionSystem {
|
||||
|
||||
@@ -72,6 +73,7 @@ public:
|
||||
QString description;
|
||||
QString url;
|
||||
QString category;
|
||||
QRegExp platformSpecification;
|
||||
QList<PluginDependency> dependencies;
|
||||
bool enabledInSettings;
|
||||
bool disabledIndirectly;
|
||||
|
||||
@@ -15,6 +15,9 @@
|
||||
<xsl:template match="vendor">
|
||||
"Vendor" : "<xsl:apply-templates/>",
|
||||
</xsl:template>
|
||||
<xsl:template match="platform">
|
||||
"Platform" : "<xsl:apply-templates/>",
|
||||
</xsl:template>
|
||||
<xsl:template match="category">
|
||||
"Category" : "<xsl:apply-templates/>",
|
||||
</xsl:template>
|
||||
|
||||
Reference in New Issue
Block a user