[libpeas] Use gtk_widget_destroy instead of g_object_unref in libpeas-gtk tests
- From: Steve Frécinaux <sfre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libpeas] Use gtk_widget_destroy instead of g_object_unref in libpeas-gtk tests
- Date: Mon, 17 Jan 2011 13:34:19 +0000 (UTC)
commit 7500f6f448148e088998a2f841fcfdeb5e60cb85
Author: Garrett Regier <alias301 gmail com>
Date: Sun Jan 16 15:38:01 2011 -0800
Use gtk_widget_destroy instead of g_object_unref in libpeas-gtk tests
tests/libpeas-gtk/plugin-manager-store.c | 6 +-----
tests/libpeas-gtk/plugin-manager-view.c | 6 +-----
tests/libpeas-gtk/plugin-manager.c | 6 +-----
tests/libpeas-gtk/testing/testing.c | 5 ++++-
4 files changed, 7 insertions(+), 16 deletions(-)
---
diff --git a/tests/libpeas-gtk/plugin-manager-store.c b/tests/libpeas-gtk/plugin-manager-store.c
index 03c69e5..63b5982 100644
--- a/tests/libpeas-gtk/plugin-manager-store.c
+++ b/tests/libpeas-gtk/plugin-manager-store.c
@@ -77,17 +77,13 @@ test_setup (TestFixture *fixture,
/* Set the model, filter and store */
g_object_notify (G_OBJECT (fixture->tree_view), "model");
-
- g_object_ref_sink (fixture->tree_view);
}
static void
test_teardown (TestFixture *fixture,
gconstpointer data)
{
- /* Yes this really is needed */
- g_object_run_dispose (G_OBJECT (fixture->tree_view));
- g_object_unref (fixture->tree_view);
+ gtk_widget_destroy (GTK_WIDGET (fixture->tree_view));
testing_engine_free (fixture->engine);
}
diff --git a/tests/libpeas-gtk/plugin-manager-view.c b/tests/libpeas-gtk/plugin-manager-view.c
index aa1d20d..dca23ef 100644
--- a/tests/libpeas-gtk/plugin-manager-view.c
+++ b/tests/libpeas-gtk/plugin-manager-view.c
@@ -75,17 +75,13 @@ test_setup (TestFixture *fixture,
/* Set the model and store */
g_object_notify (G_OBJECT (fixture->tree_view), "model");
-
- g_object_ref_sink (fixture->tree_view);
}
static void
test_teardown (TestFixture *fixture,
gconstpointer data)
{
- /* Yes this really is needed */
- g_object_run_dispose (G_OBJECT (fixture->tree_view));
- g_object_unref (fixture->tree_view);
+ gtk_widget_destroy (GTK_WIDGET (fixture->tree_view));
testing_engine_free (fixture->engine);
}
diff --git a/tests/libpeas-gtk/plugin-manager.c b/tests/libpeas-gtk/plugin-manager.c
index b7102d9..d1be5d9 100644
--- a/tests/libpeas-gtk/plugin-manager.c
+++ b/tests/libpeas-gtk/plugin-manager.c
@@ -105,17 +105,13 @@ test_setup (TestFixture *fixture,
g_assert (fixture->configure_button != NULL);
g_list_free (buttons);
-
- g_object_ref_sink (fixture->manager);
}
static void
test_teardown (TestFixture *fixture,
gconstpointer data)
{
- /* Yes this really is needed */
- g_object_run_dispose (G_OBJECT (fixture->manager));
- g_object_unref (fixture->manager);
+ gtk_widget_destroy (GTK_WIDGET (fixture->manager));
testing_engine_free (fixture->engine);
}
diff --git a/tests/libpeas-gtk/testing/testing.c b/tests/libpeas-gtk/testing/testing.c
index e1ad59d..bf3634f 100644
--- a/tests/libpeas-gtk/testing/testing.c
+++ b/tests/libpeas-gtk/testing/testing.c
@@ -207,9 +207,12 @@ testing_show_widget (gpointer widget)
g_assert (GTK_IS_WIDGET (widget));
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_has_resize_grip (GTK_WINDOW (window), FALSE);
gtk_window_set_default_size (GTK_WINDOW (window), 200, 100);
+#if GTK_CHECK_VERSION(2,91,1)
+ gtk_window_set_has_resize_grip (GTK_WINDOW (window), FALSE);
+#endif
+
gtk_container_add (GTK_CONTAINER (window), GTK_WIDGET (widget));
gtk_widget_show_all (window);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]