{
GObject parent_instance;
- GList* browsers;
MidoriBrowser* browser;
GtkAccelGroup* accel_group;
KatzeArray* search_engines;
KatzeArray* history;
KatzeArray* extensions;
+ KatzeArray* browsers;
gpointer instance;
};
PROP_SEARCH_ENGINES,
PROP_HISTORY,
PROP_EXTENSIONS,
+ PROP_BROWSERS,
PROP_BROWSER,
PROP_BROWSER_COUNT
};
midori_browser_destroy_cb (MidoriBrowser* browser,
MidoriApp* app)
{
- app->browsers = g_list_remove (app->browsers, browser);
- if (g_list_nth (app->browsers, 0))
+ katze_array_remove_item (app->browsers, browser);
+ if (!katze_array_is_empty (app->browsers))
return FALSE;
midori_app_quit (app);
return TRUE;
"signal::quit", midori_browser_quit_cb, app,
NULL);
- app->browsers = g_list_prepend (app->browsers, browser);
+ katze_array_add_item (app->browsers, browser);
#if HAVE_UNIQUE
unique_app_watch_window (app->instance, GTK_WINDOW (browser));
KATZE_TYPE_ARRAY,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ /**
+ * MidoriApp:browsers:
+ *
+ * The list of browsers.
+ *
+ * Since: 0.1.3
+ */
+ g_object_class_install_property (gobject_class,
+ PROP_BROWSERS,
+ g_param_spec_object (
+ "browsers",
+ "Browsers",
+ "The list of browsers",
+ KATZE_TYPE_ARRAY,
+ G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
+
+ /**
+ * MidoriApp:browser:
+ *
+ * The current browser, that is the one that was last used.
+ *
+ * Since: 0.1.3
+ */
g_object_class_install_property (gobject_class,
PROP_BROWSER,
g_param_spec_object (
MIDORI_TYPE_BROWSER,
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
+ /**
+ * MidoriApp:browser-count:
+ *
+ * The number of browsers.
+ *
+ * Deprecated: 0.1.3 Use MidoriApp:browsers instead.
+ */
g_object_class_install_property (gobject_class,
PROP_BROWSER_COUNT,
g_param_spec_uint (
app->search_engines = NULL;
app->history = NULL;
app->extensions = NULL;
+ app->browsers = katze_array_new (MIDORI_TYPE_BROWSER);
#if HAVE_UNIQUE
display_name = g_strdup (gdk_display_get_name (gdk_display_get_default ()));
{
MidoriApp* app = MIDORI_APP (object);
- g_list_free (app->browsers);
g_object_unref (app->accel_group);
katze_object_assign (app->settings, NULL);
katze_object_assign (app->search_engines, NULL);
katze_object_assign (app->history, NULL);
katze_object_assign (app->extensions, NULL);
+ katze_object_assign (app->browsers, NULL);
katze_object_assign (app->instance, NULL);
case PROP_EXTENSIONS:
g_value_set_object (value, app->extensions);
break;
+ case PROP_BROWSERS:
+ g_value_set_object (value, app->browsers);
+ break;
case PROP_BROWSER:
g_value_set_object (value, app->browser);
break;
case PROP_BROWSER_COUNT:
- g_value_set_uint (value, g_list_length (app->browsers));
+ g_value_set_uint (value, katze_array_get_length (app->browsers));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);