summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Nienhüser <nienhueser@kde.org>2016-07-24 07:40:50 (GMT)
committerDennis Nienhüser <nienhueser@kde.org>2016-07-24 07:58:45 (GMT)
commitce202433b9255b32f69511ef5f69c2596bdaf3ec (patch)
tree5e43b3af4d1fe71355ce67d7a850ad2465773749
parent381aab379e5a95698f906748ad28602f0aa7c043 (diff)
Fix plugin upgrade problem on Android
QFile::copy does not overwrite existing files, so old plugins were kept around and prevented a start on upgrades. Now deleting all plugins at startup in any case. This ensures a correct start even if plugins are removed in an upgrade, but results in a slower startup also.
-rw-r--r--src/lib/marble/PluginManager.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lib/marble/PluginManager.cpp b/src/lib/marble/PluginManager.cpp
index ff46ce7..3b665bf 100644
--- a/src/lib/marble/PluginManager.cpp
+++ b/src/lib/marble/PluginManager.cpp
@@ -290,6 +290,13 @@ void PluginManagerPrivate::loadPlugins()
QDir pluginHome(MarbleDirs::localPath());
pluginHome.mkpath(MarbleDirs::pluginLocalPath());
pluginHome.setCurrent(MarbleDirs::pluginLocalPath());
+
+ QStringList pluginNameFilter = QStringList() << "lib*.so";
+ QStringList const existingPlugins = QDir(MarbleDirs::pluginLocalPath()).entryList(pluginNameFilter, QDir::Files);
+ foreach(const QString &existingPlugin, existingPlugins) {
+ QFile::remove(existingPlugin);
+ }
+
foreach (const QString & file, copyList) {
QString const target = MarbleDirs::pluginLocalPath() + '/' + file;
if (QFileInfo(MarbleDirs::pluginSystemPath() + '/' + file).isDir()) {