now min version of glib is 2.20, remove all irrelevent conditionals
authorPaul <paul@claws-mail.org>
Mon, 9 Jun 2014 16:38:01 +0000 (17:38 +0100)
committerPaul <paul@claws-mail.org>
Mon, 9 Jun 2014 16:38:01 +0000 (17:38 +0100)
14 files changed:
src/common/session.c
src/common/utils.c
src/gtk/filesel.c
src/gtk/gtkcmclist.c
src/gtk/gtkcmclist.h
src/gtk/gtkcmctree.c
src/gtk/gtksctree.c
src/gtk/gtkutils.c
src/gtk/gtkvscrollbutton.c
src/inc.c
src/main.c
src/plugins/archive/libarchive_archive.c
src/prefs_customheader.c
src/summaryview.c

index f1af55b..fd6a62a 100644 (file)
@@ -264,14 +264,12 @@ void session_set_timeout(Session *session, guint interval)
 
        session->timeout_interval = interval;
        if (interval > 0) {
-#if GLIB_CHECK_VERSION(2,14,0)
                if (interval % 1000 == 0)
                        session->timeout_tag =
                                g_timeout_add_seconds(interval/1000, session_timeout_cb, session);
                else
-#endif
-               session->timeout_tag =
-                       g_timeout_add(interval, session_timeout_cb, session);
+                       session->timeout_tag =
+                               g_timeout_add(interval, session_timeout_cb, session);
        } else
                session->timeout_tag = 0;
 }
@@ -892,11 +890,5 @@ void session_register_ping(Session *session, gboolean (*ping_cb)(gpointer data))
        session->ping_tag = -1;
 
        if (ping_cb != NULL)
-#if GLIB_CHECK_VERSION(2,14,0)
-               session->ping_tag =
-                       g_timeout_add_seconds(60, ping_cb, session);
-#else
-               session->ping_tag =
-                       g_timeout_add(60*1000, ping_cb, session);
-#endif
+       session->ping_tag = g_timeout_add_seconds(60, ping_cb, session);
 }
index cca8c18..b37a568 100644 (file)
@@ -95,7 +95,7 @@ gboolean superuser_p (void)
 
 
 
-#if !GLIB_CHECK_VERSION(2, 7, 0) && !defined(G_OS_UNIX)
+#if !defined(G_OS_UNIX)
 gint g_chdir(const gchar *path)
 {
 #ifdef G_OS_WIN32
@@ -208,7 +208,7 @@ int g_open(const gchar *filename, int flags, int mode)
        return open(filename, flags, mode);
 #endif
 }
-#endif /* GLIB_CHECK_VERSION && G_OS_UNIX */
+#endif /* G_OS_UNIX */
 
 
 #ifdef G_OS_WIN32
index b8276ae..cced6ec 100644 (file)
@@ -96,9 +96,7 @@ static GList *filesel_create(const gchar *title, const gchar *path,
                                NULL);
 #endif
 
-#if GLIB_CHECK_VERSION(2,16,0)
        gtk_file_chooser_set_local_only(GTK_FILE_CHOOSER(chooser), FALSE);
