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 706807 - Do not leave behind stale .desktop files
Do not leave behind stale .desktop files
Status: RESOLVED FIXED
Product: alacarte
Classification: Applications
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Alacarte Maintainer(s)
Alacarte Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2013-08-26 14:41 UTC by Stefano Facchini
Modified: 2013-08-26 16:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Do not leave behind stale .desktop files (2.75 KB, patch)
2013-08-26 14:41 UTC, Stefano Facchini
reviewed Details | Review
Do not leave behind stale .desktop files (2.55 KB, patch)
2013-08-26 15:47 UTC, Stefano Facchini
committed Details | Review

Description Stefano Facchini 2013-08-26 14:41:17 UTC
see patch
Comment 1 Stefano Facchini 2013-08-26 14:41:19 UTC
Created attachment 253142 [details] [review]
Do not leave behind stale .desktop files

If the user clicked on Cancel in the Editor dialog, we should remove
the .desktop file we just copied to ~/.local/share/applications.
Comment 2 Jasper St. Pierre (not reading bugmail) 2013-08-26 14:56:24 UTC
Review of attachment 253142 [details] [review]:

::: Alacarte/MainWindow.py
@@ +307,2 @@
         if not os.path.isfile(file_path):
+            self.file_path = file_path

Can you not save this to self, but instead make it part of the user_data that you connect to? 'self.file_path' isn't very descriptive, when it actually means 'the file path of a temporary file that we should remove if unmodified if the actual file does not exist'
Comment 3 Stefano Facchini 2013-08-26 15:47:31 UTC
Created attachment 253148 [details] [review]
Do not leave behind stale .desktop files

If the user clicked on Cancel in the Editor dialog, we should remove
the .desktop file we just copied to ~/.local/share/applications.
Comment 4 Jasper St. Pierre (not reading bugmail) 2013-08-26 15:51:29 UTC
Review of attachment 253148 [details] [review]:

minor Python nit, otherwise looks good

::: Alacarte/MainWindow.py
@@ +314,3 @@
 
+    def on_editor_response(self, editor, modified, file_path):
+        if not modified and file_path != None:

file_path is not None
Comment 5 Stefano Facchini 2013-08-26 16:00:26 UTC
Attachment 253148 [details] pushed as fab91e9 - Do not leave behind stale .desktop files