Git commit af0105c22ec80e411bf226e77f40987464e478d3 by Antonio Rojas. Committed on 31/10/2016 at 20:36. Pushed by arojas into branch 'master'. Fix editing autostart entries when /usr/local/share/applications doesn't ex= ist QFileInfo.canonicalFilePath() returns an empty string for non-existant dire= ctories, which matches any .desktop file path and makes KPropertiesDialog try to save it to the wrong location. Make sure that the = dir exists before trying to match it in the .desktop file path BUG: 371194 REVIEW: 129280 FIXED-IN: 5.28 M +2 -1 src/widgets/kpropertiesdialog.cpp http://commits.kde.org/kio/af0105c22ec80e411bf226e77f40987464e478d3 diff --git a/src/widgets/kpropertiesdialog.cpp b/src/widgets/kpropertiesdia= log.cpp index b570a85..18c8479 100644 --- a/src/widgets/kpropertiesdialog.cpp +++ b/src/widgets/kpropertiesdialog.cpp @@ -1239,7 +1239,8 @@ static QString relativeAppsLocation(const QString &fi= le) { const QString canonical =3D QFileInfo(file).canonicalFilePath(); Q_FOREACH (const QString &base, QStandardPaths::standardLocations(QSta= ndardPaths::ApplicationsLocation)) { - if (canonical.startsWith(QFileInfo(base).canonicalFilePath())) { + QDir base_dir =3D QDir(base); + if (base_dir.exists() && canonical.startsWith(base_dir.canonicalPa= th())) { return canonical.mid(base.length() + 1); } }