-#endif
 
        if (filter != NULL) {
                GtkFileFilter *file_filter = gtk_file_filter_new();
index 3a28036..b280758 100644 (file)
@@ -1132,12 +1132,6 @@ gtk_cmclist_init (GtkCMCList *clist)
   GTK_CMCLIST_SET_FLAG (clist, CMCLIST_DRAW_DRAG_LINE);
   GTK_CMCLIST_SET_FLAG (clist, CMCLIST_USE_DRAG_ICONS);
 
-
-#if !GLIB_CHECK_VERSION(2,10,0)
-  clist->row_mem_chunk = NULL;
-  clist->cell_mem_chunk = NULL;
-#endif
-
   clist->freeze_count = 0;
 
   clist->rows = 0;
@@ -1210,22 +1204,6 @@ gtk_cmclist_constructor (GType                  type,
                                                                construct_properties);
   GtkCMCList *clist = GTK_CMCLIST (object);
   
-#if !GLIB_CHECK_VERSION(2,10,0)
-  if (!clist->row_mem_chunk)
-    clist->row_mem_chunk = g_mem_chunk_new ("clist row mem chunk",
-                                           sizeof (GtkCMCListRow),
-                                           sizeof (GtkCMCListRow) *
-                                           CMCLIST_OPTIMUM_SIZE, 
-                                           G_ALLOC_AND_FREE);
-  
-  if (!clist->cell_mem_chunk)
-    clist->cell_mem_chunk = g_mem_chunk_new ("clist cell mem chunk",
-                                            sizeof (GtkCMCell) * clist->columns,
-                                            sizeof (GtkCMCell) * clist->columns *
-                                            CMCLIST_OPTIMUM_SIZE, 
-                                            G_ALLOC_AND_FREE);
-#endif
-
   /* allocate memory for columns */
   clist->column = columns_new (clist);
   
@@ -1306,12 +1284,7 @@ gtk_cmclist_set_hadjustment (GtkCMCList      *clist,
 
   if (clist->hadjustment)
     {
-#if GLIB_CHECK_VERSION(2,10,0)
       g_object_ref_sink (clist->hadjustment);
-#else
-      gtk_object_ref (G_OBJECT (clist->hadjustment));
-      gtk_object_sink (G_OBJECT (clist->hadjustment));
-#endif
       g_signal_connect (G_OBJECT (clist->hadjustment), "value_changed",
                          G_CALLBACK( hadjustment_value_changed),
                          (gpointer) clist);
@@ -1355,12 +1328,7 @@ gtk_cmclist_set_vadjustment (GtkCMCList      *clist,
 
   if (clist->vadjustment)
     {
-#if GLIB_CHECK_VERSION(2,10,0)
       g_object_ref_sink (clist->vadjustment);
-#else
-      gtk_object_ref (G_OBJECT (clist->vadjustment));
-      gtk_object_sink (G_OBJECT (clist->vadjustment));
-#endif
 
       g_signal_connect (G_OBJECT (clist->vadjustment), "value_changed",
                          G_CALLBACK(vadjustment_value_changed),
@@ -4575,10 +4543,6 @@ gtk_cmclist_finalize (GObject *object)
 
   columns_delete (clist);
 
-#if !GLIB_CHECK_VERSION(2,10,0)
-  g_mem_chunk_destroy (clist->cell_mem_chunk);
-  g_mem_chunk_destroy (clist->row_mem_chunk);
-#endif
   G_OBJECT_CLASS (gtk_cmclist_parent_class)->finalize (object);
 }
 
@@ -6466,13 +6430,8 @@ row_new (GtkCMCList *clist)
   int i;
   GtkCMCListRow *clist_row;
 
-#if GLIB_CHECK_VERSION(2,10,0)
   clist_row = g_slice_new (GtkCMCListRow);
   clist_row->cell = g_slice_alloc (sizeof (GtkCMCell) * clist->columns);
-#else
-  clist_row = g_chunk_new (GtkCMCListRow, (GMemChunk *)clist->row_mem_chunk);
-  clist_row->cell = g_chunk_new (GtkCMCell, (GMemChunk *)clist->cell_mem_chunk);
-#endif
 
   for (i = 0; i < clist->columns; i++)
     {
@@ -6521,13 +6480,8 @@ row_delete (GtkCMCList    *clist,
   if (clist_row->destroy)
     clist_row->destroy (clist_row->data);
 
-#if GLIB_CHECK_VERSION(2,10,0)  
   g_slice_free1 (sizeof (GtkCMCell) * clist->columns, clist_row->cell);
   g_slice_free (GtkCMCListRow, clist_row);
-#else
-  g_mem_chunk_free ((GMemChunk *)clist->cell_mem_chunk, clist_row->cell);
-  g_mem_chunk_free ((GMemChunk *)clist->row_mem_chunk, clist_row);
-#endif
 }
 
 /* FOCUS FUNCTIONS
index 17f1e3a..4d2bc5a 100644 (file)
@@ -153,13 +153,8 @@ struct _GtkCMCList
   
   guint16 flags;
   
-#if !GLIB_CHECK_VERSION(2,10,0)
-  GMemChunk *row_mem_chunk;
-  GMemChunk *cell_mem_chunk;
-#else
   gpointer reserved1;
   gpointer reserved2;
-#endif
   guint freeze_count;
   
   /* allocation rectangle after the conatiner_border_width
index f8d9541..f8f80a6 100644 (file)
@@ -65,11 +65,7 @@ gtk_cmctree_pos_get_type (void)
       { GTK_CMCTREE_POS_AFTER, "GTK_CMCTREE_POS_AFTER", "after" },
       { 0, NULL, NULL }
     };
-#if GLIB_CHECK_VERSION(2,10,0)
     etype = g_enum_register_static (g_intern_static_string ("GtkCMCTreePos"), values);
-#else
-    etype = g_enum_register_static ("GtkCMCTreePos", values);
-#endif
   }
   return etype;
 }
@@ -82,11 +78,7 @@ gtk_cmctree_line_style_get_type (void)
       { GTK_CMCTREE_LINES_NONE, "GTK_CMCTREE_LINES_NONE", "none" },
       { 0, NULL, NULL }
     };
-#if GLIB_CHECK_VERSION(2,10,0)
     etype = g_enum_register_static (g_intern_static_string ("GtkCMCTreeLineStyle"), values);
-#else
-    etype = g_enum_register_static ("GtkCMCTreeLineStyle", values);
-#endif
   }
   return etype;
 }
@@ -100,11 +92,7 @@ gtk_cmctree_expander_style_get_type (void)
       { GTK_CMCTREE_EXPANDER_TRIANGLE, "GTK_CMCTREE_EXPANDER_TRIANGLE", "triangle" },
       { 0, NULL, NULL }
     };
-#if GLIB_CHECK_VERSION(2,10,0)
     etype = g_enum_register_static (g_intern_static_string ("GtkCMCTreeExpanderStyle"), values);
-#else
-    etype = g_enum_register_static ("GtkCMCTreeExpanderStyle", values);
-#endif
   }
   return etype;
 }
@@ -122,11 +110,7 @@ gtk_cmctree_expansion_type_get_type (void)
       { GTK_CMCTREE_EXPANSION_TOGGLE_RECURSIVE, "GTK_CMCTREE_EXPANSION_TOGGLE_RECURSIVE", "toggle-recursive" },
       { 0, NULL, NULL }
     };
-#if GLIB_CHECK_VERSION(2,10,0)
-    etype = g_enum_register_static (g_intern_static_string ("GtkCMCTreeExpansionType"), values);
-#else
-    etype = g_enum_register_static ("GtkCMCTreeExpansionType", values);
-#endif
+   etype = g_enum_register_static (g_intern_static_string ("GtkCMCTreeExpansionType"), values);
   }
   return etype;
 }
@@ -1211,29 +1195,11 @@ gtk_cmctree_set_arg (GObject *object,
   switch (arg_id)
     {
     case ARG_N_COLUMNS: /* construct-only arg, only set at construction time */
-#if !GLIB_CHECK_VERSION(2,10,0)
-      cm_return_if_fail (clist->row_mem_chunk == NULL);
-#endif
       clist->columns = MAX (1, g_value_get_uint (value));
-#if !GLIB_CHECK_VERSION(2,10,0)
-      clist->row_mem_chunk = g_mem_chunk_new ("ctree row mem chunk",
-                                             sizeof (GtkCMCTreeRow),
-                                             sizeof (GtkCMCTreeRow)
-                                             * CLIST_OPTIMUM_SIZE,
-                                             G_ALLOC_AND_FREE);
-      clist->cell_mem_chunk = g_mem_chunk_new ("ctree cell mem chunk",
-                                              sizeof (GtkCMCell) * clist->columns,
-                                              sizeof (GtkCMCell) * clist->columns
-                                              * CLIST_OPTIMUM_SIZE,
-                                              G_ALLOC_AND_FREE);
-#endif
       ctree->tree_column = CLAMP (ctree->tree_column, 0, clist->columns);
       break;
     case ARG_TREE_COLUMN: /* construct-only arg, only set at construction time */
       ctree->tree_column = g_value_get_uint (value);
-#if !GLIB_CHECK_VERSION(2,10,0)
-      if (clist->row_mem_chunk)
-#endif
         ctree->tree_column = CLAMP (ctree->tree_column, 0, clist->columns);
       break;
     case ARG_INDENT:
@@ -2573,13 +2539,8 @@ row_new (GtkCMCTree *ctree)
   int i;
 
   clist = GTK_CMCLIST (ctree);
-#if GLIB_CHECK_VERSION(2,10,0)
   ctree_row = g_slice_new (GtkCMCTreeRow);
   ctree_row->row.cell = g_slice_alloc (sizeof (GtkCMCell) * clist->columns);
-#else
-  ctree_row = g_chunk_new (GtkCMCTreeRow, (GMemChunk *)clist->row_mem_chunk);
-  ctree_row->row.cell = g_chunk_new (GtkCMCell, (GMemChunk *)clist->cell_mem_chunk);
-#endif
 
   for (i = 0; i < clist->columns; i++)
     {
@@ -2658,13 +2619,8 @@ row_delete (GtkCMCTree    *ctree,
       dnotify (ddata);
     }
 
-#if GLIB_CHECK_VERSION(2,10,0)  
   g_slice_free1 (sizeof (GtkCMCell) * clist->columns, ctree_row->row.cell);
   g_slice_free (GtkCMCTreeRow, ctree_row);
-#else
-  g_mem_chunk_free ((GMemChunk *)clist->cell_mem_chunk, ctree_row->row.cell);
-  g_mem_chunk_free ((GMemChunk *)clist->row_mem_chunk, ctree_row);
-#endif
 }
 
 static void
index f08a8b8..560ab42 100644 (file)
@@ -1584,13 +1584,8 @@ srow_new (GtkCMCTree *ctree)
   int i;
 
   clist = GTK_CMCLIST (ctree);
-#if GLIB_CHECK_VERSION(2,10,0)
   ctree_row = g_slice_new (GtkCMCTreeRow);
   ctree_row->row.cell = g_slice_alloc (sizeof (GtkCMCell) * clist->columns);
-#else
-  ctree_row = g_chunk_new (GtkCMCTreeRow, (GMemChunk *)clist->row_mem_chunk);
-  ctree_row->row.cell = g_chunk_new (GtkCMCell, (GMemChunk *)clist->cell_mem_chunk);
-#endif
   for (i = 0; i < clist->columns; i++)
     {
       ctree_row->row.cell[i].type = GTK_CMCELL_EMPTY;
@@ -1669,13 +1664,8 @@ srow_delete (GtkCMCTree    *ctree,
       dnotify (ddata);
     }
 
-#if GLIB_CHECK_VERSION(2,10,0)  
   g_slice_free1 (sizeof (GtkCMCell) * clist->columns, ctree_row->row.cell);
   g_slice_free (GtkCMCTreeRow, ctree_row);
-#else
-  g_mem_chunk_free ((GMemChunk *)clist->cell_mem_chunk, ctree_row->row.cell);
-  g_mem_chunk_free ((GMemChunk *)clist->row_mem_chunk, ctree_row);
-#endif
 }
 
 static void
index d547917..5bcea99 100644 (file)
@@ -686,34 +686,19 @@ void gtkut_widget_init(void)
 
        clist = gtk_cmclist_new(1);
        g_object_ref(G_OBJECT(clist));
-#if GLIB_CHECK_VERSION(2,10,0)
        g_object_ref_sink (G_OBJECT(clist));
-#else
-       gtk_object_ref (G_OBJECT(clist));
-       gtk_object_sink (G_OBJECT(clist));
-#endif
        gtkut_clist_bindings_add(clist);
        g_object_unref(G_OBJECT(clist));
 
        clist = gtk_cmctree_new(1, 0);
        g_object_ref(G_OBJECT(clist));
-#if GLIB_CHECK_VERSION(2,10,0)
        g_object_ref_sink (G_OBJECT(clist));
-#else
-       gtk_object_ref (G_OBJECT(clist));
-       gtk_object_sink (G_OBJECT(clist));
-#endif
        gtkut_clist_bindings_add(clist);
        g_object_unref(G_OBJECT(clist));
 
        clist = gtk_sctree_new_with_titles(1, 0, NULL);
        g_object_ref(G_OBJECT(clist));
-#if GLIB_CHECK_VERSION(2,10,0)
        g_object_ref_sink (G_OBJECT(clist));
-#else
-       gtk_object_ref (G_OBJECT(clist));
-       gtk_object_sink (G_OBJECT(clist));
-#endif
        gtkut_clist_bindings_add(clist);
        g_object_unref(G_OBJECT(clist));
 }
index 89ffacc..edf0775 100644 (file)
@@ -241,12 +241,7 @@ void gtk_vscrollbutton_set_adjustment(GtkVScrollbutton *scrollbutton,
 
        scrollbutton->adjustment = adjustment;
        g_object_ref(G_OBJECT(adjustment));
-#if GLIB_CHECK_VERSION(2,10,0)
        g_object_ref_sink (G_OBJECT(adjustment));
-#else
-       gtk_object_ref (G_OBJECT (adjustment));
-       gtk_object_sink (G_OBJECT (adjustment));
-#endif
     }
 }
 
index c8c68ac..ebf2cc3 100644 (file)
--- a/src/inc.c
+++ b/src/inc.c
@@ -1458,14 +1458,12 @@ static void inc_autocheck_timer_set_interval(guint interval)
           the common preferences */
        if (prefs_common.autochk_newmail && autocheck_data
            && prefs_common.work_offline == FALSE) {
-#if GLIB_CHECK_VERSION(2,14,0)
                if (interval % 1000 == 0)
                        autocheck_timer =
                                g_timeout_add_seconds(interval/1000, inc_autocheck_func, autocheck_data);
                else
-#endif
-               autocheck_timer = g_timeout_add
-                       (interval, inc_autocheck_func, autocheck_data);
+                       autocheck_timer = g_timeout_add
+                               (interval, inc_autocheck_func, autocheck_data);
                debug_print("added timer = %d\n", autocheck_timer);
        }
 }
index 6d0a1c0..813bb47 100644 (file)
@@ -1754,11 +1754,7 @@ static GString * parse_cmd_compose_from_file(const gchar *fn)
                        g_string_append_c(headers, '&');
                        g_string_append(headers, tmp);
                        g_string_append_c(headers, '=');
-#if GLIB_CHECK_VERSION(2,16,0)
                        g_string_append_uri_escaped(headers, v, NULL, TRUE);
-#else
-                       G_STRING_APPEND_ENCODED_URI(headers, v);
-#endif 
                }
                g_free(tmp);
        }
@@ -1768,11 +1764,7 @@ static GString * parse_cmd_compose_from_file(const gchar *fn)
        g_free(to);
        g_string_append(body, "?body=");
        while (fgets(fb, sizeof(fb), fp)) {
-#if GLIB_CHECK_VERSION(2,16,0)
                g_string_append_uri_escaped(body, fb, NULL, TRUE);
-#else
-               G_STRING_APPEND_ENCODED_URI(body, fb);
-#endif
        }
        if (!isstdin)
                fclose(fp);
index e4d7cb3..478202c 100644 (file)
@@ -198,9 +198,6 @@ gboolean before_date(time_t msg_mtime, const gchar* before) {
     GDate*      date;
     GDate*      file_t;
     gboolean    res;
-#if !GLIB_CHECK_VERSION(2,10,0)
-    GTime       gtime;
-#endif
 
     debug_print("Cut-off date: %s\n", before);
     if ((date = iso2GDate(before)) == NULL) {
@@ -209,12 +206,7 @@ gboolean before_date(time_t msg_mtime, const gchar* before) {
     }
 
     file_t = g_date_new();
-#if GLIB_CHECK_VERSION(2,10,0)
     g_date_set_time_t(file_t, msg_mtime);
-#else
-    gtime = (GTime) msg_mtime;
-    g_date_set_time(file_t, gtime);
-#endif
 
     if (debug_get_mode()) {
         pos = g_new0(char, 100);
index b5cec77..3a84d7c 100644 (file)
@@ -914,12 +914,7 @@ static gboolean prefs_custom_header_selected(GtkTreeSelection *selector,
                pixbuf = gtk_image_get_pixbuf(preview);
                gtk_image_set_from_pixbuf (GTK_IMAGE(customhdr.preview), pixbuf);
                gtk_widget_show(customhdr.preview);
-#if GLIB_CHECK_VERSION(2,10,0)
                g_object_ref_sink (G_OBJECT(preview));
-#else
-               gtk_object_ref (G_OBJECT(preview));
-               gtk_object_sink (G_OBJECT(preview));
-#endif
        } 
 #if HAVE_LIBCOMPFACE
 else if (!strcmp2("X-Face", ch->name)) {
@@ -927,12 +922,7 @@ else if (!strcmp2("X-Face", ch->name)) {
                pixbuf = gtk_image_get_pixbuf(preview);
                gtk_image_set_from_pixbuf (GTK_IMAGE(customhdr.preview), pixbuf);
                gtk_widget_show(customhdr.preview);
-#if GLIB_CHECK_VERSION(2,10,0)
                g_object_ref_sink (G_OBJECT(preview));
-#else
-               gtk_object_ref (G_OBJECT(preview));
-               gtk_object_sink (G_OBJECT(preview));
-#endif
        } 
 #endif
 else {
index ae63375..bb1358c 100644 (file)
@@ -3632,16 +3632,9 @@ static void summary_display_msg_full(SummaryView *summaryview,
                        data->msginfo = procmsg_msginfo_new_ref(msginfo);
                        if (summaryview->mark_as_read_timeout_tag != 0)
                                g_source_remove(summaryview->mark_as_read_timeout_tag);
-
-#if GLIB_CHECK_VERSION(2,14,0)
                        summaryview->mark_as_read_timeout_tag = 
                                g_timeout_add_seconds(prefs_common.mark_as_read_delay,
                                        msginfo_mark_as_read_timeout, data);
-#else
-                       summaryview->mark_as_read_timeout_tag = 
-                               g_timeout_add(prefs_common.mark_as_read_delay * 1000,
-                                       msginfo_mark_as_read_timeout, data);
-#endif
                } else if (new_window || !prefs_common.mark_as_read_on_new_window) {
                        msginfo_mark_as_read(summaryview, msginfo, row);
                }