summaryrefslogtreecommitdiff
path: root/plugins/filebrowser
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/filebrowser')
-rw-r--r--plugins/filebrowser/pluma-file-browser-utils.c6
-rw-r--r--plugins/filebrowser/pluma-file-browser-view.c23
-rw-r--r--plugins/filebrowser/pluma-file-browser-widget.c34
-rw-r--r--plugins/filebrowser/pluma-file-browser-widget.h8
4 files changed, 4 insertions, 67 deletions
diff --git a/plugins/filebrowser/pluma-file-browser-utils.c b/plugins/filebrowser/pluma-file-browser-utils.c
index 8ffabfbe..3a232f8d 100644
--- a/plugins/filebrowser/pluma-file-browser-utils.c
+++ b/plugins/filebrowser/pluma-file-browser-utils.c
@@ -94,12 +94,8 @@ pluma_file_browser_utils_pixbuf_from_icon (GIcon * icon,
return NULL;
ret = gtk_icon_info_load_icon (info, NULL);
-#if GTK_CHECK_VERSION (3, 0, 0)
g_object_unref (info);
-#else
- gtk_icon_info_free (info);
-#endif
-
+
return ret;
}
diff --git a/plugins/filebrowser/pluma-file-browser-view.c b/plugins/filebrowser/pluma-file-browser-view.c
index 847743b3..65728b0f 100644
--- a/plugins/filebrowser/pluma-file-browser-view.c
+++ b/plugins/filebrowser/pluma-file-browser-view.c
@@ -114,11 +114,7 @@ pluma_file_browser_view_finalize (GObject * object)
PlumaFileBrowserView *obj = PLUMA_FILE_BROWSER_VIEW(object);
if (obj->priv->hand_cursor)
-#if GTK_CHECK_VERSION (3, 0, 0)
g_object_unref (obj->priv->hand_cursor);
-#else
- gdk_cursor_unref (obj->priv->hand_cursor);
-#endif
if (obj->priv->hover_path)
gtk_tree_path_free (obj->priv->hover_path);
@@ -129,11 +125,7 @@ pluma_file_browser_view_finalize (GObject * object)
obj->priv->expand_state = NULL;
}
-#if GTK_CHECK_VERSION (3, 0, 0)
g_object_unref (obj->priv->busy_cursor);
-#else
- gdk_cursor_unref (obj->priv->busy_cursor);
-#endif
G_OBJECT_CLASS (pluma_file_browser_view_parent_class)->
finalize (object);
@@ -316,12 +308,8 @@ set_click_policy_property (PlumaFileBrowserView *obj,
if (click_policy == PLUMA_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE) {
if (obj->priv->hand_cursor == NULL)
-#if GTK_CHECK_VERSION (3, 16, 0)
display = gtk_widget_get_display (GTK_WIDGET (obj));
obj->priv->hand_cursor = gdk_cursor_new_for_display (display, GDK_HAND2);
-#else
- obj->priv->hand_cursor = gdk_cursor_new(GDK_HAND2);
-#endif
} else if (click_policy == PLUMA_FILE_BROWSER_VIEW_CLICK_POLICY_DOUBLE) {
if (obj->priv->hover_path != NULL) {
if (gtk_tree_model_get_iter (GTK_TREE_MODEL (obj->priv->model),
@@ -344,11 +332,7 @@ set_click_policy_property (PlumaFileBrowserView *obj,
}
if (obj->priv->hand_cursor) {
-#if GTK_CHECK_VERSION (3, 0, 0)
g_object_unref (obj->priv->hand_cursor);
-#else
- gdk_cursor_unref (obj->priv->hand_cursor);
-#endif
obj->priv->hand_cursor = NULL;
}
}
@@ -962,9 +946,8 @@ cell_data_cb (GtkTreeViewColumn * tree_column, GtkCellRenderer * cell,
static void
pluma_file_browser_view_init (PlumaFileBrowserView * obj)
{
-#if GTK_CHECK_VERSION (3, 16, 0)
GdkDisplay *display;
-#endif
+
obj->priv = PLUMA_FILE_BROWSER_VIEW_GET_PRIVATE (obj);
obj->priv->column = gtk_tree_view_column_new ();
@@ -999,12 +982,8 @@ pluma_file_browser_view_init (PlumaFileBrowserView * obj)
G_N_ELEMENTS (drag_source_targets),
GDK_ACTION_COPY);
-#if GTK_CHECK_VERSION (3, 16, 0)
display = gtk_widget_get_display (GTK_WIDGET (obj));
obj->priv->busy_cursor = gdk_cursor_new_for_display (display, GDK_WATCH);
-#else
- obj->priv->busy_cursor = gdk_cursor_new (GDK_WATCH);
-#endif
}
static gboolean
diff --git a/plugins/filebrowser/pluma-file-browser-widget.c b/plugins/filebrowser/pluma-file-browser-widget.c
index 7cef34cc..535ecbc4 100644
--- a/plugins/filebrowser/pluma-file-browser-widget.c
+++ b/plugins/filebrowser/pluma-file-browser-widget.c
@@ -50,10 +50,6 @@
#define XML_UI_FILE "pluma-file-browser-widget-ui.xml"
#define LOCATION_DATA_KEY "pluma-file-browser-widget-location"
-#if GTK_CHECK_VERSION (3, 0, 0)
-#define gtk_vbox_new(X,Y) gtk_box_new(GTK_ORIENTATION_VERTICAL,Y)
-#endif
-
enum
{
BOOKMARKS_ID,
@@ -240,13 +236,8 @@ static void on_action_filter_binary (GtkAction * action,
static void on_action_bookmark_open (GtkAction * action,
PlumaFileBrowserWidget * obj);
-#if GTK_CHECK_VERSION (3, 0, 0)
PLUMA_PLUGIN_DEFINE_TYPE (PlumaFileBrowserWidget, pluma_file_browser_widget,
GTK_TYPE_BOX)
-#else
-PLUMA_PLUGIN_DEFINE_TYPE (PlumaFileBrowserWidget, pluma_file_browser_widget,
- GTK_TYPE_VBOX)
-#endif
static void
free_name_icon (gpointer data)
@@ -369,11 +360,7 @@ pluma_file_browser_widget_finalize (GObject * object)
cancel_async_operation (obj);
-#if GTK_CHECK_VERSION (3, 0, 0)
g_object_unref (obj->priv->busy_cursor);
-#else
- gdk_cursor_unref (obj->priv->busy_cursor);
-#endif
G_OBJECT_CLASS (pluma_file_browser_widget_parent_class)->finalize (object);
}
@@ -1237,7 +1224,7 @@ create_filter (PlumaFileBrowserWidget * obj)
gtk_widget_show (expander);
gtk_box_pack_start (GTK_BOX (obj), expander, FALSE, FALSE, 0);
- vbox = gtk_vbox_new (FALSE, 3);
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3);
gtk_widget_show (vbox);
obj->priv->filter_expander = expander;
@@ -1261,9 +1248,8 @@ create_filter (PlumaFileBrowserWidget * obj)
static void
pluma_file_browser_widget_init (PlumaFileBrowserWidget * obj)
{
-#if GTK_CHECK_VERSION (3, 16, 0)
GdkDisplay *display;
-#endif
+
obj->priv = PLUMA_FILE_BROWSER_WIDGET_GET_PRIVATE (obj);
obj->priv->bookmarks_hash = g_hash_table_new_full (g_file_hash,
@@ -1272,17 +1258,11 @@ pluma_file_browser_widget_init (PlumaFileBrowserWidget * obj)
free_name_icon);
gtk_box_set_spacing (GTK_BOX (obj), 3);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_orientable_set_orientation (GTK_ORIENTABLE (obj),
GTK_ORIENTATION_VERTICAL);
-#endif
-#if GTK_CHECK_VERSION (3, 16, 0)
display = gtk_widget_get_display (GTK_WIDGET (obj));
obj->priv->busy_cursor = gdk_cursor_new_for_display (display, GDK_WATCH);
-#else
- obj->priv->busy_cursor = gdk_cursor_new (GDK_WATCH);
-#endif
}
/* Private */
@@ -2122,23 +2102,13 @@ set_busy (PlumaFileBrowserWidget *obj, gboolean busy)
if (busy)
{
-#if GTK_CHECK_VERSION (3, 16, 0)
GdkDisplay *display;
GdkCursor *cursor;
display = gtk_widget_get_display (GTK_WIDGET (obj));
cursor = gdk_cursor_new_for_display (display, GDK_WATCH);
-#else
- GdkCursor *cursor;
-
- cursor = gdk_cursor_new (GDK_WATCH);
-#endif
gdk_window_set_cursor (window, cursor);
-#if GTK_CHECK_VERSION (3, 0, 0)
g_object_unref (obj->priv->busy_cursor);
-#else
- gdk_cursor_unref (cursor);
-#endif
}
else
{
diff --git a/plugins/filebrowser/pluma-file-browser-widget.h b/plugins/filebrowser/pluma-file-browser-widget.h
index d7be9e4d..47b0d74e 100644
--- a/plugins/filebrowser/pluma-file-browser-widget.h
+++ b/plugins/filebrowser/pluma-file-browser-widget.h
@@ -48,22 +48,14 @@ gboolean (*PlumaFileBrowserWidgetFilterFunc) (PlumaFileBrowserWidget * obj,
struct _PlumaFileBrowserWidget
{
-#if GTK_CHECK_VERSION (3, 0, 0)
GtkBox parent;
-#else
- GtkVBox parent;
-#endif
PlumaFileBrowserWidgetPrivate *priv;
};
struct _PlumaFileBrowserWidgetClass
{
-#if GTK_CHECK_VERSION (3, 0, 0)
GtkBoxClass parent_class;
-#else
- GtkVBoxClass parent_class;
-#endif
/* Signals */
void (*uri_activated) (PlumaFileBrowserWidget * widget,