aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorXan Lopez <xlopez@igalia.com>2011-09-02 03:06:05 +0800
committerXan Lopez <xlopez@igalia.com>2011-09-02 03:07:41 +0800
commit459f7eab590f49340962cdf6bc3d4d66b3356109 (patch)
tree0361643db81b93c56bf4f2de916cb3ec786219f7 /src
parent996bf1df4981e87d507e3fc8940d0c84b7d8ba9f (diff)
downloadgsoc2013-epiphany-459f7eab590f49340962cdf6bc3d4d66b3356109.tar.gz
gsoc2013-epiphany-459f7eab590f49340962cdf6bc3d4d66b3356109.tar.zst
gsoc2013-epiphany-459f7eab590f49340962cdf6bc3d4d66b3356109.zip
Add --delete--application command line option to delete WebApps
Plus the necessary code to implement some sort of UI to do this for the 3.2 time frame. Hopefully for 3.4 we'll have a GNOME-wide system to deal with applications.
Diffstat (limited to 'src')
-rw-r--r--src/ephy-main.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/ephy-main.c b/src/ephy-main.c
index 19b4100f8..1d1e28ab2 100644
--- a/src/ephy-main.c
+++ b/src/ephy-main.c
@@ -30,6 +30,7 @@
#include "ephy-stock-icons.h"
#include "ephy-session.h"
#include "ephy-shell.h"
+#include "ephy-web-app-utils.h"
#include "ephy-debug.h"
#include "ephy-string.h"
#include "eggsmclient.h"
@@ -61,6 +62,7 @@ static char *session_filename = NULL;
static char *bookmark_url = NULL;
static char *bookmarks_file = NULL;
static char **arguments = NULL;
+static char *application_to_delete = NULL;
/* Only set from options in debug builds */
static gboolean private_instance = FALSE;
@@ -104,6 +106,8 @@ static const GOptionEntry option_entries[] =
"", N_("URL …")},
{ "version", 0, G_OPTION_FLAG_NO_ARG | G_OPTION_FLAG_HIDDEN,
G_OPTION_ARG_CALLBACK, option_version_cb, NULL, NULL },
+ { "delete-application", 0, 0, G_OPTION_ARG_STRING | G_OPTION_FLAG_HIDDEN,
+ &application_to_delete, NULL, NULL },
{ NULL }
};
@@ -359,6 +363,11 @@ main (int argc,
g_option_context_free (option_context);
/* Some argument sanity checks*/
+ if (application_to_delete != NULL && argc > 3) {
+ g_print ("Cannot pass any other parameter when using --delete-application\n");
+ exit (1);
+ }
+
if (arguments != NULL && (session_filename != NULL || open_as_bookmarks_editor)) {
g_print ("Cannot use --bookmarks-editor or --load-session with URL arguments \n");
exit (1);
@@ -416,6 +425,13 @@ main (int argc,
exit (1);
}
+ /* Delete the requested web application, if any. Must happen after
+ * ephy_file_helpers_init (). */
+ if (application_to_delete) {
+ ephy_delete_web_application (application_to_delete);
+ exit (0);
+ }
+
ephy_stock_icons_init ();
ephy_file_load_accels ();