After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 729429 - Update the favourite apps list for new nautilus and gnome-documents names
Update the favourite apps list for new nautilus and gnome-documents names
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
3.13.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2014-05-02 20:48 UTC by Kalev Lember
Modified: 2014-07-22 12:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Update the default favourite apps list for renamed desktop files (1.35 KB, patch)
2014-05-02 20:51 UTC, Kalev Lember
committed Details | Review
appFavorites: Automatically update desktop file names in user settings (1.49 KB, patch)
2014-05-02 20:51 UTC, Kalev Lember
reviewed Details | Review
appFavorites: Automatically update desktop file names in user settings (2.03 KB, patch)
2014-05-02 23:47 UTC, Kalev Lember
committed Details | Review

Description Kalev Lember 2014-05-02 20:48:30 UTC
Apps are slowly moving over to DBus activation and changing their desktop file names because of that. It's easy enough to update the defaults, but I think we should also do something with the list of favourites that are saved in users GSettings. Attaching a patch to that effect; it's not pretty but I guess it's better than having the file browser vanish on upgrades.
Comment 1 Kalev Lember 2014-05-02 20:51:36 UTC
Created attachment 275702 [details] [review]
Update the default favourite apps list for renamed desktop files

Nautilus and gnome-documents have changed their desktop file names to
support DBus activation.
Comment 2 Kalev Lember 2014-05-02 20:51:40 UTC
Created attachment 275703 [details] [review]
appFavorites: Automatically update desktop file names in user settings

This adds a table with mappings for GNOME apps that have recently
renamed their desktop files, and automatically switches over to their
new names.

Most importantly, it makes sure the file browser doesn't vanish on
upgrades.
Comment 3 Florian Müllner 2014-05-02 21:02:28 UTC
Review of attachment 275702 [details] [review]:

Sure
Comment 4 Florian Müllner 2014-05-02 21:25:53 UTC
Review of attachment 275703 [details] [review]:

::: js/ui/appFavorites.js
@@ +27,3 @@
+        if (appId == 'gnome-documents.desktop')
+            return 'org.gnome.Documents.desktop';
+        else if (appId == 'nautilus.desktop')

Considering that there'll be likely more entries in the future, I'd prefer a switch statement.
(Also: if we are doing this, I don't see why we should restrict desktop id translation to ids in the default list - if a user had added gnome-clocks before the desktop file got renamed, it's as OK to have the icon disappear as the file manager ...)

@@ +35,2 @@
     reload: function() {
+        let ids = global.settings.get_strv(this.FAVORITE_APPS_KEY).map(this._updateAppId);

This should be temporary, not something we'll have to maintain forever IMHO. So the problem here is that unless users make changes to their favorites, we keep storing the old id. Maybe we should instead check if there are ids that need translation and write out the translated list if that's the case?
Comment 5 Jasper St. Pierre (not reading bugmail) 2014-05-02 21:34:13 UTC
Ryan wants to have a way of saying "Alias=" or something for legacy name compatibility.
Comment 6 Kalev Lember 2014-05-02 21:55:28 UTC
That sounds much nicer, indeed.
Comment 7 Kalev Lember 2014-05-02 22:03:01 UTC
Comment on attachment 275702 [details] [review]
Update the default favourite apps list for renamed desktop files

Attachment 275702 [details] pushed as 0832ca5 - Update the default favourite apps list for renamed desktop files
Comment 8 Kalev Lember 2014-05-02 23:36:23 UTC
(In reply to comment #4)
> This should be temporary, not something we'll have to maintain forever IMHO. So
> the problem here is that unless users make changes to their favorites, we keep
> storing the old id. Maybe we should instead check if there are ids that need
> translation and write out the translated list if that's the case?

Yes, saving it back makes sense to me. I can think of some edge cases where this could be unwanted, though:

 - developers with parallel jhbuild setup: if jhbuilt gnome-shell updates the favourites with the new desktop file names, it can cause stuff to disappear from the host system, because it's likely to have older apps.
 - corporations with e.g. RHEL 7 and Fedora 21 running from the same NFS home directory
Comment 9 Kalev Lember 2014-05-02 23:47:32 UTC
Created attachment 275724 [details] [review]
appFavorites: Automatically update desktop file names in user settings

This adds a table with mappings for GNOME apps that have recently
renamed their desktop files, and updates user settings with the new
names.
Comment 10 Kalev Lember 2014-05-02 23:57:25 UTC
I've updated the patch taking into account the review comments. It now saves back the updated favourite apps list and hopefully makes it easier to add more entries in the future. And I've added a few more desktop files to the list that I could find.

Not sure it's actually worth committing this though if "Alias=" is coming soon.
Comment 11 Matthias Clasen 2014-05-03 15:49:18 UTC
another shell setting we need to update for these name changes is app folder configuration
Comment 12 Allison Karlitskaya (desrt) 2014-05-22 21:51:38 UTC
To clarify: if we introduced this, it would have to be in the form of installing a desktop file with the _old_ name and having it look like:

[Desktop Entry]
AliasFor=org.gnome.NewName


If we did it the other "obvious" way then the process of looking up a desktop file by its aliased name would be extremely slow (since you would need to search through all files looking for Alias= lines).
Comment 13 Jasper St. Pierre (not reading bugmail) 2014-05-22 21:55:11 UTC
Yeah, that's what I meant. I think that's comfortable for most developers.
Comment 14 Kalev Lember 2014-05-22 22:19:56 UTC
There are also a bunch of apps that have gone through, or are planning to go through several renames. e.g. gnomine.desktop -> gnome-mines.desktop in the 3.12 cycle, and likely going for org.gnome.Mines.desktop in the future.
Comment 15 Kalev Lember 2014-07-20 15:22:25 UTC
Doesn't look like AliasFor has landed yet and 3.13.90 tarballs are due tomorrow. Can we go with the fix here and revert it when a better, alternative solution is ready?
Comment 16 Jasper St. Pierre (not reading bugmail) 2014-07-20 15:37:37 UTC
Review of attachment 275724 [details] [review]:

Sure.
Comment 17 Kalev Lember 2014-07-22 12:21:22 UTC
Attachment 275724 [details] pushed as cceac0d - appFavorites: Automatically update desktop file names in user settings

Thanks. I added a few more renamed desktop files I could find and pushed this.