Merge lp:~tuxator/midori/glib-bump into lp:midori

Proposed by Paweł Forysiuk
Status: Merged
Approved by: Cris Dywan
Approved revision: 6236
Merged at revision: 6236
Proposed branch: lp:~tuxator/midori/glib-bump
Merge into: lp:midori
Diff against target: 359 lines (+3/-155)
11 files modified
extensions/cookie-manager/cookie-manager-page.c (+0/-8)
extensions/feed-panel/feed-panel.c (+0/-8)
extensions/status-clock.c (+0/-9)
katze/gtk3-compat.h (+0/-9)
katze/midori-paths.vala (+0/-6)
midori/midori-app.c (+0/-6)
midori/midori-download.vala (+0/-6)
midori/midori-preferences.c (+0/-2)
midori/sokoke.c (+0/-31)
panels/midori-history.c (+2/-54)
wscript (+1/-16)
To merge this branch: bzr merge lp:~tuxator/midori/glib-bump
Reviewer Review Type Date Requested Status
Cris Dywan Approve
Review via email: mp+171676@code.launchpad.net

Commit message

Bump glib2 version to 2.32.4

To post a comment you must log in.
Revision history for this message
Cris Dywan (kalikiana) wrote :

Looks decent.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'extensions/cookie-manager/cookie-manager-page.c'
--- extensions/cookie-manager/cookie-manager-page.c 2013-06-21 23:18:01 +0000
+++ extensions/cookie-manager/cookie-manager-page.c 2013-06-26 21:57:40 +0000
@@ -660,17 +660,9 @@
660 if (cookie->expires != NULL)660 if (cookie->expires != NULL)
661 {661 {
662 time_t expiration_time = soup_date_to_time_t(cookie->expires);662 time_t expiration_time = soup_date_to_time_t(cookie->expires);
663 #if GLIB_CHECK_VERSION (2, 26, 0)
664 GDateTime* date = g_date_time_new_from_unix_local(expiration_time);663 GDateTime* date = g_date_time_new_from_unix_local(expiration_time);
665 expires = g_date_time_format(date, "%c");664 expires = g_date_time_format(date, "%c");
666 g_date_time_unref(date);665 g_date_time_unref(date);
667 #else
668 static gchar date_fmt[512];
669 const struct tm *tm = localtime(&expiration_time);
670 /* Some GCC versions falsely complain about "%c" */
671 strftime(date_fmt, sizeof(date_fmt), "%c", tm);
672 expires = g_strdup(date_fmt);
673 #endif
674 }666 }
675 else667 else
676 expires = g_strdup(_("At the end of the session"));668 expires = g_strdup(_("At the end of the session"));
677669
=== modified file 'extensions/feed-panel/feed-panel.c'
--- extensions/feed-panel/feed-panel.c 2013-06-21 23:18:01 +0000
+++ extensions/feed-panel/feed-panel.c 2013-06-26 21:57:40 +0000
@@ -359,17 +359,9 @@
359 g_assert (KATZE_IS_ARRAY (parent));359 g_assert (KATZE_IS_ARRAY (parent));
360 if (added)360 if (added)
361 {361 {
362 #if GLIB_CHECK_VERSION (2, 26, 0)
363 GDateTime* date = g_date_time_new_from_unix_local (added);362 GDateTime* date = g_date_time_new_from_unix_local (added);
364 gchar* pretty = g_date_time_format (date, "%c");363 gchar* pretty = g_date_time_format (date, "%c");
365 g_date_time_unref (date);364 g_date_time_unref (date);
366 #else
367 static gchar date_fmt[512];
368 const struct tm *tm = localtime (&added);
369 /* Some GCC versions falsely complain about "%c" */
370 strftime (date_fmt, sizeof (date_fmt), "%c", tm);
371 gchar* pretty = g_strdup (date_fmt);
372 #endif
373365
374 /* i18n: The local date a feed was last updated */366 /* i18n: The local date a feed was last updated */
375 gchar* last_updated = g_strdup_printf (C_("Feed", "Last updated: %s."), pretty);367 gchar* last_updated = g_strdup_printf (C_("Feed", "Last updated: %s."), pretty);
376368
=== modified file 'extensions/status-clock.c'
--- extensions/status-clock.c 2012-12-05 20:12:30 +0000
+++ extensions/status-clock.c 2013-06-26 21:57:40 +0000
@@ -48,21 +48,12 @@
48 GtkWidget* label = g_object_get_data (G_OBJECT (browser), "clock-label");48 GtkWidget* label = g_object_get_data (G_OBJECT (browser), "clock-label");
49 const gchar* format = midori_extension_get_string (extension, "format");49 const gchar* format = midori_extension_get_string (extension, "format");
5050
51 #if GLIB_CHECK_VERSION (2, 26, 0)
52 GDateTime* date = g_date_time_new_now_local ();51 GDateTime* date = g_date_time_new_now_local ();
53 gint seconds = g_date_time_get_seconds (date);52 gint seconds = g_date_time_get_seconds (date);
54 gchar* pretty = g_date_time_format (date, format);53 gchar* pretty = g_date_time_format (date, format);
55 gtk_label_set_label (GTK_LABEL (label), pretty);54 gtk_label_set_label (GTK_LABEL (label), pretty);
56 g_free (pretty);55 g_free (pretty);
57 g_date_time_unref (date);56 g_date_time_unref (date);
58 #else
59 time_t rawtime = time (NULL);
60 struct tm *tm = localtime (&rawtime);
61 gint seconds = tm->tm_sec;
62 char date_fmt[512];
63 strftime (date_fmt, sizeof (date_fmt), format, tm);
64 gtk_label_set_label (GTK_LABEL (label), date_fmt);
65 #endif
6657
67 if (g_strstr_len (format, -1, "%c")58 if (g_strstr_len (format, -1, "%c")
68 || g_strstr_len (format, -1, "%N")59 || g_strstr_len (format, -1, "%N")
6960
=== modified file 'katze/gtk3-compat.h'
--- katze/gtk3-compat.h 2013-06-20 21:19:42 +0000
+++ katze/gtk3-compat.h 2013-06-26 21:57:40 +0000
@@ -41,15 +41,6 @@
41 gtk_widget_get_preferred_size(wdgt, req, NULL)41 gtk_widget_get_preferred_size(wdgt, req, NULL)
42#endif42#endif
4343
44#if !GLIB_CHECK_VERSION (2, 32, 0)
45 #define G_SOURCE_REMOVE FALSE
46 #define G_SOURCE_CONTINUE TRUE
47#endif
48
49#if !GLIB_CHECK_VERSION (2, 30, 0)
50 #define g_format_size(sz) g_format_size_for_display ((goffset)sz)
51#endif
52
53#if GTK_CHECK_VERSION (3, 0, 0)44#if GTK_CHECK_VERSION (3, 0, 0)
54 #define GTK_DIALOG_NO_SEPARATOR 045 #define GTK_DIALOG_NO_SEPARATOR 0
55#endif46#endif
5647
=== modified file 'katze/midori-paths.vala'
--- katze/midori-paths.vala 2013-06-19 20:27:53 +0000
+++ katze/midori-paths.vala 2013-06-26 21:57:40 +0000
@@ -272,18 +272,12 @@
272272
273 public static string make_tmp_dir (string tmpl) {273 public static string make_tmp_dir (string tmpl) {
274 assert (tmp_dir != null);274 assert (tmp_dir != null);
275#if HAVE_GLIB_2_30
276 try {275 try {
277 return DirUtils.make_tmp (tmpl);276 return DirUtils.make_tmp (tmpl);
278 }277 }
279 catch (Error error) {278 catch (Error error) {
280 GLib.error (error.message);279 GLib.error (error.message);
281 }280 }
282#else
283 string folder = Path.build_path (Path.DIR_SEPARATOR_S, Environment.get_tmp_dir (), tmpl);
284 DirUtils.mkdtemp (folder);
285 return folder;
286#endif
287 }281 }
288282
289 public static void init_exec_path (string[] new_command_line) {283 public static void init_exec_path (string[] new_command_line) {
290284
=== modified file 'midori/midori-app.c'
--- midori/midori-app.c 2013-05-30 11:08:14 +0000
+++ midori/midori-app.c 2013-06-26 21:57:40 +0000
@@ -1371,12 +1371,6 @@
1371 }1371 }
1372 #endif1372 #endif
13731373
1374 /* libSoup uses threads, therefore if WebKit is built with libSoup
1375 * or Midori is using it, we need to initialize threads. */
1376 #if !GLIB_CHECK_VERSION (2, 32, 0)
1377 if (!g_thread_supported ()) g_thread_init (NULL);
1378 #endif
1379
1380 /* Midori.Paths uses GFile */1374 /* Midori.Paths uses GFile */
1381 g_type_init ();1375 g_type_init ();
1382 /* Preserve argument vector */1376 /* Preserve argument vector */
13831377
=== modified file 'midori/midori-download.vala'
--- midori/midori-download.vala 2013-06-03 22:48:08 +0000
+++ midori/midori-download.vala 2013-06-26 21:57:40 +0000
@@ -50,12 +50,6 @@
50#endif50#endif
51 }51 }
5252
53#if !HAVE_GLIB_2_30
54 private static string format_size (uint64 size) {
55 return format_size_for_display ((int64)size);
56 }
57#endif
58
59 public static string get_tooltip (WebKit.Download download) {53 public static string get_tooltip (WebKit.Download download) {
60#if !HAVE_WEBKIT254#if !HAVE_WEBKIT2
61 string filename = Path.get_basename (download.destination_uri);55 string filename = Path.get_basename (download.destination_uri);
6256
=== modified file 'midori/midori-preferences.c'
--- midori/midori-preferences.c 2013-06-19 20:24:37 +0000
+++ midori/midori-preferences.c 2013-06-26 21:57:40 +0000
@@ -484,7 +484,6 @@
484 g_signal_connect (settings, "notify::proxy-type",484 g_signal_connect (settings, "notify::proxy-type",
485 G_CALLBACK (midori_preferences_notify_proxy_type_cb), entry);485 G_CALLBACK (midori_preferences_notify_proxy_type_cb), entry);
486 midori_preferences_notify_proxy_type_cb (settings, NULL, entry);486 midori_preferences_notify_proxy_type_cb (settings, NULL, entry);
487 #if GLIB_CHECK_VERSION (2, 26, 0)
488 INDENTED_ADD (gtk_event_box_new ());487 INDENTED_ADD (gtk_event_box_new ());
489 label = gtk_label_new (NULL);488 label = gtk_label_new (NULL);
490 GString* proxy_types = g_string_new (NULL);489 GString* proxy_types = g_string_new (NULL);
@@ -504,7 +503,6 @@
504 g_signal_connect (settings, "notify::proxy-type",503 g_signal_connect (settings, "notify::proxy-type",
505 G_CALLBACK (midori_preferences_notify_proxy_type_cb), label);504 G_CALLBACK (midori_preferences_notify_proxy_type_cb), label);
506 midori_preferences_notify_proxy_type_cb (settings, NULL, label);505 midori_preferences_notify_proxy_type_cb (settings, NULL, label);
507 #endif
508#ifndef HAVE_WEBKIT2506#ifndef HAVE_WEBKIT2
509 if (soup_session_get_feature (webkit_get_default_session (), SOUP_TYPE_CACHE))507 if (soup_session_get_feature (webkit_get_default_session (), SOUP_TYPE_CACHE))
510 {508 {
511509
=== modified file 'midori/sokoke.c'
--- midori/sokoke.c 2013-06-21 20:49:53 +0000
+++ midori/sokoke.c 2013-06-26 21:57:40 +0000
@@ -148,14 +148,6 @@
148 return NULL;148 return NULL;
149149
150 info = g_app_info_get_default_for_uri_scheme (scheme);150 info = g_app_info_get_default_for_uri_scheme (scheme);
151 #if !GLIB_CHECK_VERSION (2, 28, 0)
152 if (!info)
153 {
154 gchar* type = g_strdup_printf ("x-scheme-handler/%s", scheme);
155 info = g_app_info_get_default_for_type (type, FALSE);
156 g_free (type);
157 }
158 #endif
159 if (scheme_ptr != NULL)151 if (scheme_ptr != NULL)
160 *scheme_ptr = scheme;152 *scheme_ptr = scheme;
161 else153 else
@@ -191,10 +183,6 @@
191 return ShellExecuteEx (&info);183 return ShellExecuteEx (&info);
192 #else184 #else
193185
194 #if !GLIB_CHECK_VERSION (2, 28, 0)
195 GAppInfo* info;
196 gchar* scheme;
197 #endif
198 GtkWidget* dialog;186 GtkWidget* dialog;
199 GtkWidget* box;187 GtkWidget* box;
200 gchar* filename;188 gchar* filename;
@@ -211,25 +199,6 @@
211 if (gtk_show_uri (screen, uri, timestamp, error))199 if (gtk_show_uri (screen, uri, timestamp, error))
212 return TRUE;200 return TRUE;
213201
214 #if !GLIB_CHECK_VERSION (2, 28, 0)
215 info = sokoke_default_for_uri (uri, &scheme);
216 if (info)
217 {
218 gchar* argument = g_strdup (&uri[scheme - uri]);
219 GList* uris = g_list_prepend (NULL, argument);
220 if (g_app_info_launch_uris (info, uris, NULL, NULL))
221 {
222 g_list_free (uris);
223 g_free (scheme);
224 g_object_unref (info);
225 return TRUE;
226 }
227 g_list_free (uris);
228 g_free (scheme);
229 g_object_unref (info);
230 }
231 #endif
232
233 {202 {
234 gchar* command = g_strconcat ("xdg-open ", uri, NULL);203 gchar* command = g_strconcat ("xdg-open ", uri, NULL);
235 gboolean result = g_spawn_command_line_async (command, error);204 gboolean result = g_spawn_command_line_async (command, error);
236205
=== modified file 'panels/midori-history.c'
--- panels/midori-history.c 2013-06-21 23:18:01 +0000
+++ panels/midori-history.c 2013-06-26 21:57:40 +0000
@@ -117,37 +117,12 @@
117 return STOCK_HISTORY;117 return STOCK_HISTORY;
118}118}
119119
120#if !GLIB_CHECK_VERSION (2, 26, 0)
121static gint
122sokoke_days_between (const time_t* day1,
123 const time_t* day2)
124{
125 GDate* date1;
126 GDate* date2;
127 gint age;
128
129 date1 = g_date_new ();
130 date2 = g_date_new ();
131
132 g_date_set_time_t (date1, *day1);
133 g_date_set_time_t (date2, *day2);
134
135 age = g_date_days_between (date1, date2);
136
137 g_date_free (date1);
138 g_date_free (date2);
139
140 return age;
141}
142#endif
143
144static gchar*120static gchar*
145midori_history_format_date (KatzeItem *item)121midori_history_format_date (KatzeItem *item)
146{122{
147 gint64 day = katze_item_get_added (item);123 gint64 day = katze_item_get_added (item);
148 gchar* sdate;124 gchar* sdate;
149 gint age;125 gint age;
150 #if GLIB_CHECK_VERSION (2, 26, 0)
151 GDateTime* now = g_date_time_new_now_local ();126 GDateTime* now = g_date_time_new_now_local ();
152 GDateTime* then = g_date_time_new_from_unix_local (day);127 GDateTime* then = g_date_time_new_from_unix_local (day);
153 age = g_date_time_get_day_of_year (now) - g_date_time_get_day_of_year (then);128 age = g_date_time_get_day_of_year (now) - g_date_time_get_day_of_year (then);
@@ -167,31 +142,7 @@
167 sdate = g_date_time_format (then, "%x");142 sdate = g_date_time_format (then, "%x");
168 g_date_time_unref (now);143 g_date_time_unref (now);
169 g_date_time_unref (then);144 g_date_time_unref (then);
170 #else145
171 gchar token[50];
172 time_t current_time;
173
174 current_time = time (NULL);
175 age = sokoke_days_between ((time_t*)&day, &current_time);
176
177 /* A negative age is a date in the future, the clock is probably off */
178 if (age < -1)
179 sdate = g_strdup ("");
180 else if (age > 7 || age < 0)
181 {
182 strftime (token, sizeof (token), "%x", localtime ((time_t*)&day));
183 sdate = g_strdup (token);
184 }
185 else if (age > 6)
186 sdate = g_strdup (_("A week ago"));
187 else if (age > 1)
188 sdate = g_strdup_printf (ngettext ("%d day ago",
189 "%d days ago", (gint)age), (gint)age);
190 else if (age == 0)
191 sdate = g_strdup (_("Today"));
192 else
193 sdate = g_strdup (_("Yesterday"));
194 #endif
195 return sdate;146 return sdate;
196}147}
197148
@@ -466,7 +417,6 @@
466 gtk_tree_model_get (model, &iter, 0, &today, -1);417 gtk_tree_model_get (model, &iter, 0, &today, -1);
467418
468 day = katze_item_get_added (today);419 day = katze_item_get_added (today);
469 #if GLIB_CHECK_VERSION (2, 26, 0)
470 has_today = g_date_time_get_day_of_month (420 has_today = g_date_time_get_day_of_month (
471 g_date_time_new_from_unix_local (day))421 g_date_time_new_from_unix_local (day))
472 == g_date_time_get_day_of_month (422 == g_date_time_get_day_of_month (
@@ -475,10 +425,8 @@
475 g_date_time_new_from_unix_local (day))425 g_date_time_new_from_unix_local (day))
476 == g_date_time_get_day_of_year (426 == g_date_time_get_day_of_year (
477 g_date_time_new_from_unix_local (current_time));427 g_date_time_new_from_unix_local (current_time));
478 #else
479 has_today = sokoke_days_between ((time_t*)&day, &current_time) == 0;
480 #endif
481 g_object_unref (today);428 g_object_unref (today);
429
482 if (has_today)430 if (has_today)
483 {431 {
484 gchar* tooltip = g_markup_escape_text (katze_item_get_uri (item), -1);432 gchar* tooltip = g_markup_escape_text (katze_item_get_uri (item), -1);
485433
=== modified file 'wscript'
--- wscript 2013-06-22 19:53:16 +0000
+++ wscript 2013-06-26 21:57:40 +0000
@@ -219,11 +219,7 @@
219219
220 conf.check (lib='m')220 conf.check (lib='m')
221 check_pkg ('gmodule-2.0')221 check_pkg ('gmodule-2.0')
222 check_pkg ('gio-2.0', '2.22.0')222 check_pkg ('gio-2.0', '2.32.4')
223 if check_version (conf.env['GIO_VERSION'], 2, 30, 0) \
224 and check_version (conf.env['VALAC_VERSION'], 0, 16, 0):
225 # Older Vala doesn't have GLib 2.30 bindings
226 conf.env.append_value ('VALAFLAGS', '-D HAVE_GLIB_2_30')
227223
228 args = ''224 args = ''
229 if Options.platform == 'win32':225 if Options.platform == 'win32':
@@ -302,10 +298,6 @@
302 conf.env['docs'] = option_enabled ('docs')298 conf.env['docs'] = option_enabled ('docs')
303 if 'LINGUAS' in os.environ: conf.env['LINGUAS'] = os.environ['LINGUAS']299 if 'LINGUAS' in os.environ: conf.env['LINGUAS'] = os.environ['LINGUAS']
304300
305 if not check_version (conf.env['GIO_VERSION'], 2, 26, 0):
306 conf.env['addons'] = False
307 Utils.pprint ('YELLOW', 'Glib < 2.26.0, disabling addons')
308
309 conf.check (header_name='unistd.h')301 conf.check (header_name='unistd.h')
310 if not conf.env['HAVE_UNIQUE']:302 if not conf.env['HAVE_UNIQUE']:
311 if Options.platform == 'win32':303 if Options.platform == 'win32':
@@ -366,13 +358,6 @@
366 Utils.pprint ('RED', 'unique 1.0.4 found, this version is erroneous.')358 Utils.pprint ('RED', 'unique 1.0.4 found, this version is erroneous.')
367 Utils.pprint ('RED', 'Please use an older or newer version.')359 Utils.pprint ('RED', 'Please use an older or newer version.')
368 sys.exit (1)360 sys.exit (1)
369 if check_version (conf.env['LIBSOUP_VERSION'], 2, 33, 4) \
370 and check_version (conf.env['GIO_VERSION'], 2, 32, 1) \
371 and not check_version (conf.env['GIO_VERSION'], 2, 32, 3):
372 Utils.pprint ('RED', 'libsoup >= 2.33.4 found with glib >= 2.32.1 < 2.32.3:')
373 Utils.pprint ('RED', 'This combination breaks the download GUI.')
374 Utils.pprint ('RED', 'See https://bugs.launchpad.net/midori/+bug/780133/comments/14')
375 sys.exit (1)
376361
377def set_options (opt):362def set_options (opt):
378 def add_enable_option (option, desc, group=None, disable=False):363 def add_enable_option (option, desc, group=None, disable=False):

Subscribers

People subscribed via source and target branches

to all changes: