diff options
-rw-r--r-- | src/ephy-seed-extension.c | 41 | ||||
-rw-r--r-- | src/ephy-seed-extension.h | 9 | ||||
-rw-r--r-- | src/ephy-seed-loader.c | 60 | ||||
-rw-r--r-- | src/ephy-seed-loader.h | 9 |
4 files changed, 58 insertions, 61 deletions
diff --git a/src/ephy-seed-extension.c b/src/ephy-seed-extension.c index 3f8845213..12ff3ebbf 100644 --- a/src/ephy-seed-extension.c +++ b/src/ephy-seed-extension.c @@ -142,24 +142,21 @@ ephy_seed_extension_get_file (const gchar * name) dot_path = g_strconcat (dot_dir, "/", name, ".js", NULL); g_free (dot_dir); - if (g_file_test (dot_path, G_FILE_TEST_EXISTS)) - { - return dot_path; - } + if (g_file_test (dot_path, G_FILE_TEST_EXISTS)) { + return dot_path; + } system_path = g_strconcat (EXTENSIONS_DIR, name, NULL); - if (g_file_test (system_path, G_FILE_TEST_EXISTS)) - { - return system_path; - } + if (g_file_test (system_path, G_FILE_TEST_EXISTS)) { + return system_path; + } g_free (system_path); dirname = g_path_get_dirname (name); - if (g_path_is_absolute (dirname)) - { - g_free (dirname); - return g_strdup (name); - } + if (g_path_is_absolute (dirname)) { + g_free (dirname); + return g_strdup (name); + } g_free (dirname); return NULL; @@ -230,15 +227,14 @@ ephy_seed_extension_set_property (GObject *object, { EphySeedExtension *ext = EPHY_SEED_EXTENSION (object); - switch (prop_id) - { + switch (prop_id) { case PROP_FILENAME: ext->priv->filename = ephy_seed_extension_get_file (g_value_get_string (value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - } + } } static void @@ -264,12 +260,11 @@ ephy_seed_extension_class_init (EphySeedExtensionClass *klass) g_type_class_add_private (object_class, sizeof (EphySeedExtensionPrivate)); - if (global_eng == NULL) - { - global_eng = seed_init (NULL, NULL); - seed_simple_evaluate (global_eng->context, - "Seed.import_namespace('Gtk');" - "Seed.import_namespace('Epiphany');"); - } + if (global_eng == NULL) { + global_eng = seed_init (NULL, NULL); + seed_simple_evaluate (global_eng->context, + "Seed.import_namespace('Gtk');" + "Seed.import_namespace('Epiphany');"); + } } diff --git a/src/ephy-seed-extension.h b/src/ephy-seed-extension.h index 09141f6b4..2559899ba 100644 --- a/src/ephy-seed-extension.h +++ b/src/ephy-seed-extension.h @@ -1,3 +1,4 @@ +/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */ /* * Copyright © 2009, Robert Carr <carrr@rpi.edu> * @@ -42,15 +43,15 @@ typedef struct _EphySeedExtensionPrivate EphySeedExtensionPrivate; struct _EphySeedExtensionClass { - GObjectClass parent_class; + GObjectClass parent_class; }; struct _EphySeedExtension { - GObject parent_instance; + GObject parent_instance; - /*< private >*/ - EphySeedExtensionPrivate *priv; + /*< private >*/ + EphySeedExtensionPrivate *priv; }; GType ephy_seed_extension_get_type (void); diff --git a/src/ephy-seed-loader.c b/src/ephy-seed-loader.c index 859a09a65..600d210fc 100644 --- a/src/ephy-seed-loader.c +++ b/src/ephy-seed-loader.c @@ -1,3 +1,4 @@ +/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */ /* * Copyright © 2009, Robert Carr <carrr@rpi.edu> * @@ -30,50 +31,49 @@ struct _EphySeedLoaderPrivate { - gpointer dummy; + gpointer dummy; }; static GObject * impl_get_object (EphyLoader *eloader, - GKeyFile *keyfile) + GKeyFile *keyfile) { - char *filename; - GObject *object; + char *filename; + GObject *object; - g_return_val_if_fail (keyfile != NULL, NULL); + g_return_val_if_fail (keyfile != NULL, NULL); - filename = g_key_file_get_string (keyfile, "Loader", "Module", NULL); - if (filename == NULL) - { - g_warning ("NULL module name!\n"); - return NULL; - } + filename = g_key_file_get_string (keyfile, "Loader", "Module", NULL); + if (filename == NULL) { + g_warning ("NULL module name!\n"); + return NULL; + } - object = g_object_new (EPHY_TYPE_SEED_EXTENSION, - "filename", filename, - NULL); + object = g_object_new (EPHY_TYPE_SEED_EXTENSION, + "filename", filename, + NULL); - g_free (filename); + g_free (filename); - /* we own one ref */ - return g_object_ref (object); + /* we own one ref */ + return g_object_ref (object); } static void impl_release_object (EphyLoader *eloader, - GObject *object) + GObject *object) { - g_return_if_fail (object != NULL); + g_return_if_fail (object != NULL); - g_object_unref (object); + g_object_unref (object); } static void ephy_seed_loader_iface_init (EphyLoaderIface *iface) { - iface->type = "seed"; - iface->get_object = impl_get_object; - iface->release_object = impl_release_object; + iface->type = "seed"; + iface->get_object = impl_get_object; + iface->release_object = impl_release_object; } G_DEFINE_TYPE_WITH_CODE (EphySeedLoader, ephy_seed_loader, G_TYPE_OBJECT, @@ -82,27 +82,27 @@ G_DEFINE_TYPE_WITH_CODE (EphySeedLoader, ephy_seed_loader, G_TYPE_OBJECT, static void ephy_seed_loader_init (EphySeedLoader *loader) { - loader->priv = EPHY_SEED_LOADER_GET_PRIVATE (loader); + loader->priv = EPHY_SEED_LOADER_GET_PRIVATE (loader); - LOG ("EphySeedLoader initialising"); + LOG ("EphySeedLoader initialising"); } static void ephy_seed_loader_finalize (GObject *object) { - LOG ("EphySeedLoader finalising"); + LOG ("EphySeedLoader finalising"); - G_OBJECT_CLASS (ephy_seed_loader_parent_class)->finalize (object); + G_OBJECT_CLASS (ephy_seed_loader_parent_class)->finalize (object); } static void ephy_seed_loader_class_init (EphySeedLoaderClass *klass) { - GObjectClass *object_class = G_OBJECT_CLASS (klass); + GObjectClass *object_class = G_OBJECT_CLASS (klass); - object_class->finalize = ephy_seed_loader_finalize; + object_class->finalize = ephy_seed_loader_finalize; - g_type_class_add_private (object_class, sizeof (EphySeedLoaderPrivate)); + g_type_class_add_private (object_class, sizeof (EphySeedLoaderPrivate)); } diff --git a/src/ephy-seed-loader.h b/src/ephy-seed-loader.h index 71ca4fd42..d6ef29354 100644 --- a/src/ephy-seed-loader.h +++ b/src/ephy-seed-loader.h @@ -1,3 +1,4 @@ +/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */ /* * Copyright Robert Carr, <carrr@rpi.edu> 2009 * @@ -42,15 +43,15 @@ typedef struct _EphySeedLoaderPrivate EphySeedLoaderPrivate; struct _EphySeedLoaderClass { - GObjectClass parent_class; + GObjectClass parent_class; }; struct _EphySeedLoader { - GObject parent_instance; + GObject parent_instance; - /*< private >*/ - EphySeedLoaderPrivate *priv; + /*< private >*/ + EphySeedLoaderPrivate *priv; }; GType ephy_seed_loader_get_type (void); |