fix: default apps
This commit is contained in:
parent
51eb065399
commit
0426b57b8d
1 changed files with 3 additions and 3 deletions
|
@ -340,12 +340,12 @@ bool MimeAppManager::setDefaultAppForFile(const QString &filePath, const QString
|
||||||
KConfig::NoGlobals,
|
KConfig::NoGlobals,
|
||||||
QStandardPaths::GenericConfigLocation);
|
QStandardPaths::GenericConfigLocation);
|
||||||
KConfigGroup defaultApp(profile, "Default Applications");
|
KConfigGroup defaultApp(profile, "Default Applications");
|
||||||
defaultApp.writeXdgListEntry(mimeType.name(), {desktop});
|
defaultApp.writeXdgListEntry(mimeType.name(), {value});
|
||||||
|
|
||||||
KConfigGroup addedApps(profile, "Added Associations");
|
KConfigGroup addedApps(profile, "Added Associations");
|
||||||
QStringList apps = addedApps.readXdgListEntry(mimeType.name());
|
QStringList apps = addedApps.readXdgListEntry(mimeType.name());
|
||||||
apps.removeAll(desktop);
|
apps.removeAll(value);
|
||||||
apps.prepend(desktop); // make it the preferred app
|
apps.prepend(value); // make it the preferred app
|
||||||
addedApps.writeXdgListEntry(mimeType.name(), apps);
|
addedApps.writeXdgListEntry(mimeType.name(), apps);
|
||||||
|
|
||||||
profile->sync();
|
profile->sync();
|
||||||
|
|
Loading…
Reference in a new issue