* Normally a single #SecretService object can be shared between multiple
* callers. The secret_service_get() method is used to access this #SecretService
* object. If a new independent #SecretService object is required, use
- * secret_service_new().
+ * secret_service_open().
*
* In order to securely transfer secrets to the Sercret Service, an session
* is established. This session can be established while initializing a
* #SecretService object by passing the %SECRET_SERVICE_OPEN_SESSION flag
- * to the secret_service_get() or secret_service_new() functions. In order to
+ * to the secret_service_get() or secret_service_open() functions. In order to
* establish a session on an already existing #SecretService, use the
* secret_service_ensure_session() function.
*
* secret items. In order to instantiate #SecretCollection objects which
* represent those collections while initializing a #SecretService then pass
* the %SECRET_SERVICE_LOAD_COLLECTIONS flag to the secret_service_get() or
- * secret_service_new() functions. In order to establish a session on an already
+ * secret_service_open() functions. In order to establish a session on an already
* existing #SecretService, use the secret_service_load_collections() function.
* To access the list of collections use secret_service_get_collections().
*
* #SecretService
*
* Flags which determine which parts of the #SecretService proxy are initialized
- * during a secret_service_get() or secret_service_new() operation.
+ * during a secret_service_get() or secret_service_open() operation.
*/
EGG_SECURE_DEFINE_GLIB_GLOBALS ();
*
* To load the collections, specify the %SECRET_SERVICE_LOAD_COLLECTIONS
* initialization flag when calling the secret_service_get() or
- * secret_service_new() functions. Or call the secret_service_load_collections()
+ * secret_service_open() functions. Or call the secret_service_load_collections()
* method.
*/
g_object_class_install_property (object_class, PROP_COLLECTIONS,
}
/**
- * secret_service_new:
+ * secret_service_open:
* @service_gtype: the GType of the new secret service
* @service_bus_name: (allow-none): the D-Bus service name of the secret service
* @flags: flags for which service functionality to ensure is initialized
* This method will return immediately and complete asynchronously.
*/
void
-secret_service_new (GType service_gtype,
- const gchar *service_bus_name,
- SecretServiceFlags flags,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
+secret_service_open (GType service_gtype,
+ const gchar *service_bus_name,
+ SecretServiceFlags flags,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
g_return_if_fail (g_type_is_a (service_gtype, SECRET_TYPE_SERVICE));
}
/**
- * secret_service_new_finish:
+ * secret_service_open_finish:
* @result: the asynchronous result passed to the callback
* @error: location to place an error on failure
*
* should be released with g_object_unref().
*/
SecretService *
-secret_service_new_finish (GAsyncResult *result,
- GError **error)
+secret_service_open_finish (GAsyncResult *result,
+ GError **error)
{
GObject *source_object;
GObject *object;
}
/**
- * secret_service_new_sync:
+ * secret_service_open_sync:
* @service_gtype: the GType of the new secret service
* @service_bus_name: (allow-none): the D-Bus service name of the secret service
* @flags: flags for which service functionality to ensure is initialized
* should be released with g_object_unref().
*/
SecretService *
-secret_service_new_sync (GType service_gtype,
- const gchar *service_bus_name,
- SecretServiceFlags flags,
- GCancellable *cancellable,
- GError **error)
+secret_service_open_sync (GType service_gtype,
+ const gchar *service_bus_name,
+ SecretServiceFlags flags,
+ GCancellable *cancellable,
+ GError **error)
{
g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL);
g_return_val_if_fail (g_type_is_a (service_gtype, SECRET_TYPE_SERVICE), NULL);
}
static void
-test_new_sync (void)
+test_open_sync (void)
{
SecretService *service1;
SecretService *service2;
/* Both these sohuld point to different things */
- service1 = secret_service_new_sync (SECRET_TYPE_SERVICE, NULL,
- SECRET_SERVICE_NONE, NULL, &error);
+ service1 = secret_service_open_sync (SECRET_TYPE_SERVICE, NULL,
+ SECRET_SERVICE_NONE, NULL, &error);
g_assert_no_error (error);
- service2 = secret_service_new_sync (SECRET_TYPE_SERVICE, NULL,
- SECRET_SERVICE_NONE, NULL, &error);
+ service2 = secret_service_open_sync (SECRET_TYPE_SERVICE, NULL,
+ SECRET_SERVICE_NONE, NULL, &error);
g_assert_no_error (error);
g_assert (SECRET_IS_SERVICE (service1));
}
static void
-test_new_async (void)
+test_open_async (void)
{
SecretService *service1;
SecretService *service2;
/* Both these sohuld point to different things */
- secret_service_new (SECRET_TYPE_SERVICE, NULL, SECRET_SERVICE_NONE,
- NULL, on_complete_get_result, &result);
+ secret_service_open (SECRET_TYPE_SERVICE, NULL, SECRET_SERVICE_NONE,
+ NULL, on_complete_get_result, &result);
g_assert (result == NULL);
egg_test_wait ();
- service1 = secret_service_new_finish (result, &error);
+ service1 = secret_service_open_finish (result, &error);
g_assert_no_error (error);
g_clear_object (&result);
- secret_service_new (SECRET_TYPE_SERVICE, NULL, SECRET_SERVICE_NONE, NULL,
- on_complete_get_result, &result);
+ secret_service_open (SECRET_TYPE_SERVICE, NULL, SECRET_SERVICE_NONE, NULL,
+ on_complete_get_result, &result);
g_assert (result == NULL);
egg_test_wait ();
- service2 = secret_service_new_finish (result, &error);
+ service2 = secret_service_open_finish (result, &error);
g_assert_no_error (error);
g_clear_object (&result);
}
static void
-test_new_more_sync (Test *test,
+test_open_more_sync (Test *test,
gconstpointer data)
{
SecretService *service;
const gchar *path;
GList *collections;
- service = secret_service_new_sync (SECRET_TYPE_SERVICE, NULL, SECRET_SERVICE_NONE,
- NULL, &error);
+ service = secret_service_open_sync (SECRET_TYPE_SERVICE, NULL, SECRET_SERVICE_NONE,
+ NULL, &error);
g_assert_no_error (error);
g_assert (SECRET_IS_SERVICE (service));
g_object_unref (service);
egg_assert_not_object (service);
- service = secret_service_new_sync (SECRET_TYPE_SERVICE, NULL,
- SECRET_SERVICE_LOAD_COLLECTIONS, NULL, &error);
+ service = secret_service_open_sync (SECRET_TYPE_SERVICE, NULL,
+ SECRET_SERVICE_LOAD_COLLECTIONS, NULL, &error);
g_assert_no_error (error);
g_assert (SECRET_IS_SERVICE (service));
g_object_unref (service);
egg_assert_not_object (service);
- service = secret_service_new_sync (SECRET_TYPE_SERVICE, NULL,
- SECRET_SERVICE_OPEN_SESSION, NULL, &error);
+ service = secret_service_open_sync (SECRET_TYPE_SERVICE, NULL,
+ SECRET_SERVICE_OPEN_SESSION, NULL, &error);
g_assert_no_error (error);
g_assert (SECRET_IS_SERVICE (service));
}
static void
-test_new_more_async (Test *test,
+test_open_more_async (Test *test,
gconstpointer data)
{
GAsyncResult *result = NULL;
const gchar *path;
GList *collections;
- secret_service_new (SECRET_TYPE_SERVICE, NULL,
- SECRET_SERVICE_LOAD_COLLECTIONS | SECRET_SERVICE_OPEN_SESSION, NULL, on_complete_get_result, &result);
+ secret_service_open (SECRET_TYPE_SERVICE, NULL,
+ SECRET_SERVICE_LOAD_COLLECTIONS | SECRET_SERVICE_OPEN_SESSION, NULL, on_complete_get_result, &result);
g_assert (result == NULL);
egg_test_wait ();
- service = secret_service_new_finish (result, &error);
+ service = secret_service_open_finish (result, &error);
g_assert_no_error (error);
g_object_unref (result);
result = NULL;
/* Now get a session with just collections */
- secret_service_new (SECRET_TYPE_SERVICE, NULL, SECRET_SERVICE_LOAD_COLLECTIONS,
- NULL, on_complete_get_result, &result);
+ secret_service_open (SECRET_TYPE_SERVICE, NULL, SECRET_SERVICE_LOAD_COLLECTIONS,
+ NULL, on_complete_get_result, &result);
g_assert (result == NULL);
egg_test_wait ();
- service = secret_service_new_finish (result, &error);
+ service = secret_service_open_finish (result, &error);
g_assert_no_error (error);
g_object_unref (result);
gboolean ret;
/* Passing true, ensures session is established */
- service = secret_service_new_sync (SECRET_TYPE_SERVICE, NULL,
- SECRET_SERVICE_NONE, NULL, &error);
+ service = secret_service_open_sync (SECRET_TYPE_SERVICE, NULL,
+ SECRET_SERVICE_NONE, NULL, &error);
g_assert_no_error (error);
g_assert (service != NULL);
gboolean ret;
/* Passing true, ensures session is established */
- service = secret_service_new_sync (SECRET_TYPE_SERVICE, NULL,
- SECRET_SERVICE_NONE, NULL, &error);
+ service = secret_service_open_sync (SECRET_TYPE_SERVICE, NULL,
+ SECRET_SERVICE_NONE, NULL, &error);
g_assert_no_error (error);
g_assert (service != NULL);
g_test_add ("/service/get-more-sync", Test, "mock-service-normal.py", setup_mock, test_get_more_sync, teardown_mock);
g_test_add ("/service/get-more-async", Test, "mock-service-normal.py", setup_mock, test_get_more_async, teardown_mock);
- g_test_add_func ("/service/new-sync", test_new_sync);
- g_test_add_func ("/service/new-async", test_new_async);
- g_test_add ("/service/new-more-sync", Test, "mock-service-normal.py", setup_mock, test_new_more_sync, teardown_mock);
- g_test_add ("/service/new-more-async", Test, "mock-service-normal.py", setup_mock, test_new_more_async, teardown_mock);
+ g_test_add_func ("/service/open-sync", test_open_sync);
+ g_test_add_func ("/service/open-async", test_open_async);
+ g_test_add ("/service/open-more-sync", Test, "mock-service-normal.py", setup_mock, test_open_more_sync, teardown_mock);
+ g_test_add ("/service/open-more-async", Test, "mock-service-normal.py", setup_mock, test_open_more_async, teardown_mock);
g_test_add ("/service/connect-sync", Test, "mock-service-normal.py", setup_mock, test_connect_async, teardown_mock);
g_test_add ("/service/connect-ensure-sync", Test, "mock-service-normal.py", setup_mock, test_connect_ensure_async, teardown_mock);