Method

GLibBookmarkFileset_app_info

deprecated: 2.66 since: 2.12

Declaration

gboolean
g_bookmark_file_set_app_info (
  GBookmarkFile* bookmark,
  const gchar* uri,
  const gchar* name,
  const gchar* exec,
  gint count,
  time_t stamp,
  GError** error
)

Description

Sets the meta-data of application name inside the list of applications that have registered a bookmark for uri inside bookmark.

You should rarely use this function; use g_bookmark_file_add_application() and g_bookmark_file_remove_application() instead.

name can be any UTF-8 encoded string used to identify an application. exec can have one of these two modifiers: “\%f”, which will be expanded as the local file name retrieved from the bookmark’s URI; “\%u”, which will be expanded as the bookmark’s URI. The expansion is done automatically when retrieving the stored command line using the g_bookmark_file_get_application_info() function. count is the number of times the application has registered the bookmark; if is < 0, the current registration count will be increased by one, if is 0, the application with name will be removed from the list of registered applications. stamp is the Unix time of the last registration; if it is -1, the current time will be used.

If you try to remove an application by setting its registration count to zero, and no bookmark for uri is found, FALSE is returned and error is set to G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND; similarly, in the event that no application name has registered a bookmark for uri, FALSE is returned and error is set to G_BOOKMARK_FILE_ERROR_APP_NOT_REGISTERED. Otherwise, if no bookmark for uri is found, one is created.

Available since: 2.12

Deprecated since: 2.66

Use g_bookmark_file_set_application_info() instead, as time_t is deprecated due to the year 2038 problem.

Parameters

uri

Type: const gchar*

A valid URI.

The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.
name

Type: const gchar*

An application’s name.

The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.
exec

Type: const gchar*

An application’s command line.

The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.
count

Type: gint

The number of registrations done for this application.

stamp

Type: time_t

The time of the last registration for this application.

error

Type: GError **

The return location for a recoverable error.

The argument can be NULL.
If the return location is not NULL, then you must initialize it to a NULL GError*.
The argument will left initialized to NULL by the method if there are no errors.
In case of error, the argument will be set to a newly allocated GError; the caller will take ownership of the data, and be responsible for freeing it.

Return value

Type: gboolean

TRUE if the application’s meta-data was successfully changed.