[gnome-software] Do not allow plugins to call gs_app_set_last_error() manually



commit a9515b1d94a3482fa677166c91fac2e9cefa9d04
Author: Richard Hughes <richard hughsie com>
Date:   Tue May 10 16:58:22 2016 +0100

    Do not allow plugins to call gs_app_set_last_error() manually

 src/Makefile.am        |    1 +
 src/gs-app-private.h   |   36 ++++++++++++++++++++++++++++++++++++
 src/gs-app.c           |    2 +-
 src/gs-app.h           |    3 ---
 src/gs-page.c          |    2 +-
 src/gs-plugin-loader.c |    1 +
 src/gs-self-test.c     |    2 +-
 src/gs-shell-details.c |    1 +
 src/gs-shell-updates.c |    2 +-
 9 files changed, 43 insertions(+), 7 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index f2441ad..2675a8e 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -119,6 +119,7 @@ gnome_software_SOURCES =                            \
        gs-utils.h                                      \
        gs-app.c                                        \
        gs-app.h                                        \
+       gs-app-private.h                                \
        gs-app-list.c                                   \
        gs-app-list.h                                   \
        gs-category.c                                   \
diff --git a/src/gs-app-private.h b/src/gs-app-private.h
new file mode 100644
index 0000000..6d41284
--- /dev/null
+++ b/src/gs-app-private.h
@@ -0,0 +1,36 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2016 Richard Hughes <richard hughsie com>
+ *
+ * Licensed under the GNU General Public License Version 2
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef __GS_APP_PRIVATE_H
+#define __GS_APP_PRIVATE_H
+
+#include "gs-app.h"
+
+G_BEGIN_DECLS
+
+GError         *gs_app_get_last_error          (GsApp          *app);
+void            gs_app_set_last_error          (GsApp          *app,
+                                                GError         *error);
+G_END_DECLS
+
+#endif /* __GS_APP_PRIVATE_H */
+
+/* vim: set noexpandtab: */
diff --git a/src/gs-app.c b/src/gs-app.c
index bbef000..c6ba863 100644
--- a/src/gs-app.c
+++ b/src/gs-app.c
@@ -47,7 +47,7 @@
 #include <gtk/gtk.h>
 #include <glib/gi18n.h>
 
-#include "gs-app.h"
+#include "gs-app-private.h"
 #include "gs-plugin.h"
 #include "gs-utils.h"
 
diff --git a/src/gs-app.h b/src/gs-app.h
index 0dd15b6..4f9ec62 100644
--- a/src/gs-app.h
+++ b/src/gs-app.h
@@ -274,9 +274,6 @@ void                 gs_app_add_quirk               (GsApp          *app,
                                                 AsAppQuirk      quirk);
 void            gs_app_remove_quirk            (GsApp          *app,
                                                 AsAppQuirk      quirk);
-GError         *gs_app_get_last_error          (GsApp          *app);
-void            gs_app_set_last_error          (GsApp          *app,
-                                                GError         *error);
 G_END_DECLS
 
 #endif /* __GS_APP_H */
diff --git a/src/gs-page.c b/src/gs-page.c
index 49e4e30..9e6cbd0 100644
--- a/src/gs-page.c
+++ b/src/gs-page.c
@@ -24,7 +24,7 @@
 #include <string.h>
 #include <glib/gi18n.h>
 
-#include "gs-app.h"
+#include "gs-app-private.h"
 #include "gs-page.h"
 #include "gs-shell.h"
 #include "gs-common.h"
diff --git a/src/gs-plugin-loader.c b/src/gs-plugin-loader.c
index b9ca0e7..c3a8d2b 100644
--- a/src/gs-plugin-loader.c
+++ b/src/gs-plugin-loader.c
@@ -25,6 +25,7 @@
 #include <glib/gi18n.h>
 #include <appstream-glib.h>
 
+#include "gs-app-private.h"
 #include "gs-plugin-loader.h"
 #include "gs-plugin.h"
 #include "gs-plugin-private.h"
diff --git a/src/gs-self-test.c b/src/gs-self-test.c
index 1726a68..f641b11 100644
--- a/src/gs-self-test.c
+++ b/src/gs-self-test.c
@@ -24,7 +24,7 @@
 #include <glib-object.h>
 #include <stdlib.h>
 
-#include "gs-app.h"
+#include "gs-app-private.h"
 #include "gs-plugin.h"
 #include "gs-plugin-loader.h"
 #include "gs-plugin-loader-sync.h"
diff --git a/src/gs-shell-details.c b/src/gs-shell-details.c
index b1dc7e4..03da15c 100644
--- a/src/gs-shell-details.c
+++ b/src/gs-shell-details.c
@@ -29,6 +29,7 @@
 #include "gs-common.h"
 
 #include "gs-shell-details.h"
+#include "gs-app-private.h"
 #include "gs-app-addon-row.h"
 #include "gs-history-dialog.h"
 #include "gs-screenshot-image.h"
diff --git a/src/gs-shell-updates.c b/src/gs-shell-updates.c
index 167abcf..f7e72d8 100644
--- a/src/gs-shell-updates.c
+++ b/src/gs-shell-updates.c
@@ -27,7 +27,7 @@
 #include "gs-shell.h"
 #include "gs-shell-updates.h"
 #include "gs-common.h"
-#include "gs-app.h"
+#include "gs-app-private.h"
 #include "gs-app-row.h"
 #include "gs-update-dialog.h"
 #include "gs-update-list.h"


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]