GtkRecentManager: Formatting fixes

This commit is contained in:
Matthias Clasen 2014-12-22 17:16:30 -05:00
parent ea9f5e2273
commit 0a54ad1187

View File

@ -242,7 +242,8 @@ filename_warning (const gchar *format,
/* Test of haystack has the needle prefix, comparing case /* Test of haystack has the needle prefix, comparing case
* insensitive. haystack may be UTF-8, but needle must * insensitive. haystack may be UTF-8, but needle must
* contain only lowercase ascii. */ * contain only lowercase ascii.
*/
static gboolean static gboolean
has_case_prefix (const gchar *haystack, has_case_prefix (const gchar *haystack,
const gchar *needle) const gchar *needle)
@ -281,8 +282,8 @@ gtk_recent_manager_class_init (GtkRecentManagerClass *klass)
/** /**
* GtkRecentManager:filename: * GtkRecentManager:filename:
* *
* The full path to the file to be used to store and read the recently * The full path to the file to be used to store and read the
* used resources list * recently used resources list
* *
* Since: 2.10 * Since: 2.10
*/ */
@ -315,9 +316,9 @@ gtk_recent_manager_class_init (GtkRecentManagerClass *klass)
* GtkRecentManager::changed: * GtkRecentManager::changed:
* @recent_manager: the recent manager * @recent_manager: the recent manager
* *
* Emitted when the current recently used resources manager changes its * Emitted when the current recently used resources manager changes
* contents, either by calling gtk_recent_manager_add_item() or by another * its contents, either by calling gtk_recent_manager_add_item() or
* application. * by another application.
* *
* Since: 2.10 * Since: 2.10
*/ */
@ -589,8 +590,8 @@ gtk_recent_manager_set_filename (GtkRecentManager *manager,
/* if a filename is already set and filename is not NULL, then copy /* if a filename is already set and filename is not NULL, then copy
* it and reset the monitor; otherwise, if it's NULL we're being * it and reset the monitor; otherwise, if it's NULL we're being
* called from the finalization sequence, so we simply disconnect the * called from the finalization sequence, so we simply disconnect
* monitoring and return. * the monitoring and return.
* *
* if no filename is set and filename is NULL, use the default. * if no filename is set and filename is NULL, use the default.
*/ */
@ -668,7 +669,8 @@ build_recent_items_list (GtkRecentManager *manager)
{ {
/* the file exists, and it's valid (we hope); if not, destroy the container /* the file exists, and it's valid (we hope); if not, destroy the container
* object and hope for a better result when the next "changed" signal is * object and hope for a better result when the next "changed" signal is
* fired. */ * fired.
*/
read_error = NULL; read_error = NULL;
g_bookmark_file_load_from_file (priv->recent_items, priv->filename, &read_error); g_bookmark_file_load_from_file (priv->recent_items, priv->filename, &read_error);
if (read_error) if (read_error)
@ -722,7 +724,7 @@ build_recent_items_list (GtkRecentManager *manager)
* #GtkRecentManager objects are expensive: be sure to create them only when * #GtkRecentManager objects are expensive: be sure to create them only when
* needed. You should use gtk_recent_manager_get_default() instead. * needed. You should use gtk_recent_manager_get_default() instead.
* *
* Returns: A newly created #GtkRecentManager object. * Returns: A newly created #GtkRecentManager object
* *
* Since: 2.10 * Since: 2.10
*/ */
@ -738,7 +740,8 @@ gtk_recent_manager_new (void)
* Gets a unique instance of #GtkRecentManager, that you can share * Gets a unique instance of #GtkRecentManager, that you can share
* in your application without caring about memory management. * in your application without caring about memory management.
* *
* Returns: (transfer none): A unique #GtkRecentManager. Do not ref or unref it. * Returns: (transfer none): A unique #GtkRecentManager. Do not ref or
* unref it.
* *
* Since: 2.10 * Since: 2.10
*/ */
@ -799,7 +802,8 @@ gtk_recent_manager_add_item_query_info (GObject *source_object,
gdk_threads_enter (); gdk_threads_enter ();
/* Ignore return value, this can't fail anyway since all required /* Ignore return value, this can't fail anyway since all required
* fields are set */ * fields are set
*/
gtk_recent_manager_add_full (manager, uri, &recent_data); gtk_recent_manager_add_full (manager, uri, &recent_data);
manager->priv->is_dirty = TRUE; manager->priv->is_dirty = TRUE;
@ -824,8 +828,8 @@ gtk_recent_manager_add_item_query_info (GObject *source_object,
* resources list. * resources list.
* *
* This function automatically retrieves some of the needed * This function automatically retrieves some of the needed
* metadata and setting other metadata to common default values; it * metadata and setting other metadata to common default values;
* then feeds the data to gtk_recent_manager_add_full(). * it then feeds the data to gtk_recent_manager_add_full().
* *
* See gtk_recent_manager_add_full() if you want to explicitly * See gtk_recent_manager_add_full() if you want to explicitly
* define the metadata for the resource pointed by @uri. * define the metadata for the resource pointed by @uri.
@ -866,8 +870,8 @@ gtk_recent_manager_add_item (GtkRecentManager *manager,
* @recent_data: metadata of the resource * @recent_data: metadata of the resource
* *
* Adds a new resource, pointed by @uri, into the recently used * Adds a new resource, pointed by @uri, into the recently used
* resources list, using the metadata specified inside the #GtkRecentData-struct * resources list, using the metadata specified inside the
* passed in @recent_data. * #GtkRecentData-struct passed in @recent_data.
* *
* The passed URI will be used to identify this resource inside the * The passed URI will be used to identify this resource inside the
* list. * list.
@ -880,13 +884,13 @@ gtk_recent_manager_add_item (GtkRecentManager *manager,
* launching the item. * launching the item.
* *
* Optionally, a #GtkRecentData-struct might contain a UTF-8 string * Optionally, a #GtkRecentData-struct might contain a UTF-8 string
* to be used when viewing the item instead of the last component of the * to be used when viewing the item instead of the last component of
* URI; a short description of the item; whether the item should be * the URI; a short description of the item; whether the item should
* considered private - that is, should be displayed only by the * be considered private - that is, should be displayed only by the
* applications that have registered it. * applications that have registered it.
* *
* Returns: %TRUE if the new item was successfully added to the * Returns: %TRUE if the new item was successfully added to the
* recently used resources list, %FALSE otherwise. * recently used resources list, %FALSE otherwise
* *
* Since: 2.10 * Since: 2.10
*/ */
@ -1010,7 +1014,7 @@ gtk_recent_manager_add_full (GtkRecentManager *manager,
* list handled by a recent manager. * list handled by a recent manager.
* *
* Returns: %TRUE if the item pointed by @uri has been successfully * Returns: %TRUE if the item pointed by @uri has been successfully
* removed by the recently used resources list, and %FALSE otherwise. * removed by the recently used resources list, and %FALSE otherwise
* *
* Since: 2.10 * Since: 2.10
*/ */
@ -1068,7 +1072,7 @@ gtk_recent_manager_remove_item (GtkRecentManager *manager,
* Checks whether there is a recently used resource registered * Checks whether there is a recently used resource registered
* with @uri inside the recent manager. * with @uri inside the recent manager.
* *
* Returns: %TRUE if the resource was found, %FALSE otherwise. * Returns: %TRUE if the resource was found, %FALSE otherwise
* *
* Since: 2.10 * Since: 2.10
*/ */
@ -1215,8 +1219,8 @@ gtk_recent_manager_lookup_item (GtkRecentManager *manager,
* gtk_recent_manager_move_item: * gtk_recent_manager_move_item:
* @manager: a #GtkRecentManager * @manager: a #GtkRecentManager
* @uri: the URI of a recently used resource * @uri: the URI of a recently used resource
* @new_uri: (allow-none): the new URI of the recently used resource, or %NULL to * @new_uri: (allow-none): the new URI of the recently used resource, or
* remove the item pointed by @uri in the list * %NULL to remove the item pointed by @uri in the list
* @error: (allow-none): a return location for a #GError, or %NULL * @error: (allow-none): a return location for a #GError, or %NULL
* *
* Changes the location of a recently used resource from @uri to @new_uri. * Changes the location of a recently used resource from @uri to @new_uri.
@ -1224,7 +1228,7 @@ gtk_recent_manager_lookup_item (GtkRecentManager *manager,
* Please note that this function will not affect the resource pointed * Please note that this function will not affect the resource pointed
* by the URIs, but only the URI used in the recently used resources list. * by the URIs, but only the URI used in the recently used resources list.
* *
* Returns: %TRUE on success. * Returns: %TRUE on success
* *
* Since: 2.10 * Since: 2.10
*/ */
@ -1351,7 +1355,7 @@ purge_recent_items_list (GtkRecentManager *manager,
* Purges every item from the recently used resources list. * Purges every item from the recently used resources list.
* *
* Returns: the number of items that have been removed from the * Returns: the number of items that have been removed from the
* recently used resources list. * recently used resources list
* *
* Since: 2.10 * Since: 2.10
*/ */
@ -1526,8 +1530,8 @@ gtk_recent_info_free (GtkRecentInfo *recent_info)
* *
* Increases the reference count of @recent_info by one. * Increases the reference count of @recent_info by one.
* *
* Returns: the recent info object with its reference count increased * Returns: the recent info object with its reference count
* by one. * increased by one
* *
* Since: 2.10 * Since: 2.10
*/ */
@ -1714,7 +1718,7 @@ gtk_recent_info_get_visited (GtkRecentInfo *info)
* list that have this flag set to %TRUE should only be displayed by the * list that have this flag set to %TRUE should only be displayed by the
* applications that have registered them. * applications that have registered them.
* *
* Returns: %TRUE if the private flag was found, %FALSE otherwise. * Returns: %TRUE if the private flag was found, %FALSE otherwise
* *
* Since: 2.10 * Since: 2.10
*/ */
@ -1759,7 +1763,8 @@ recent_app_info_free (RecentAppInfo *app_info)
* gtk_recent_info_get_application_info: * gtk_recent_info_get_application_info:
* @info: a #GtkRecentInfo * @info: a #GtkRecentInfo
* @app_name: the name of the application that has registered this item * @app_name: the name of the application that has registered this item
* @app_exec: (transfer none) (out): return location for the string containing the command line * @app_exec: (transfer none) (out): return location for the string containing
* the command line
* @count: (out): return location for the number of times this item was registered * @count: (out): return location for the number of times this item was registered
* @time_: (out): return location for the timestamp this item was last registered * @time_: (out): return location for the timestamp this item was last registered
* for this application * for this application
@ -1873,7 +1878,7 @@ gtk_recent_info_get_applications (GtkRecentInfo *info,
* Checks whether an application registered this resource using @app_name. * Checks whether an application registered this resource using @app_name.
* *
* Returns: %TRUE if an application with name @app_name was found, * Returns: %TRUE if an application with name @app_name was found,
* %FALSE otherwise. * %FALSE otherwise
* *
* Since: 2.10 * Since: 2.10
*/ */
@ -1922,7 +1927,7 @@ gtk_recent_info_last_application (GtkRecentInfo *info)
} }
static GdkPixbuf * static GdkPixbuf *
get_icon_for_mime_type (const char *mime_type, get_icon_for_mime_type (const gchar *mime_type,
gint pixel_size) gint pixel_size)
{ {
GtkIconTheme *icon_theme; GtkIconTheme *icon_theme;
@ -2015,8 +2020,8 @@ gtk_recent_info_get_icon (GtkRecentInfo *info,
* *
* Retrieves the icon associated to the resource MIME type. * Retrieves the icon associated to the resource MIME type.
* *
* Returns: (transfer full): a #GIcon containing the icon, or %NULL. Use * Returns: (transfer full): a #GIcon containing the icon, or %NULL.
* g_object_unref() when finished using the icon * Use g_object_unref() when finished using the icon
* *
* Since: 2.22 * Since: 2.22
*/ */
@ -2045,7 +2050,7 @@ gtk_recent_info_get_gicon (GtkRecentInfo *info)
* Checks whether the resource is local or not by looking at the * Checks whether the resource is local or not by looking at the
* scheme of its URI. * scheme of its URI.
* *
* Returns: %TRUE if the resource is local. * Returns: %TRUE if the resource is local
* *
* Since: 2.10 * Since: 2.10
*/ */
@ -2061,8 +2066,9 @@ gtk_recent_info_is_local (GtkRecentInfo *info)
* gtk_recent_info_exists: * gtk_recent_info_exists:
* @info: a #GtkRecentInfo * @info: a #GtkRecentInfo
* *
* Checks whether the resource pointed by @info still exists. At * Checks whether the resource pointed by @info still exists.
* the moment this check is done only on resources pointing to local files. * At the moment this check is done only on resources pointing
* to local files.
* *
* Returns: %TRUE if the resource exists * Returns: %TRUE if the resource exists
* *
@ -2101,8 +2107,8 @@ gtk_recent_info_exists (GtkRecentInfo *info)
* Checks whether two #GtkRecentInfo-struct point to the same * Checks whether two #GtkRecentInfo-struct point to the same
* resource. * resource.
* *
* Returns: %TRUE if both #GtkRecentInfo-struct point to se same * Returns: %TRUE if both #GtkRecentInfo-struct point to the same
* resource, %FALSE otherwise. * resource, %FALSE otherwise
* *
* Since: 2.10 * Since: 2.10
*/ */
@ -2244,12 +2250,13 @@ get_uri_shortname_for_display (const gchar *uri)
* gtk_recent_info_get_short_name: * gtk_recent_info_get_short_name:
* @info: an #GtkRecentInfo * @info: an #GtkRecentInfo
* *
* Computes a valid UTF-8 string that can be used as the name of the item in a * Computes a valid UTF-8 string that can be used as the
* menu or list. For example, calling this function on an item that refers to * name of the item in a menu or list. For example, calling
* this function on an item that refers to
* file:///foo/bar.txt” will yield “bar.txt”. * file:///foo/bar.txt” will yield “bar.txt”.
* *
* Returns: A newly-allocated string in UTF-8 encoding; free it with * Returns: A newly-allocated string in UTF-8 encoding
* g_free(). * free it with g_free()
* *
* Since: 2.10 * Since: 2.10
*/ */
@ -2312,11 +2319,11 @@ gtk_recent_info_get_uri_display (GtkRecentInfo *info)
* gtk_recent_info_get_age: * gtk_recent_info_get_age:
* @info: a #GtkRecentInfo * @info: a #GtkRecentInfo
* *
* Gets the number of days elapsed since the last update of the resource * Gets the number of days elapsed since the last update
* pointed by @info. * of the resource pointed by @info.
* *
* Returns: a positive integer containing the number of days elapsed * Returns: a positive integer containing the number of days
* since the time this resource was last modified. * elapsed since the time this resource was last modified
* *
* Since: 2.10 * Since: 2.10
*/ */
@ -2342,9 +2349,9 @@ gtk_recent_info_get_age (GtkRecentInfo *info)
* @info: a #GtkRecentInfo * @info: a #GtkRecentInfo
* @length: (out) (allow-none): return location for the number of groups returned * @length: (out) (allow-none): return location for the number of groups returned
* *
* Returns all groups registered for the recently used item @info. The * Returns all groups registered for the recently used item @info.
* array of returned group names will be %NULL terminated, so length might * The array of returned group names will be %NULL terminated, so
* optionally be %NULL. * length might optionally be %NULL.
* *
* Returns: (array length=length zero-terminated=1) (transfer full): * Returns: (array length=length zero-terminated=1) (transfer full):
* a newly allocated %NULL terminated array of strings. * a newly allocated %NULL terminated array of strings.
@ -2397,10 +2404,10 @@ gtk_recent_info_get_groups (GtkRecentInfo *info,
* @info: a #GtkRecentInfo * @info: a #GtkRecentInfo
* @group_name: name of a group * @group_name: name of a group
* *
* Checks whether @group_name appears inside the groups registered for the * Checks whether @group_name appears inside the groups
* recently used item @info. * registered for the recently used item @info.
* *
* Returns: %TRUE if the group was found. * Returns: %TRUE if the group was found
* *
* Since: 2.10 * Since: 2.10
*/ */