[nautilus-actions] Make all warnings errord and fix them
- From: Pierre Wieser <pwieser src gnome org>
- To: svn-commits-list gnome org
- Subject: [nautilus-actions] Make all warnings errord and fix them
- Date: Sat, 16 May 2009 18:02:23 -0400 (EDT)
commit 800fac1734903580c13955242ce27681f7c5dc07
Author: Pierre Wieser <pwieser trychlos org>
Date: Sun May 17 00:05:21 2009 +0200
Make all warnings errord and fix them
---
configure.ac | 4 +-
.../nautilus-actions-config-gconf-reader.c | 47 ++++--
.../nautilus-actions-config-schema-reader.c | 130 ++++++++-------
libnautilus-actions/nautilus-actions-config.c | 105 +++++++------
m4/cmdline-tools.m4 | 1 +
nact/nact-editor.c | 146 +++++++++--------
nact/nact-import-export.c | 92 ++++++-----
nact/nact-profile-editor.c | 170 +++++++++++---------
nact/nact-utils.c | 73 +++++----
nact/nact.c | 95 +++++++----
plugin/nautilus-actions.c | 35 +++--
utils/nautilus-actions-check-actions-change.c | 38 +++--
utils/nautilus-actions-tools-utils.c | 36 +++--
13 files changed, 548 insertions(+), 424 deletions(-)
diff --git a/configure.ac b/configure.ac
index a3168bc..a06af49 100644
--- a/configure.ac
+++ b/configure.ac
@@ -55,6 +55,7 @@ AC_CONFIG_FILES([
AC_CONFIG_MACRO_DIR([m4])
+# pwi 2009-05-15 disabled as useless or badly explained
#AC_SUBST(ACLOCAL_AMFLAGS, "$ACLOCAL_FLAGS")
# don't agree with maintainer mode use
@@ -75,7 +76,7 @@ AC_PROG_MAKE_SET
# Gnome stuff
GNOME_COMMON_INIT
GNOME_MAINTAINER_MODE_DEFINES
-GNOME_COMPILE_WARNINGS
+GNOME_COMPILE_WARNINGS([error])
AC_SUBST([AM_CPPFLAGS],["${AM_CPPFLAGS} ${DISABLE_DEPRECATED}"])
AC_SUBST([AM_CFLAGS],["${AM_CFLAGS} ${WARN_CFLAGS}"])
@@ -149,6 +150,7 @@ NACT_COMMANDLINE_TOOLS
AC_CHECK_LIB(nautilus-extension, nautilus_menu_item_new)
AC_CHECK_FUNCS(nautilus_menu_provider_emit_items_updated_signal)
+# pwi 2009-05-15 disabled as useless or badly explained
#if test "x${exec_prefix}" = "xNONE"; then
# if test "x${prefix}" = "xNONE"; then
# if test "x${bindir}" = "xNONE"; then
diff --git a/libnautilus-actions/nautilus-actions-config-gconf-reader.c b/libnautilus-actions/nautilus-actions-config-gconf-reader.c
index b213959..a75a4b3 100644
--- a/libnautilus-actions/nautilus-actions-config-gconf-reader.c
+++ b/libnautilus-actions/nautilus-actions-config-gconf-reader.c
@@ -1,24 +1,32 @@
-/* Nautilus Actions configuration tool
- * Copyright (C) 2005 The GNOME Foundation
+/*
+ * Nautilus Actions
*
- * Authors:
- * Frederic Ruaudel (grumz grumz net)
- * Rodrigo Moya (rodrigo gnome-db org)
+ * Copyright (C) 2005 The GNOME Foundation
+ * Copyright (C) 2006, 2007, 2008 Frederic Ruaudel and others (see AUTHORS)
+ * Copyright (C) 2009 Pierre Wieser and others (see AUTHORS)
*
* This Program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
*
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this Library; see the file COPYING. If not,
- * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * write to the Free Software Foundation, Inc., 59 Temple Place,
+ * Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Authors:
+ * Frederic Ruaudel <grumz grumz net>
+ * Rodrigo Moya <rodrigo gnome-db org>
+ * Pierre Wieser <pwieser trychlos org>
+ * and many others (see AUTHORS)
+ *
+ * pwi 2009-05-16 fix compilation warnings
*/
#include <config.h>
@@ -87,6 +95,7 @@ nautilus_actions_config_gconf_reader_class_init (NautilusActionsConfigGconfReade
config_class->remove_action = remove_action;
}
+/*
static gchar* get_action_profile_name_from_key (const gchar* key, const gchar* uuid)
{
gchar* prefix = g_strdup_printf ("%s/%s/%s", ACTIONS_CONFIG_DIR, uuid, ACTIONS_PROFILE_PREFIX);
@@ -94,7 +103,7 @@ static gchar* get_action_profile_name_from_key (const gchar* key, const gchar* u
if (g_str_has_prefix (key, prefix))
{
-
+
profile_name = g_strdup (key + strlen (prefix));
gchar* pos = g_strrstr (profile_name, "/");
if (pos != NULL)
@@ -107,12 +116,15 @@ static gchar* get_action_profile_name_from_key (const gchar* key, const gchar* u
return profile_name;
}
+*/
+/*
static void
copy_list (GConfValue* value, GSList** list)
{
(*list) = g_slist_append ((*list), g_strdup (gconf_value_get_string (value)));
}
+*/
static void
actions_changed_cb (GConfClient *client,
@@ -123,11 +135,11 @@ actions_changed_cb (GConfClient *client,
NautilusActionsConfig *config = NAUTILUS_ACTIONS_CONFIG (user_data);
- /* The Key value format is XXX:YYYY-YYYY-... where XXX is an number incremented to make key
+ /* The Key value format is XXX:YYYY-YYYY-... where XXX is an number incremented to make key
* effectively changed each time and YYYY-YYYY-... is the modified uuid */
- GConfValue* value = gconf_entry_get_value (entry);
- gchar* notify_value = gconf_value_get_string (value);
- gchar* uuid = notify_value + 4;
+ const GConfValue* value = gconf_entry_get_value (entry);
+ const gchar* notify_value = gconf_value_get_string (value);
+ const gchar* uuid = notify_value + 4;
// Get the modified action from the internal list if any //
NautilusActionsConfigAction *old_action = nautilus_actions_config_get_action (config, uuid);
@@ -172,7 +184,7 @@ nautilus_actions_config_gconf_reader_init (NautilusActionsConfigGconfReader *con
{
/* install notification callbacks */
gconf_client_add_dir (NAUTILUS_ACTIONS_CONFIG_GCONF (config)->conf_client, ACTIONS_CONFIG_DIR, GCONF_CLIENT_PRELOAD_RECURSIVE, NULL);
- config->actions_notify_id = gconf_client_notify_add (NAUTILUS_ACTIONS_CONFIG_GCONF (config)->conf_client,
+ config->actions_notify_id = gconf_client_notify_add (NAUTILUS_ACTIONS_CONFIG_GCONF (config)->conf_client,
ACTIONS_CONFIG_NOTIFY_KEY,
(GConfClientNotifyFunc) actions_changed_cb, config,
NULL, NULL);
@@ -212,4 +224,3 @@ nautilus_actions_config_gconf_reader_get (void)
return NAUTILUS_ACTIONS_CONFIG_GCONF_READER (g_object_ref (G_OBJECT (config)));
}
-// vim:ts=3:sw=3:tw=1024:cin
diff --git a/libnautilus-actions/nautilus-actions-config-schema-reader.c b/libnautilus-actions/nautilus-actions-config-schema-reader.c
index e052831..578cfcc 100644
--- a/libnautilus-actions/nautilus-actions-config-schema-reader.c
+++ b/libnautilus-actions/nautilus-actions-config-schema-reader.c
@@ -1,24 +1,32 @@
-/* Nautilus Actions configuration tool
- * Copyright (C) 2005 The GNOME Foundation
+/*
+ * Nautilus Actions
*
- * Authors:
- * Frederic Ruaudel (grumz grumz net)
- * Rodrigo Moya (rodrigo gnome-db org)
+ * Copyright (C) 2005 The GNOME Foundation
+ * Copyright (C) 2006, 2007, 2008 Frederic Ruaudel and others (see AUTHORS)
+ * Copyright (C) 2009 Pierre Wieser and others (see AUTHORS)
*
* This Program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
*
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this Library; see the file COPYING. If not,
- * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * write to the Free Software Foundation, Inc., 59 Temple Place,
+ * Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Authors:
+ * Frederic Ruaudel <grumz grumz net>
+ * Rodrigo Moya <rodrigo gnome-db org>
+ * Pierre Wieser <pwieser trychlos org>
+ * and many others (see AUTHORS)
+ *
+ * pwi 2009-05-16 fix compilation warnings
*/
#include <config.h>
@@ -69,7 +77,7 @@ static gchar* get_action_profile_name_from_key (const gchar* key, const gchar* u
if (g_str_has_prefix (key, prefix))
{
-
+
profile_name = g_strdup (key + strlen (prefix));
gchar* pos = g_strrstr (profile_name, "/");
if (pos != NULL)
@@ -87,7 +95,7 @@ static gchar* get_action_profile_name_from_key (const gchar* key, const gchar* u
static gchar* get_action_uuid_from_key (const gchar* key)
{
g_return_val_if_fail (g_str_has_prefix (key, ACTIONS_CONFIG_DIR), NULL);
-
+
gchar* uuid = g_strdup (key + strlen (ACTIONS_CONFIG_DIR "/"));
gchar* pos = g_strstr_len (uuid, strlen (uuid), "/");
if (pos != NULL)
@@ -97,7 +105,7 @@ static gchar* get_action_uuid_from_key (const gchar* key)
return uuid;
}
-
+
static ProfileChecking* nautilus_actions_config_schema_reader_profile_checking_new ()
{
ProfileChecking* check = g_new0 (ProfileChecking, 1);
@@ -185,14 +193,14 @@ static gboolean nautilus_actions_config_schema_reader_profile_checking_check (GH
g_hash_table_foreach (profile_check_list, (GHFunc)get_hash_keys, &profile_list);
printf ("test check 2\n");
- // Check if the default profile has been found in the xml file, if not remove
+ // Check if the default profile has been found in the xml file, if not remove
// it (added automatically by nautilus_actions_config_action_new_default() function)
check = g_hash_table_lookup (profile_check_list, NAUTILUS_ACTIONS_DEFAULT_PROFILE_NAME);
printf ("test check 3 : <%p>\n", check);
- if (check == NULL || (!check->is_schemes_ok && !check->is_multiple_ok &&
+ if (check == NULL || (!check->is_schemes_ok && !check->is_multiple_ok &&
!check->is_matchcase_ok && !check->is_mimetypes_ok &&
- !check->is_isdir_ok && !check->is_isfile_ok && !check->is_basenames_ok &&
+ !check->is_isdir_ok && !check->is_isfile_ok && !check->is_basenames_ok &&
!check->is_params_ok && !check->is_path_ok))
{
printf ("test 1\n");
@@ -206,7 +214,7 @@ static gboolean nautilus_actions_config_schema_reader_profile_checking_check (GH
printf ("test check 5\n");
if (g_slist_length (profile_list) >= 1)
{
- // There is at least one profile to check so we'll enter the next loop and
+ // There is at least one profile to check so we'll enter the next loop and
// so we set the return val to TRUE to make the local check works
retv = TRUE;
}
@@ -217,26 +225,26 @@ static gboolean nautilus_actions_config_schema_reader_profile_checking_check (GH
gchar* profile_name = (gchar*)iter->data;
printf ("test 2 (%s)\n", profile_name);
check = g_hash_table_lookup (profile_check_list, profile_name);
-
- printf ("version <%s>, sh: %d, mul: %d, mat:%d, mim:%d, dir:%d, fil:%d, bas:%d, par:%d, path:%d, check ver: %d\n", version, check->is_schemes_ok , check->is_multiple_ok ,
+
+ printf ("version <%s>, sh: %d, mul: %d, mat:%d, mim:%d, dir:%d, fil:%d, bas:%d, par:%d, path:%d, check ver: %d\n", version, check->is_schemes_ok , check->is_multiple_ok ,
check->is_matchcase_ok , check->is_mimetypes_ok ,
- check->is_isdir_ok , check->is_isfile_ok , check->is_basenames_ok ,
+ check->is_isdir_ok , check->is_isfile_ok , check->is_basenames_ok ,
check->is_params_ok , check->is_path_ok, (g_ascii_strcasecmp (version, "1.1") >= 0));
- if (g_ascii_strcasecmp (version, "1.0") == 0 &&
- check->is_schemes_ok && check->is_multiple_ok &&
- check->is_isdir_ok && check->is_isfile_ok && check->is_basenames_ok &&
+ if (g_ascii_strcasecmp (version, "1.0") == 0 &&
+ check->is_schemes_ok && check->is_multiple_ok &&
+ check->is_isdir_ok && check->is_isfile_ok && check->is_basenames_ok &&
check->is_params_ok && check->is_path_ok)
{
local_retv = TRUE;
}
- //else if (g_ascii_strcasecmp (version, NAUTILUS_ACTIONS_CONFIG_VERSION) == 0 &&
- else if (g_ascii_strcasecmp (version, "1.1") >= 0 &&
- check->is_schemes_ok && check->is_multiple_ok &&
+ //else if (g_ascii_strcasecmp (version, NAUTILUS_ACTIONS_CONFIG_VERSION) == 0 &&
+ else if (g_ascii_strcasecmp (version, "1.1") >= 0 &&
+ check->is_schemes_ok && check->is_multiple_ok &&
check->is_matchcase_ok && check->is_mimetypes_ok &&
- check->is_isdir_ok && check->is_isfile_ok && check->is_basenames_ok &&
+ check->is_isdir_ok && check->is_isfile_ok && check->is_basenames_ok &&
check->is_params_ok && check->is_path_ok)
{
local_retv = TRUE;
@@ -304,9 +312,9 @@ static gboolean nautilus_actions_config_schema_reader_profile_checking_check (GH
g_free (tmp);
}
- printf ("b: retv %d local: %d\n", retv, local_retv);
+ printf ("b: retv %d local: %d\n", retv, local_retv);
retv = (retv && local_retv);
- printf ("a: retv %d local: %d\n", retv, local_retv);
+ printf ("a: retv %d local: %d\n", retv, local_retv);
}
g_slist_free (profile_list);
@@ -330,11 +338,11 @@ static gboolean nautilus_actions_config_schema_reader_action_parse_schema_key_lo
{
gboolean retv = FALSE;
xmlNode* iter;
-
+
for (iter = config_node->children; iter; iter = iter->next)
{
if (!retv && iter->type == XML_ELEMENT_NODE &&
- g_ascii_strncasecmp ((gchar*)iter->name,
+ g_ascii_strncasecmp ((gchar*)iter->name,
NA_GCONF_XML_SCHEMA_DFT,
strlen (NA_GCONF_XML_SCHEMA_DFT)) == 0)
{
@@ -352,7 +360,7 @@ static gboolean nautilus_actions_config_schema_reader_action_parse_schema_key (x
xmlNode* iter;
gboolean is_key_ok = FALSE;
gboolean is_default_value_ok = FALSE;
-
+
*type = ACTION_NONE_TYPE;
for (iter = config_node->children; iter; iter = iter->next)
{
@@ -360,7 +368,7 @@ static gboolean nautilus_actions_config_schema_reader_action_parse_schema_key (x
gchar* uuid_tmp;
if (!is_key_ok && iter->type == XML_ELEMENT_NODE &&
- g_ascii_strncasecmp ((gchar*)iter->name,
+ g_ascii_strncasecmp ((gchar*)iter->name,
NA_GCONF_XML_SCHEMA_APPLYTO,
strlen (NA_GCONF_XML_SCHEMA_APPLYTO)) == 0)
{
@@ -440,7 +448,7 @@ static gboolean nautilus_actions_config_schema_reader_action_parse_schema_key (x
xmlFree (text);
}
else if (!is_default_value_ok && iter->type == XML_ELEMENT_NODE &&
- g_ascii_strncasecmp ((gchar*)iter->name,
+ g_ascii_strncasecmp ((gchar*)iter->name,
NA_GCONF_XML_SCHEMA_DFT,
strlen (NA_GCONF_XML_SCHEMA_DFT)) == 0)
{
@@ -448,7 +456,7 @@ static gboolean nautilus_actions_config_schema_reader_action_parse_schema_key (x
is_default_value_ok = TRUE;
}
else if (!is_default_value_ok && iter->type == XML_ELEMENT_NODE &&
- g_ascii_strncasecmp ((gchar*)iter->name,
+ g_ascii_strncasecmp ((gchar*)iter->name,
NA_GCONF_XML_SCHEMA_LOCALE,
strlen (NA_GCONF_XML_SCHEMA_LOCALE)) == 0)
{
@@ -463,7 +471,7 @@ static gboolean nautilus_actions_config_schema_reader_action_parse_schema_key (x
{
retv = TRUE;
}
-
+
return retv;
}
@@ -475,7 +483,7 @@ static GSList* schema_string_to_gslist (const gchar* str_list_value)
gchar* str_list = NULL;
gchar** str_list_splited = NULL;
int i;
-
+
//--> First remove the brackets []
while (*ptr != '[')
{
@@ -510,8 +518,8 @@ static GSList* schema_string_to_gslist (const gchar* str_list_value)
}
g_strfreev (str_list_splited);
}
-
- return list;
+
+ return list;
}
static gboolean schema_string_to_bool (const gchar* str_bool_value)
@@ -550,11 +558,11 @@ static gboolean nautilus_actions_config_schema_reader_action_fill (NautilusActio
type = ACTION_NONE_TYPE;
if (iter->type == XML_ELEMENT_NODE)
{
- if (g_ascii_strncasecmp ((gchar*)iter->name,
+ if (g_ascii_strncasecmp ((gchar*)iter->name,
NA_GCONF_XML_SCHEMA_ENTRY,
strlen (NA_GCONF_XML_SCHEMA_ENTRY)) == 0)
{
- gchar* value;
+ gchar* value = NULL;
gchar* uuid = NULL;
gchar* profile_name = NULL;
NautilusActionsConfigActionProfile* action_profile = NULL;
@@ -663,7 +671,7 @@ static gboolean nautilus_actions_config_schema_reader_action_fill (NautilusActio
printf ("test parse 3\n");
g_free (value);
printf ("test parse 4\n");
- }
+ }
printf ("test parse 5\n");
action_profile = nautilus_actions_config_action_get_or_create_profile (action, profile_name);
@@ -683,7 +691,7 @@ static gboolean nautilus_actions_config_schema_reader_action_fill (NautilusActio
}
}
}
-
+
printf ("test parse 8\n");
if (is_version_ok)
{
@@ -695,15 +703,15 @@ static gboolean nautilus_actions_config_schema_reader_action_fill (NautilusActio
// if the version of the file is greater than the current one, we reject the file
g_set_error (error, NAUTILUS_ACTIONS_SCHEMA_READER_ERROR, NAUTILUS_ACTIONS_SCHEMA_READER_ERROR_FAILED, _("This config file is more recent than this version of Nautilus-actions can support. Please upgrade Nautilus-actions to the latest version if you want to be able to import it (File version: %s (max supported version : %s))"), action->version, NAUTILUS_ACTIONS_CONFIG_VERSION);
}
- else if (g_ascii_strcasecmp (action->version, "1.0") == 0 &&
- is_profiles_ok && is_icon_ok &&
+ else if (g_ascii_strcasecmp (action->version, "1.0") == 0 &&
+ is_profiles_ok && is_icon_ok &&
is_tooltip_ok && is_label_ok)
{
retv = TRUE;
}
- else if (g_ascii_strcasecmp (action->version, NAUTILUS_ACTIONS_CONFIG_VERSION) == 0 &&
- is_profiles_ok && is_icon_ok &&
+ else if (g_ascii_strcasecmp (action->version, NAUTILUS_ACTIONS_CONFIG_VERSION) == 0 &&
+ is_profiles_ok && is_icon_ok &&
is_tooltip_ok && is_label_ok)
{
retv = TRUE;
@@ -755,10 +763,10 @@ static gboolean nautilus_actions_config_schema_reader_action_fill (NautilusActio
/*
g_warning ("schemes : %d, multiple : %d, match_case : %d, mimetypes : %d, isdir : %d, isfile : %d, basenames : %d, param : %d, path : %d, icon : %d, tooltip : %d, label : %d, TRUE: %d, version: %s",
- is_schemes_ok , is_multiple_ok ,
- is_matchcase_ok , is_mimetypes_ok ,
- is_isdir_ok , is_isfile_ok , is_basenames_ok ,
- is_params_ok , is_path_ok , is_icon_ok ,
+ is_schemes_ok , is_multiple_ok ,
+ is_matchcase_ok , is_mimetypes_ok ,
+ is_isdir_ok , is_isfile_ok , is_basenames_ok ,
+ is_params_ok , is_path_ok , is_icon_ok ,
is_tooltip_ok , is_label_ok, TRUE, action->version);
*/
return retv;
@@ -768,7 +776,7 @@ gboolean nautilus_actions_config_schema_reader_parse_file (NautilusActionsConfig
{
xmlDoc* doc = NULL;
xmlNode* root_node;
- xmlNode* iter;
+ xmlNode* iter = NULL;
NautilusActionsConfigAction *action;
gboolean retv = FALSE;
xmlError* xml_error = NULL;
@@ -780,8 +788,8 @@ gboolean nautilus_actions_config_schema_reader_parse_file (NautilusActionsConfig
if (doc != NULL)
{
root_node = xmlDocGetRootElement (doc);
- if (g_ascii_strncasecmp ((gchar*)root_node->name,
- NA_GCONF_XML_ROOT,
+ if (g_ascii_strncasecmp ((gchar*)root_node->name,
+ NA_GCONF_XML_ROOT,
strlen (NA_GCONF_XML_ROOT)) == 0)
{
iter = root_node->children;
@@ -789,9 +797,9 @@ gboolean nautilus_actions_config_schema_reader_parse_file (NautilusActionsConfig
{
if (iter->type == XML_ELEMENT_NODE)
{
-
- if (g_ascii_strncasecmp ((gchar*)iter->name,
- NA_GCONF_XML_SCHEMA_LIST,
+
+ if (g_ascii_strncasecmp ((gchar*)iter->name,
+ NA_GCONF_XML_SCHEMA_LIST,
strlen (NA_GCONF_XML_SCHEMA_LIST)) == 0)
{
action = nautilus_actions_config_action_new_default ();
@@ -836,7 +844,7 @@ gboolean nautilus_actions_config_schema_reader_parse_file (NautilusActionsConfig
}
xmlCleanupParser ();
-
+
return retv;
}
@@ -847,7 +855,7 @@ save_action (NautilusActionsConfig *self, NautilusActionsConfigAction *action)
g_return_val_if_fail (NAUTILUS_ACTIONS_IS_CONFIG_SCHEMA_READER (self), FALSE);
// NautilusActionsConfigSchemaReader* config = NAUTILUS_ACTIONS_CONFIG_SCHEMA_READER (self);
-
+
return retv;
}
@@ -927,5 +935,3 @@ nautilus_actions_config_schema_reader_get (void)
return NAUTILUS_ACTIONS_CONFIG_SCHEMA_READER (g_object_ref (G_OBJECT (config)));
}
-
-// vim:ts=3:sw=3:tw=1024:cin
diff --git a/libnautilus-actions/nautilus-actions-config.c b/libnautilus-actions/nautilus-actions-config.c
index 7dbc8d2..2233956 100644
--- a/libnautilus-actions/nautilus-actions-config.c
+++ b/libnautilus-actions/nautilus-actions-config.c
@@ -1,24 +1,32 @@
-/* Nautilus Actions configuration tool
- * Copyright (C) 2005 The GNOME Foundation
+/*
+ * Nautilus Actions
*
- * Authors:
- * Rodrigo Moya (rodrigo gnome-db org)
- * Frederic Ruaudel (grumz grumz net)
+ * Copyright (C) 2005 The GNOME Foundation
+ * Copyright (C) 2006, 2007, 2008 Frederic Ruaudel and others (see AUTHORS)
+ * Copyright (C) 2009 Pierre Wieser and others (see AUTHORS)
*
* This Program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
*
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this Library; see the file COPYING. If not,
- * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * write to the Free Software Foundation, Inc., 59 Temple Place,
+ * Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Authors:
+ * Frederic Ruaudel <grumz grumz net>
+ * Rodrigo Moya <rodrigo gnome-db org>
+ * Pierre Wieser <pwieser trychlos org>
+ * and many others (see AUTHORS)
+ *
+ * pwi 2009-05-16 fix compilation warnings
*/
#include <config.h>
@@ -27,22 +35,22 @@
#include "nautilus-actions-config-gconf-private.h"
enum {
- ACTION_ADDED,
- ACTION_CHANGED,
- ACTION_REMOVED,
- LAST_SIGNAL
+ ACTION_ADDED,
+ ACTION_CHANGED,
+ ACTION_REMOVED,
+ LAST_SIGNAL
};
static GObjectClass *parent_class = NULL;
static gint signals[LAST_SIGNAL] = { 0 };
-static void nautilus_actions_config_action_removed_default_handler (NautilusActionsConfig* config,
+static void nautilus_actions_config_action_removed_default_handler (NautilusActionsConfig* config,
NautilusActionsConfigAction* action,
gpointer user_data);
-static void nautilus_actions_config_action_changed_default_handler (NautilusActionsConfig* config,
+static void nautilus_actions_config_action_changed_default_handler (NautilusActionsConfig* config,
NautilusActionsConfigAction* action,
gpointer user_data);
-static void nautilus_actions_config_action_added_default_handler (NautilusActionsConfig* config,
+static void nautilus_actions_config_action_added_default_handler (NautilusActionsConfig* config,
NautilusActionsConfigAction* action,
gpointer user_data);
@@ -190,23 +198,23 @@ nautilus_actions_config_add_action (NautilusActionsConfig *config, NautilusActio
{
gboolean retv = FALSE;
NautilusActionsConfigAction* found_action;
-
+
g_assert (NAUTILUS_ACTIONS_IS_CONFIG (config));
g_assert (action != NULL);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
- if (action->uuid != NULL)
+ if (action->uuid != NULL)
{
found_action = (NautilusActionsConfigAction*)g_hash_table_lookup (config->actions, action->uuid);
- if (found_action != NULL)
+ if (found_action != NULL)
{
// i18n notes: will be displayed in an error dialog
g_set_error (error, NAUTILUS_ACTIONS_CONFIG_ERROR, NAUTILUS_ACTIONS_CONFIG_ERROR_FAILED, _("The action '%s' already exists with the name '%s', please first remove the existing one before trying to add this one"), action->label, found_action->label);
return FALSE;
}
- }
- else
+ }
+ else
{
action->uuid = get_new_uuid ();
}
@@ -221,11 +229,11 @@ nautilus_actions_config_add_action (NautilusActionsConfig *config, NautilusActio
// i18n notes: will be displayed in an error dialog
g_set_error (error, NAUTILUS_ACTIONS_CONFIG_ERROR, NAUTILUS_ACTIONS_CONFIG_ERROR_FAILED, _("Can't save action '%s'"), action->label);
}
-
+
return retv;
}
-static void nautilus_actions_config_action_added_default_handler (NautilusActionsConfig* config,
+static void nautilus_actions_config_action_added_default_handler (NautilusActionsConfig* config,
NautilusActionsConfigAction* action,
gpointer user_data)
{
@@ -251,11 +259,11 @@ nautilus_actions_config_update_action (NautilusActionsConfig *config, NautilusAc
g_signal_emit (config, signals[ACTION_CHANGED], 0, action);
retv = TRUE;
}
-
+
return retv;
}
-static void nautilus_actions_config_action_changed_default_handler (NautilusActionsConfig* config,
+static void nautilus_actions_config_action_changed_default_handler (NautilusActionsConfig* config,
NautilusActionsConfigAction* action,
gpointer user_data)
{
@@ -300,7 +308,7 @@ static gboolean
clear_actions_hashtable (gchar *uuid, NautilusActionsConfigAction *action, NautilusActionsConfig *config)
{
gboolean retv = FALSE;
-
+
if (NAUTILUS_ACTIONS_CONFIG_GET_CLASS(config)->remove_action (config, action))
{
retv = TRUE;
@@ -324,11 +332,11 @@ nautilus_actions_config_clear (NautilusActionsConfig *config)
{
retv = TRUE;
}
-
+
return retv;
}
-static void nautilus_actions_config_action_removed_default_handler (NautilusActionsConfig* config,
+static void nautilus_actions_config_action_removed_default_handler (NautilusActionsConfig* config,
NautilusActionsConfigAction* action,
gpointer user_data)
{
@@ -361,12 +369,12 @@ NautilusActionsConfigActionProfile *nautilus_actions_config_action_profile_new_d
new_action_profile->accept_multiple_files = FALSE;
new_action_profile->schemes = NULL;
new_action_profile->schemes = g_slist_append (new_action_profile->schemes, g_strdup ("file"));
-
+
return new_action_profile;
}
gboolean
-nautilus_actions_config_action_profile_exists (NautilusActionsConfigAction *action,
+nautilus_actions_config_action_profile_exists (NautilusActionsConfigAction *action,
const gchar* profile_name)
{
gboolean retv = FALSE;
@@ -385,7 +393,7 @@ static void get_profiles_names (gchar* key, gchar* value, GSList** list)
}
GSList*
-nautilus_actions_config_action_get_all_profile_names (NautilusActionsConfigAction *action)
+nautilus_actions_config_action_get_all_profile_names (NautilusActionsConfigAction *action)
{
GSList* profile_names = NULL;
g_hash_table_foreach (action->profiles, (GHFunc)get_profiles_names, &profile_names);
@@ -420,7 +428,7 @@ nautilus_actions_config_action_get_new_default_profile_name (NautilusActionsConf
}
NautilusActionsConfigActionProfile*
-nautilus_actions_config_action_get_profile (NautilusActionsConfigAction *action,
+nautilus_actions_config_action_get_profile (NautilusActionsConfigAction *action,
const gchar* profile_name)
{
if (profile_name != NULL)
@@ -433,7 +441,7 @@ nautilus_actions_config_action_get_profile (NautilusActionsConfigAction *action,
}
}
-NautilusActionsConfigActionProfile *nautilus_actions_config_action_get_or_create_profile (NautilusActionsConfigAction *action,
+NautilusActionsConfigActionProfile *nautilus_actions_config_action_get_or_create_profile (NautilusActionsConfigAction *action,
const gchar* profile_name)
{
NautilusActionsConfigActionProfile* action_profile = nautilus_actions_config_action_get_profile (action, profile_name);
@@ -448,7 +456,7 @@ NautilusActionsConfigActionProfile *nautilus_actions_config_action_get_or_create
}
gboolean
-nautilus_actions_config_action_add_profile (NautilusActionsConfigAction *action,
+nautilus_actions_config_action_add_profile (NautilusActionsConfigAction *action,
const gchar* profile_name,
NautilusActionsConfigActionProfile* profile,
GError** error)
@@ -477,7 +485,7 @@ nautilus_actions_config_action_add_profile (NautilusActionsConfigAction *action,
}
void
-nautilus_actions_config_action_replace_profile (NautilusActionsConfigAction *action,
+nautilus_actions_config_action_replace_profile (NautilusActionsConfigAction *action,
const gchar* profile_name,
NautilusActionsConfigActionProfile* profile)
{
@@ -486,14 +494,15 @@ nautilus_actions_config_action_replace_profile (NautilusActionsConfigAction *act
}
gboolean
-nautilus_actions_config_action_remove_profile (NautilusActionsConfigAction *action,
+nautilus_actions_config_action_remove_profile (NautilusActionsConfigAction *action,
const gchar* profile_name)
{
return g_hash_table_remove (action->profiles, profile_name);
}
/* Obsolete function (not used anymore) */
-gboolean nautilus_actions_config_action_rename_profile (NautilusActionsConfigAction *action,
+/*
+gboolean nautilus_actions_config_action_rename_profile (NautilusActionsConfigAction *action,
const gchar* old_profile_name,
const gchar* new_profile_name,
GError** error)
@@ -533,7 +542,7 @@ gboolean nautilus_actions_config_action_rename_profile (Naut
return ret;
}
-
+*/
NautilusActionsConfigAction *nautilus_actions_config_action_new (void)
{
@@ -554,7 +563,7 @@ NautilusActionsConfigAction *nautilus_actions_config_action_new_default (void)
(GDestroyNotify) nautilus_actions_config_action_profile_free);
g_hash_table_insert (new_action->profiles, g_strdup (NAUTILUS_ACTIONS_DEFAULT_PROFILE_NAME), nautilus_actions_config_action_profile_new_default ());
new_action->version = g_strdup (NAUTILUS_ACTIONS_CONFIG_VERSION);
-
+
return new_action;
}
@@ -639,13 +648,13 @@ nautilus_actions_config_action_profile_set_parameters (NautilusActionsConfigActi
action_profile->parameters = g_strdup (parameters);
}
-static void
+static void
copy_list (gchar* data, GSList** list)
{
(*list) = g_slist_append ((*list), g_strdup (data));
}
-static void
+static void
copy_list_strdown (gchar* data, GSList** list)
{
// make sure that the elements are copied with their case lowered
@@ -695,7 +704,7 @@ NautilusActionsConfigActionProfile* nautilus_actions_config_action_profile_dup (
{
new_action_profile = nautilus_actions_config_action_profile_new ();
- if (action_profile->desc_name)
+ if (action_profile->desc_name)
{
new_action_profile->desc_name = g_strdup (action_profile->desc_name);
}
@@ -726,7 +735,7 @@ NautilusActionsConfigActionProfile* nautilus_actions_config_action_profile_dup (
new_action_profile->basenames = g_slist_append (new_action_profile->basenames, g_strdup ((gchar*)iter->data));
}
}
-
+
new_action_profile->match_case = action_profile->match_case;
if (action_profile->mimetypes && success) {
@@ -767,7 +776,7 @@ nautilus_actions_config_action_profile_free (NautilusActionsConfigActionProfile
{
if (action_profile != NULL)
{
- if (action_profile->desc_name)
+ if (action_profile->desc_name)
{
g_free (action_profile->desc_name);
action_profile->desc_name = NULL;
@@ -818,7 +827,7 @@ NautilusActionsConfigAction* nautilus_actions_config_action_dup (NautilusActions
{
NautilusActionsConfigAction* new_action = NULL;
gboolean success = TRUE;
- GSList* iter;
+ /*GSList* iter;*/
if (action != NULL)
{
@@ -950,5 +959,3 @@ nautilus_actions_config_action_free (NautilusActionsConfigAction *action)
action = NULL;
}
}
-
-// vim:ts=3:sw=3:tw=1024:cin
diff --git a/m4/cmdline-tools.m4 b/m4/cmdline-tools.m4
index dda9f44..672f3a6 100644
--- a/m4/cmdline-tools.m4
+++ b/m4/cmdline-tools.m4
@@ -48,6 +48,7 @@ AC_DEFUN([NACT_COMMANDLINE_TOOLS],[
PKG_CHECK_MODULES([NAUTILUS_ACTIONS_UTILS], \
glib-2.0 >= ${GLIB_REQUIRED} \
+ gtk+-2.0 >= ${GTK_REQUIRED} \
gthread-2.0 >= ${GLIB_REQUIRED} \
gmodule-2.0 >= ${GLIB_REQUIRED} \
gconf-2.0 >= ${GCONF_REQUIRED} \
diff --git a/nact/nact-editor.c b/nact/nact-editor.c
index 872c4dc..4e08248 100644
--- a/nact/nact-editor.c
+++ b/nact/nact-editor.c
@@ -1,24 +1,32 @@
-/* Nautilus Actions configuration tool
- * Copyright (C) 2005 The GNOME Foundation
+/*
+ * Nautilus Actions
*
- * Authors:
- * Rodrigo Moya (rodrigo gnome-db org)
- * Frederic Ruaudel (grumz grumz net)
+ * Copyright (C) 2005 The GNOME Foundation
+ * Copyright (C) 2006, 2007, 2008 Frederic Ruaudel and others (see AUTHORS)
+ * Copyright (C) 2009 Pierre Wieser and others (see AUTHORS)
*
* This Program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
*
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this Library; see the file COPYING. If not,
- * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * write to the Free Software Foundation, Inc., 59 Temple Place,
+ * Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Authors:
+ * Frederic Ruaudel <grumz grumz net>
+ * Rodrigo Moya <rodrigo gnome-db org>
+ * Pierre Wieser <pwieser trychlos org>
+ * and many others (see AUTHORS)
+ *
+ * pwi 2009-05-16 fix compilation warnings
*/
#include <string.h>
@@ -33,6 +41,8 @@
#include "nact-prefs.h"
#include "nact.h"
+static void field_changed_cb (GObject *object, gpointer user_data);
+
enum {
ICON_STOCK_COLUMN = 0,
ICON_LABEL_COLUMN,
@@ -48,7 +58,7 @@ strip_underscore (const gchar *text)
result = g_strdup (text);
p = q = result;
- while (*p)
+ while (*p)
{
if (*p != '_')
{
@@ -62,7 +72,7 @@ strip_underscore (const gchar *text)
return result;
}
-void
+static void
field_changed_cb (GObject *object, gpointer user_data)
{
GtkWidget* editor = nact_get_glade_widget_from ("EditActionDialog", GLADE_EDIT_DIALOG_WIDGET);
@@ -75,7 +85,7 @@ field_changed_cb (GObject *object, gpointer user_data)
gtk_dialog_set_response_sensitive (GTK_DIALOG (editor), GTK_RESPONSE_OK, FALSE);
}
-void
+/*void
icon_browse_button_clicked_cb (GtkButton *button, gpointer user_data)
{
gchar* last_dir;
@@ -89,7 +99,7 @@ icon_browse_button_clicked_cb (GtkButton *button, gpointer user_data)
{
set_current_location = gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (filechooser), filename);
}
-
+
if (!set_current_location)
{
last_dir = nact_prefs_get_icon_last_browsed_dir ();
@@ -97,7 +107,7 @@ icon_browse_button_clicked_cb (GtkButton *button, gpointer user_data)
g_free (last_dir);
}
- switch (gtk_dialog_run (GTK_DIALOG (filechooser)))
+ switch (gtk_dialog_run (GTK_DIALOG (filechooser)))
{
case GTK_RESPONSE_OK :
last_dir = gtk_file_chooser_get_current_folder (GTK_FILE_CHOOSER (filechooser));
@@ -110,8 +120,8 @@ icon_browse_button_clicked_cb (GtkButton *button, gpointer user_data)
case GTK_RESPONSE_CANCEL:
case GTK_RESPONSE_DELETE_EVENT:
gtk_widget_hide (filechooser);
- }
-}
+ }
+}*/
static gint sort_stock_ids (gconstpointer a, gconstpointer b)
{
@@ -161,9 +171,9 @@ static GtkTreeModel* create_stock_icon_model (void)
gchar* label;
model = gtk_list_store_new (ICON_N_COLUMN, G_TYPE_STRING, G_TYPE_STRING);
-
+
gtk_list_store_append (model, &row);
-
+
/* i18n notes: when no icon is selected in the drop-down list */
gtk_list_store_set (model, &row, ICON_STOCK_COLUMN, "", ICON_LABEL_COLUMN, _("None"), -1);
stock_list = gtk_stock_list_ids ();
@@ -208,26 +218,26 @@ static void preview_icon_changed_cb (GtkEntry* icon_entry, gpointer user_data)
gtk_widget_show (image);
}
- else if (g_file_test (icon_name, G_FILE_TEST_EXISTS) &&
+ else if (g_file_test (icon_name, G_FILE_TEST_EXISTS) &&
g_file_test (icon_name, G_FILE_TEST_IS_REGULAR))
{
gint width;
gint height;
GError* error = NULL;
-
+
gtk_icon_size_lookup (GTK_ICON_SIZE_MENU, &width, &height);
icon = gdk_pixbuf_new_from_file_at_size (icon_name, width, height, &error);
if (error)
{
icon = NULL;
-
+
error_msg = g_strdup_printf ("Can't load icon from file %s !", icon_name);
nautilus_actions_display_error (error_msg, error->message);
g_free (error_msg);
g_error_free (error);
}
gtk_image_set_from_pixbuf (GTK_IMAGE (image), icon);
-
+
gtk_widget_show (image);
}
else
@@ -245,7 +255,7 @@ static void fill_menu_icon_combo_list_of (GtkComboBoxEntry* combo)
{
GtkCellRenderer *cell_renderer_pix;
GtkCellRenderer *cell_renderer_text;
-
+
gtk_combo_box_set_model (GTK_COMBO_BOX (combo), create_stock_icon_model ());
if (gtk_combo_box_entry_get_text_column (combo) == -1)
{
@@ -270,7 +280,7 @@ static void fill_menu_icon_combo_list_of (GtkComboBoxEntry* combo)
gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 0);
}
-static gboolean
+/*static gboolean
cell_edited (GtkTreeModel *model,
const gchar *path_string,
const gchar *new_text,
@@ -283,7 +293,7 @@ cell_edited (GtkTreeModel *model,
gtk_tree_model_get_iter (model, &iter, path);
- gtk_tree_model_get (model, &iter, SCHEMES_CHECKBOX_COLUMN, &toggle_state,
+ gtk_tree_model_get (model, &iter, SCHEMES_CHECKBOX_COLUMN, &toggle_state,
column, &old_text, -1);
g_free (old_text);
@@ -293,7 +303,7 @@ cell_edited (GtkTreeModel *model,
gtk_tree_path_free (path);
return toggle_state;
-}
+}*/
static void
profile_name_edited_cb (GtkCellRendererText *cell,
@@ -306,8 +316,8 @@ profile_name_edited_cb (GtkCellRendererText *cell,
GtkTreeModel* model = GTK_TREE_MODEL (data);
GtkTreePath *path = gtk_tree_path_new_from_string (path_string);
GtkTreeIter iter;
- GError* error = NULL;
- gchar* tmp;
+ /*GError* error = NULL;*/
+ /*gchar* tmp;*/
gchar* profile_name;
NautilusActionsConfigActionProfile* action_profile;
@@ -319,7 +329,7 @@ profile_name_edited_cb (GtkCellRendererText *cell,
nautilus_actions_config_action_profile_set_desc_name (action_profile, new_profile_desc_name);
gtk_list_store_set (GTK_LIST_STORE (model), &iter, PROFILE_DESC_LABEL_COLUMN,
g_strdup (new_profile_desc_name), -1);
-
+
field_changed_cb (G_OBJECT (cell), NULL);
g_free (profile_name);
gtk_tree_path_free (path);
@@ -334,7 +344,7 @@ void nact_editor_fill_profiles_list (GtkWidget *list, NautilusActionsConfigActio
profile_names = nautilus_actions_config_action_get_all_profile_names (action);
profile_names = g_slist_sort (profile_names, (GCompareFunc)g_utf8_collate);
- for (l = profile_names; l != NULL; l = l->next)
+ for (l = profile_names; l != NULL; l = l->next)
{
GtkTreeIter iter;
gchar* profile_name = (gchar*)l->data;
@@ -347,7 +357,7 @@ void nact_editor_fill_profiles_list (GtkWidget *list, NautilusActionsConfigActio
}
gtk_list_store_append (model, &iter);
- gtk_list_store_set (model, &iter,
+ gtk_list_store_set (model, &iter,
PROFILE_LABEL_COLUMN, profile_name,
PROFILE_DESC_LABEL_COLUMN, profile_desc_name,
-1);
@@ -356,7 +366,7 @@ void nact_editor_fill_profiles_list (GtkWidget *list, NautilusActionsConfigActio
g_slist_free (profile_names);
}
-void
+/*void
add_prof_button_clicked_cb (GtkButton *button, gpointer user_data)
{
GtkWidget* profile_list = nact_get_glade_widget_from ("ProfilesList", GLADE_EDIT_DIALOG_WIDGET);
@@ -369,9 +379,9 @@ add_prof_button_clicked_cb (GtkButton *button, gpointer user_data)
nact_editor_fill_profiles_list (nact_get_glade_widget_from ("ProfilesList", GLADE_EDIT_DIALOG_WIDGET), action);
field_changed_cb (G_OBJECT (profile_list), NULL);
}
-}
+}*/
-void
+/*void
edit_prof_button_clicked_cb (GtkButton *button, gpointer user_data)
{
GtkTreeSelection *selection;
@@ -393,7 +403,7 @@ edit_prof_button_clicked_cb (GtkButton *button, gpointer user_data)
printf ("profile_name : %s\n", profile_name);
action_profile = nautilus_actions_config_action_profile_dup (nautilus_actions_config_action_get_profile (action, profile_name));
- if (action && action_profile)
+ if (action && action_profile)
{
if (nact_profile_editor_edit_profile (action, profile_name, action_profile))
{
@@ -404,9 +414,9 @@ edit_prof_button_clicked_cb (GtkButton *button, gpointer user_data)
g_free (profile_name);
}
-}
+}*/
-void
+/*void
copy_prof_button_clicked_cb (GtkButton *button, gpointer user_data)
{
GtkTreeSelection *selection;
@@ -421,7 +431,7 @@ copy_prof_button_clicked_cb (GtkButton *button, gpointer user_data)
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (nact_profiles_list));
- if (gtk_tree_selection_get_selected (selection, &model, &iter))
+ if (gtk_tree_selection_get_selected (selection, &model, &iter))
{
gchar* profile_name;
NautilusActionsConfigActionProfile* action_profile;
@@ -434,7 +444,7 @@ copy_prof_button_clicked_cb (GtkButton *button, gpointer user_data)
action_profile = nautilus_actions_config_action_profile_dup (nautilus_actions_config_action_get_profile (action, profile_name));
new_action_profile = nautilus_actions_config_action_profile_dup (action_profile);
- if (action && new_action_profile)
+ if (action && new_action_profile)
{
// Remove and free any existing data
nautilus_actions_config_action_profile_free (g_object_steal_data (G_OBJECT (nact_prof_paste_button), "profile"));
@@ -453,10 +463,9 @@ copy_prof_button_clicked_cb (GtkButton *button, gpointer user_data)
g_free (profile_name);
}
+}*/
-}
-
-void
+/*void
paste_prof_button_clicked_cb (GtkButton *button, gpointer user_data)
{
GtkTreeSelection *selection;
@@ -470,12 +479,12 @@ paste_prof_button_clicked_cb (GtkButton *button, gpointer user_data)
GtkWidget *nact_prof_paste_button = nact_get_glade_widget_from ("PasteProfileButton", GLADE_EDIT_DIALOG_WIDGET);
NautilusActionsConfigActionProfile* action_profile = (NautilusActionsConfigActionProfile*)g_object_get_data (G_OBJECT (nact_prof_paste_button), "profile");
- /* i18n notes: will be displayed in a dialog */
+ / * i18n notes: will be displayed in a dialog * /
const gchar *cantpaste = _( "Can't paste action's profile '%s'!" );
printf ("profile_name : %s\n", action_profile->desc_name);
- // i18n notes: this is the default name of a copied profile
+ // i18n notes: this is the default name of a copied profile
gchar* new_profile_desc_name = g_strdup_printf (_("%s Copy"), action_profile->desc_name);
// Get a new uniq profile key name but not a new desc name because we already have it.
@@ -484,7 +493,7 @@ paste_prof_button_clicked_cb (GtkButton *button, gpointer user_data)
NautilusActionsConfigActionProfile* new_action_profile = nautilus_actions_config_action_profile_dup (action_profile);
nautilus_actions_config_action_profile_set_desc_name (new_action_profile, new_profile_desc_name);
- if (action && new_action_profile)
+ if (action && new_action_profile)
{
if (nautilus_actions_config_action_add_profile (action, new_profile_name, new_action_profile, &error))
{
@@ -505,10 +514,9 @@ paste_prof_button_clicked_cb (GtkButton *button, gpointer user_data)
nautilus_actions_display_error (tmp, "");
g_free (tmp);
}
+}*/
-}
-
-void
+/*void
delete_prof_button_clicked_cb (GtkButton *button, gpointer user_data)
{
GtkTreeSelection *selection;
@@ -520,7 +528,7 @@ delete_prof_button_clicked_cb (GtkButton *button, gpointer user_data)
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (nact_profiles_list));
- if (gtk_tree_selection_get_selected (selection, &model, &iter))
+ if (gtk_tree_selection_get_selected (selection, &model, &iter))
{
gchar *profile_name;
@@ -543,7 +551,7 @@ delete_prof_button_clicked_cb (GtkButton *button, gpointer user_data)
g_free (profile_name);
}
-}
+}*/
static void
profile_list_selection_changed_cb (GtkTreeSelection *selection, gpointer user_data)
@@ -585,7 +593,7 @@ static void nact_editor_setup_profiles_list (GtkWidget *list, NautilusActionsCon
g_object_set (G_OBJECT (text_cell), "editable", TRUE, NULL);
g_signal_connect (G_OBJECT (text_cell), "edited",
- G_CALLBACK (profile_name_edited_cb),
+ G_CALLBACK (profile_name_edited_cb),
gtk_tree_view_get_model (GTK_TREE_VIEW (list)));
column = gtk_tree_view_column_new_with_attributes (_("Profile Name"),
@@ -610,15 +618,15 @@ open_editor (NautilusActionsConfigAction *action, gboolean is_new)
NautilusActionsConfigGconfWriter *config;
GList* aligned_widgets = NULL;
GList* iter;
- GSList* list;
+ /*GSList* list;*/
GtkSizeGroup* label_size_group;
- GtkSizeGroup* button_size_group;
- GtkWidget *menu_icon, *scheme_listview;
+ /*GtkSizeGroup* button_size_group;*/
+ GtkWidget *menu_icon /*, *scheme_listview*/;
GtkWidget *menu_label, *menu_tooltip, *menu_profiles_list;
- GtkWidget *command_path, *command_params, *test_patterns, *match_case, *test_mimetypes;
- GtkWidget *only_files, *only_folders, *both, *accept_multiple;
+ /*GtkWidget *command_path, *command_params, *test_patterns, *match_case, *test_mimetypes;*/
+ /*GtkWidget *only_files, *only_folders, *both, *accept_multiple;*/
gint width, height, x, y;
- GtkTreeModel* scheme_model;
+ /*GtkTreeModel* scheme_model;*/
if (!init)
{
@@ -637,13 +645,13 @@ open_editor (NautilusActionsConfigAction *action, gboolean is_new)
g_signal_connect (G_OBJECT (GTK_BIN (menu_icon)->child), "changed",
G_CALLBACK (preview_icon_changed_cb), NULL);
-
+
fill_menu_icon_combo_list_of (GTK_COMBO_BOX_ENTRY (menu_icon));
- gtk_tooltips_set_tip (gtk_tooltips_new (), GTK_WIDGET (GTK_BIN (menu_icon)->child),
- _("Icon of the menu item in the Nautilus popup menu"), "");
-
-
+ /* TODO: replace deprecated gtk_tooltips_set_tip by its equivalent */
+ /*gtk_tooltips_set_tip (gtk_tooltips_new (), GTK_WIDGET (GTK_BIN (menu_icon)->child),
+ _("Icon of the menu item in the Nautilus popup menu"), "");*/
+
aligned_widgets = nact_get_glade_widget_prefix_from ("LabelAlign", GLADE_EDIT_DIALOG_WIDGET);
label_size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
for (iter = aligned_widgets; iter; iter = iter->next)
@@ -676,14 +684,14 @@ open_editor (NautilusActionsConfigAction *action, gboolean is_new)
gtk_window_get_default_size (GTK_WINDOW (editor), &width, &height);
/* Override with preferred one, if any */
nact_prefs_get_edit_dialog_size (&width, &height);
-
+
gtk_window_resize (GTK_WINDOW (editor), width, height);
if (nact_prefs_get_edit_dialog_position (&x, &y))
{
gtk_window_move (GTK_WINDOW (editor), x, y);
}
-
+
menu_label = nact_get_glade_widget_from ("MenuLabelEntry", GLADE_EDIT_DIALOG_WIDGET);
gtk_entry_set_text (GTK_ENTRY (menu_label), action->label);
@@ -692,7 +700,7 @@ open_editor (NautilusActionsConfigAction *action, gboolean is_new)
menu_icon = nact_get_glade_widget_from ("MenuIconComboBoxEntry", GLADE_EDIT_DIALOG_WIDGET);
gtk_entry_set_text (GTK_ENTRY (GTK_BIN (menu_icon)->child), action->icon);
-
+
menu_profiles_list = nact_get_glade_widget_from ("ProfilesList", GLADE_EDIT_DIALOG_WIDGET);
nact_editor_fill_profiles_list (menu_profiles_list, action);
@@ -726,8 +734,8 @@ open_editor (NautilusActionsConfigAction *action, gboolean is_new)
ret = FALSE;
break;
}
-
- /* FIXME: update save preference code
+
+ /* FIXME: update save preference code
// Save preferences
list = NULL;
diff --git a/nact/nact-import-export.c b/nact/nact-import-export.c
index 9df67d8..817c08e 100644
--- a/nact/nact-import-export.c
+++ b/nact/nact-import-export.c
@@ -1,24 +1,32 @@
-/* Nautilus Actions configuration tool
- * Copyright (C) 2005 The GNOME Foundation
+/*
+ * Nautilus Actions
*
- * Authors:
- * Frederic Ruaudel (grumz grumz net)
- * Rodrigo Moya (rodrigo gnome-db org)
+ * Copyright (C) 2005 The GNOME Foundation
+ * Copyright (C) 2006, 2007, 2008 Frederic Ruaudel and others (see AUTHORS)
+ * Copyright (C) 2009 Pierre Wieser and others (see AUTHORS)
*
* This Program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
*
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this Library; see the file COPYING. If not,
- * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * write to the Free Software Foundation, Inc., 59 Temple Place,
+ * Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Authors:
+ * Frederic Ruaudel <grumz grumz net>
+ * Rodrigo Moya <rodrigo gnome-db org>
+ * Pierre Wieser <pwieser trychlos org>
+ * and many others (see AUTHORS)
+ *
+ * pwi 2009-05-16 fix compilation warnings
*/
#include <config.h>
@@ -36,6 +44,10 @@
#include "nact-prefs.h"
#include "nact.h"
+static gboolean nact_import_actions (void);
+static gboolean nact_export_actions (void);
+
+/*
void mode_toggled_cb (GtkWidget* widget, gpointer user_data)
{
GtkWidget* import_radio = nact_get_glade_widget_from ("ImportRadioButton", GLADE_IM_EX_PORT_DIALOG_WIDGET);
@@ -51,7 +63,9 @@ void mode_toggled_cb (GtkWidget* widget, gpointer user_data)
gtk_widget_set_sensitive (nact_get_glade_widget_from ("ImportVBox", GLADE_IM_EX_PORT_DIALOG_WIDGET), FALSE);
}
}
+*/
+/*
void import_browse_button_clicked_cb (GtkWidget* widget, gpointer data)
{
gchar* last_dir;
@@ -65,7 +79,7 @@ void import_browse_button_clicked_cb (GtkWidget* widget, gpointer data)
{
set_current_location = gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (filechooser), filename);
}
-
+
if (!set_current_location)
{
last_dir = nact_prefs_get_import_last_browsed_dir ();
@@ -73,7 +87,7 @@ void import_browse_button_clicked_cb (GtkWidget* widget, gpointer data)
g_free (last_dir);
}
- switch (gtk_dialog_run (GTK_DIALOG (filechooser)))
+ switch (gtk_dialog_run (GTK_DIALOG (filechooser)))
{
case GTK_RESPONSE_OK :
last_dir = gtk_file_chooser_get_current_folder (GTK_FILE_CHOOSER (filechooser));
@@ -86,10 +100,12 @@ void import_browse_button_clicked_cb (GtkWidget* widget, gpointer data)
case GTK_RESPONSE_CANCEL:
case GTK_RESPONSE_DELETE_EVENT:
gtk_widget_hide (filechooser);
- }
+ }
}
+*/
-void export_browse_button_clicked_cb (GtkWidget* widget, gpointer data)
+/*
+void export_browse_button_clicked_cb (GtkWidget* widget, gpointer data)
{
gchar* last_dir;
gchar* foldername;
@@ -102,7 +118,7 @@ void export_browse_button_clicked_cb (GtkWidget* widget, gpointer data)
{
set_current_location = gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (folderchooser), foldername);
}
-
+
if (!set_current_location)
{
last_dir = nact_prefs_get_export_last_browsed_dir ();
@@ -110,7 +126,7 @@ void export_browse_button_clicked_cb (GtkWidget* widget, gpointer data)
g_free (last_dir);
}
- switch (gtk_dialog_run (GTK_DIALOG (folderchooser)))
+ switch (gtk_dialog_run (GTK_DIALOG (folderchooser)))
{
case GTK_RESPONSE_OK :
last_dir = gtk_file_chooser_get_current_folder (GTK_FILE_CHOOSER (folderchooser));
@@ -123,9 +139,9 @@ void export_browse_button_clicked_cb (GtkWidget* widget, gpointer data)
case GTK_RESPONSE_CANCEL:
case GTK_RESPONSE_DELETE_EVENT:
gtk_widget_hide (folderchooser);
- }
+ }
}
-
+*/
static void
list_selection_changed_cb (GtkTreeSelection *selection, gpointer user_data)
@@ -133,7 +149,7 @@ list_selection_changed_cb (GtkTreeSelection *selection, gpointer user_data)
/*
GtkWidget *nact_edit_button;
GtkWidget *nact_delete_button;
-
+
nact_edit_button = nact_get_glade_widget ("EditActionButton");
nact_delete_button = nact_get_glade_widget ("DeleteActionButton");
@@ -171,14 +187,15 @@ static void nact_setup_actions_list (GtkWidget *list)
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (list));
gtk_tree_selection_set_mode (selection, GTK_SELECTION_MULTIPLE);
-
+
/* set up selection */
g_signal_connect (G_OBJECT (gtk_tree_view_get_selection (GTK_TREE_VIEW (list))), "changed",
G_CALLBACK (list_selection_changed_cb), NULL);
}
-gboolean nact_import_actions (void)
+static gboolean
+nact_import_actions (void)
{
gboolean retv = FALSE;
GSList* iter;
@@ -192,7 +209,7 @@ gboolean nact_import_actions (void)
config = nautilus_actions_config_gconf_writer_get ();
schema_reader = nautilus_actions_config_schema_reader_get ();
- nautilus_actions_config_clear (schema_reader);
+ nautilus_actions_config_clear(( NautilusActionsConfig * ) schema_reader );
if (file_path != NULL && strlen (file_path) > 0)
{
@@ -233,7 +250,8 @@ gboolean nact_import_actions (void)
return retv;
}
-gboolean nact_export_actions (void)
+static gboolean
+nact_export_actions (void)
{
gboolean retv = FALSE;
GtkTreeSelection *selection;
@@ -279,7 +297,7 @@ gboolean nact_export_actions (void)
g_list_free (selection_list);
retv = TRUE;
}
-
+
if (retv)
{
gchar* command = g_strdup_printf ("nautilus %s", save_path);
@@ -312,12 +330,12 @@ gboolean nact_import_export_actions (void)
g_error (_("Could not load interface for Nautilus Actions Config Tool"));
return FALSE;
}
-
+
glade_xml_signal_autoconnect (gui);
nact_action_list_tree = nact_get_glade_widget_from ("ExportTreeView", GLADE_IM_EX_PORT_DIALOG_WIDGET);
nact_setup_actions_list (nact_action_list_tree);
-
+
aligned_widgets = nact_get_glade_widget_prefix_from ("IELabelAlign", GLADE_IM_EX_PORT_DIALOG_WIDGET);
label_size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
for (iter = aligned_widgets; iter; iter = iter->next)
@@ -325,11 +343,11 @@ gboolean nact_import_export_actions (void)
gtk_size_group_add_widget (label_size_group, GTK_WIDGET (iter->data));
}
button_size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
- gtk_size_group_add_widget (button_size_group,
- nact_get_glade_widget_from ("ImportBrowseButton",
+ gtk_size_group_add_widget (button_size_group,
+ nact_get_glade_widget_from ("ImportBrowseButton",
GLADE_IM_EX_PORT_DIALOG_WIDGET));
- gtk_size_group_add_widget (button_size_group,
- nact_get_glade_widget_from ("ExportBrowseButton",
+ gtk_size_group_add_widget (button_size_group,
+ nact_get_glade_widget_from ("ExportBrowseButton",
GLADE_IM_EX_PORT_DIALOG_WIDGET));
/* free memory */
g_object_unref (gui);
@@ -345,10 +363,10 @@ gboolean nact_import_export_actions (void)
/* Get the default dialog size */
gtk_window_get_default_size (GTK_WINDOW (import_export_dialog), &width, &height);
-
+
/* Override with preferred one, if any */
nact_prefs_get_im_ex_dialog_size (&width, &height);
-
+
gtk_window_resize (GTK_WINDOW (import_export_dialog), width, height);
if (nact_prefs_get_im_ex_dialog_position (&x, &y))
@@ -358,10 +376,10 @@ gboolean nact_import_export_actions (void)
last_dir = nact_prefs_get_export_last_browsed_dir ();
gtk_entry_set_text (GTK_ENTRY (nact_get_glade_widget_from ("ExportEntry", GLADE_IM_EX_PORT_DIALOG_WIDGET)), last_dir);
- gtk_entry_select_region (GTK_ENTRY (nact_get_glade_widget_from ("ExportEntry", GLADE_IM_EX_PORT_DIALOG_WIDGET)), 0, -1);
-
+ gtk_editable_select_region (GTK_EDITABLE (nact_get_glade_widget_from ("ExportEntry", GLADE_IM_EX_PORT_DIALOG_WIDGET)), 0, -1);
+
/* run the dialog */
- switch (gtk_dialog_run (GTK_DIALOG (import_export_dialog)))
+ switch (gtk_dialog_run (GTK_DIALOG (import_export_dialog)))
{
case GTK_RESPONSE_OK :
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (import_radio)))
@@ -388,5 +406,3 @@ gboolean nact_import_export_actions (void)
return retv;
}
-
-// vim:ts=3:sw=3:tw=1024:cin
diff --git a/nact/nact-profile-editor.c b/nact/nact-profile-editor.c
index bd85599..8247e25 100644
--- a/nact/nact-profile-editor.c
+++ b/nact/nact-profile-editor.c
@@ -1,23 +1,32 @@
-/* Nautilus Actions configuration tool
- * Copyright (C) 2005 The GNOME Foundation
+/*
+ * Nautilus Actions
*
- * Authors:
- * Frederic Ruaudel (grumz grumz net)
+ * Copyright (C) 2005 The GNOME Foundation
+ * Copyright (C) 2006, 2007, 2008 Frederic Ruaudel and others (see AUTHORS)
+ * Copyright (C) 2009 Pierre Wieser and others (see AUTHORS)
*
* This Program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
*
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this Library; see the file COPYING. If not,
- * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * write to the Free Software Foundation, Inc., 59 Temple Place,
+ * Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Authors:
+ * Frederic Ruaudel <grumz grumz net>
+ * Rodrigo Moya <rodrigo gnome-db org>
+ * Pierre Wieser <pwieser trychlos org>
+ * and many others (see AUTHORS)
+ *
+ * pwi 2009-05-16 fix compilation warnings
*/
#include <string.h>
@@ -32,7 +41,11 @@
#include "nact-prefs.h"
#include "nact.h"
-void update_example_label (void)
+static void update_example_label (void);
+static void profile_field_changed_cb (GObject *object, gpointer user_data);
+
+static void
+update_example_label (void)
{
GtkWidget* label_widget = nact_get_glade_widget_from ("LabelExample", GLADE_EDIT_PROFILE_DIALOG_WIDGET);
static gboolean init = FALSE;
@@ -45,7 +58,7 @@ void update_example_label (void)
g_stpcpy (label_format_string, gtk_label_get_label (GTK_LABEL (label_widget)));
init = TRUE;
}
-
+
// Convert special xml chars (&, <, >,...) to avoid warnings generated by Pango parser
ex_str = g_markup_printf_escaped (label_format_string, tmp);
gtk_label_set_label (GTK_LABEL (label_widget), ex_str);
@@ -53,7 +66,7 @@ void update_example_label (void)
g_free (tmp);
}
-void
+static void
profile_field_changed_cb (GObject *object, gpointer user_data)
{
GtkWidget* editor = nact_get_glade_widget_from ("EditProfileDialog", GLADE_EDIT_PROFILE_DIALOG_WIDGET);
@@ -68,12 +81,12 @@ profile_field_changed_cb (GObject *object, gpointer user_data)
gtk_dialog_set_response_sensitive (GTK_DIALOG (editor), GTK_RESPONSE_OK, FALSE);
}
-void
+/*void
example_changed_cb (GObject *object, gpointer user_data)
{
-}
+}*/
-void path_browse_button_clicked_cb (GtkButton *button, gpointer user_data)
+/*void path_browse_button_clicked_cb (GtkButton *button, gpointer user_data)
{
gchar* last_dir;
gchar* filename;
@@ -86,7 +99,7 @@ void path_browse_button_clicked_cb (GtkButton *button, gpointer user_data)
{
set_current_location = gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (filechooser), filename);
}
-
+
if (!set_current_location)
{
last_dir = nact_prefs_get_path_last_browsed_dir ();
@@ -94,7 +107,7 @@ void path_browse_button_clicked_cb (GtkButton *button, gpointer user_data)
g_free (last_dir);
}
- switch (gtk_dialog_run (GTK_DIALOG (filechooser)))
+ switch (gtk_dialog_run (GTK_DIALOG (filechooser)))
{
case GTK_RESPONSE_OK :
last_dir = gtk_file_chooser_get_current_folder (GTK_FILE_CHOOSER (filechooser));
@@ -107,10 +120,10 @@ void path_browse_button_clicked_cb (GtkButton *button, gpointer user_data)
case GTK_RESPONSE_CANCEL:
case GTK_RESPONSE_DELETE_EVENT:
gtk_widget_hide (filechooser);
- }
-}
+ }
+}*/
-static void
+/*static void
show_legend_dialog ()
{
GtkWidget* editor = nact_get_glade_widget_from ("EditActionDialog", GLADE_EDIT_PROFILE_DIALOG_WIDGET);
@@ -119,9 +132,9 @@ show_legend_dialog ()
gtk_window_set_transient_for (GTK_WINDOW (legend_dialog), GTK_WINDOW (editor));
// TODO: Get back the last position saved !!
gtk_widget_show (legend_dialog);
-}
+}*/
-static void
+static void
hide_legend_dialog ()
{
GtkWidget *legend_dialog = nact_get_glade_widget_from ("LegendDialog", GLADE_LEGEND_DIALOG_WIDGET);
@@ -129,12 +142,12 @@ hide_legend_dialog ()
gtk_widget_hide (legend_dialog);
// TODO: Save the current position !!
- // Set the legend button state consistent for when the dialog is hidden
+ // Set the legend button state consistent for when the dialog is hidden
// by another mean (eg. close the edit profile dialog)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (legend_button), FALSE);
}
-void
+/*void
legend_button_toggled_cb (GtkToggleButton *button, gpointer user_data)
{
if (gtk_toggle_button_get_active (button))
@@ -145,7 +158,7 @@ legend_button_toggled_cb (GtkToggleButton *button, gpointer user_data)
{
hide_legend_dialog ();
}
-}
+}*/
static void scheme_selection_toggled_cb (GtkCellRendererToggle *cell_renderer,
gchar *path_str,
@@ -182,7 +195,7 @@ cell_edited (GtkTreeModel *model,
gtk_tree_model_get_iter (model, &iter, path);
- gtk_tree_model_get (model, &iter, SCHEMES_CHECKBOX_COLUMN, &toggle_state,
+ gtk_tree_model_get (model, &iter, SCHEMES_CHECKBOX_COLUMN, &toggle_state,
column, &old_text, -1);
g_free (old_text);
@@ -231,20 +244,20 @@ scheme_list_selection_changed_cb (GtkTreeSelection *selection, gpointer user_dat
}
}
-void add_scheme_clicked (GtkWidget* widget, gpointer user_data)
+/*void add_scheme_clicked (GtkWidget* widget, gpointer user_data)
{
GtkWidget* listview = nact_get_glade_widget_from ("SchemesTreeView", GLADE_EDIT_PROFILE_DIALOG_WIDGET);
GtkTreeModel* model = gtk_tree_view_get_model (GTK_TREE_VIEW (listview));
GtkTreeIter row;
-
+
gtk_list_store_append (GTK_LIST_STORE (model), &row);
- gtk_list_store_set (GTK_LIST_STORE (model), &row, SCHEMES_CHECKBOX_COLUMN, FALSE,
- /* i18n notes : scheme name set for a new entry in the scheme list */
+ gtk_list_store_set (GTK_LIST_STORE (model), &row, SCHEMES_CHECKBOX_COLUMN, FALSE,
+ / * i18n notes : scheme name set for a new entry in the scheme list * /
SCHEMES_KEYWORD_COLUMN, _("new-scheme"),
SCHEMES_DESC_COLUMN, _("New Scheme Description"), -1);
-}
+}*/
-void remove_scheme_clicked (GtkWidget* widget, gpointer user_data)
+/*void remove_scheme_clicked (GtkWidget* widget, gpointer user_data)
{
GtkWidget* listview = nact_get_glade_widget_from ("SchemesTreeView", GLADE_EDIT_PROFILE_DIALOG_WIDGET);
GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (listview));
@@ -262,7 +275,7 @@ void remove_scheme_clicked (GtkWidget* widget, gpointer user_data)
path = (GtkTreePath*)(list_iter->data);
gtk_tree_model_get_iter (model, &iter, path);
gtk_tree_model_get (model, &iter, SCHEMES_CHECKBOX_COLUMN, &toggle_state, -1);
-
+
gtk_list_store_remove (GTK_LIST_STORE (model), &iter);
if (toggle_state)
@@ -272,10 +285,10 @@ void remove_scheme_clicked (GtkWidget* widget, gpointer user_data)
update_example_label ();
}
}
-
+
g_list_foreach (selected_values_path, (GFunc)gtk_tree_path_free, NULL);
g_list_free (selected_values_path);
-}
+}*/
static void create_schemes_selection_list (void)
{
@@ -289,16 +302,16 @@ static void create_schemes_selection_list (void)
GtkCellRenderer* text_cell;
model = gtk_list_store_new (SCHEMES_N_COLUMN, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_STRING);
-
+
for (iter = schemes_list; iter; iter = iter->next)
{
gchar** tokens = g_strsplit ((gchar*)iter->data, "|", 2);
-
+
gtk_list_store_append (model, &row);
- gtk_list_store_set (model, &row, SCHEMES_CHECKBOX_COLUMN, FALSE,
+ gtk_list_store_set (model, &row, SCHEMES_CHECKBOX_COLUMN, FALSE,
SCHEMES_KEYWORD_COLUMN, tokens[0],
SCHEMES_DESC_COLUMN, tokens[1], -1);
-
+
g_strfreev (tokens);
}
@@ -307,25 +320,25 @@ static void create_schemes_selection_list (void)
gtk_tree_view_set_model (GTK_TREE_VIEW (listview), GTK_TREE_MODEL (model));
g_object_unref (model);
-
+
toggled_cell = gtk_cell_renderer_toggle_new ();
g_signal_connect (G_OBJECT (toggled_cell), "toggled",
- G_CALLBACK (scheme_selection_toggled_cb),
+ G_CALLBACK (scheme_selection_toggled_cb),
gtk_tree_view_get_model (GTK_TREE_VIEW (listview)));
column = gtk_tree_view_column_new_with_attributes ("",
toggled_cell,
"active", SCHEMES_CHECKBOX_COLUMN, NULL);
gtk_tree_view_append_column (GTK_TREE_VIEW (listview), column);
-
+
text_cell = gtk_cell_renderer_text_new ();
g_object_set (G_OBJECT (text_cell), "editable", TRUE, NULL);
g_signal_connect (G_OBJECT (text_cell), "edited",
- G_CALLBACK (scheme_edited_cb),
+ G_CALLBACK (scheme_edited_cb),
gtk_tree_view_get_model (GTK_TREE_VIEW (listview)));
-
+
column = gtk_tree_view_column_new_with_attributes (_("Scheme"),
text_cell,
"text", SCHEMES_KEYWORD_COLUMN, NULL);
@@ -335,9 +348,9 @@ static void create_schemes_selection_list (void)
g_object_set (G_OBJECT (text_cell), "editable", TRUE, NULL);
g_signal_connect (G_OBJECT (text_cell), "edited",
- G_CALLBACK (scheme_desc_edited_cb),
+ G_CALLBACK (scheme_desc_edited_cb),
gtk_tree_view_get_model (GTK_TREE_VIEW (listview)));
-
+
column = gtk_tree_view_column_new_with_attributes (_("Description"),
text_cell,
"text", SCHEMES_DESC_COLUMN, NULL);
@@ -347,7 +360,7 @@ static void create_schemes_selection_list (void)
G_CALLBACK (scheme_list_selection_changed_cb), NULL);
}
-static gboolean reset_schemes_list (GtkTreeModel* scheme_model, GtkTreePath *path,
+static gboolean reset_schemes_list (GtkTreeModel* scheme_model, GtkTreePath *path,
GtkTreeIter* iter, gpointer data)
{
gtk_list_store_set (GTK_LIST_STORE (scheme_model), iter, SCHEMES_CHECKBOX_COLUMN, FALSE, -1);
@@ -355,7 +368,7 @@ static gboolean reset_schemes_list (GtkTreeModel* scheme_model, GtkTreePath *pat
return FALSE; // Don't stop looping
}
-static gboolean get_all_schemes_list (GtkTreeModel* scheme_model, GtkTreePath *path,
+/*static gboolean get_all_schemes_list (GtkTreeModel* scheme_model, GtkTreePath *path,
GtkTreeIter* iter, gpointer data)
{
GSList** list = data;
@@ -363,7 +376,7 @@ static gboolean get_all_schemes_list (GtkTreeModel* scheme_model, GtkTreePath *p
gchar* desc;
gchar* scheme_desc;
- gtk_tree_model_get (scheme_model, iter, SCHEMES_KEYWORD_COLUMN, &scheme,
+ gtk_tree_model_get (scheme_model, iter, SCHEMES_KEYWORD_COLUMN, &scheme,
SCHEMES_DESC_COLUMN, &desc, -1);
scheme_desc = g_strjoin ("|", scheme, desc, NULL);
@@ -374,7 +387,7 @@ static gboolean get_all_schemes_list (GtkTreeModel* scheme_model, GtkTreePath *p
g_free (desc);
return FALSE; // Don't stop looping
-}
+}*/
static void set_action_schemes (gchar* action_scheme, GtkTreeModel* scheme_model)
{
@@ -403,7 +416,7 @@ static void set_action_schemes (gchar* action_scheme, GtkTreeModel* scheme_model
if (!found)
{
gtk_list_store_append (GTK_LIST_STORE (scheme_model), &iter);
- gtk_list_store_set (GTK_LIST_STORE (scheme_model), &iter, SCHEMES_CHECKBOX_COLUMN, TRUE,
+ gtk_list_store_set (GTK_LIST_STORE (scheme_model), &iter, SCHEMES_CHECKBOX_COLUMN, TRUE,
SCHEMES_KEYWORD_COLUMN, action_scheme,
SCHEMES_DESC_COLUMN, "", -1);
}
@@ -424,7 +437,7 @@ static void set_action_match_string_list (GtkEntry* entry, GSList* basenames, co
{
entry_text = g_strdup ((gchar*)iter->data);
iter = iter->next;
-
+
while (iter)
{
tmp = g_strjoin (" ; ", entry_text, (gchar*)iter->data, NULL);
@@ -443,16 +456,17 @@ static GSList* get_action_match_string_list (const gchar* patterns, const gchar*
gchar** iter;
GSList* list = NULL;
gchar* tmp;
+ gchar *source = g_strdup( patterns );
- tmp = g_strstrip (patterns);
+ tmp = g_strstrip( source );
if (strlen (tmp) == 0)
{
list = g_slist_append (list, g_strdup (default_string));
}
else
{
- tokens = g_strsplit (patterns, ";", -1);
-
+ tokens = g_strsplit( source, ";", -1);
+
iter = tokens;
while (*iter != NULL)
{
@@ -460,10 +474,10 @@ static GSList* get_action_match_string_list (const gchar* patterns, const gchar*
list = g_slist_append (list, g_strdup (tmp));
iter++;
}
-
+
g_strfreev (tokens);
}
-
+ g_free( source );
return list;
}
@@ -474,22 +488,22 @@ open_profile_editor (NautilusActionsConfigAction *action, gchar* profile_name, N
static gboolean init = FALSE;
GtkWidget* editor;
GladeXML *gui;
- gchar *label;
+ /*gchar *label;*/
GList* aligned_widgets = NULL;
GList* iter;
GSList* list;
GtkSizeGroup* label_size_group;
GtkSizeGroup* button_size_group;
- GtkWidget *menu_icon, *scheme_listview;
- GtkWidget *menu_label, *menu_tooltip, *menu_profiles_list;
+ GtkWidget /* *menu_icon,*/ *scheme_listview;
+ /*GtkWidget *menu_label, *menu_tooltip, *menu_profiles_list*/;
GtkWidget *command_path, *command_params, *test_patterns, *match_case, *test_mimetypes;
GtkWidget *only_files, *only_folders, *both, *accept_multiple;
- gint width, height, x, y;
+ gint width, height /*, x, y*/;
GtkTreeModel* scheme_model;
if (!init)
{
- // load the GUI
+ // load the GUI
gui = nact_get_glade_xml_object (GLADE_EDIT_PROFILE_DIALOG_WIDGET);
if (!gui) {
g_error (_("Could not load interface for Nautilus Actions Config Tool"));
@@ -514,13 +528,13 @@ open_profile_editor (NautilusActionsConfigAction *action, gchar* profile_name, N
gtk_size_group_add_widget (label_size_group, GTK_WIDGET (iter->data));
}
button_size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
- gtk_size_group_add_widget (button_size_group,
- nact_get_glade_widget_from ("BrowseButton",
+ gtk_size_group_add_widget (button_size_group,
+ nact_get_glade_widget_from ("BrowseButton",
GLADE_EDIT_PROFILE_DIALOG_WIDGET));
- gtk_size_group_add_widget (button_size_group,
- nact_get_glade_widget_from ("LegendButton",
+ gtk_size_group_add_widget (button_size_group,
+ nact_get_glade_widget_from ("LegendButton",
GLADE_EDIT_PROFILE_DIALOG_WIDGET));
- // free memory
+ // free memory
g_object_unref (gui);
init = TRUE;
}
@@ -538,14 +552,14 @@ open_profile_editor (NautilusActionsConfigAction *action, gchar* profile_name, N
g_free (title);
}
- // Get the default dialog size
+ // Get the default dialog size
gtk_window_get_default_size (GTK_WINDOW (editor), &width, &height);
/* FIXME: update preference data for profile editor dialog
- // Override with preferred one, if any
+ // Override with preferred one, if any
nact_prefs_get_edit_dialog_size (&width, &height);
-
+
gtk_window_resize (GTK_WINDOW (editor), width, height);
if (nact_prefs_get_edit_dialog_position (&x, &y))
@@ -572,9 +586,9 @@ open_profile_editor (NautilusActionsConfigAction *action, gchar* profile_name, N
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (match_case), action_profile->match_case);
test_mimetypes = nact_get_glade_widget_from ("MimeTypeEntry", GLADE_EDIT_PROFILE_DIALOG_WIDGET);
-
+
set_action_match_string_list (GTK_ENTRY (test_mimetypes), action_profile->mimetypes, "*/*");
-
+
only_folders = nact_get_glade_widget_from ("OnlyFoldersButton", GLADE_EDIT_PROFILE_DIALOG_WIDGET);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (only_folders), action_profile->is_dir);
@@ -594,7 +608,7 @@ open_profile_editor (NautilusActionsConfigAction *action, gchar* profile_name, N
update_example_label ();
- // run the dialog
+ // run the dialog
gtk_dialog_set_response_sensitive (GTK_DIALOG (editor), GTK_RESPONSE_OK, FALSE);
switch (gtk_dialog_run (GTK_DIALOG (editor))) {
case GTK_RESPONSE_OK :
@@ -608,7 +622,7 @@ open_profile_editor (NautilusActionsConfigAction *action, gchar* profile_name, N
nautilus_actions_config_action_profile_set_match_case (
action_profile, gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (match_case)));
-
+
list = get_action_match_string_list (gtk_entry_get_text (GTK_ENTRY (test_mimetypes)), "*/*");
nautilus_actions_config_action_profile_set_mimetypes (action_profile, list);
g_slist_foreach (list, (GFunc) g_free, NULL);
@@ -654,7 +668,7 @@ open_profile_editor (NautilusActionsConfigAction *action, gchar* profile_name, N
ret = FALSE;
break;
}
-
+
/*
// Save preferences
list = NULL;
@@ -669,7 +683,7 @@ open_profile_editor (NautilusActionsConfigAction *action, gchar* profile_name, N
hide_legend_dialog ();
gtk_widget_hide (editor);
-
+
return ret;
}
@@ -696,5 +710,3 @@ nact_profile_editor_edit_profile (NautilusActionsConfigAction *action, gchar* pr
{
return open_profile_editor (action, profile_name, action_profile, FALSE);
}
-
-// vim:ts=3:sw=3:tw=1024:cin
diff --git a/nact/nact-utils.c b/nact/nact-utils.c
index 90f3613..2f798f4 100644
--- a/nact/nact-utils.c
+++ b/nact/nact-utils.c
@@ -1,23 +1,32 @@
-/* Nautilus Actions configuration tool
- * Copyright (C) 2005 The GNOME Foundation
+/*
+ * Nautilus Actions
*
- * Authors:
- * Frederic Ruaudel (grumz grumz net)
+ * Copyright (C) 2005 The GNOME Foundation
+ * Copyright (C) 2006, 2007, 2008 Frederic Ruaudel and others (see AUTHORS)
+ * Copyright (C) 2009 Pierre Wieser and others (see AUTHORS)
*
* This Program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
*
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this Library; see the file COPYING. If not,
- * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * write to the Free Software Foundation, Inc., 59 Temple Place,
+ * Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Authors:
+ * Frederic Ruaudel <grumz grumz net>
+ * Rodrigo Moya <rodrigo gnome-db org>
+ * Pierre Wieser <pwieser trychlos org>
+ * and many others (see AUTHORS)
+ *
+ * pwi 2009-05-16 fix compilation warnings
*/
#include <config.h>
@@ -98,7 +107,7 @@ void nautilus_actions_display_error (const gchar *primary_msg, const gchar* seco
}
error_dialog = nact_get_glade_widget_from ("ErrorDialog", GLADE_ERROR_DIALOG_WIDGET);
-
+
error_label = nact_get_glade_widget_from ("ErrorLabel", GLADE_ERROR_DIALOG_WIDGET);
tmp = g_markup_printf_escaped (label_text_template, primary_msg, secondary_msg);
@@ -111,14 +120,14 @@ void nautilus_actions_display_error (const gchar *primary_msg, const gchar* seco
g_object_unref (gui);
}
-gboolean nact_utils_get_action_schemes_list (GtkTreeModel* scheme_model, GtkTreePath *path,
+gboolean nact_utils_get_action_schemes_list (GtkTreeModel* scheme_model, GtkTreePath *path,
GtkTreeIter* iter, gpointer data)
{
GSList** list = data;
gboolean toggle_state;
gchar* scheme;
- gtk_tree_model_get (scheme_model, iter, SCHEMES_CHECKBOX_COLUMN, &toggle_state,
+ gtk_tree_model_get (scheme_model, iter, SCHEMES_CHECKBOX_COLUMN, &toggle_state,
SCHEMES_KEYWORD_COLUMN, &scheme, -1);
if (toggle_state)
@@ -149,7 +158,7 @@ static gchar* nact_utils_joinv (const gchar* start, const gchar* separator, gcha
{
tmp_string = g_string_append (tmp_string, _(list[0]));
}
-
+
for (i = 1; list[i] != NULL; i++)
{
if (separator)
@@ -166,7 +175,7 @@ gchar* nact_utils_parse_parameter (void)
{
/*
* Valid parameters :
- *
+ *
* %u : gnome-vfs URI
* %d : base dir of the selected file(s)/folder(s)
* %f : the name of the selected file/folder or the 1st one if many are selected
@@ -180,7 +189,7 @@ gchar* nact_utils_parse_parameter (void)
*/
gchar* retv = NULL;
GString* tmp_string = g_string_new ("");
-
+
/* i18n notes: example strings for the command preview */
gchar* ex_path = _("/path/to");
gchar* ex_files[] = { N_("file1.txt"), N_("file2.txt"), NULL };
@@ -190,13 +199,13 @@ gchar* nact_utils_parse_parameter (void)
gchar* ex_host_default = _("test.example.net");
gchar* ex_one_file = _("file.txt");
gchar* ex_one_dir = _("folder");
- gchar* ex_one;
- gchar* ex_list;
- gchar* ex_path_list;
+ gchar* ex_one = NULL;
+ gchar* ex_list = NULL;
+ gchar* ex_path_list = NULL;
gchar* ex_scheme;
gchar* ex_host;
- const gchar* param_template = gtk_entry_get_text (GTK_ENTRY (nact_get_glade_widget_from ("CommandParamsEntry",
+ const gchar* param_template = gtk_entry_get_text (GTK_ENTRY (nact_get_glade_widget_from ("CommandParamsEntry",
GLADE_EDIT_PROFILE_DIALOG_WIDGET)));
gchar* iter = g_strdup (param_template);
gchar* old_iter = iter;
@@ -205,25 +214,25 @@ gchar* nact_utils_parse_parameter (void)
gchar* start;
GSList* scheme_list = NULL;
- const gchar* command = gtk_entry_get_text (GTK_ENTRY (nact_get_glade_widget_from ("CommandPathEntry",
+ const gchar* command = gtk_entry_get_text (GTK_ENTRY (nact_get_glade_widget_from ("CommandPathEntry",
GLADE_EDIT_PROFILE_DIALOG_WIDGET)));
g_string_append_printf (tmp_string, "%s ", command);
- gboolean is_file = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (nact_get_glade_widget_from ("OnlyFilesButton",
+ gboolean is_file = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (nact_get_glade_widget_from ("OnlyFilesButton",
GLADE_EDIT_PROFILE_DIALOG_WIDGET)));
- gboolean is_dir = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (nact_get_glade_widget_from ("OnlyFoldersButton",
+ gboolean is_dir = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (nact_get_glade_widget_from ("OnlyFoldersButton",
GLADE_EDIT_PROFILE_DIALOG_WIDGET)));
- if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (nact_get_glade_widget_from ("BothButton",
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (nact_get_glade_widget_from ("BothButton",
GLADE_EDIT_PROFILE_DIALOG_WIDGET))))
{
is_file = TRUE;
is_dir = TRUE;
}
- gboolean accept_multiple = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (nact_get_glade_widget_from ("AcceptMultipleButton",
+ gboolean accept_multiple = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (nact_get_glade_widget_from ("AcceptMultipleButton",
GLADE_EDIT_PROFILE_DIALOG_WIDGET)));
-
- GtkTreeModel* scheme_model = gtk_tree_view_get_model (GTK_TREE_VIEW (nact_get_glade_widget_from ("SchemesTreeView",
+
+ GtkTreeModel* scheme_model = gtk_tree_view_get_model (GTK_TREE_VIEW (nact_get_glade_widget_from ("SchemesTreeView",
GLADE_EDIT_PROFILE_DIALOG_WIDGET)));
gtk_tree_model_foreach (scheme_model, (GtkTreeModelForeachFunc)nact_utils_get_action_schemes_list, &scheme_list);
@@ -265,7 +274,7 @@ gchar* nact_utils_parse_parameter (void)
}
g_free (start);
g_free (separator);
-
+
if (scheme_list != NULL)
{
ex_scheme = (gchar*)scheme_list->data;
@@ -291,7 +300,7 @@ gchar* nact_utils_parse_parameter (void)
ex_scheme = ex_scheme_default;
ex_host = "";
}
-
+
while ((iter = g_strstr_len (iter, strlen (iter), "%")))
{
tmp_string = g_string_append_len (tmp_string, old_iter, strlen (old_iter) - strlen (iter));
@@ -331,14 +340,12 @@ gchar* nact_utils_parse_parameter (void)
old_iter = iter; // store the new start of the string
}
tmp_string = g_string_append_len (tmp_string, old_iter, strlen (old_iter));
-
+
g_free (ex_list);
g_free (ex_path_list);
g_free (iter);
retv = g_string_free (tmp_string, FALSE); // return the content of the GString
-
+
return retv;
}
-
-// vim:ts=3:sw=3:tw=1024:cin
diff --git a/nact/nact.c b/nact/nact.c
index 1660b7c..ea68884 100644
--- a/nact/nact.c
+++ b/nact/nact.c
@@ -1,24 +1,32 @@
-/* Nautilus Actions configuration tool
- * Copyright (C) 2005 The GNOME Foundation
+/*
+ * Nautilus Actions
*
- * Authors:
- * Rodrigo Moya (rodrigo gnome-db org)
- * Frederic Ruaudel (grumz grumz net)
+ * Copyright (C) 2005 The GNOME Foundation
+ * Copyright (C) 2006, 2007, 2008 Frederic Ruaudel and others (see AUTHORS)
+ * Copyright (C) 2009 Pierre Wieser and others (see AUTHORS)
*
* This Program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
*
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this Library; see the file COPYING. If not,
- * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * write to the Free Software Foundation, Inc., 59 Temple Place,
+ * Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Authors:
+ * Frederic Ruaudel <grumz grumz net>
+ * Rodrigo Moya <rodrigo gnome-db org>
+ * Pierre Wieser <pwieser trychlos org>
+ * and many others (see AUTHORS)
+ *
+ * pwi 2009-05-16 fix compilation warnings
*/
#include <config.h>
@@ -38,9 +46,21 @@
#include "nact-import-export.h"
#include "nact-prefs.h"
+static gint actions_list_sort_by_label (gconstpointer a1, gconstpointer a2);
+/*
+static void add_button_clicked_cb (GtkButton *button, gpointer user_data);
+static void edit_button_clicked_cb (GtkButton *button, gpointer user_data);
+static void duplicate_button_clicked_cb (GtkButton *button, gpointer user_data);
+static void delete_button_clicked_cb (GtkButton *button, gpointer user_data);
+static void im_export_button_clicked_cb (GtkButton *button, gpointer user_data);
+static void dialog_response_cb (GtkDialog *dialog, gint response_id, gpointer user_data);
+*/
+static void list_selection_changed_cb (GtkTreeSelection *selection, gpointer user_data);
+
static NautilusActionsConfigGconfWriter *config = NULL;
-gint actions_list_sort_by_label (gconstpointer a1, gconstpointer a2)
+static gint
+actions_list_sort_by_label (gconstpointer a1, gconstpointer a2)
{
NautilusActionsConfigAction* action1 = (NautilusActionsConfigAction*)a1;
NautilusActionsConfigAction* action2 = (NautilusActionsConfigAction*)a2;
@@ -71,7 +91,7 @@ void nact_fill_actions_list (GtkWidget *list)
gint width;
gint height;
GError* error = NULL;
-
+
gtk_icon_size_lookup (GTK_ICON_SIZE_MENU, &width, &height);
icon = gdk_pixbuf_new_from_file_at_size (action->icon, width, height, &error);
if (error)
@@ -82,8 +102,8 @@ void nact_fill_actions_list (GtkWidget *list)
}
}
gtk_list_store_append (model, &iter);
- gtk_list_store_set (model, &iter,
- MENU_ICON_COLUMN, icon,
+ gtk_list_store_set (model, &iter,
+ MENU_ICON_COLUMN, icon,
MENU_LABEL_COLUMN, action->label,
UUID_COLUMN, action->uuid,
-1);
@@ -92,14 +112,17 @@ void nact_fill_actions_list (GtkWidget *list)
nautilus_actions_config_free_actions_list (actions);
}
-void
+/*
+static void
add_button_clicked_cb (GtkButton *button, gpointer user_data)
{
if (nact_editor_new_action ())
nact_fill_actions_list (nact_get_glade_widget ("ActionsList"));
}
+*/
-void
+/*
+static void
edit_button_clicked_cb (GtkButton *button, gpointer user_data)
{
GtkTreeSelection *selection;
@@ -126,8 +149,10 @@ edit_button_clicked_cb (GtkButton *button, gpointer user_data)
g_free (uuid);
}
}
+*/
-void
+/*
+static void
duplicate_button_clicked_cb (GtkButton *button, gpointer user_data)
{
GtkTreeSelection *selection;
@@ -141,7 +166,7 @@ duplicate_button_clicked_cb (GtkButton *button, gpointer user_data)
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (nact_actions_list));
- if (gtk_tree_selection_get_selected (selection, &model, &iter))
+ if (gtk_tree_selection_get_selected (selection, &model, &iter))
{
gchar *uuid;
NautilusActionsConfigAction *action;
@@ -151,7 +176,7 @@ duplicate_button_clicked_cb (GtkButton *button, gpointer user_data)
action = nautilus_actions_config_get_action (NAUTILUS_ACTIONS_CONFIG (config), uuid);
new_action = nautilus_actions_config_action_dup_new (action);
- if (new_action)
+ if (new_action)
{
if (nautilus_actions_config_add_action (NAUTILUS_ACTIONS_CONFIG (config), new_action, &error))
{
@@ -170,8 +195,10 @@ duplicate_button_clicked_cb (GtkButton *button, gpointer user_data)
g_free (uuid);
}
}
+*/
-void
+/*
+static void
delete_button_clicked_cb (GtkButton *button, gpointer user_data)
{
GtkTreeSelection *selection;
@@ -193,8 +220,11 @@ delete_button_clicked_cb (GtkButton *button, gpointer user_data)
g_free (uuid);
}
}
+*/
-void im_export_button_clicked_cb (GtkButton *button, gpointer user_data)
+/*
+static void
+im_export_button_clicked_cb (GtkButton *button, gpointer user_data)
{
GtkWidget *nact_actions_list;
@@ -204,8 +234,10 @@ void im_export_button_clicked_cb (GtkButton *button, gpointer user_data)
nact_fill_actions_list (nact_actions_list);
}
}
+*/
-void
+/*
+static void
dialog_response_cb (GtkDialog *dialog, gint response_id, gpointer user_data)
{
GtkWidget* nact_about_dialog;
@@ -218,11 +250,11 @@ dialog_response_cb (GtkDialog *dialog, gint response_id, gpointer user_data)
// Free any profile in the clipboard
nautilus_actions_config_action_profile_free (g_object_steal_data (G_OBJECT (nact_prof_paste_button), "profile"));
- /* FIXME : update pref settings
+ / * FIXME : update pref settings
nact_prefs_set_main_dialog_size (GTK_WINDOW (dialog));
nact_prefs_set_main_dialog_position (GTK_WINDOW (dialog));
nact_prefs_save_preferences ();
- */
+ * /
gtk_widget_destroy (GTK_WIDGET (dialog));
nact_destroy_glade_objects ();
@@ -239,6 +271,7 @@ dialog_response_cb (GtkDialog *dialog, gint response_id, gpointer user_data)
break;
}
}
+*/
static void
list_selection_changed_cb (GtkTreeSelection *selection, gpointer user_data)
@@ -246,7 +279,7 @@ list_selection_changed_cb (GtkTreeSelection *selection, gpointer user_data)
GtkWidget *nact_edit_button;
GtkWidget *nact_delete_button;
GtkWidget *nact_duplicate_button;
-
+
nact_edit_button = nact_get_glade_widget ("EditActionButton");
nact_delete_button = nact_get_glade_widget ("DeleteActionButton");
nact_duplicate_button = nact_get_glade_widget ("DuplicateActionButton");
@@ -296,7 +329,7 @@ init_dialog (void)
gint width, height, x, y;
GtkWidget *nact_dialog;
GtkWidget *nact_actions_list;
- GtkWidget* nact_edit_button;
+ /*GtkWidget* nact_edit_button;*/
GtkWidget* nact_about_button;
GladeXML *gui = nact_get_glade_xml_object (GLADE_MAIN_WIDGET);
if (!gui) {
@@ -315,7 +348,7 @@ init_dialog (void)
gtk_window_get_default_size (GTK_WINDOW (nact_dialog), &width, &height);
/* Override with preferred one, if any */
nact_prefs_get_main_dialog_size (&width, &height);
-
+
gtk_window_resize (GTK_WINDOW (nact_dialog), width, height);
/* Get the default position */
@@ -325,7 +358,7 @@ init_dialog (void)
gtk_window_move (GTK_WINDOW (nact_dialog), x, y);
-#if ((GTK_MAJOR_VERSION == 2) && (GTK_MINOR_VERSION == 4))
+#if ((GTK_MAJOR_VERSION == 2) && (GTK_MINOR_VERSION == 4))
/* Fix a stock icon bug with GTK+ 2.4 */
nact_edit_button = nact_get_glade_widget ("EditActionButton");
gtk_button_set_use_stock (GTK_BUTTON (nact_edit_button), FALSE);
@@ -333,7 +366,7 @@ init_dialog (void)
gtk_button_set_label (GTK_BUTTON (nact_edit_button), "_Edit");
#endif
-#if ((GTK_MAJOR_VERSION == 2) && (GTK_MINOR_VERSION >= 6))
+#if ((GTK_MAJOR_VERSION == 2) && (GTK_MINOR_VERSION >= 6))
/* Add about dialog for GTK+ >= 2.6 */
nact_about_button = nact_get_glade_widget ("AboutButton");
gtk_widget_show (nact_about_button);
@@ -369,5 +402,3 @@ main (int argc, char *argv[])
gtk_main ();
return 0;
}
-
-// vim:ts=3:sw=3:tw=1024:cin
diff --git a/plugin/nautilus-actions.c b/plugin/nautilus-actions.c
index 2a81d61..b3e9643 100644
--- a/plugin/nautilus-actions.c
+++ b/plugin/nautilus-actions.c
@@ -1,28 +1,37 @@
-/* Nautilus Actions configuration tool
- * Copyright (C) 2005 The GNOME Foundation
+/*
+ * Nautilus Actions
*
- * Authors:
- * Frederic Ruaudel (grumz grumz net)
- * Rodrigo Moya (rodrigo gnome-db org)
+ * Copyright (C) 2005 The GNOME Foundation
+ * Copyright (C) 2006, 2007, 2008 Frederic Ruaudel and others (see AUTHORS)
+ * Copyright (C) 2009 Pierre Wieser and others (see AUTHORS)
*
* This Program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
*
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this Library; see the file COPYING. If not,
- * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * write to the Free Software Foundation, Inc., 59 Temple Place,
+ * Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Authors:
+ * Frederic Ruaudel <grumz grumz net>
+ * Rodrigo Moya <rodrigo gnome-db org>
+ * Pierre Wieser <pwieser trychlos org>
+ * and many others (see AUTHORS)
+ *
+ * pwi 2009-05-16 fix compilation warnings
*/
#include <config.h>
#include <string.h>
+#include <libgnomevfs/gnome-vfs.h>
#include <libgnomevfs/gnome-vfs-utils.h>
#include <libgnomevfs/gnome-vfs-file-info.h>
#include <libgnomevfs/gnome-vfs-ops.h>
@@ -211,7 +220,7 @@ static void nautilus_actions_action_changed_handler (NautilusActionsConfig* conf
if (!self->dispose_has_run)
{
- nautilus_menu_provider_emit_items_updated_signal (self);
+ nautilus_menu_provider_emit_items_updated_signal(( NautilusMenuProvider * ) self );
nautilus_actions_config_free_actions_list (self->config_list);
self->config_list = nautilus_actions_config_get_actions (NAUTILUS_ACTIONS_CONFIG (self->configs));
@@ -306,5 +315,3 @@ void nautilus_actions_register_type (GTypeModule *module)
NAUTILUS_TYPE_MENU_PROVIDER,
&menu_provider_iface_info);
}
-
-// vim:ts=4:sw=4:tw=1024:cin
diff --git a/utils/nautilus-actions-check-actions-change.c b/utils/nautilus-actions-check-actions-change.c
index 1a1cc1b..617d92d 100644
--- a/utils/nautilus-actions-check-actions-change.c
+++ b/utils/nautilus-actions-check-actions-change.c
@@ -1,30 +1,40 @@
-/* Nautilus Actions tool for checking actions change
- * Copyright (C) 2005 The GNOME Foundation
+/*
+ * Nautilus Actions
*
- * Authors:
- * Frederic Ruaudel (grumz grumz net)
+ * Copyright (C) 2005 The GNOME Foundation
+ * Copyright (C) 2006, 2007, 2008 Frederic Ruaudel and others (see AUTHORS)
+ * Copyright (C) 2009 Pierre Wieser and others (see AUTHORS)
*
* This Program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
*
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this Library; see the file COPYING. If not,
- * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * write to the Free Software Foundation, Inc., 59 Temple Place,
+ * Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Authors:
+ * Frederic Ruaudel <grumz grumz net>
+ * Rodrigo Moya <rodrigo gnome-db org>
+ * Pierre Wieser <pwieser trychlos org>
+ * and many others (see AUTHORS)
+ *
+ * pwi 2009-05-16 fix compilation warnings
*/
#include <config.h>
+#include <gtk/gtk.h>
#include <libnautilus-actions/nautilus-actions-config.h>
#include <libnautilus-actions/nautilus-actions-config-gconf-reader.h>
-static void nautilus_actions_action_added_handler (NautilusActionsConfig* config,
+static void nautilus_actions_action_added_handler (NautilusActionsConfig* config,
NautilusActionsConfigAction* action,
gpointer user_data)
{
@@ -33,7 +43,7 @@ static void nautilus_actions_action_added_handler (NautilusActionsConfig* config
//self->config_list = nautilus_actions_config_get_actions (NAUTILUS_ACTIONS_CONFIG (self->configs));
}
-static void nautilus_actions_action_changed_handler (NautilusActionsConfig* config,
+static void nautilus_actions_action_changed_handler (NautilusActionsConfig* config,
NautilusActionsConfigAction* action,
gpointer user_data)
{
@@ -44,7 +54,7 @@ static void nautilus_actions_action_changed_handler (NautilusActionsConfig* conf
//self->config_list = nautilus_actions_config_get_actions (NAUTILUS_ACTIONS_CONFIG (self->configs));
}
-static void nautilus_actions_action_removed_handler (NautilusActionsConfig* config,
+static void nautilus_actions_action_removed_handler (NautilusActionsConfig* config,
NautilusActionsConfigAction* action,
gpointer user_data)
{
@@ -81,5 +91,3 @@ int main (int argc, char **argv)
/* The user lost interest */
return 0;
}
-
-// vim:ts=3:sw=3:tw=1024:cin
diff --git a/utils/nautilus-actions-tools-utils.c b/utils/nautilus-actions-tools-utils.c
index 87d831c..17888c5 100644
--- a/utils/nautilus-actions-tools-utils.c
+++ b/utils/nautilus-actions-tools-utils.c
@@ -1,31 +1,41 @@
-/* Nautilus Actions Tools
- * Copyright (C) 2005 The GNOME Foundation
+/*
+ * Nautilus Actions
*
- * Authors:
- * Frederic Ruaudel (grumz grumz net)
+ * Copyright (C) 2005 The GNOME Foundation
+ * Copyright (C) 2006, 2007, 2008 Frederic Ruaudel and others (see AUTHORS)
+ * Copyright (C) 2009 Pierre Wieser and others (see AUTHORS)
*
* This Program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
*
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this Library; see the file COPYING. If not,
- * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * write to the Free Software Foundation, Inc., 59 Temple Place,
+ * Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Authors:
+ * Frederic Ruaudel <grumz grumz net>
+ * Rodrigo Moya <rodrigo gnome-db org>
+ * Pierre Wieser <pwieser trychlos org>
+ * and many others (see AUTHORS)
+ *
+ * pwi 2009-05-16 fix compilation warnings
*/
#include <config.h>
#include <stdio.h>
#include <glib.h>
#include <glib/gi18n.h>
+#include "nautilus-actions-tools-utils.h"
-gboolean nautilus_actions_file_set_contents (const gchar* filename,
+gboolean nautilus_actions_file_set_contents (const gchar* filename,
const gchar* contents,
gssize length,
GError** error)
@@ -52,10 +62,8 @@ gboolean nautilus_actions_file_set_contents (const gchar* filename,
else
{
(*error) = g_error_new (G_FILE_ERROR, G_FILE_ERROR_FAILED, _("Can't open file %s for writing\n"), filename);
- }
+ }
#endif
return success;
}
-
-// vim:ts=3:sw=3:tw=1024:cin
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]