Commit f8cfd44f authored by Emmanuele Bassi's avatar Emmanuele Bassi Committed by Emmanuele Bassi
Browse files

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)
parent 51275b65
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)
2006-05-11 Matthias Clasen <mclasen@redhat.com>
* demos/gtk-demo/Makefile.am (demos): Add it here.
......
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)
2006-05-11 Matthias Clasen <mclasen@redhat.com>
* demos/gtk-demo/Makefile.am (demos): Add it here.
......
......@@ -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;
}
......
......@@ -104,8 +104,6 @@ struct _GtkRecentManagerClass
* @GTK_RECENT_MANAGER_ERROR_NOT_FOUND: the URI specified does not exists in
* the recently used resources list.
* @GTK_RECENT_MANAGER_ERROR_INVALID_URI: the URI specified is not valid.
* @GTK_RECENT_MANAGER_ERROR_INVALID_MIME: the MIME type specified is not
* valid.
* @GTK_RECENT_MANAGER_ERROR_INVALID_ENCODING: the supplied string is not
* UTF-8 encoded.
* @GTK_RECENT_MANAGER_ERROR_NOT_REGISTERED: no application has registered
......@@ -122,10 +120,8 @@ typedef enum
{
GTK_RECENT_MANAGER_ERROR_NOT_FOUND,
GTK_RECENT_MANAGER_ERROR_INVALID_URI,
GTK_RECENT_MANAGER_ERROR_INVALID_MIME,
GTK_RECENT_MANAGER_ERROR_INVALID_ENCODING,
GTK_RECENT_MANAGER_ERROR_NOT_REGISTERED,
GTK_RECENT_MANAGER_ERROR_BAD_EXEC_STRING,
GTK_RECENT_MANAGER_ERROR_READ,
GTK_RECENT_MANAGER_ERROR_WRITE,
GTK_RECENT_MANAGER_ERROR_UNKNOWN
......@@ -145,12 +141,10 @@ void gtk_recent_manager_set_screen (GtkRecentManager *manag
GdkScreen *screen);
gboolean gtk_recent_manager_add_item (GtkRecentManager *manager,
const gchar *uri,
GError **error);
const gchar *uri);
gboolean gtk_recent_manager_add_full (GtkRecentManager *manager,
const gchar *uri,
const GtkRecentData *recent_data,
GError **error);
const GtkRecentData *recent_data);
gboolean gtk_recent_manager_remove_item (GtkRecentManager *manager,
const gchar *uri,
GError **error);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment