[nautilus-actions] Get rid of GTK_CHECK_VERSION less than (required) 3.4



commit 21d7dc866d5efe0d68535f87f845174f2da187bb
Author: Pierre Wieser <pwieser trychlos org>
Date:   Wed Feb 15 12:47:46 2017 +0100

    Get rid of GTK_CHECK_VERSION less than (required) 3.4

 src/core/fma-gtk-utils.c        |    8 -------
 src/core/fma-importer-ask.c     |    4 ---
 src/ui/base-keysyms.h           |   20 -----------------
 src/ui/fma-assistant-export.c   |   10 --------
 src/ui/fma-assistant-import.c   |   44 ---------------------------------------
 src/ui/fma-icon-chooser.c       |    4 ---
 src/ui/fma-preferences-editor.c |    4 ---
 src/ui/fma-tree-model-dnd.c     |   26 ++--------------------
 8 files changed, 3 insertions(+), 117 deletions(-)
---
diff --git a/src/core/fma-gtk-utils.c b/src/core/fma-gtk-utils.c
index 0a473bb..71baa03 100644
--- a/src/core/fma-gtk-utils.c
+++ b/src/core/fma-gtk-utils.c
@@ -313,15 +313,7 @@ fma_gtk_utils_set_editable( GObject *widget, gboolean editable )
 {
        GList *renderers, *irender;
 
-/* GtkComboBoxEntry is deprecated from Gtk+3
- * see. http://git.gnome.org/browse/gtk+/commit/?id=9612c648176378bf237ad0e1a8c6c995b0ca7c61
- * while 'has_entry' property exists since 2.24
- */
-#if GTK_CHECK_VERSION( 2,24,0 )
        if( GTK_IS_COMBO_BOX( widget ) && gtk_combo_box_get_has_entry( GTK_COMBO_BOX( widget ))){
-#else
-       if( GTK_IS_COMBO_BOX_ENTRY( widget )){
-#endif
                /* idem as GtkEntry */
                gtk_editable_set_editable( GTK_EDITABLE( gtk_bin_get_child( GTK_BIN( widget ))), editable );
                g_object_set( G_OBJECT( gtk_bin_get_child( GTK_BIN( widget ))), "can-focus", editable, NULL );
diff --git a/src/core/fma-importer-ask.c b/src/core/fma-importer-ask.c
index 78345e0..beaa4d9 100644
--- a/src/core/fma-importer-ask.c
+++ b/src/core/fma-importer-ask.c
@@ -286,10 +286,6 @@ import_ask_new( GtkWindow *parent )
                                }
 
                                initialize_gtk( dialog, toplevel );
-
-#if !GTK_CHECK_VERSION( 2,22,0 )
-                               gtk_dialog_set_has_separator( GTK_DIALOG( toplevel ), FALSE );
-#endif
                        }
                }
                g_object_unref( builder );
diff --git a/src/ui/base-keysyms.h b/src/ui/base-keysyms.h
index 861bd2f..08839c2 100644
--- a/src/ui/base-keysyms.h
+++ b/src/ui/base-keysyms.h
@@ -41,11 +41,6 @@
 
 G_BEGIN_DECLS
 
-/* GDK_KEY_ defines have been defined since Gtk+ 2.21.8 released on 2010-09-14
- * see http://git.gnome.org/browse/gtk+/commit/?id=750c81f43dda6c783372b983e630ecd30b776d7e
- */
-#if GTK_CHECK_VERSION( 2, 21, 8 )
-
 #define NACT_KEY_Escape    (GDK_KEY_Escape)
 #define NACT_KEY_Insert    (GDK_KEY_Insert)
 #define NACT_KEY_Delete    (GDK_KEY_Delete)
@@ -57,21 +52,6 @@ G_BEGIN_DECLS
 #define NACT_KEY_Right     (GDK_KEY_Right)
 #define NACT_KEY_F2        (GDK_KEY_F2)
 
-#else
-
-#define NACT_KEY_Escape    (GDK_Escape)
-#define NACT_KEY_Insert    (GDK_Insert)
-#define NACT_KEY_Delete    (GDK_Delete)
-#define NACT_KEY_Return    (GDK_Return)
-#define NACT_KEY_KP_Delete (GDK_KP_Delete)
-#define NACT_KEY_KP_Enter  (GDK_KP_Enter)
-#define NACT_KEY_KP_Insert (GDK_KP_Insert)
-#define NACT_KEY_Left      (GDK_Left)
-#define NACT_KEY_Right     (GDK_Right)
-#define NACT_KEY_F2        (GDK_F2)
-
-#endif
-
 G_END_DECLS
 
 #endif /* __UI_BASE_KEYSYMS_H__ */
