diff --git a/ChangeLog b/ChangeLog index 7ab2a48..d2053ea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,2 +1,7 @@ +1.0.1: + * BUGFIX: Show correctly file names with underscores + * BUGFIX: Fixed compilation on 64bits archs (__unused can't be defined) + * BUGFIX: Require automake 1.9, which was actually used + 1.0: Initial public release diff --git a/configure.in b/configure.in index 5871069..59aa0a1 100644 --- a/configure.in +++ b/configure.in @@ -1,6 +1,6 @@ AC_INIT(src/follow-symlink.c) -AM_INIT_AUTOMAKE(libnautilus-follow-symlink, "1.0.0") +AM_INIT_AUTOMAKE([ 1.9 libnautilus-follow-symlink ], "1.0.1") AC_CONFIG_HEADER(src/config.h) dnl default FLAGS diff --git a/debian/changelog b/debian/changelog index e244ad6..7c8a3e0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +nautilus-follow-symlink (1.0.1-out.1) unstable; urgency=low + + * New upstream version + * debian/control: Bumped Build-Depends to automake1.9 + + -- Toni Corvera Fri, 1 Dec 2006 23:40:48 +0100 + nautilus-follow-symlink (1.0.0-out.1) unstable; urgency=low * Initial release diff --git a/debian/control b/debian/control index 9b17c80..320b173 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: nautilus-follow-symlink Section: contrib/gnome Priority: extra Maintainer: Toni Corvera -Build-Depends: debhelper (>= 4.0.0), gcc, libtool, pkg-config, libc6-dev, libglib2.0-dev, libnautilus-extension-dev, intltool (>= 0.18), gettext, automaken, autoconf +Build-Depends: debhelper (>= 4.0.0), gcc, libtool, pkg-config, libc6-dev, libglib2.0-dev, libnautilus-extension-dev, intltool (>= 0.18), gettext, automake1.9, autoconf Standards-Version: 3.6.2 Package: nautilus-follow-symlink diff --git a/dist b/dist index c007a32..e38bf08 100755 --- a/dist +++ b/dist @@ -36,7 +36,7 @@ check-gen-deps: \ which-aclocal \ which-autoconf \ which-autoheader \ - which-automake + which-automake-1.9 help: @echo "This file is used to aid in the setup of the build" diff --git a/po/ca.po b/po/ca.po index 90e8ede..3d548ef 100644 --- a/po/ca.po +++ b/po/ca.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: libnautilus-follow-symlink\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2006-10-30 13:46+0100\n" +"POT-Creation-Date: 2006-12-01 23:52+0100\n" "PO-Revision-Date: 2006-10-30 13:42+0100\n" "Last-Translator: Toni Corvera \n" "Language-Team: Catalan \n" @@ -15,30 +15,30 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: ../src/follow-symlink.c:218 +#: ../src/follow-symlink.c:219 #, c-format msgid "Follow symbolic _link '%s'" msgstr "Segueix l'en_llaç simbòlic '%s'" -#: ../src/follow-symlink.c:219 +#: ../src/follow-symlink.c:220 #, c-format msgid "Open the directory pointed by the symbolic link '%s'" msgstr "Obre el directori apuntat per l'enllaç simbòlic '%s'" -#: ../src/follow-symlink.c:222 +#: ../src/follow-symlink.c:223 #, c-format msgid "Open _real path of '%s'" msgstr "Obre la _ruta real de '%s'" -#: ../src/follow-symlink.c:223 +#: ../src/follow-symlink.c:224 #, c-format msgid "Open the real path of the folder pointed by '%s'" msgstr "Obre el directori apuntat per '%s'" -#: ../src/follow-symlink.c:249 +#: ../src/follow-symlink.c:284 msgid "Follow symbolic _link" msgstr "Segueix l'en_llaç simbòlic" -#: ../src/follow-symlink.c:250 +#: ../src/follow-symlink.c:285 msgid "Open the symbolic link" msgstr "Obre l'enllaç simbòlic" diff --git a/po/es.po b/po/es.po index e4639cf..ff440a4 100644 --- a/po/es.po +++ b/po/es.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: libnautilus-follow-symlink\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2006-10-30 13:46+0100\n" +"POT-Creation-Date: 2006-12-01 23:52+0100\n" "PO-Revision-Date: 2006-10-30 13:42+0100\n" "Last-Translator: Toni Corvera \n" "Language-Team: Spanish \n" @@ -17,30 +17,30 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: ../src/follow-symlink.c:218 +#: ../src/follow-symlink.c:219 #, c-format msgid "Follow symbolic _link '%s'" msgstr "Seguir en_lace simbólico '%s'" -#: ../src/follow-symlink.c:219 +#: ../src/follow-symlink.c:220 #, c-format msgid "Open the directory pointed by the symbolic link '%s'" msgstr "Abrir el directorio apuntado por el enlace simbólico '%s'" -#: ../src/follow-symlink.c:222 +#: ../src/follow-symlink.c:223 #, c-format msgid "Open _real path of '%s'" msgstr "Abrir la _ruta real de '%s'" -#: ../src/follow-symlink.c:223 +#: ../src/follow-symlink.c:224 #, c-format msgid "Open the real path of the folder pointed by '%s'" msgstr "Abrir el directoro apuntado por '%s'" -#: ../src/follow-symlink.c:249 +#: ../src/follow-symlink.c:284 msgid "Follow symbolic _link" msgstr "Seguir en_lace simbólico" -#: ../src/follow-symlink.c:250 +#: ../src/follow-symlink.c:285 msgid "Open the symbolic link" msgstr "Abrir el enlace simbólico" diff --git a/src/common.h b/src/common.h index d01dcef..33208de 100644 --- a/src/common.h +++ b/src/common.h @@ -66,7 +66,8 @@ #define __must_check __attribute__((warn_unused_result)) #define __deprecated __attribute__((deprecated)) #define __used __attribute__((used)) - #define __unused __attribute__((unused)) + // __unused gives errors in x86_64 + #define __UNUSED __attribute__((unused)) #define __packed __attribute__((packed)) #define likely(x) __builtin_expect (!!(x), 1) #define unlikely(x) __builtin_expect (!!(x), 0) @@ -86,7 +87,7 @@ #define __must_check /* no warn_unused_result */ #define __deprecated /* no deprecated */ #define __used /* no used */ - #define __unused /* no unused */ + #define __UNUSED /* no unused */ #define __packed /* no packed */ #define likely(x) (x) #define unlikely(x) (x) @@ -150,7 +151,7 @@ * Same as FSL_LOG_WITH_LEVEL but taking a va_list, this function * provides the implementation used by the other FSL_LOG_*'s */ - static inline void __unused FSL_LOG_WITH_LEVEL_IMPL(int level, + static inline void __UNUSED FSL_LOG_WITH_LEVEL_IMPL(int level, gchar * const format, va_list ap) { @@ -164,7 +165,7 @@ * Display a log message with a given log level if the level * is at least VERBOSITY_LEVEL(). */ - static void __unused __va_fprintf FSL_LOG_WITH_LEVEL(int level, + static void __UNUSED __va_fprintf FSL_LOG_WITH_LEVEL(int level, gchar * const format, ...) { @@ -180,7 +181,7 @@ * * NOTE: Variadic functions can't be inlined */ - static void __unused __va_printf FSL_LOG(gchar * const format, ...) + static void __UNUSED __va_printf FSL_LOG(gchar * const format, ...) { va_list ap; va_start(ap, format); @@ -194,7 +195,7 @@ * * NOTE: Variadic functions can't be inlined */ - static void __unused __va_fprintf FSL_LOG_COND(int cond, gchar * const format, ...) + static void __UNUSED __va_fprintf FSL_LOG_COND(int cond, gchar * const format, ...) { if (cond) { va_list ap; diff --git a/src/follow-symlink.c b/src/follow-symlink.c index 1a22e3f..6ef337e 100644 --- a/src/follow-symlink.c +++ b/src/follow-symlink.c @@ -83,7 +83,7 @@ GList * fsl_get_items_impl(GtkWidget * window, } GList * -fsl_get_background_items(NautilusMenuProvider * provider __unused, +fsl_get_background_items(NautilusMenuProvider * provider __UNUSED, GtkWidget * window, NautilusFileInfo * current_folder) { @@ -113,7 +113,7 @@ gboolean file_is_directory (const gpointer const file_data) * * */ -GList * fsl_get_file_items (NautilusMenuProvider * provider __unused, +GList * fsl_get_file_items (NautilusMenuProvider * provider __UNUSED, GtkWidget * window, GList * files) { @@ -155,7 +155,7 @@ GList * fsl_get_file_items (NautilusMenuProvider * provider __unused, * * file_info: The symbolic link */ -void fsl_callback (NautilusMenuItem * item __unused, NautilusFileInfo * file_info) +void fsl_callback (NautilusMenuItem * item __UNUSED, NautilusFileInfo * file_info) { TRACE(); @@ -205,9 +205,9 @@ void fsl_callback (NautilusMenuItem * item __unused, NautilusFileInfo * file_inf * over a (opened) folder * base_name: file name, without path, of the given file */ -NautilusMenuItem * fsl_menu_item_new(GdkScreen *screen __unused, +NautilusMenuItem * fsl_menu_item_new(GdkScreen *screen __UNUSED, gboolean is_file_item, - const gchar * base_name) + const gchar * a_base_name) { TRACE(); @@ -224,6 +224,40 @@ NautilusMenuItem * fsl_menu_item_new(GdkScreen *screen __unused, fmt_tooltip = _("Open the real path of the folder pointed by '%s'"); } + gchar * base_name = (gchar*)a_base_name; + + // Replace any _ in the file name with __ (to display correctly in the + // context menu) + { + // Count them + size_t count = 0; + for (size_t i=0; i 0) { + gchar * escaped_name = g_malloc( (strlen(base_name) + count)*sizeof(gchar) ); + gchar * src = base_name, * dst = escaped_name; + + while (count > 0) { + const gchar c = *src; + if (c == '_') { + *dst = '_'; + dst++; + + --count; + } + *dst = *src; + dst++; src++; + } + g_stpcpy(dst, src); + base_name = escaped_name; + } + } + // Trial and error showed that the menu item name must be different // when various are to be shown (multiple selections), and also that the // name should always be the same for a given file, hence the base name is @@ -231,8 +265,8 @@ NautilusMenuItem * fsl_menu_item_new(GdkScreen *screen __unused, static const gchar * const ITEM_NAME_FMT = "FsymlinkExtension::follow_symlink_%s"; name = g_try_malloc( printf_string_upper_bound(fmt_name, base_name) ); - tooltip = g_try_malloc( printf_string_upper_bound(fmt_tooltip, base_name) ); - unique_name = g_try_malloc( printf_string_upper_bound(ITEM_NAME_FMT, base_name) ); + tooltip = g_try_malloc( printf_string_upper_bound(fmt_tooltip, a_base_name) ); + unique_name = g_try_malloc( printf_string_upper_bound(ITEM_NAME_FMT, a_base_name) ); if (NULL == name || NULL == tooltip || NULL == unique_name) { @@ -255,12 +289,15 @@ NautilusMenuItem * fsl_menu_item_new(GdkScreen *screen __unused, } g_sprintf(name, fmt_name, base_name); - g_sprintf(tooltip, fmt_tooltip, base_name); - g_sprintf(unique_name, ITEM_NAME_FMT, base_name); + g_sprintf(tooltip, fmt_tooltip, a_base_name); + g_sprintf(unique_name, ITEM_NAME_FMT, a_base_name); // (name, label, tip, icon) ret = nautilus_menu_item_new(unique_name, name, tooltip, FSL_ICON); + if (base_name != a_base_name) { + g_free(base_name); + } g_free(unique_name); g_free(name); g_free(tooltip); diff --git a/src/nautilus-ext-follow-symlink.c b/src/nautilus-ext-follow-symlink.c index fb0ab7b..2838b15 100644 --- a/src/nautilus-ext-follow-symlink.c +++ b/src/nautilus-ext-follow-symlink.c @@ -38,7 +38,7 @@ void nautilus_module_initialize (GTypeModule *module) bindtextdomain(GETTEXT_PACKAGE, GNOMELOCALEDIR); textdomain(GETTEXT_PACKAGE); - g_printf("Initializing nautilus-follow-symlink extension (v.%s)\n", VERSION); + g_printf("Initializing nautilus-follow-symlink extension (v%s)\n", VERSION); fsl_register_type(module); # if 0