[gnome-software] trivial: Add ERROR_DELETE_FAILED
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] trivial: Add ERROR_DELETE_FAILED
- Date: Wed, 7 Sep 2016 15:30:49 +0000 (UTC)
commit 01a711720f85e5dc715b2a125eeef7b72aa25fbc
Author: Richard Hughes <richard hughsie com>
Date: Wed Sep 7 15:10:54 2016 +0100
trivial: Add ERROR_DELETE_FAILED
src/gs-plugin.c | 2 ++
src/gs-plugin.h | 2 ++
src/gs-utils.c | 6 +++---
3 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/src/gs-plugin.c b/src/gs-plugin.c
index ea0d901..2149627 100644
--- a/src/gs-plugin.c
+++ b/src/gs-plugin.c
@@ -1309,6 +1309,8 @@ gs_plugin_error_to_string (GsPluginError error)
return "write-failed";
if (error == GS_PLUGIN_ERROR_INVALID_FORMAT)
return "invalid-format";
+ if (error == GS_PLUGIN_ERROR_DELETE_FAILED)
+ return "delete-failed";
return NULL;
}
diff --git a/src/gs-plugin.h b/src/gs-plugin.h
index 6331094..7cceeda 100644
--- a/src/gs-plugin.h
+++ b/src/gs-plugin.h
@@ -114,6 +114,7 @@ typedef guint64 GsPluginFlags;
* @GS_PLUGIN_ERROR_DOWNLOAD_FAILED: The download action failed
* @GS_PLUGIN_ERROR_WRITE_FAILED: The save-to-disk failed
* @GS_PLUGIN_ERROR_INVALID_FORMAT: The data format is invalid
+ * @GS_PLUGIN_ERROR_DELETE_FAILED: The delete action failed
*
* The failure error types.
**/
@@ -133,6 +134,7 @@ typedef enum {
GS_PLUGIN_ERROR_DOWNLOAD_FAILED,
GS_PLUGIN_ERROR_WRITE_FAILED,
GS_PLUGIN_ERROR_INVALID_FORMAT,
+ GS_PLUGIN_ERROR_DELETE_FAILED,
/*< private >*/
GS_PLUGIN_ERROR_LAST
} GsPluginError;
diff --git a/src/gs-utils.c b/src/gs-utils.c
index d75882c..58263d1 100644
--- a/src/gs-utils.c
+++ b/src/gs-utils.c
@@ -353,7 +353,7 @@ gs_utils_unlink (const gchar *filename, GError **error)
if (g_unlink (filename) != 0) {
g_set_error (error,
GS_PLUGIN_ERROR,
- GS_PLUGIN_ERROR_FAILED,
+ GS_PLUGIN_ERROR_DELETE_FAILED,
"failed to delete %s",
filename);
return FALSE;
@@ -384,7 +384,7 @@ gs_utils_rmtree_real (const gchar *directory, GError **error)
if (g_unlink (src) != 0) {
g_set_error (error,
GS_PLUGIN_ERROR,
- GS_PLUGIN_ERROR_FAILED,
+ GS_PLUGIN_ERROR_DELETE_FAILED,
"Failed to delete: %s", src);
return FALSE;
}
@@ -394,7 +394,7 @@ gs_utils_rmtree_real (const gchar *directory, GError **error)
if (g_rmdir (directory) != 0) {
g_set_error (error,
GS_PLUGIN_ERROR,
- GS_PLUGIN_ERROR_FAILED,
+ GS_PLUGIN_ERROR_DELETE_FAILED,
"Failed to remove: %s", directory);
return FALSE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]