From 59d5e4e5edec060657d4cda0cc99c0e077ef07b7 Mon Sep 17 00:00:00 2001 From: Kai Uwe Broulik Date: Sun, 18 Dec 2016 17:16:16 +0100 Subject: [PATCH] [Icon Applet] Fix migration from old applet to new one plasmoid.configuration.url where the applet stored its URL ends up in [Configuration][General] whereas config() from C++ side ends up in [Configuration] so the new applet doesn't find the old URLs and breaks. --- applets/icon/iconapplet.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/applets/icon/iconapplet.cpp b/applets/icon/iconapplet.cpp index fded3aa38..bb689fe4b 100644 --- a/applets/icon/iconapplet.cpp +++ b/applets/icon/iconapplet.cpp @@ -61,7 +61,14 @@ void IconApplet::init() void IconApplet::populate() { - m_url = QUrl(config().readEntry(QStringLiteral("url"), QUrl())); + m_url = config().readEntry(QStringLiteral("url"), QUrl()); + + if (!m_url.isValid()) { + // the old applet that used a QML plugin and stored its url + // in plasmoid.configuration.url had its entries stored in [Configuration][General] + // so we look here as well to provide an upgrade path + m_url = config().group("General").readEntry(QStringLiteral("url"), QUrl()); + } // our backing desktop file already exists? just read all the things from it const QString path = localPath();