summaryrefslogtreecommitdiff
path: root/gtk/gtkrecentmanager.c
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@cvs.gnome.org>2006-05-12 08:37:07 +0000
committerEmmanuele Bassi <ebassi@src.gnome.org>2006-05-12 08:37:07 +0000
commitf8cfd44ff8672aa94bdb9c63f4f1c25111d4d4a4 (patch)
treea11e2a6705eee24e724be848826f12514a6561e1 /gtk/gtkrecentmanager.c
parent51275b656583cecf8e2ba8fafe93529e77b284c9 (diff)
downloadgtk+-f8cfd44ff8672aa94bdb9c63f4f1c25111d4d4a4.tar.gz
Remove the error parameter to the gtk_recent_manager_add() and
2006-05-11 Emmanuele Bassi <ebassi@cvs.gnome.org> * gtk/gtkrecentmanager.h: Remove the error parameter to the gtk_recent_manager_add() and gtk_recent_manager_add_full() functions; remove the unneeded error codes from the error enumeration. (#336774). * gtk/gtkrecentmanager.c: Make gtk_recent_manager_add() and gtk_recent_manager_add_full() complain loudly about wrong or missing meta-data, instead of using a GError. (#336774)
Diffstat (limited to 'gtk/gtkrecentmanager.c')
-rw-r--r--gtk/gtkrecentmanager.c58
1 files changed, 21 insertions, 37 deletions
diff --git a/gtk/gtkrecentmanager.c b/gtk/gtkrecentmanager.c
index bf469dd6dc..371db0ff7a 100644
--- a/gtk/gtkrecentmanager.c
+++ b/gtk/gtkrecentmanager.c
@@ -812,7 +812,6 @@ gtk_recent_manager_get_limit (GtkRecentManager *manager)
* gtk_recent_manager_add_item:
* @manager: a #GtkRecentManager
* @uri: a valid URI
- * @error: return location for a #GError, or %NULL
*
* Adds a new resource, pointed by @uri, into the recently used
* resources list.
@@ -831,8 +830,7 @@ gtk_recent_manager_get_limit (GtkRecentManager *manager)
*/
gboolean
gtk_recent_manager_add_item (GtkRecentManager *manager,
- const gchar *uri,
- GError **error)
+ const gchar *uri);
{
GtkRecentData *recent_data;
GError *add_error;
@@ -873,7 +871,7 @@ gtk_recent_manager_add_item (GtkRecentManager *manager,
recent_data->is_private = FALSE;
add_error = NULL;
- retval = gtk_recent_manager_add_full (manager, uri, recent_data, &add_error);
+ retval = gtk_recent_manager_add_full (manager, uri, recent_data);
g_free (recent_data->mime_type);
g_free (recent_data->app_name);
@@ -881,13 +879,6 @@ gtk_recent_manager_add_item (GtkRecentManager *manager,
g_slice_free (GtkRecentData, recent_data);
- if (!retval)
- {
- g_propagate_error (error, add_error);
-
- return FALSE;
- }
-
return retval;
}
@@ -896,7 +887,6 @@ gtk_recent_manager_add_item (GtkRecentManager *manager,
* @manager: a #GtkRecentManager
* @uri: a valid URI
* @recent_data: metadata of the resource
- * @error: return location for a #GError, or %NULL
*
* Adds a new resource, pointed by @uri, into the recently used
* resources list, using the metadata specified inside the #GtkRecentData
@@ -939,53 +929,47 @@ gtk_recent_manager_add_full (GtkRecentManager *manager,
if ((data->display_name) &&
(!g_utf8_validate (data->display_name, -1, NULL)))
{
- g_set_error (error, GTK_RECENT_MANAGER_ERROR,
- GTK_RECENT_MANAGER_ERROR_INVALID_ENCODING,
- _("The display name of the recently used resource "
- "must be a valid UTF-8 encoded string."));
+ g_warning ("Attempting to add `%s' to the list of recently used "
+ "resources, but the display name is not a valid UTF-8 "
+ "encoded string",
+ uri);
return FALSE;
}
if ((data->description) &&
(!g_utf8_validate (data->description, -1, NULL)))
{
- g_set_error (error, GTK_RECENT_MANAGER_ERROR,
- GTK_RECENT_MANAGER_ERROR_INVALID_ENCODING,
- _("The description of the recently used resource "
- "must be a valid UTF-8 encoded string."));
+ g_warning ("Attempting to add `%s' to the list of recently used "
+ "resources, but the description is not a valid UTF-8 "
+ "encoded string",
+ uri);
return FALSE;
}
if (!data->mime_type)
{
- g_set_error (error, GTK_RECENT_MANAGER_ERROR,
- GTK_RECENT_MANAGER_ERROR_INVALID_MIME,
- _("You must specify the MIME type of the "
- "resource pointed by `%s'"),
- uri);
+ g_warning ("Attempting to add `%s' to the list of recently used "
+ "resources, but not MIME type was defined",
+ uri);
return FALSE;
}
if (!data->app_name)
{
- g_set_error (error, GTK_RECENT_MANAGER_ERROR,
- GTK_RECENT_MANAGER_ERROR_NOT_REGISTERED,
- _("You must specify the name of the application "
- "that is registering the recently used resource "
- "pointed by `%s'"),
- uri);
+ g_warning ("Attempting to add `%s' to the list of recently used "
+ "resources, but no name of the application that is "
+ "registering it was defined"
+ uri);
return FALSE;
}
if (!data->app_exec)
{
- g_set_error (error, GTK_RECENT_MANAGER_ERROR,
- GTK_RECENT_MANAGER_ERROR_BAD_EXEC_STRING,
- _("You must specify a command line to "
- "be used when launching the resource "
- "pointed by `%s'"),
- uri);
+ g_warning ("Attempting to add `%s' to the list of recently used "
+ "resources, but no command line for the application "
+ "that is registering it was defined",
+ uri);
return FALSE;
}