diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2006-01-25 02:15:50 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2006-01-25 02:15:50 +0800 |
commit | e10ccbd38205bdf451f68932aacfc7f5e3f70dea (patch) | |
tree | 9ddf7bb9028a60dfcd64cff29ccf3005269a79a5 /lib | |
parent | 21086fc06ec3d08e3c5609cc53383e7c18fd2175 (diff) | |
download | gsoc2013-epiphany-e10ccbd38205bdf451f68932aacfc7f5e3f70dea.tar gsoc2013-epiphany-e10ccbd38205bdf451f68932aacfc7f5e3f70dea.tar.gz gsoc2013-epiphany-e10ccbd38205bdf451f68932aacfc7f5e3f70dea.tar.bz2 gsoc2013-epiphany-e10ccbd38205bdf451f68932aacfc7f5e3f70dea.tar.lz gsoc2013-epiphany-e10ccbd38205bdf451f68932aacfc7f5e3f70dea.tar.xz gsoc2013-epiphany-e10ccbd38205bdf451f68932aacfc7f5e3f70dea.tar.zst gsoc2013-epiphany-e10ccbd38205bdf451f68932aacfc7f5e3f70dea.zip |
Run the main loop until the reply is received when activating a running
2006-01-24 Christian Persch <chpe@cvs.gnome.org>
* lib/ephy-file-helpers.c: (ephy_dot_dir),
(ephy_file_helpers_init):
* lib/ephy-file-helpers.h:
* src/ephy-dbus.c:
* src/ephy-main.c: (unref_proxy_reply_cb), (open_urls), (main):
Run the main loop until the reply is received when
activating a running instance. Fixes URL opening with
two concurrently starting instance.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ephy-file-helpers.c | 49 | ||||
-rw-r--r-- | lib/ephy-file-helpers.h | 7 |
2 files changed, 39 insertions, 17 deletions
diff --git a/lib/ephy-file-helpers.c b/lib/ephy-file-helpers.c index c9c62d043..6e024c260 100644 --- a/lib/ephy-file-helpers.c +++ b/lib/ephy-file-helpers.c @@ -1,7 +1,7 @@ /* * Copyright (C) 2002 Jorn Baayen * Copyright (C) 2003, 2004 Marco Pesenti Gritti - * Copyright (C) 2004 Christian Persch + * Copyright (C) 2004, 2005, 2006 Christian Persch * * 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 @@ -28,10 +28,6 @@ #include "eel-gconf-extensions.h" #include "ephy-debug.h" -#include <string.h> -#include <stdlib.h> -#include <unistd.h> -#include <sys/stat.h> #include <glib.h> #include <glib/gi18n.h> #include <libgnome/gnome-init.h> @@ -49,6 +45,11 @@ #include <gdk/gdk.h> #include <gdk/gdkx.h> +#include <string.h> +#include <stdlib.h> +#include <unistd.h> +#include <sys/stat.h> + #define EPHY_UUID "0d82d98f-7079-401c-abff-203fcde1ece3" #define EPHY_UUID_ENVVAR "EPHY_UNIQUE" #define EPHY_UUID_ENVSTRING EPHY_UUID_ENVVAR "=" EPHY_UUID @@ -59,6 +60,7 @@ static GHashTable *files = NULL; static GHashTable *mime_table = NULL; +static gboolean have_private_profile = FALSE; static char *dot_dir = NULL; static char *tmp_dir = NULL; static GList *del_on_exit = NULL; @@ -251,19 +253,12 @@ ephy_file (const char *filename) const char * ephy_dot_dir (void) { - if (dot_dir == NULL) - { - dot_dir = g_build_filename (g_get_home_dir (), - GNOME_DOT_GNOME, - "epiphany", - NULL); - } - return dot_dir; } gboolean -ephy_file_helpers_init (GError **error) +ephy_file_helpers_init (gboolean private_profile, + GError **error) { const char *uuid; @@ -285,6 +280,32 @@ ephy_file_helpers_init (GError **error) (GDestroyNotify) g_free, (GDestroyNotify) g_free); + have_private_profile = private_profile; + + if (private_profile) + { + if (ephy_file_tmp_dir () == NULL) + { + g_set_error (error, + EPHY_FILE_HELPERS_ERROR_QUARK, + 0, + _("Could not create a temporary directory in ā%sā."), + g_get_tmp_dir ()); + return FALSE; + } + + dot_dir = g_build_filename (ephy_file_tmp_dir (), + "epiphany", + NULL); + } + else + { + dot_dir = g_build_filename (g_get_home_dir (), + GNOME_DOT_GNOME, + "epiphany", + NULL); + } + return ephy_ensure_dir_exists (ephy_dot_dir (), error); } diff --git a/lib/ephy-file-helpers.h b/lib/ephy-file-helpers.h index 189cc17e2..505e609c6 100644 --- a/lib/ephy-file-helpers.h +++ b/lib/ephy-file-helpers.h @@ -1,7 +1,7 @@ /* * Copyright (C) 2002 Jorn Baayen * Copyright (C) 2003, 2004 Marco Pesenti Gritti - * Copyright (C) 2004 Christian Persch + * Copyright (C) 2004, 2005, 2006 Christian Persch * * 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 @@ -43,12 +43,13 @@ typedef struct _EphyFileMonitor EphyFileMonitor; typedef void (* EphyFileMonitorFunc) (EphyFileMonitor*, const char*, GnomeVFSMonitorEventType, gpointer); typedef gboolean (* EphyFileMonitorDelayFunc) (EphyFileMonitor*, gpointer); +gboolean ephy_file_helpers_init (gboolean private_profile, + GError **error); + const char *ephy_file (const char *filename); const char *ephy_dot_dir (void); -gboolean ephy_file_helpers_init (GError **error); - void ephy_file_helpers_shutdown (void); char *ephy_file_downloads_dir (void); |