add get_permission API to GSettingsBackend

implement it in the various in-tree backends

also, lots of whitespace changes to realign the vtable members
This commit is contained in:
Ryan Lortie
2010-06-04 23:07:40 +02:00
parent 95c564cabe
commit 61f3f45cb9
7 changed files with 101 additions and 32 deletions

View File

@@ -25,6 +25,7 @@
#include "gsettingsbackendinternal.h"
#include "gnullsettingsbackend.h"
#include "gsimplepermission.h"
#include "giomodule-priv.h"
#include "gio-marshal.h"
@@ -1156,6 +1157,30 @@ g_settings_backend_supports_context (const gchar *context)
return FALSE;
}
/*< private >
* g_settings_backend_get_permission:
* @backend: a #GSettingsBackend
* @path: a path
* @returns: a non-%NULL #GPermission
*
* Gets the permission object associated with writing to keys below
* @path on @backend.
*
* If this is not implemented in the backend, then a %TRUE
* #GSimplePermission is returned.
*/
GPermission *
g_settings_backend_get_permission (GSettingsBackend *backend,
const gchar *path)
{
GSettingsBackendClass *class = G_SETTINGS_BACKEND_GET_CLASS (backend);
if (class->get_permission)
return class->get_permission (backend, path);
return g_simple_permission_new (TRUE);
}
/**
* g_settings_backend_setup:
* @context: a context string (not %NULL or "")