aboutsummaryrefslogtreecommitdiffstats
path: root/embed/mozilla/mozilla-embed-single.cpp
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@src.gnome.org>2008-01-14 04:42:01 +0800
committerCosimo Cecchi <cosimoc@src.gnome.org>2008-01-14 04:42:01 +0800
commitaf1c2ceaef7d949e36a7680f463c5e25f79c43d6 (patch)
tree19c94f1df613831ed8ab92b4ac904be0c20c673f /embed/mozilla/mozilla-embed-single.cpp
parent12d96e8a6fc9eddaffdbad58754e712af5fc5fef (diff)
downloadgsoc2013-epiphany-af1c2ceaef7d949e36a7680f463c5e25f79c43d6.tar
gsoc2013-epiphany-af1c2ceaef7d949e36a7680f463c5e25f79c43d6.tar.gz
gsoc2013-epiphany-af1c2ceaef7d949e36a7680f463c5e25f79c43d6.tar.bz2
gsoc2013-epiphany-af1c2ceaef7d949e36a7680f463c5e25f79c43d6.tar.lz
gsoc2013-epiphany-af1c2ceaef7d949e36a7680f463c5e25f79c43d6.tar.xz
gsoc2013-epiphany-af1c2ceaef7d949e36a7680f463c5e25f79c43d6.tar.zst
gsoc2013-epiphany-af1c2ceaef7d949e36a7680f463c5e25f79c43d6.zip
Drop gnome-vfs dependency. Now Epiphany depends on glib >= 2.15.1.
Also, optional Zeroconf support depends on Avahi >= 0.6.22. Bug #507152. svn path=/trunk/; revision=7858
Diffstat (limited to 'embed/mozilla/mozilla-embed-single.cpp')
-rw-r--r--embed/mozilla/mozilla-embed-single.cpp43
1 files changed, 23 insertions, 20 deletions
diff --git a/embed/mozilla/mozilla-embed-single.cpp b/embed/mozilla/mozilla-embed-single.cpp
index 1d07ab548..05f081fac 100644
--- a/embed/mozilla/mozilla-embed-single.cpp
+++ b/embed/mozilla/mozilla-embed-single.cpp
@@ -29,7 +29,7 @@
#include <glib.h>
#include <glib/gi18n.h>
-#include <libgnomevfs/gnome-vfs-utils.h>
+#include <gio/gio.h>
#include <nsStringAPI.h>
@@ -79,10 +79,10 @@
#include "ephy-debug.h"
#include "ephy-embed-prefs.h"
#include "ephy-embed-shell.h"
-#include "ephy-file-helpers.h"
#include "ephy-langs.h"
#include "ephy-password-manager.h"
#include "ephy-permission-manager.h"
+#include "ephy-string.h"
#include "mozilla-embed.h"
#include "mozilla-notifiers.h"
#include "mozilla-x509-cert.h"
@@ -114,7 +114,7 @@ struct MozillaEmbedSinglePrivate
char *user_css_file;
guint user_css_enabled_notifier_id;
- EphyFileMonitor *user_css_file_monitor;
+ GFileMonitor *user_css_file_monitor;
guint user_css_enabled : 1;
guint online : 1;
@@ -263,7 +263,8 @@ mozilla_init_plugin_add_unique_path (GList *list,
if (path == NULL)
return list;
- canon = gnome_vfs_make_path_name_canonical (path);
+ canon = ephy_string_canonicalize_pathname (path);
+
for (l = list; l != NULL; l = l->next) {
if (g_str_equal (list->data, canon) != FALSE) {
/* The path is already in the list */
@@ -470,14 +471,15 @@ user_css_unregister (MozillaEmbedSingle *single)
}
static void
-user_css_file_monitor_func (EphyFileMonitor *,
- const char *,
- GnomeVFSMonitorEventType event_type,
- MozillaEmbedSingle *single)
+user_css_file_monitor_changed_cb (GFileMonitor *file_monitor,
+ GFile *file,
+ GFile *other_file,
+ gint event_type,
+ MozillaEmbedSingle *single)
{
LOG ("Reregistering the user style sheet");
- if (event_type == GNOME_VFS_MONITOR_EVENT_DELETED)
+ if (event_type == G_FILE_MONITOR_EVENT_DELETED)
{
user_css_unregister (single);
}
@@ -505,27 +507,28 @@ user_css_enabled_notify (GConfClient *client,
if (enabled)
{
- char *uri;
+ GFile *file;
user_css_register (single);
- uri = gnome_vfs_get_uri_from_local_path (priv->user_css_file);
+ file = g_file_new_for_path (priv->user_css_file);
g_assert (priv->user_css_file_monitor == NULL);
priv->user_css_file_monitor =
- ephy_file_monitor_add (uri,
- GNOME_VFS_MONITOR_FILE,
- USER_CSS_LOAD_DELAY,
- (EphyFileMonitorFunc) user_css_file_monitor_func,
- NULL,
- single);
- g_free (uri);
+ g_file_monitor_file (file,
+ G_FILE_MONITOR_NONE, NULL);
+ g_file_monitor_set_rate_limit (priv->user_css_file_monitor,
+ USER_CSS_LOAD_DELAY);
+ g_signal_connect (priv->user_css_file_monitor, "changed",
+ G_CALLBACK (user_css_file_monitor_changed_cb),
+ single);
+ g_object_unref (file);
}
else
{
if (priv->user_css_file_monitor != NULL)
{
- ephy_file_monitor_cancel (priv->user_css_file_monitor);
+ g_file_monitor_cancel (priv->user_css_file_monitor);
priv->user_css_file_monitor = NULL;
}
@@ -563,7 +566,7 @@ mozilla_stylesheet_shutdown (MozillaEmbedSingle *single)
if (priv->user_css_file_monitor != NULL)
{
- ephy_file_monitor_cancel (priv->user_css_file_monitor);
+ g_file_monitor_cancel (priv->user_css_file_monitor);
priv->user_css_file_monitor = NULL;
}