Top |
These functions provide useful functionality that makes it easy to add new plugin functions.
gchar * gs_utils_get_content_type (GFile *file
,GCancellable *cancellable
,GError **error
);
Gets the standard content type for a file.
gboolean gs_mkdir_parent (const gchar *path
,GError **error
);
Creates any required directories, including any parent directories.
gchar * gs_utils_get_cache_filename (const gchar *kind
,const gchar *basename
,GsUtilsCacheFlags flags
,GError **error
);
Returns a filename that points into the cache.
This may be per-system or per-user, the latter being more likely
when GS_UTILS_CACHE_FLAG_WRITEABLE
is specified in flags
.
kind |
A cache kind, e.g. "firmware" or "screenshots/123x456" |
|
basename |
A filename basename, e.g. "system.bin" |
|
flags |
Some GsUtilsCacheFlags, e.g. |
|
error |
gchar *
gs_utils_get_user_hash (GError **error
);
This SHA1 hash is composed of the contents of machine-id and your usename and is also salted with a hardcoded value.
This provides an identifier that can be used to identify a specific user on a machine, allowing them to cast only one vote or perform one review on each application.
There is no known way to calculate the machine ID or username from the machine hash and there should be no privacy issue.
GPermission *
gs_utils_get_permission (const gchar *id
);
Gets a permission object for an ID.
gboolean gs_utils_strv_fnmatch (gchar **strv
,const gchar *str
);
Matches a string against a list of globs.
GDesktopAppInfo *
gs_utils_get_desktop_app_info (const gchar *id
);
Gets a a GDesktopAppInfo taking into account the kde4- prefix.