MidoriApp* app = MIDORI_APP (data);
gchar** active_extensions = g_object_get_data (G_OBJECT (app), "extensions");
KatzeArray* extensions;
+ #ifdef G_ENABLE_DEBUG
+ gboolean startup_timer = g_getenv ("MIDORI_STARTTIME") != NULL;
+ GTimer* timer;
+ if (startup_timer)
+ timer = g_timer_new ();
+ #endif
/* Load extensions */
extensions = katze_array_new (MIDORI_TYPE_EXTENSION);
g_idle_add (midori_load_netscape_plugins, app);
+ #ifdef G_ENABLE_DEBUG
+ if (startup_timer)
+ g_debug ("Extensions:\t%f", g_test_timer_elapsed ());
+ #endif
+
return FALSE;
}
guint i;
gint64 current;
gchar** command = g_object_get_data (G_OBJECT (app), "execute-command");
+ #ifdef G_ENABLE_DEBUG
+ gboolean startup_timer = g_getenv ("MIDORI_STARTTIME") != NULL;
+ GTimer* timer;
+ if (startup_timer)
+ timer = g_timer_new ();
+ #endif
browser = midori_app_create_browser (app);
config_file = build_config_filename ("session.old.xbel");
if (command)
midori_app_send_command (app, command);
+ #ifdef G_ENABLE_DEBUG
+ if (startup_timer)
+ g_debug ("Session setup:\t%f", g_test_timer_elapsed ());
+ #endif
+
return FALSE;
}
gint max_history_age;
#endif
gint clear_prefs = MIDORI_CLEAR_NONE;
+ #ifdef G_ENABLE_DEBUG
+ gboolean startup_timer = g_getenv ("MIDORI_STARTTIME") != NULL;
+ #define midori_startup_timer(tmrmsg) if (startup_timer) \
+ g_debug (tmrmsg, (g_test_timer_last () - g_test_timer_elapsed ()) * -1)
+ #else
+ #define midori_startup_timer(tmrmsg)
+ #endif
#if ENABLE_NLS
setlocale (LC_ALL, "");
sokoke_register_stock_items ();
g_set_application_name (_("Midori"));
+ #ifdef G_ENABLE_DEBUG
+ if (startup_timer)
+ g_test_timer_start ();
+ #endif
+
if (version)
{
g_print (
if (webapp)
{
MidoriBrowser* browser = midori_browser_new ();
+ midori_startup_timer ("Browser: \t%f");
settings = katze_object_get_object (browser, "settings");
g_object_set (settings,
"show-menubar", FALSE,
"enable-developer-extras", FALSE,
NULL);
g_object_set (browser, "settings", settings, NULL);
+ midori_startup_timer ("Setup config: \t%f");
g_object_unref (settings);
sokoke_set_config_dir ("/");
g_signal_connect (browser, "notify::load-status",
i++;
}
}
+ midori_startup_timer ("App created: \t%f");
gtk_main ();
return 0;
}
else
app = midori_app_new ();
g_free (config);
+ midori_startup_timer ("App created: \t%f");
/* FIXME: The app might be 'running' but actually showing a dialog
after a crash, so running a new window isn't a good idea. */
katze_mkdir_with_parents (sokoke_set_config_dir (NULL), 0700);
- /* Load configuration files */
+ /* Load configuration file */
error_messages = g_string_new (NULL);
config_file = build_config_filename ("config");
error = NULL;
settings = settings_new_from_file (config_file, &extensions);
g_object_set (settings, "enable-developer-extras", TRUE, NULL);
+ midori_startup_timer ("Config read: \t%f");
+
+ /* Load accelerators */
katze_assign (config_file, build_config_filename ("accels"));
if (g_access (config_file, F_OK) != 0)
katze_assign (config_file, sokoke_find_config_filename (NULL, "accels"));
gtk_accel_map_load (config_file);
+ midori_startup_timer ("Accels read: \t%f");
+
+ /* Load search engines */
katze_assign (config_file, build_config_filename ("search"));
error = NULL;
search_engines = search_engines_new_from_file (config_file, &error);
error->message);
g_error_free (error);
}
-
/* Pick first search engine as default if not set */
g_object_get (settings, "location-entry-search", &uri, NULL);
if (!(uri && *uri) && !katze_array_is_empty (search_engines))
katze_item_get_uri (item), NULL);
}
g_free (uri);
+ midori_startup_timer ("Search read: \t%f");
bookmarks = katze_array_new (KATZE_TYPE_ARRAY);
#if HAVE_LIBXML
g_error_free (error);
}
#endif
+ midori_startup_timer ("Bkmarks read: \t%f");
+
_session = katze_array_new (KATZE_TYPE_ITEM);
#if HAVE_LIBXML
g_object_get (settings, "load-on-startup", &load_on_startup, NULL);
}
}
#endif
+ midori_startup_timer ("Session read: \t%f");
+
trash = katze_array_new (KATZE_TYPE_ITEM);
#if HAVE_LIBXML
katze_assign (config_file, build_config_filename ("tabtrash.xbel"));
g_error_free (error);
}
#endif
+
+ midori_startup_timer ("Trash read: \t%f");
history = katze_array_new (KATZE_TYPE_ARRAY);
#if HAVE_SQLITE
katze_assign (config_file, build_config_filename ("history.db"));
}
g_object_set_data (G_OBJECT (history), "db", db);
#endif
+ midori_startup_timer ("History read: \t%f");
/* In case of errors */
if (error_messages->len)
gtk_widget_destroy (dialog);
}
g_signal_connect (app, "quit", G_CALLBACK (midori_app_quit_cb), NULL);
+ midori_startup_timer ("Signal setup: \t%f");
g_object_set (app, "settings", settings,
"bookmarks", bookmarks,
g_object_unref (settings);
g_signal_connect (app, "add-browser",
G_CALLBACK (midori_app_add_browser_cb), NULL);
+ midori_startup_timer ("App prepared: \t%f");
g_idle_add (midori_load_cookie_jar, settings);
g_idle_add (midori_load_extensions, app);