mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-19 09:36:21 +00:00
added the possibility to uninstall a plugin
This commit is contained in:
committed by
Dmitry Podgorny
parent
e4ddced420
commit
cd86f5bc28
@@ -34,6 +34,7 @@
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <gio/gio.h>
|
||||
|
||||
#include "log.h"
|
||||
#include "config.h"
|
||||
@@ -168,6 +169,20 @@ plugins_install_all(const char *const path)
|
||||
return result;
|
||||
}
|
||||
|
||||
gboolean
|
||||
plugins_uninstall(const char *const plugin_name)
|
||||
{
|
||||
plugins_unload(plugin_name);
|
||||
char *plugins_dir = files_get_data_path(DIR_PLUGINS);
|
||||
GString *target_path = g_string_new(plugins_dir);
|
||||
free(plugins_dir);
|
||||
g_string_append(target_path, "/");
|
||||
g_string_append(target_path, plugin_name);
|
||||
GFile *file = g_file_new_for_path(target_path->str);
|
||||
GError *error = NULL;
|
||||
return g_file_delete(file, NULL, &error);
|
||||
}
|
||||
|
||||
gboolean
|
||||
plugins_install(const char *const plugin_name, const char *const filename, GString *error_message)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user