changeset 1234:4e3281c63564

Fixed bug when generated desktop icon was not matched and user was asked for recreation * netx/net/sourceforge/jnlp/util/XDesktopEntry.java: (getShortcutTmpFile) (getLinuxDesktopIconFile) (getLinuxMenuIconFile) now generate file name by same way. By new method getDesktopIconFileName which is using sanitizing getDesktopIconName.
author Jiri Vanek <jvanek@redhat.com>
date Tue, 09 Jun 2015 14:36:37 +0200
parents 9d92f5640f83
children 7b9e3303f691
files ChangeLog netx/net/sourceforge/jnlp/util/XDesktopEntry.java
diffstat 2 files changed, 15 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed May 27 16:56:55 2015 +0200
+++ b/ChangeLog	Tue Jun 09 14:36:37 2015 +0200
@@ -1,3 +1,11 @@
+2015-06-09  Jiri Vanek  <jvanek@redhat.com>
+
+	Fixed bug when generated desktop icon was not matched and user was asked for recreation
+	* netx/net/sourceforge/jnlp/util/XDesktopEntry.java: (getShortcutTmpFile)
+	(getLinuxDesktopIconFile) (getLinuxMenuIconFile) now generate file name by
+	same way. By new method getDesktopIconFileName which is using sanitizing 
+	getDesktopIconName.
+
 2015-05-27  Jiri Vanek  <jvanek@redhat.com>
 
 	Improved caching of files obtained via query
--- a/netx/net/sourceforge/jnlp/util/XDesktopEntry.java	Wed May 27 16:56:55 2015 +0200
+++ b/netx/net/sourceforge/jnlp/util/XDesktopEntry.java	Tue Jun 09 14:36:37 2015 +0200
@@ -266,7 +266,7 @@
 
     public File getShortcutTmpFile() {
         String userTmp = PathsAndFiles.TMP_DIR.getFullPath();
-        File shortcutFile = new File(userTmp + File.separator + FileUtils.sanitizeFileName(file.getTitle()) + ".desktop");
+        File shortcutFile = new File(userTmp + File.separator + getDesktopIconFileName());
         return shortcutFile;
     }
 
@@ -497,11 +497,15 @@
     }
 
     public File getLinuxDesktopIconFile() {
-        return new File(findFreedesktopOrgDesktopPathCatch() + "/" + getDesktopIconName() + ".desktop");
+        return new File(findFreedesktopOrgDesktopPathCatch() + "/" + getDesktopIconFileName());
     }
 
     public File getLinuxMenuIconFile() {
-        return new File(findAndVerifyJavawsMenuDir() + "/" + getDesktopIconName() + ".desktop");
+        return new File(findAndVerifyJavawsMenuDir() + "/" + getDesktopIconFileName());
+    }
+    
+    private String getDesktopIconFileName() {
+        return getDesktopIconName() + ".desktop";
     }
 
     private static String findAndVerifyGeneratedJnlpDir() {