[Icon Applet] Fully re-populate when user changes Link URL

When applying KPropertiesDialog of a Link desktop file, the URL might have changed.
In this case nuke the local file and start afresh.

Differential Revision: https://phabricator.kde.org/D3906
wilder-5.14
Kai Uwe Broulik 9 years ago
parent bc46f16323
commit 53c4f98a33
  1. 9
      applets/icon/iconapplet.cpp

@ -362,7 +362,14 @@ void IconApplet::configure()
m_configDialog = dialog;
connect(dialog, &KPropertiesDialog::applied, this, [this] {
populate();
KDesktopFile desktopFile(m_localPath);
if (desktopFile.hasLinkType()) {
// make sure to fully repopulate in case the user changed the Link URL
QFile::remove(m_localPath);
setUrl(QUrl(desktopFile.readUrl())); // calls populate() itself
} else {
populate();
}
});
dialog->setAttribute(Qt::WA_DeleteOnClose, true);

Loading…
Cancel
Save