1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
|
Origin: upstream, commit:ec7d9a85d79b45c558a4230ef35251122167064e
Author: Dmitri Ovodok <dmitrio95@yandex.ru>
Description: fix #275268: don't list non-plugin QML files in Plugin Manager
--- a/mscore/musescore.h
+++ b/mscore/musescore.h
@@ -908,7 +908,7 @@ extern bool saveXml(Score*, QIODevice*);
extern bool saveXml(Score*, const QString& name);
struct PluginDescription;
-extern void collectPluginMetaInformation(PluginDescription*);
+extern bool collectPluginMetaInformation(PluginDescription*);
extern QString getSharePath();
extern Score::FileError importMidi(MasterScore*, const QString& name);
--- a/mscore/plugin/mscorePlugins.cpp
+++ b/mscore/plugin/mscorePlugins.cpp
@@ -381,8 +381,8 @@ bool MuseScore::loadPlugin(const QString
PluginDescription* p = new PluginDescription;
p->path = path;
p->load = false;
- collectPluginMetaInformation(p);
- registerPlugin(p);
+ if (collectPluginMetaInformation(p))
+ registerPlugin(p);
result = true;
}
}
@@ -478,9 +478,11 @@ void MuseScore::pluginTriggered(QString
//---------------------------------------------------------
// collectPluginMetaInformation
+/// returns false if loading a plugin for the given
+/// description has failed
//---------------------------------------------------------
-void collectPluginMetaInformation(PluginDescription* d)
+bool collectPluginMetaInformation(PluginDescription* d)
{
qDebug("Collect meta for <%s>", qPrintable(d->path));
@@ -491,14 +493,16 @@ void collectPluginMetaInformation(Plugin
foreach(QQmlError e, component.errors()) {
qDebug(" line %d: %s", e.line(), qPrintable(e.description()));
}
- return;
+ return false;
}
QmlPlugin* item = qobject_cast<QmlPlugin*>(obj);
+ const bool isQmlPlugin = bool(item);
if (item) {
d->version = item->version();
d->description = item->description();
}
delete obj;
+ return isQmlPlugin;
}
}
--- a/mscore/plugin/pluginManager.cpp
+++ b/mscore/plugin/pluginManager.cpp
@@ -167,8 +167,8 @@ static void updatePluginList(QList<QStri
PluginDescription p;
p.path = path;
p.load = false;
- collectPluginMetaInformation(&p);
- pluginList.append(p);
+ if (collectPluginMetaInformation(&p))
+ pluginList.append(p);
}
}
}
|