Optimizations in main and MidoriApp

This commit is contained in:
Christian Dywan 2008-12-30 03:00:08 +01:00
parent e30b30d37d
commit 4e1deaee05
3 changed files with 19 additions and 19 deletions

View file

@ -1208,7 +1208,7 @@ parse_cookie (gchar* line,
SoupCookie *cookie = NULL;
gboolean http_only;
time_t max_age;
gchar* host, *is_domain, *path, *secure, *expires, *name, *value;
gchar* host/*, *is_domain*/, *path, *secure, *expires, *name, *value;
if (g_str_has_prefix (line, "#HttpOnly_"))
{
@ -1231,7 +1231,7 @@ parse_cookie (gchar* line,
goto out;
host = result[0];
is_domain = result[1];
/* is_domain = result[1]; */
path = result[2];
secure = result[3];
@ -1689,7 +1689,6 @@ midori_load_extensions (gpointer data)
MidoriApp* app = MIDORI_APP (data);
KatzeArray* extensions;
gchar* extension_path;
GDir* extension_dir;
const gchar* filename;
MidoriExtension* extension;
guint n, i;
@ -1698,11 +1697,9 @@ midori_load_extensions (gpointer data)
extensions = katze_array_new (MIDORI_TYPE_EXTENSION);
extension_path = g_build_filename (LIBDIR, PACKAGE_NAME, NULL);
if (g_module_supported ())
extension_dir = g_dir_open (extension_path, 0, NULL);
else
extension_dir = NULL;
if (extension_dir)
{
GDir* extension_dir = g_dir_open (extension_path, 0, NULL);
while ((filename = g_dir_read_name (extension_dir)))
{
gchar* fullname;
@ -1718,11 +1715,13 @@ midori_load_extensions (gpointer data)
(gpointer) &extension_init))
extension = extension_init ();
else
{
extension = g_object_new (MIDORI_TYPE_EXTENSION,
"name", filename,
"description", g_module_error (),
NULL);
g_warning ("%s", g_module_error ());
}
katze_array_add_item (extensions, extension);
g_object_unref (extension);
}

View file

@ -160,7 +160,6 @@ _midori_app_add_browser (MidoriApp* app,
app->browsers = g_list_prepend (app->browsers, browser);
#if HAVE_UNIQUE
if (app->instance)
unique_app_watch_window (app->instance, GTK_WINDOW (browser));
#endif
}
@ -369,7 +368,7 @@ midori_app_init (MidoriApp* app)
app->accel_group = gtk_accel_group_new ();
app->settings = midori_web_settings_new ();
app->settings = NULL;
app->bookmarks = NULL;
app->trash = NULL;
app->search_engines = NULL;
@ -552,7 +551,7 @@ midori_app_instance_send_activate (MidoriApp* app)
UniqueResponse response;
#endif
g_return_val_if_fail (MIDORI_IS_APP (app), FALSE);
/* g_return_val_if_fail (MIDORI_IS_APP (app), FALSE); */
g_return_val_if_fail (midori_app_instance_is_running (app), FALSE);
#if HAVE_UNIQUE
@ -579,7 +578,7 @@ midori_app_instance_send_new_browser (MidoriApp* app)
UniqueResponse response;
#endif
g_return_val_if_fail (MIDORI_IS_APP (app), FALSE);
/* g_return_val_if_fail (MIDORI_IS_APP (app), FALSE); */
g_return_val_if_fail (midori_app_instance_is_running (app), FALSE);
#if HAVE_UNIQUE
@ -611,7 +610,7 @@ midori_app_instance_send_uris (MidoriApp* app,
UniqueResponse response;
#endif
g_return_val_if_fail (MIDORI_IS_APP (app), FALSE);
/* g_return_val_if_fail (MIDORI_IS_APP (app), FALSE); */
g_return_val_if_fail (midori_app_instance_is_running (app), FALSE);
g_return_val_if_fail (uris != NULL, FALSE);

View file

@ -177,10 +177,11 @@ midori_extensions_add_item_cb (KatzeArray* array,
MidoriExtensions* extensions)
{
GtkTreeIter iter;
GtkListStore* liststore = GTK_LIST_STORE (gtk_tree_view_get_model (
GTK_TREE_VIEW (extensions->treeview)));
gtk_list_store_append (liststore, &iter);
gtk_list_store_set (liststore, &iter, 0, extension, -1);
GtkTreeModel* model;
model = gtk_tree_view_get_model (GTK_TREE_VIEW (extensions->treeview));
gtk_list_store_append (GTK_LIST_STORE (model), &iter);
gtk_list_store_set (GTK_LIST_STORE (model), &iter, 0, extension, -1);
}
static void
@ -198,6 +199,7 @@ midori_extensions_set_property (GObject* object,
KatzeArray* array;
guint i, n;
/* FIXME: Handle NULL and subsequent assignments */
extensions->app = g_value_get_object (value);
array = katze_object_get_object (extensions->app, "extensions");
g_signal_connect (array, "add-item",