]> saetta.ns0.it Git - nautilus-search-tool/commitdiff
Added autogen.sh
authorAndrea Zagli <azagli@libero.it>
Sun, 26 Apr 2009 07:17:48 +0000 (07:17 +0000)
committerAndrea Zagli <azagli@libero.it>
Sun, 26 Apr 2009 07:17:48 +0000 (07:17 +0000)
Applied patches from OpenSuse

git-svn-id: http://saetta.homelinux.org/svn/nautilus-search-tool/trunk@2 20f00ee0-92f8-4baf-bd23-f7db83d90979

ChangeLog
autogen.sh
configure.ac
src/nautilus-search-tool.c
src/nautilus-search-tool.h
src/search-tool.c

index 9397eecda2652e8be0fa2685b81593dfa1ef6684..d38a2caec79af1d6bc8a732d7afd7e38a0516d39 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,14 @@
+2009-04-26  Andrea Zagli <azagli@libero.it>
+
+       * added autogen.sh (thanks to nautilus-open-terminal authors)
+       * applied patches from opensuse
+
 2009-04-12  Andrea Zagli <azagli@libero.it>
 
        * added turkish translation (thanks to Yavuz Selim)
        * fixes to work with nautilus >= 2.22 (thanks to nautilus-open-terminal
          authors)
-       * fixes to work with gnome-utils => 2.22
+       * fixes to work with gnome-utils >= 2.22
        * version 0.3.0
 
 2007-07-01  Andrea Zagli <azagli@inwind.it>
index 2de1cb98e97310ebbb066539913558a67c586fc4..81a37311029be664bf6fb80750eeddac0b7f9c68 100755 (executable)
@@ -7,7 +7,7 @@ test -z "$srcdir" && srcdir=.
 PKGNAME=nautilus-search-tool
 REQUIRED_AUTOMAKE_VERSION=1.7
 
