diff options
author | Giovanni panozzo <giovanni@panozzo.it> | 2020-05-21 15:28:56 +0300 |
---|---|---|
committer | Giovanni panozzo <giovanni@panozzo.it> | 2020-05-21 15:28:56 +0300 |
commit | 9c1683a357634035b4eef38e3ea8e6728c90a85f (patch) | |
tree | d70b953ce9a7a25e3b913b108a20bb128bc1bb7d /plugins/secret | |
parent | 7f1e16eabd3c142fcbc474d896b6cde731ac5bdd (diff) |
Introduce remmina_plugin_debug() for plugins
Diffstat (limited to 'plugins/secret')
-rw-r--r-- | plugins/secret/src/glibsecret_plugin.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/plugins/secret/src/glibsecret_plugin.c b/plugins/secret/src/glibsecret_plugin.c index 3feda4951..58f1eac44 100644 --- a/plugins/secret/src/glibsecret_plugin.c +++ b/plugins/secret/src/glibsecret_plugin.c @@ -43,6 +43,8 @@ #include <remmina/plugin.h> static RemminaPluginService *remmina_plugin_service = NULL; +#define remmina_plugin_debug(fmt, ...) remmina_plugin_service->_remmina_debug(__func__, fmt __VA_OPT__(,) __VA_ARGS__) + static SecretSchema remmina_file_secret_schema = { "org.remmina.Password", SECRET_SCHEMA_NONE, @@ -84,7 +86,7 @@ static void remmina_plugin_glibsecret_unlock_secret_service() if (secretservice && defaultcollection) { if (secret_collection_get_locked(defaultcollection)) { lbl = secret_collection_get_label(defaultcollection); - remmina_plugin_service->_debug("Requesting unlock of the default '%s' collection", lbl); + remmina_plugin_debug("Requesting unlock of the default '%s' collection", lbl); objects = g_list_append(NULL, defaultcollection); secret_service_unlock_sync(secretservice, objects, NULL, &ul, &error); g_list_free(objects); @@ -108,9 +110,9 @@ void remmina_plugin_glibsecret_store_password(RemminaFile *remminafile, const gc NULL, &r, "filename", path, "key", key, NULL); g_free(s); if (r == NULL) { - remmina_plugin_service->_debug("Password \"%s\" saved for file %s\n", key, path); + remmina_plugin_debug("Password \"%s\" saved for file %s\n", key, path); }else { - remmina_plugin_service->_debug("Password \"%s\" cannot be saved for file %s\n", key, path); + remmina_plugin_debug("Password \"%s\" cannot be saved for file %s\n", key, path); g_error_free(r); } } @@ -131,7 +133,7 @@ remmina_plugin_glibsecret_get_password(RemminaFile *remminafile, const gchar *ke secret_password_free(password); return p; }else { - remmina_plugin_service->_debug("Password cannot be found for file %s\n", path); + remmina_plugin_debug("Password cannot be found for file %s\n", path); return NULL; } } @@ -145,9 +147,9 @@ void remmina_plugin_glibsecret_delete_password(RemminaFile *remminafile, const g path = remmina_plugin_service->file_get_path(remminafile); secret_password_clear_sync(&remmina_file_secret_schema, NULL, &r, "filename", path, "key", key, NULL); if (r == NULL) - remmina_plugin_service->_debug("password \"%s\" deleted for file %s", key, path); + remmina_plugin_debug("password \"%s\" deleted for file %s", key, path); else - remmina_plugin_service->_debug("password \"%s\" cannot be deleted for file %s", key, path); + remmina_plugin_debug("password \"%s\" cannot be deleted for file %s", key, path); } gboolean remmina_plugin_glibsecret_init() |