[Bug 923360] [kde-workspace] kcontrol/autostart: make sure to use the same file name when replicating a desktop file
Harald Sitter
sitter.harald at gmail.com
Mon Dec 10 09:41:54 UTC 2012
Git commit f90f52488b0bef192395b77764fae41491dbb832 by Harald Sitter.
Committed on 10/12/2012 at 10:41.
Pushed by sitter into branch 'master'.
make sure to use the same file name when replicating a desktop file
when replicating an existing desktop file also use the exactly same
entry name to enable users to override a global autostart (e.g. from
a distro)
previously the translated name was used.
(user visible names etc. remain working as expected, so are desktop files
replicated before this change)
https://bugs.launchpad.net/ubuntu/+source/kde-workspace/+bug/923360
CCMAIL: 923360 at bugs.launchpad.net
M +13 -3 kcontrol/autostart/autostart.cpp
http://commits.kde.org/kde-
workspace/f90f52488b0bef192395b77764fae41491dbb832
diff --git a/kcontrol/autostart/autostart.cpp b/kcontrol/autostart/autostart.cpp
index 02c2f0e..4ed6764 100644
--- a/kcontrol/autostart/autostart.cpp
+++ b/kcontrol/autostart/autostart.cpp
@@ -260,9 +260,17 @@ void Autostart::slotAddProgram()
return; // Don't crash if KOpenWith wasn't able to create service.
}
+ // It is important to ensure that we make an exact copy of an existing
+ // desktop file (if selected) to enable users to override global autostarts.
+ // Also see
+ // https://bugs.launchpad.net/ubuntu/+source/kde-workspace/+bug/923360
+ QString desktopPath;
KUrl desktopTemplate;
if ( service->desktopEntryName().isEmpty() ) {
- desktopTemplate = KUrl( m_paths[4] + service->name() + ".desktop" );
+ // Build custom desktop file (e.g. when the user entered an executable
+ // name in the OpenWithDialog).
+ desktopPath = m_paths[4] + service->name() + ".desktop";
+ desktopTemplate = KUrl( desktopPath );
KConfig kc(desktopTemplate.path(), KConfig::SimpleConfig);
KConfigGroup kcg = kc.group("Desktop Entry");
kcg.writeEntry("Exec",service->exec());
@@ -280,13 +288,15 @@ void Autostart::slotAddProgram()
}
else
{
+ // Use existing desktop file and use same file name to enable overrides.
+ desktopPath = m_paths[4] + service->desktopEntryName() + ".desktop";
desktopTemplate = KUrl( KStandardDirs::locate("apps", service->entryPath()) );
- KPropertiesDialog dlg( desktopTemplate, KUrl(m_paths[4]), service->name() + ".desktop", this );
+ KPropertiesDialog dlg( desktopTemplate, KUrl(m_paths[4]), service->desktopEntryName() + ".desktop", this );
if ( dlg.exec() != QDialog::Accepted )
return;
}
- DesktopStartItem * item = new DesktopStartItem( m_paths[4] + service->name() + ".desktop", m_programItem,this );
+ DesktopStartItem * item = new DesktopStartItem( desktopPath, m_programItem,this );
addItem( item, service->name(), m_pathName[0], service->exec() , false);
}
** Also affects: kde-workspace (Ubuntu Precise)
Importance: Undecided
Status: New
** Also affects: kde-workspace (Ubuntu Quantal)
Importance: Undecided
Status: New
** Also affects: kde-workspace (Ubuntu Raring)
Importance: Undecided
Status: New
** Changed in: kde-workspace (Ubuntu Raring)
Status: New => In Progress
** Changed in: kde-workspace (Ubuntu Quantal)
Status: New => Triaged
** Changed in: kde-workspace (Ubuntu Precise)
Status: New => Triaged
** Changed in: kde-workspace (Ubuntu Precise)
Importance: Undecided => Low
** Changed in: kde-workspace (Ubuntu Raring)
Importance: Undecided => Low
** Changed in: kde-workspace (Ubuntu Raring)
Assignee: (unassigned) => Harald Sitter (apachelogger)
** Changed in: kde-workspace (Ubuntu Quantal)
Assignee: (unassigned) => Harald Sitter (apachelogger)
** Changed in: kde-workspace (Ubuntu Precise)
Assignee: (unassigned) => Harald Sitter (apachelogger)
** Changed in: kde-workspace (Ubuntu Quantal)
Importance: Undecided => Low
--
You received this bug notification because you are a member of Kubuntu
Bugs, which is subscribed to kde-workspace in Ubuntu.
https://bugs.launchpad.net/bugs/923360
Title:
systemsettings/start_and_shutdown shouldn't generate localized
.desktop file names
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/kde-workspace/+bug/923360/+subscriptions
More information about the kubuntu-bugs
mailing list