-(test -f $srcdir/configure.in) || {
+(test -f $srcdir/configure.ac) || {
        echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
        echo " top-level $PKG_NAME directory"
        exit 1
index f721cc14bd608c707eb951986212718d8d18183f..4ac602b0c60397751cb20783c148cf5791004335 100644 (file)
@@ -1,10 +1,12 @@
 AC_PREREQ(2.59)
-AC_INIT([nautilus-search-tool], [0.3.0], [azagli@libero.it])
+AC_INIT([nautilus-search-tool], [0.3.1], [azagli@libero.it])
 AC_CONFIG_SRCDIR([src/search-tool.c])
-AM_CONFIG_HEADER(config.h)
+AM_CONFIG_HEADER([config.h])
 
 AM_INIT_AUTOMAKE
 
+AM_MAINTAINER_MODE
+
 NAUTILUS_REQUIRED=2.10.0
 EEL_REQUIRED=2.10.0
 GNOME_DESKTOP_REQUIRED=2.10.0
@@ -16,6 +18,7 @@ AC_PROG_CXX
 AC_PROG_CC
 AC_PROG_LIBTOOL
 AC_PROG_INTLTOOL([0.22])
+AC_PROG_RANLIB
 
 # Check for pkg-config
 AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, yes, no)
@@ -64,6 +67,7 @@ AC_SUBST(GNOME_SEARCH_TOOL_VERSION)
 AC_DEFINE_UNQUOTED(GNOME_SEARCH_TOOL_VERSION, "$GNOME_SEARCH_TOOL_VERSION", [gnome-search-tool version])
 
 # Checks for header files.
+AC_CHECK_HEADERS([libintl.h])
 
 # Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
index 476a1f05b6256b9e75f7c77290eaf3b29e8962be..a1cb5b412116b5a8f8cada7afea5d21c95bc71ca 100644 (file)
 #include <libnautilus-extension/nautilus-menu-provider.h>
 
 #include <glib/gi18n-lib.h>
-#include <gtk/gtkicontheme.h>
-#include <gtk/gtkwidget.h>
-#include <gconf/gconf-client.h>
-#include <libgnome/gnome-desktop-item.h>
+//#include <gtk/gtkicontheme.h>
+//#include <gtk/gtkwidget.h>
 
 static void nautilus_search_tool_instance_init (NautilusSearchTool *cvs);
 static void nautilus_search_tool_class_init    (NautilusSearchToolClass *class);
 
 static GType search_tool_type = 0;
+static gchar *gnome_search_tool = NULL;
 
 static void
 search_tool_callback (NautilusMenuItem *item,
@@ -57,11 +56,18 @@ search_tool_callback (NautilusMenuItem *item,
                {
                        if (strcmp (nautilus_file_info_get_uri_scheme (file_info), "x-nautilus-desktop") == 0)
                                {
-                                       working_directory = g_strdup_printf ("%s/Desktop", g_get_home_dir ());
+                                       working_directory = g_strdup (g_get_user_special_dir (G_USER_DIRECTORY_DESKTOP));
                                }
                        else
                                {
                                        working_directory = g_filename_from_uri (uri, NULL, NULL);
+                                       if (!nautilus_file_info_is_directory (file_info)) {
+                                               gchar *tmp;
+
+                                               tmp = g_path_get_dirname (working_directory);
+                                               g_free (working_directory);
+                                               working_directory = tmp;
+                                       }
                                }
                }
        else
@@ -69,17 +75,14 @@ search_tool_callback (NautilusMenuItem *item,
                        working_directory = g_strdup (g_get_home_dir ());
                }
 
-       if (!nautilus_file_info_is_directory (file_info))
-               working_directory = g_path_get_dirname (working_directory);
-
        g_free (uri);
 
-       argv[0] = g_strdup ("gnome-search-tool");
+       argv[0] = gnome_search_tool;
        quoted_directory = g_shell_quote (working_directory);
 
 #ifdef GNOME_SEARCH_TOOL_VERSION
        guint i;
-       gchar *version;
+       gchar *version = NULL;
 
        gchar **array_version = g_strsplit (GNOME_SEARCH_TOOL_VERSION, " ", -1);
        guint array_lenght = g_strv_length (array_version);
@@ -92,6 +95,7 @@ search_tool_callback (NautilusMenuItem *item,
                                        g_strfreev (array_version);
 
                                        array_version = g_strsplit (version, ".", -1);
+                                       g_free (version);
                                        break;
                                }
                }
@@ -106,16 +110,15 @@ search_tool_callback (NautilusMenuItem *item,
                        argv[2] = NULL;
                }
 
-       g_free (version);
        g_strfreev (array_version);
 #else
        argv[1] = NULL;
-#endif /* GNOME_SEARCH_TOOL */
+#endif /* GNOME_SEARCH_TOOL_VERSION */
 
        g_spawn_async (working_directory,
                       argv,
                       NULL,
-                      G_SPAWN_SEARCH_PATH,
+                      0,
                       NULL,
                       NULL,
                       NULL,
@@ -123,7 +126,6 @@ search_tool_callback (NautilusMenuItem *item,
 
        g_free (quoted_directory);
        g_free (working_directory);
-       g_free (argv[0]);
        g_free (argv[1]);
 }
 
@@ -142,6 +144,8 @@ nautilus_search_tool_get_background_items (NautilusMenuProvider *provider,
                                            NautilusFileInfo     *file_info)
 {
        NautilusMenuItem *item;
+       if (!gnome_search_tool)
+               return NULL;
 
        item = search_tool_menu_item_new ();
        g_signal_connect (item, "activate",
@@ -158,6 +162,9 @@ nautilus_search_tool_get_file_items (NautilusMenuProvider *provider,
 {
        NautilusMenuItem *item;
 
+       if (!gnome_search_tool)
+               return NULL;
+
        if (g_list_length (files) != 1)
                return NULL;
 
@@ -222,4 +229,13 @@ nautilus_search_tool_register_type (GTypeModule *module)
                                     search_tool_type,
                                     NAUTILUS_TYPE_MENU_PROVIDER,
                                     &menu_provider_iface_info);
+
+       gnome_search_tool = g_find_program_in_path ("gnome-search-tool");
+}
+
+void
+nautilus_search_tool_free (void)
+{
+       g_free (gnome_search_tool);
+       gnome_search_tool = NULL;
 }
index 889c9fd4a24d2cb227d2bdab4c08689e61ec3023..89ca3bf8535f3d16499121760697be5da21c22ea 100644 (file)
@@ -47,7 +47,8 @@ struct _NautilusSearchToolClass {
 };
 
 GType nautilus_search_tool_get_type (void);
-void  nautilus_search_tool_register_type (GTypeModule *module);
+void nautilus_search_tool_register_type (GTypeModule *module);
+void nautilus_search_tool_free (void);
 
 G_END_DECLS
 
index 2c5b0be6e01d88f20c9f96ce0cbd5d5b82d7f04f..9d56db5c894e350ce5dfad0b7acd590d0cb1671c 100644 (file)
@@ -47,6 +47,8 @@ void
 nautilus_module_shutdown (void)
 {
        g_print ("Shutting down nautilus-search-tool extension\n");
+
+       nautilus_search_tool_free ();
 }
 
 void