diff -Nru plank-0.11.2+bzr1577/ChangeLog plank-0.11.2+bzr1578/ChangeLog --- plank-0.11.2+bzr1577/ChangeLog 2016-11-05 19:52:42.000000000 +0000 +++ plank-0.11.2+bzr1578/ChangeLog 2016-11-06 11:57:13.000000000 +0000 @@ -1,3 +1,9 @@ +2016-11-06 Rico Tzschichholz + + filedockitem: Use the file's display-name where possible + + This is the proper string to use for user-visible references to a file. + 2016-11-05 Rico Tzschichholz appdockitem: Trust bamf with providing us the window-count diff -Nru plank-0.11.2+bzr1577/configure plank-0.11.2+bzr1578/configure --- plank-0.11.2+bzr1577/configure 2016-11-05 19:51:49.000000000 +0000 +++ plank-0.11.2+bzr1578/configure 2016-11-06 11:56:20.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for plank 0.11.2.1577. +# Generated by GNU Autoconf 2.69 for plank 0.11.2.1578. # # Report bugs to . # @@ -650,8 +650,8 @@ # Identity of this package. PACKAGE_NAME='plank' PACKAGE_TARNAME='plank' -PACKAGE_VERSION='0.11.2.1577' -PACKAGE_STRING='plank 0.11.2.1577' +PACKAGE_VERSION='0.11.2.1578' +PACKAGE_STRING='plank 0.11.2.1578' PACKAGE_BUGREPORT='https://bugs.launchpad.net/plank' PACKAGE_URL='https://launchpad.net/plank' @@ -1537,7 +1537,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures plank 0.11.2.1577 to adapt to many kinds of systems. +\`configure' configures plank 0.11.2.1578 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1608,7 +1608,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of plank 0.11.2.1577:";; + short | recursive ) echo "Configuration of plank 0.11.2.1578:";; esac cat <<\_ACEOF @@ -1765,7 +1765,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -plank configure 0.11.2.1577 +plank configure 0.11.2.1578 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2255,7 +2255,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by plank $as_me 0.11.2.1577, which was +It was created by plank $as_me 0.11.2.1578, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3145,7 +3145,7 @@ # Define the identity of the package. PACKAGE='plank' - VERSION='0.11.2.1577' + VERSION='0.11.2.1578' cat >>confdefs.h <<_ACEOF @@ -19385,7 +19385,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by plank $as_me 0.11.2.1577, which was +This file was extended by plank $as_me 0.11.2.1578, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -19452,7 +19452,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -plank config.status 0.11.2.1577 +plank config.status 0.11.2.1578 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -Nru plank-0.11.2+bzr1577/debian/changelog plank-0.11.2+bzr1578/debian/changelog --- plank-0.11.2+bzr1577/debian/changelog 2016-11-05 19:52:48.000000000 +0000 +++ plank-0.11.2+bzr1578/debian/changelog 2016-11-06 11:57:20.000000000 +0000 @@ -1,8 +1,8 @@ -plank (0.11.2+bzr1577-0ubuntu1~17.04~ricotz1) zesty; urgency=high +plank (0.11.2+bzr1578-0ubuntu1~17.04~ricotz1) zesty; urgency=high - * New development release of lp:plank bzr1577 + * New development release of lp:plank bzr1578 - -- Rico Tzschichholz Sat, 05 Nov 2016 20:52:48 +0100 + -- Rico Tzschichholz Sun, 06 Nov 2016 12:57:20 +0100 plank (0.11.1-1) unstable; urgency=medium diff -Nru plank-0.11.2+bzr1577/lib/Items/FileDockItem.vala plank-0.11.2+bzr1578/lib/Items/FileDockItem.vala --- plank-0.11.2+bzr1577/lib/Items/FileDockItem.vala 2016-11-05 19:51:10.000000000 +0000 +++ plank-0.11.2+bzr1578/lib/Items/FileDockItem.vala 2016-11-06 11:55:43.000000000 +0000 @@ -92,7 +92,7 @@ return; } - Text = OwnedFile.get_basename () ?? ""; + Text = get_display_name (OwnedFile); // pop up the dir contents on a left click too if (OwnedFile.query_file_type (0) == FileType.DIRECTORY) { @@ -189,20 +189,22 @@ var icons = new Gee.HashMap (); var keys = new Gee.ArrayList (); - foreach (var file in get_files ()) { + get_files (OwnedFile).map_iterator ().foreach ((display_name, file) => { string icon, text; var uri = file.get_uri (); if (uri.has_suffix (".desktop")) { ApplicationDockItem.parse_launcher (uri, out icon, out text); } else { icon = DrawingService.get_icon_from_file (file) ?? ""; - text = file.get_basename () ?? ""; + text = display_name ?? ""; } var key = "%s%s".printf (text, uri); icons.set (key, icon); keys.add (key); - } + + return true; + }); var pos = 0; var icon_width = (int) ((width - 80 * radius / 33.0) / 2.0); @@ -272,7 +274,7 @@ var menu_items = new Gee.HashMap (); var keys = new Gee.ArrayList (); - foreach (var file in get_files ()) { + get_files (OwnedFile).map_iterator ().foreach ((display_name, file) => { Gtk.MenuItem item; string icon, text; var uri = file.get_uri (); @@ -286,7 +288,7 @@ }); } else { icon = DrawingService.get_icon_from_file (file) ?? ""; - text = file.get_basename () ?? ""; + text = display_name ?? ""; text = text.replace ("_", "__"); item = create_menu_item (text, icon, true); item.activate.connect (() => { @@ -299,7 +301,9 @@ var key = "%s%s".printf (text, uri); menu_items.set (key, item); keys.add (key); - } + + return true; + }); keys.sort (); foreach (var s in keys) @@ -354,13 +358,14 @@ return items; } - Gee.ArrayList get_files () + static Gee.HashMap get_files (File file) { - var files = new Gee.ArrayList (); + var files = new Gee.HashMap (); var count = 0U; try { - var enumerator = OwnedFile.enumerate_children (FileAttribute.STANDARD_NAME + "," + var enumerator = file.enumerate_children (FileAttribute.STANDARD_NAME + "," + + FileAttribute.STANDARD_DISPLAY_NAME + "," + FileAttribute.STANDARD_IS_HIDDEN + "," + FileAttribute.ACCESS_CAN_READ, 0); @@ -371,15 +376,28 @@ continue; if (count++ >= FOLDER_MAX_FILE_COUNT) { - critical ("There are way too many files (%u+) in '%s'.", FOLDER_MAX_FILE_COUNT, OwnedFile.get_path ()); + critical ("There are way too many files (%u+) in '%s'.", FOLDER_MAX_FILE_COUNT, file.get_path ()); break; } - - files.add (OwnedFile.get_child (info.get_name ())); + + unowned string name = info.get_name (); + files.set (info.get_display_name () ?? name, file.get_child (name)); } } catch { } return files; } + + static string get_display_name (File file) + { + try { + var info = file.query_info (FileAttribute.STANDARD_NAME + "," + FileAttribute.STANDARD_DISPLAY_NAME, 0); + return info.get_display_name () ?? info.get_name (); + } catch { } + + debug ("Could not get display-name for '%s'", file.get_path () ?? ""); + + return "Unknown"; + } } } diff -Nru plank-0.11.2+bzr1577/.tarball-version plank-0.11.2+bzr1578/.tarball-version --- plank-0.11.2+bzr1577/.tarball-version 2016-11-05 19:52:43.000000000 +0000 +++ plank-0.11.2+bzr1578/.tarball-version 2016-11-06 11:57:14.000000000 +0000 @@ -1 +1 @@ -0.11.2.1577 +0.11.2.1578 diff -Nru plank-0.11.2+bzr1577/.version plank-0.11.2+bzr1578/.version --- plank-0.11.2+bzr1577/.version 2016-11-05 19:51:58.000000000 +0000 +++ plank-0.11.2+bzr1578/.version 2016-11-06 11:56:29.000000000 +0000 @@ -1 +1 @@ -0.11.2.1577 +0.11.2.1578