diff --git a/src/ui/fma-assistant-export.c b/src/ui/fma-assistant-export.c
index 3a18371..1bdd65d 100644
--- a/src/ui/fma-assistant-export.c
+++ b/src/ui/fma-assistant-export.c
@@ -671,16 +671,6 @@ assist_prepare_confirm( FMAAssistantExport *window, GtkAssistant *assistant, Gtk
        g_debug( "%s: window=%p, assistant=%p, page=%p",
                        thisfn, ( void * ) window, ( void * ) assistant, ( void * ) page );
 
-#if !GTK_CHECK_VERSION( 3,0,0 )
-       /* Note that, at least, in Gtk 2.20 (Ubuntu 10) and 2.22 (Fedora 14), GtkLabel
-        * queues its resize (when the text is being set), but the actual resize does
-        * not happen immediately - We have to wait until Gtk 3.0, most probably due
-        * to the new width-for-height and height-for-width features...
-        */
-       GtkWidget *vbox = fma_gtk_utils_find_widget_by_name( GTK_CONTAINER( page ), "p4-ConfirmVBox" );
-       gtk_container_set_resize_mode( GTK_CONTAINER( vbox ), GTK_RESIZE_IMMEDIATE );
-#endif
-
        /* display the items to be exported
         */
        text = NULL;
diff --git a/src/ui/fma-assistant-import.c b/src/ui/fma-assistant-import.c
index 0663b2c..178adc3 100644
--- a/src/ui/fma-assistant-import.c
+++ b/src/ui/fma-assistant-import.c
@@ -342,27 +342,6 @@ on_base_initialize_gtk( FMAAssistantImport *dialog )
        if( !dialog->private->dispose_has_run ){
                g_debug( "%s: dialog=%p", thisfn, ( void * ) dialog );
 
-#if !GTK_CHECK_VERSION( 3,0,0 )
-               guint padder = 8;
-               GtkAssistant *assistant = GTK_ASSISTANT( base_window_get_gtk_toplevel( BASE_WINDOW( dialog 
)));
-               /* selecting files */
-               GtkWidget *page = gtk_assistant_get_nth_page( assistant, ASSIST_PAGE_FILES_SELECTION );
-               GtkWidget *container = find_widget_from_page( page, "p1-l2-alignment1" );
-               g_object_set( G_OBJECT( container ), "top_padding", padder, NULL );
-               /* managing duplicates */
-               page = gtk_assistant_get_nth_page( assistant, ASSIST_PAGE_DUPLICATES );
-               container = find_widget_from_page( page, "p2-l2-alignment1" );
-               g_object_set( G_OBJECT( container ), "border_width", padder, NULL );
-               /* summary */
-               page = gtk_assistant_get_nth_page( assistant, ASSIST_PAGE_CONFIRM );
-               container = find_widget_from_page( page, "p3-l2-alignment1" );
-               g_object_set( G_OBJECT( container ), "border_width", padder, NULL );
-               /* import is done */
-               page = gtk_assistant_get_nth_page( assistant, ASSIST_PAGE_DONE );
-               container = find_widget_from_page( page, "p4-l2-alignment1" );
-               g_object_set( G_OBJECT( container ), "border_width", padder, NULL );
-#endif
-
                create_duplicates_treeview_model( dialog );
        }
 }
