Mercurial > hg > release > icedtea-web-1.8
changeset 1543:87556fa6a511
Desktop sortcuts name is now based on title. And only if missing, then on file
* netx/net/sourceforge/jnlp/JNLPFile.java: new method of createNameForDesktopFile, which
returns title if it is present, jnlp file name otherwise.
* netx/net/sourceforge/jnlp/util/XDesktopEntry.java: getGeneratedJnlpFileName and getDesktopIconName now uses
* NEWS: mentioned
author | Jiri Vanek <jvanek@redhat.com> |
---|---|
date | Thu, 07 Feb 2019 14:12:39 +0100 |
parents | 3a3e13df995c |
children | daea55188c54 |
files | ChangeLog NEWS netx/net/sourceforge/jnlp/JNLPFile.java netx/net/sourceforge/jnlp/util/XDesktopEntry.java |
diffstat | 4 files changed, 22 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Wed Feb 06 19:05:05 2019 +0100 +++ b/ChangeLog Thu Feb 07 14:12:39 2019 +0100 @@ -1,3 +1,11 @@ +2019-02-07 Jiri Vanek <jvanek@redhat.com> + + Desktop sortcuts name is now based on title. And only if missing, then on file + * netx/net/sourceforge/jnlp/JNLPFile.java: new method of createNameForDesktopFile, which + returns title if it is present, jnlp file name otherwise. + * netx/net/sourceforge/jnlp/util/XDesktopEntry.java: getGeneratedJnlpFileName and getDesktopIconName now uses + * NEWS: mentioned + 2019-02-06 Jiri Vanek <jvanek@redhat.com> Delete-by app dialogue split keys to two groups instead of mixing them
--- a/NEWS Wed Feb 06 19:05:05 2019 +0100 +++ b/NEWS Thu Feb 07 14:12:39 2019 +0100 @@ -16,6 +16,7 @@ * deployment.config now support generic url instead just file * Added support for windows desktop shortcuts via https://github.com/DmitriiShamrikov/mslinks * cache can now be operated by groups, list by -Xcacheids (details via -verbose, can filter by regex), Xclearcache now can clear only selected id. There is also gui to operate cache via id in itweb-settings now. +* desktop shortcut name get shortened to title or file if title is missing. New in release 1.7 (2017-07-19): * PR3366 - bash completion file was split to three, and is setup-able by bashcompdir environment variable
--- a/netx/net/sourceforge/jnlp/JNLPFile.java Wed Feb 06 19:05:05 2019 +0100 +++ b/netx/net/sourceforge/jnlp/JNLPFile.java Thu Feb 07 14:12:39 2019 +0100 @@ -1190,7 +1190,7 @@ return "Generated from applet from " + createJnlpVendorValue(); } - public String createJnlpTitleValue() { + private String createJnlpTitleValue() { final String location; if (getSourceLocation() != null) { location = new File(getSourceLocation().getFile()).getName(); @@ -1215,6 +1215,15 @@ return getTitle() + " from " + createJnlpTitleValue(); } + public String createNameForDesktopFile() { + String basicTitle = getTitle(); + if (basicTitle == null || basicTitle.trim().isEmpty()) { + return createJnlpTitleValue().replaceAll(".jnlp$",""); + } else { + return basicTitle; + } + } + //not private for testing purposes static String[] splitEntryPoints(String entryPointString) { if (entryPointString == null || entryPointString.trim().isEmpty()) {
--- a/netx/net/sourceforge/jnlp/util/XDesktopEntry.java Wed Feb 06 19:05:05 2019 +0100 +++ b/netx/net/sourceforge/jnlp/util/XDesktopEntry.java Thu Feb 07 14:12:39 2019 +0100 @@ -414,7 +414,7 @@ @Override public File getGeneratedJnlpFileName() { - String name = FileUtils.sanitizeFileName(file.createJnlpTitle()); + String name = FileUtils.sanitizeFileName(file.createNameForDesktopFile()); while (name.endsWith(".jnlp")) { name = name.substring(0, name.length() - 5); } @@ -558,9 +558,10 @@ } static String getDesktopIconName(JNLPFile file) { - return sanitize(file.createJnlpTitle()); + return sanitize(file.createNameForDesktopFile()); } + @Override public File getDesktopIconFile() { return new File(getDesktop(), getDesktopIconFileName()); }