[libgda] Code cleanups to avoid compiler warnings
- From: Vivien Malerba <vivien src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgda] Code cleanups to avoid compiler warnings
- Date: Wed, 22 Aug 2012 19:53:08 +0000 (UTC)
commit 59586eb73efc12e218fad1d9763ff7ed01fdbe88
Author: Vivien Malerba <malerba gnome-db org>
Date: Wed Aug 22 21:47:35 2012 +0200
Code cleanups to avoid compiler warnings
tools/browser/canvas/browser-canvas-db-relations.c | 14 ++---
tools/browser/canvas/browser-canvas.c | 52 --------------------
tools/browser/ldap-browser/class-properties.c | 10 ++--
tools/browser/ldap-browser/classes-view.c | 47 ------------------
tools/browser/ldap-browser/hierarchy-view.c | 47 ------------------
tools/browser/ldap-browser/ldap-classes-page.c | 49 +------------------
tools/browser/ldap-browser/ldap-entries-page.c | 49 +------------------
7 files changed, 14 insertions(+), 254 deletions(-)
---
diff --git a/tools/browser/canvas/browser-canvas-db-relations.c b/tools/browser/canvas/browser-canvas-db-relations.c
index 85b3139..9455968 100644
--- a/tools/browser/canvas/browser-canvas-db-relations.c
+++ b/tools/browser/canvas/browser-canvas-db-relations.c
@@ -825,12 +825,11 @@ popup_add_table_cb (G_GNUC_UNUSED GtkMenuItem *mitem, BrowserCanvasDbRelations *
{
if (! dbrels->priv->add_dialog) {
GtkWidget *vbox, *cloud, *find, *dcontents;
- dbrels->priv->add_dialog = gtk_dialog_new_with_buttons (_("Select tables to add to diagram"),
- (GtkWindow*) gtk_widget_get_toplevel ((GtkWidget*) dbrels),
- 0,
- NULL);
- g_signal_connect (dbrels->priv->add_dialog, "close",
- G_CALLBACK (gtk_widget_hide), NULL);
+ dbrels->priv->add_dialog = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+ gtk_window_set_title (GTK_WINDOW (dbrels->priv->add_dialog),
+ _("Select tables to add to diagram"));
+ gtk_window_set_transient_for (GTK_WINDOW (dbrels->priv->add_dialog),
+ (GtkWindow*) gtk_widget_get_toplevel ((GtkWidget*) dbrels));
g_signal_connect (dbrels->priv->add_dialog, "delete-event",
G_CALLBACK (add_dialog_delete_event), NULL);
gtk_window_set_default_size (GTK_WINDOW (dbrels->priv->add_dialog), 430, 400);
@@ -838,8 +837,7 @@ popup_add_table_cb (G_GNUC_UNUSED GtkMenuItem *mitem, BrowserCanvasDbRelations *
g_object_set_data (G_OBJECT (dbrels->priv->add_dialog), "__canvas", dbrels);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
- dcontents = gtk_dialog_get_content_area (GTK_DIALOG (dbrels->priv->add_dialog));
- gtk_container_add (GTK_CONTAINER (dcontents), vbox);
+ gtk_container_add (GTK_CONTAINER (dbrels->priv->add_dialog), vbox);
cloud = objects_cloud_new (dbrels->priv->mstruct, OBJECTS_CLOUD_TYPE_TABLE);
dbrels->priv->cloud = OBJECTS_CLOUD (cloud);
diff --git a/tools/browser/canvas/browser-canvas.c b/tools/browser/canvas/browser-canvas.c
index f04d094..a67f2f0 100644
--- a/tools/browser/canvas/browser-canvas.c
+++ b/tools/browser/canvas/browser-canvas.c
@@ -45,15 +45,6 @@ static void browser_canvas_init (BrowserCanvas *canvas);
static void browser_canvas_dispose (GObject *object);
static void browser_canvas_finalize (GObject *object);
-static void browser_canvas_set_property (GObject *object,
- guint param_id,
- const GValue *value,
- GParamSpec *pspec);
-static void browser_canvas_get_property (GObject *object,
- guint param_id,
- GValue *value,
- GParamSpec *pspec);
-
/* get a pointer to the parents to be able to call their destructor */
static GObjectClass *parent_class = NULL;
@@ -63,11 +54,6 @@ enum
LAST_SIGNAL
};
-enum
-{
- PROP_0,
-};
-
static gint canvas_signals[LAST_SIGNAL] = { 0 };
GType
@@ -110,10 +96,6 @@ browser_canvas_class_init (BrowserCanvasClass *klass)
g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1,
TYPE_BROWSER_CANVAS_ITEM);
- /* properties */
- object_class->set_property = browser_canvas_set_property;
- object_class->get_property = browser_canvas_get_property;
-
/* virtual functions */
klass->clean_canvas_items = NULL;
klass->build_context_menu = NULL;
@@ -671,40 +653,6 @@ browser_canvas_finalize (GObject *object)
parent_class->finalize (object);
}
-
-static void
-browser_canvas_set_property (GObject *object,
- guint param_id,
- G_GNUC_UNUSED const GValue *value,
- GParamSpec *pspec)
-{
- BrowserCanvas *canvas;
- canvas = BROWSER_CANVAS (object);
-
- switch (param_id) {
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
- break;
- }
-}
-
-static void
-browser_canvas_get_property (GObject *object,
- guint param_id,
- G_GNUC_UNUSED GValue *value,
- GParamSpec *pspec)
-{
- BrowserCanvas *canvas;
-
- canvas = BROWSER_CANVAS (object);
-
- switch (param_id) {
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
- break;
- }
-}
-
/**
* browser_canvas_set_zoom_factor
* @canvas: a #BrowserCanvas widget
diff --git a/tools/browser/ldap-browser/class-properties.c b/tools/browser/ldap-browser/class-properties.c
index fa74afa..9844301 100644
--- a/tools/browser/ldap-browser/class-properties.c
+++ b/tools/browser/ldap-browser/class-properties.c
@@ -247,8 +247,12 @@ visibility_notify_event (GtkWidget *text_view, G_GNUC_UNUSED GdkEventVisibility
ClassProperties *cprop)
{
gint wx, wy, bx, by;
-
- gdk_window_get_pointer (gtk_widget_get_window (text_view), &wx, &wy, NULL);
+ GdkDeviceManager *manager;
+ GdkDevice *pointer;
+
+ manager = gdk_display_get_device_manager (gtk_widget_get_display (text_view));
+ pointer = gdk_device_manager_get_client_pointer (manager);
+ gdk_window_get_device_position (gtk_widget_get_window (text_view), pointer, &wx, &wy, NULL);
gtk_text_view_window_to_buffer_coords (GTK_TEXT_VIEW (text_view),
GTK_TEXT_WINDOW_WIDGET,
@@ -273,8 +277,6 @@ motion_notify_event (GtkWidget *text_view, GdkEventMotion *event, ClassPropertie
set_cursor_if_appropriate (GTK_TEXT_VIEW (text_view), x, y, cprop);
- gdk_window_get_pointer (gtk_widget_get_window (text_view), NULL, NULL, NULL);
-
return FALSE;
}
diff --git a/tools/browser/ldap-browser/classes-view.c b/tools/browser/ldap-browser/classes-view.c
index 789fa68..ad22d68 100644
--- a/tools/browser/ldap-browser/classes-view.c
+++ b/tools/browser/ldap-browser/classes-view.c
@@ -40,19 +40,6 @@ struct _ClassesViewPrivate {
static void classes_view_class_init (ClassesViewClass *klass);
static void classes_view_init (ClassesView *eview, ClassesViewClass *klass);
static void classes_view_dispose (GObject *object);
-static void classes_view_set_property (GObject *object,
- guint param_id,
- const GValue *value,
- GParamSpec *pspec);
-static void classes_view_get_property (GObject *object,
- guint param_id,
- GValue *value,
- GParamSpec *pspec);
-
-/* properties */
-enum {
- PROP_0,
-};
static GObjectClass *parent_class = NULL;
@@ -68,10 +55,6 @@ classes_view_class_init (ClassesViewClass *klass)
parent_class = g_type_class_peek_parent (klass);
- /* Properties */
- object_class->set_property = classes_view_set_property;
- object_class->get_property = classes_view_get_property;
-
object_class->dispose = classes_view_dispose;
}
@@ -125,36 +108,6 @@ classes_view_get_type (void)
return type;
}
-static void
-classes_view_set_property (GObject *object,
- guint param_id,
- G_GNUC_UNUSED const GValue *value,
- GParamSpec *pspec)
-{
- ClassesView *eview;
- eview = CLASSES_VIEW (object);
- switch (param_id) {
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
- break;
- }
-}
-
-static void
-classes_view_get_property (GObject *object,
- guint param_id,
- G_GNUC_UNUSED GValue *value,
- GParamSpec *pspec)
-{
- ClassesView *eview;
- eview = CLASSES_VIEW (object);
- switch (param_id) {
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
- break;
- }
-}
-
static gchar *
classes_view_to_selection (G_GNUC_UNUSED ClassesView *eview)
{
diff --git a/tools/browser/ldap-browser/hierarchy-view.c b/tools/browser/ldap-browser/hierarchy-view.c
index b0ba96c..a792fe1 100644
--- a/tools/browser/ldap-browser/hierarchy-view.c
+++ b/tools/browser/ldap-browser/hierarchy-view.c
@@ -43,19 +43,6 @@ struct _HierarchyViewPrivate {
static void hierarchy_view_class_init (HierarchyViewClass *klass);
static void hierarchy_view_init (HierarchyView *eview, HierarchyViewClass *klass);
static void hierarchy_view_dispose (GObject *object);
-static void hierarchy_view_set_property (GObject *object,
- guint param_id,
- const GValue *value,
- GParamSpec *pspec);
-static void hierarchy_view_get_property (GObject *object,
- guint param_id,
- GValue *value,
- GParamSpec *pspec);
-
-/* properties */
-enum {
- PROP_0,
-};
static GObjectClass *parent_class = NULL;
@@ -71,10 +58,6 @@ hierarchy_view_class_init (HierarchyViewClass *klass)
parent_class = g_type_class_peek_parent (klass);
- /* Properties */
- object_class->set_property = hierarchy_view_set_property;
- object_class->get_property = hierarchy_view_get_property;
-
object_class->dispose = hierarchy_view_dispose;
}
@@ -138,36 +121,6 @@ hierarchy_view_get_type (void)
return type;
}
-static void
-hierarchy_view_set_property (GObject *object,
- guint param_id,
- G_GNUC_UNUSED const GValue *value,
- GParamSpec *pspec)
-{
- HierarchyView *eview;
- eview = HIERARCHY_VIEW (object);
- switch (param_id) {
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
- break;
- }
-}
-
-static void
-hierarchy_view_get_property (GObject *object,
- guint param_id,
- G_GNUC_UNUSED GValue *value,
- GParamSpec *pspec)
-{
- HierarchyView *eview;
- eview = HIERARCHY_VIEW (object);
- switch (param_id) {
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
- break;
- }
-}
-
static gchar *
hierarchy_view_to_selection (G_GNUC_UNUSED HierarchyView *eview)
{
diff --git a/tools/browser/ldap-browser/ldap-classes-page.c b/tools/browser/ldap-browser/ldap-classes-page.c
index 2370bad..baed957 100644
--- a/tools/browser/ldap-browser/ldap-classes-page.c
+++ b/tools/browser/ldap-browser/ldap-classes-page.c
@@ -62,26 +62,13 @@ struct _LdapClassesPagePrivate {
static void ldap_classes_page_class_init (LdapClassesPageClass *klass);
static void ldap_classes_page_init (LdapClassesPage *ebrowser, LdapClassesPageClass *klass);
static void ldap_classes_page_dispose (GObject *object);
-static void ldap_classes_page_set_property (GObject *object,
- guint param_id,
- const GValue *value,
- GParamSpec *pspec);
-static void ldap_classes_page_get_property (GObject *object,
- guint param_id,
- GValue *value,
- GParamSpec *pspec);
+
/* BrowserPage interface */
static void ldap_classes_page_page_init (BrowserPageIface *iface);
static GtkActionGroup *ldap_classes_page_page_get_actions_group (BrowserPage *page);
static const gchar *ldap_classes_page_page_get_actions_ui (BrowserPage *page);
static GtkWidget *ldap_classes_page_page_get_tab_label (BrowserPage *page, GtkWidget **out_close_button);
-
-/* properties */
-enum {
- PROP_0,
-};
-
static GObjectClass *parent_class = NULL;
@@ -96,10 +83,6 @@ ldap_classes_page_class_init (LdapClassesPageClass *klass)
parent_class = g_type_class_peek_parent (klass);
- /* Properties */
- object_class->set_property = ldap_classes_page_set_property;
- object_class->get_property = ldap_classes_page_get_property;
-
object_class->dispose = ldap_classes_page_dispose;
}
@@ -180,36 +163,6 @@ ldap_classes_page_get_type (void)
return type;
}
-static void
-ldap_classes_page_set_property (GObject *object,
- guint param_id,
- G_GNUC_UNUSED const GValue *value,
- GParamSpec *pspec)
-{
- LdapClassesPage *ebrowser;
- ebrowser = LDAP_CLASSES_PAGE (object);
- switch (param_id) {
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
- break;
- }
-}
-
-static void
-ldap_classes_page_get_property (GObject *object,
- guint param_id,
- G_GNUC_UNUSED GValue *value,
- GParamSpec *pspec)
-{
- LdapClassesPage *ebrowser;
- ebrowser = LDAP_CLASSES_PAGE (object);
- switch (param_id) {
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
- break;
- }
-}
-
static gchar *
ldap_classes_page_to_selection (G_GNUC_UNUSED LdapClassesPage *ebrowser)
{
diff --git a/tools/browser/ldap-browser/ldap-entries-page.c b/tools/browser/ldap-browser/ldap-entries-page.c
index f6fde04..592b9f4 100644
--- a/tools/browser/ldap-browser/ldap-entries-page.c
+++ b/tools/browser/ldap-browser/ldap-entries-page.c
@@ -63,26 +63,13 @@ struct _LdapEntriesPagePrivate {
static void ldap_entries_page_class_init (LdapEntriesPageClass *klass);
static void ldap_entries_page_init (LdapEntriesPage *ebrowser, LdapEntriesPageClass *klass);
static void ldap_entries_page_dispose (GObject *object);
-static void ldap_entries_page_set_property (GObject *object,
- guint param_id,
- const GValue *value,
- GParamSpec *pspec);
-static void ldap_entries_page_get_property (GObject *object,
- guint param_id,
- GValue *value,
- GParamSpec *pspec);
+
/* BrowserPage interface */
static void ldap_entries_page_page_init (BrowserPageIface *iface);
static GtkActionGroup *ldap_entries_page_page_get_actions_group (BrowserPage *page);
static const gchar *ldap_entries_page_page_get_actions_ui (BrowserPage *page);
static GtkWidget *ldap_entries_page_page_get_tab_label (BrowserPage *page, GtkWidget **out_close_button);
-
-/* properties */
-enum {
- PROP_0,
-};
-
static GObjectClass *parent_class = NULL;
@@ -97,10 +84,6 @@ ldap_entries_page_class_init (LdapEntriesPageClass *klass)
parent_class = g_type_class_peek_parent (klass);
- /* Properties */
- object_class->set_property = ldap_entries_page_set_property;
- object_class->get_property = ldap_entries_page_get_property;
-
object_class->dispose = ldap_entries_page_dispose;
}
@@ -181,36 +164,6 @@ ldap_entries_page_get_type (void)
return type;
}
-static void
-ldap_entries_page_set_property (GObject *object,
- guint param_id,
- G_GNUC_UNUSED const GValue *value,
- GParamSpec *pspec)
-{
- LdapEntriesPage *ebrowser;
- ebrowser = LDAP_ENTRIES_PAGE (object);
- switch (param_id) {
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
- break;
- }
-}
-
-static void
-ldap_entries_page_get_property (GObject *object,
- guint param_id,
- G_GNUC_UNUSED GValue *value,
- GParamSpec *pspec)
-{
- LdapEntriesPage *ebrowser;
- ebrowser = LDAP_ENTRIES_PAGE (object);
- switch (param_id) {
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
- break;
- }
-}
-
static gchar *
ldap_entries_page_to_selection (G_GNUC_UNUSED LdapEntriesPage *ebrowser)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]