@@ -584,16 +563,6 @@ prepare_confirm( FMAAssistantImport *window, GtkAssistant *assistant, GtkWidget
        g_debug( "%s: window=%p, assistant=%p, page=%p",
                        thisfn, ( void * ) window, ( void * ) assistant, ( void * ) page );
 
-#if !GTK_CHECK_VERSION( 3,0,0 )
-       /* Note that, at least, in Gtk 2.20 (Ubuntu 10) and 2.22 (Fedora 14), GtkLabel
-        * queues its resize (when the text is being set), but the actual resize does
-        * not happen immediately - We have to wait until Gtk 3.0, most probably due
-        * to the new width-for-height and height-for-width features...
-        */
-       GtkWidget *vbox = find_widget_from_page( page, "p3-ConfirmVBox" );
-       gtk_container_set_resize_mode( GTK_CONTAINER( vbox ), GTK_RESIZE_IMMEDIATE );
-#endif
-
        /* adding list of uris to import
         */
        text = NULL;
@@ -764,15 +733,6 @@ prepare_importdone( FMAAssistantImport *window, GtkAssistant *assistant, GtkWidg
        vbox = find_widget_from_page( page, "p4-SummaryParent" );
        g_return_if_fail( GTK_IS_BOX( vbox ));
 
-#if !GTK_CHECK_VERSION( 3,0,0 )
-       /* Note that, at least, in Gtk 2.20 (Ubuntu 10) and 2.22 (Fedora 14), GtkLabel
-        * queues its resize (when the text is being set), but the actual resize does
-        * not happen immediately - We have to wait until Gtk 3.0, most probably due
-        * to the new width-for-height and height-for-width features...
-        */
-       gtk_container_set_resize_mode( GTK_CONTAINER( vbox ), GTK_RESIZE_IMMEDIATE );
-#endif
-
        /* for each uri
         *      - display the uri
         *  - display a brief import log
@@ -783,11 +743,7 @@ prepare_importdone( FMAAssistantImport *window, GtkAssistant *assistant, GtkWidg
 
                /* display the uri
                 */
-#if GTK_CHECK_VERSION( 3,0,0 )
                file_vbox = gtk_box_new( GTK_ORIENTATION_VERTICAL, 4 );
-#else
-               file_vbox = gtk_vbox_new( FALSE, 4 );
-#endif
                gtk_box_pack_start( GTK_BOX( vbox ), file_vbox, FALSE, FALSE, 0 );
 
                color = result->imported ? "blue" : "red";
diff --git a/src/ui/fma-icon-chooser.c b/src/ui/fma-icon-chooser.c
index d3c7b8d..d62a90f 100644
--- a/src/ui/fma-icon-chooser.c
+++ b/src/ui/fma-icon-chooser.c
@@ -360,10 +360,6 @@ on_base_initialize_gtk( FMAIconChooser *editor, GtkDialog *toplevel, gpointer us
                 */
                GtkDialog *dialog = GTK_DIALOG( base_window_get_gtk_toplevel( BASE_WINDOW( editor )));
                g_signal_connect( G_OBJECT( dialog ), "destroy", G_CALLBACK( on_destroy ), NULL );
-
-#if !GTK_CHECK_VERSION( 2,22,0 )
-               gtk_dialog_set_has_separator( toplevel, FALSE );
-#endif
        }
 }
 
diff --git a/src/ui/fma-preferences-editor.c b/src/ui/fma-preferences-editor.c
index 1b421ce..9a3dec2 100644
--- a/src/ui/fma-preferences-editor.c
+++ b/src/ui/fma-preferences-editor.c
@@ -499,10 +499,6 @@ on_base_initialize_gtk( FMAPreferencesEditor *editor, GtkDialog *toplevel, gpoin
 
                listview = GTK_TREE_VIEW( base_window_get_widget( BASE_WINDOW( editor ), "ProvidersTreeView" 
));
                fma_providers_list_create_model( listview );
-
-#if !GTK_CHECK_VERSION( 2,22,0 )
-               gtk_dialog_set_has_separator( toplevel, FALSE );
-#endif
        }
 }
 
diff --git a/src/ui/fma-tree-model-dnd.c b/src/ui/fma-tree-model-dnd.c
index a4804ee..73bc864 100644
--- a/src/ui/fma-tree-model-dnd.c
+++ b/src/ui/fma-tree-model-dnd.c
@@ -304,13 +304,8 @@ fma_tree_model_dnd_imulti_drag_source_drag_data_get( EggTreeMultiDragSource *dra
 
        selection_data_target = gtk_selection_data_get_target( selection_data );
 
-#if GTK_CHECK_VERSION( 2, 22, 0 )
        context_suggested_action = gdk_drag_context_get_suggested_action( context );
        context_selected_action = gdk_drag_context_get_selected_action( context );
-#else
-       context_suggested_action = context->suggested_action;
-       context_selected_action = context->action;
-#endif
 
        atom_name = gdk_atom_name( selection_data_target );
        g_debug( "%s: drag_source=%p (ref_count=%d), context=%p, suggested action=%d, selection_data=%p, 
rows=%p (count=%d), atom=%s",
@@ -498,14 +493,8 @@ fma_tree_model_dnd_on_drag_begin( GtkWidget *widget, GdkDragContext *context, Ba
 
                model->private->drag_highlight = FALSE;
                model->private->drag_drop = FALSE;
-
                fma_clipboard_dnd_clear( model->private->clipboard );
-
-#if GTK_CHECK_VERSION( 2, 22, 0 )
                context_source_window = gdk_drag_context_get_source_window( context );
-#else
-               context_source_window = context->source_window;
-#endif
 
                gdk_property_change(
                                context_source_window,
@@ -541,13 +530,7 @@ fma_tree_model_dnd_on_drag_end( GtkWidget *widget, GdkDragContext *context, Base
 
                fma_clipboard_dnd_drag_end( model->private->clipboard );
                fma_clipboard_dnd_clear( model->private->clipboard );
-
-#if GTK_CHECK_VERSION( 2, 22, 0 )
                context_source_window = gdk_drag_context_get_source_window( context );
-#else
-               context_source_window = context->source_window;
-#endif
-
                gdk_property_delete( context_source_window, XDS_ATOM );
        }
 }
@@ -1120,13 +1103,10 @@ get_xds_atom_value( GdkDragContext *context )
        gint actual_length;
        GdkWindow *context_source_window;
 
-#if GTK_CHECK_VERSION( 2, 22, 0 )
-               context_source_window = gdk_drag_context_get_source_window( context );
-#else
-               context_source_window = context->source_window;
-#endif
-
        g_return_val_if_fail( context != NULL, NULL );
+
+       context_source_window = gdk_drag_context_get_source_window( context );
+
        g_return_val_if_fail( context_source_window != NULL, NULL );
 
        gdk_property_get( context_source_window,                /* a GdkWindow */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]