[seahorse] Remove more GTK+ 2.x cruft.
- From: Stefan Walter <stefw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [seahorse] Remove more GTK+ 2.x cruft.
- Date: Fri, 2 Sep 2011 11:35:20 +0000 (UTC)
commit c4093fe3b8b33acbde86e6f8e07f3a949c493ca7
Author: Stef Walter <stefw collabora co uk>
Date: Fri Sep 2 13:34:43 2011 +0200
Remove more GTK+ 2.x cruft.
* Removed a bunch of version dependent #ifdefs for drag and drop
src/seahorse-key-manager-store.c | 65 +++++++++++---------------------------
1 files changed, 19 insertions(+), 46 deletions(-)
---
diff --git a/src/seahorse-key-manager-store.c b/src/seahorse-key-manager-store.c
index 170ad32..481ed16 100644
--- a/src/seahorse-key-manager-store.c
+++ b/src/seahorse-key-manager-store.c
@@ -403,29 +403,19 @@ append_text_column (SeahorseKeyManagerStore *skstore, GtkTreeView *view,
static char *
xds_get_atom_value (GdkDragContext *context)
{
- #if GTK_CHECK_VERSION (2,22,0)
- GdkWindow *source_window;
- #endif
+ GdkWindow *source_window;
char *ret;
g_return_val_if_fail (context != NULL, NULL);
-
- #if GTK_CHECK_VERSION (2,22,0)
- source_window = gdk_drag_context_get_source_window (context);
- g_return_val_if_fail (source_window != NULL, NULL);
- #else
- g_return_val_if_fail (context->source_window != NULL, NULL);
- #endif
-
- #if GTK_CHECK_VERSION (2,22,0)
- if (gdk_property_get (source_window,
- #else
- if (gdk_property_get (context->source_window,
- #endif
- XDS_ATOM, TEXT_ATOM,
- 0, MAX_XDS_ATOM_VAL_LEN,
- FALSE, NULL, NULL, NULL,
- (unsigned char **) &ret))
+
+ source_window = gdk_drag_context_get_source_window (context);
+ g_return_val_if_fail (source_window != NULL, NULL);
+
+ if (gdk_property_get (source_window,
+ XDS_ATOM, TEXT_ATOM,
+ 0, MAX_XDS_ATOM_VAL_LEN,
+ FALSE, NULL, NULL, NULL,
+ (unsigned char **) &ret))
return ret;
return NULL;
@@ -434,15 +424,8 @@ xds_get_atom_value (GdkDragContext *context)
static gboolean
xds_context_offers_target (GdkDragContext *context, GdkAtom target)
{
- #if GTK_CHECK_VERSION (2,22,0)
- GList *targets;
-
- targets = gdk_drag_context_list_targets (context);
-
- return (g_list_find (targets, target) != NULL);
- #else
- return (g_list_find (context->targets, target) != NULL);
- #endif
+ GList *targets = gdk_drag_context_list_targets (context);
+ return (g_list_find (targets, target) != NULL);
}
static gboolean
@@ -468,10 +451,7 @@ static gboolean
drag_begin (GtkWidget *widget, GdkDragContext *context, SeahorseKeyManagerStore *skstore)
{
GtkTreeView *view = GTK_TREE_VIEW (widget);
-
- #if GTK_CHECK_VERSION (2,22,0)
- GdkWindow *source_window;
-#endif
+ GdkWindow *source_window;
seahorse_debug ("drag_begin -->");
@@ -482,21 +462,14 @@ drag_begin (GtkWidget *widget, GdkDragContext *context, SeahorseKeyManagerStore
g_list_free (skstore->priv->drag_objects);
skstore->priv->drag_objects = seahorse_key_manager_store_get_selected_objects (view);
-
- #if GTK_CHECK_VERSION (2,22,0)
- if (skstore->priv->drag_objects) {
- source_window = gdk_drag_context_get_source_window (context);
- gdk_property_change (source_window, XDS_ATOM, TEXT_ATOM,
- #else
- if (skstore->priv->drag_objects)
- gdk_property_change (context->source_window, XDS_ATOM, TEXT_ATOM,
- #endif
+
+ if (skstore->priv->drag_objects) {
+ source_window = gdk_drag_context_get_source_window (context);
+ gdk_property_change (source_window, XDS_ATOM, TEXT_ATOM,
8, GDK_PROP_MODE_REPLACE, (guchar*)XDS_FILENAME,
strlen (XDS_FILENAME));
- #if GTK_CHECK_VERSION (2,22,0)
- }
- #endif
-
+ }
+
seahorse_debug ("drag_begin <--");
return skstore->priv->drag_objects ? TRUE : FALSE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]