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
1=== modified file 'extensions/cookie-manager/cookie-manager-page.c'
2--- extensions/cookie-manager/cookie-manager-page.c 2013-06-21 23:18:01 +0000
3+++ extensions/cookie-manager/cookie-manager-page.c 2013-06-26 21:57:40 +0000
4@@ -660,17 +660,9 @@
5 if (cookie->expires != NULL)
6 {
7 time_t expiration_time = soup_date_to_time_t(cookie->expires);
8- #if GLIB_CHECK_VERSION (2, 26, 0)
9 GDateTime* date = g_date_time_new_from_unix_local(expiration_time);
10 expires = g_date_time_format(date, "%c");
11 g_date_time_unref(date);
12- #else
13- static gchar date_fmt[512];
14- const struct tm *tm = localtime(&expiration_time);
15- /* Some GCC versions falsely complain about "%c" */
16- strftime(date_fmt, sizeof(date_fmt), "%c", tm);
17- expires = g_strdup(date_fmt);
18- #endif
19 }
20 else
21 expires = g_strdup(_("At the end of the session"));
22
23=== modified file 'extensions/feed-panel/feed-panel.c'
24--- extensions/feed-panel/feed-panel.c 2013-06-21 23:18:01 +0000
25+++ extensions/feed-panel/feed-panel.c 2013-06-26 21:57:40 +0000
26@@ -359,17 +359,9 @@
27 g_assert (KATZE_IS_ARRAY (parent));
28 if (added)
29 {
30- #if GLIB_CHECK_VERSION (2, 26, 0)
31 GDateTime* date = g_date_time_new_from_unix_local (added);
32 gchar* pretty = g_date_time_format (date, "%c");
33 g_date_time_unref (date);
34- #else
35- static gchar date_fmt[512];
36- const struct tm *tm = localtime (&added);
37- /* Some GCC versions falsely complain about "%c" */
38- strftime (date_fmt, sizeof (date_fmt), "%c", tm);
39- gchar* pretty = g_strdup (date_fmt);
40- #endif
41
42 /* i18n: The local date a feed was last updated */
43 gchar* last_updated = g_strdup_printf (C_("Feed", "Last updated: %s."), pretty);
44
45=== modified file 'extensions/status-clock.c'
46--- extensions/status-clock.c 2012-12-05 20:12:30 +0000
47+++ extensions/status-clock.c 2013-06-26 21:57:40 +0000
48@@ -48,21 +48,12 @@
49 GtkWidget* label = g_object_get_data (G_OBJECT (browser), "clock-label");
50 const gchar* format = midori_extension_get_string (extension, "format");
51
52- #if GLIB_CHECK_VERSION (2, 26, 0)
53 GDateTime* date = g_date_time_new_now_local ();
54 gint seconds = g_date_time_get_seconds (date);
55 gchar* pretty = g_date_time_format (date, format);
56 gtk_label_set_label (GTK_LABEL (label), pretty);
57 g_free (pretty);
58 g_date_time_unref (date);
59- #else
60- time_t rawtime = time (NULL);
61- struct tm *tm = localtime (&rawtime);
62- gint seconds = tm->tm_sec;
63- char date_fmt[512];
64- strftime (date_fmt, sizeof (date_fmt), format, tm);
65- gtk_label_set_label (GTK_LABEL (label), date_fmt);
66- #endif
67
68 if (g_strstr_len (format, -1, "%c")
69 || g_strstr_len (format, -1, "%N")
70
71=== modified file 'katze/gtk3-compat.h'
72--- katze/gtk3-compat.h 2013-06-20 21:19:42 +0000
73+++ katze/gtk3-compat.h 2013-06-26 21:57:40 +0000
74@@ -41,15 +41,6 @@
75 gtk_widget_get_preferred_size(wdgt, req, NULL)
76 #endif
77
78-#if !GLIB_CHECK_VERSION (2, 32, 0)
79- #define G_SOURCE_REMOVE FALSE
80- #define G_SOURCE_CONTINUE TRUE
81-#endif
82-
83-#if !GLIB_CHECK_VERSION (2, 30, 0)
84- #define g_format_size(sz) g_format_size_for_display ((goffset)sz)
85-#endif
86-
87 #if GTK_CHECK_VERSION (3, 0, 0)
88 #define GTK_DIALOG_NO_SEPARATOR 0
89 #endif
90
91=== modified file 'katze/midori-paths.vala'
92--- katze/midori-paths.vala 2013-06-19 20:27:53 +0000
93+++ katze/midori-paths.vala 2013-06-26 21:57:40 +0000
94@@ -272,18 +272,12 @@
95
96 public static string make_tmp_dir (string tmpl) {
97 assert (tmp_dir != null);
98-#if HAVE_GLIB_2_30
99 try {
100 return DirUtils.make_tmp (tmpl);
101 }
102 catch (Error error) {
103 GLib.error (error.message);
104 }
105-#else
106- string folder = Path.build_path (Path.DIR_SEPARATOR_S, Environment.get_tmp_dir (), tmpl);
107- DirUtils.mkdtemp (folder);
108- return folder;
109-#endif
110 }
111
112 public static void init_exec_path (string[] new_command_line) {
113
114=== modified file 'midori/midori-app.c'
115--- midori/midori-app.c 2013-05-30 11:08:14 +0000
116+++ midori/midori-app.c 2013-06-26 21:57:40 +0000
117@@ -1371,12 +1371,6 @@
118 }
119 #endif
120
121- /* libSoup uses threads, therefore if WebKit is built with libSoup
122- * or Midori is using it, we need to initialize threads. */
123- #if !GLIB_CHECK_VERSION (2, 32, 0)
124- if (!g_thread_supported ()) g_thread_init (NULL);
125- #endif
126-
127 /* Midori.Paths uses GFile */
128 g_type_init ();
129 /* Preserve argument vector */
130
131=== modified file 'midori/midori-download.vala'
132--- midori/midori-download.vala 2013-06-03 22:48:08 +0000
133+++ midori/midori-download.vala 2013-06-26 21:57:40 +0000
134@@ -50,12 +50,6 @@
135 #endif
136 }
137
138-#if !HAVE_GLIB_2_30
139- private static string format_size (uint64 size) {
140- return format_size_for_display ((int64)size);
141- }
142-#endif
143-
144 public static string get_tooltip (WebKit.Download download) {
145 #if !HAVE_WEBKIT2
146 string filename = Path.get_basename (download.destination_uri);
147
148=== modified file 'midori/midori-preferences.c'
149--- midori/midori-preferences.c 2013-06-19 20:24:37 +0000
150+++ midori/midori-preferences.c 2013-06-26 21:57:40 +0000
151@@ -484,7 +484,6 @@
152 g_signal_connect (settings, "notify::proxy-type",
153 G_CALLBACK (midori_preferences_notify_proxy_type_cb), entry);
154 midori_preferences_notify_proxy_type_cb (settings, NULL, entry);
155- #if GLIB_CHECK_VERSION (2, 26, 0)
156 INDENTED_ADD (gtk_event_box_new ());
157 label = gtk_label_new (NULL);
158 GString* proxy_types = g_string_new (NULL);
159@@ -504,7 +503,6 @@
160 g_signal_connect (settings, "notify::proxy-type",
161 G_CALLBACK (midori_preferences_notify_proxy_type_cb), label);
162 midori_preferences_notify_proxy_type_cb (settings, NULL, label);
163- #endif
164 #ifndef HAVE_WEBKIT2
165 if (soup_session_get_feature (webkit_get_default_session (), SOUP_TYPE_CACHE))
166 {
167
168=== modified file 'midori/sokoke.c'
169--- midori/sokoke.c 2013-06-21 20:49:53 +0000
170+++ midori/sokoke.c 2013-06-26 21:57:40 +0000
171@@ -148,14 +148,6 @@
172 return NULL;
173
174 info = g_app_info_get_default_for_uri_scheme (scheme);
175- #if !GLIB_CHECK_VERSION (2, 28, 0)
176- if (!info)
177- {
178- gchar* type = g_strdup_printf ("x-scheme-handler/%s", scheme);
179- info = g_app_info_get_default_for_type (type, FALSE);
180- g_free (type);
181- }
182- #endif
183 if (scheme_ptr != NULL)
184 *scheme_ptr = scheme;
185 else
186@@ -191,10 +183,6 @@
187 return ShellExecuteEx (&info);
188 #else
189
190- #if !GLIB_CHECK_VERSION (2, 28, 0)
191- GAppInfo* info;
192- gchar* scheme;
193- #endif
194 GtkWidget* dialog;
195 GtkWidget* box;
196 gchar* filename;
197@@ -211,25 +199,6 @@
198 if (gtk_show_uri (screen, uri, timestamp, error))
199 return TRUE;
200
201- #if !GLIB_CHECK_VERSION (2, 28, 0)
202- info = sokoke_default_for_uri (uri, &scheme);
203- if (info)
204- {
205- gchar* argument = g_strdup (&uri[scheme - uri]);
206- GList* uris = g_list_prepend (NULL, argument);
207- if (g_app_info_launch_uris (info, uris, NULL, NULL))
208- {
209- g_list_free (uris);
210- g_free (scheme);
211- g_object_unref (info);
212- return TRUE;
213- }
214- g_list_free (uris);
215- g_free (scheme);
216- g_object_unref (info);
217- }
218- #endif
219-
220 {
221 gchar* command = g_strconcat ("xdg-open ", uri, NULL);
222 gboolean result = g_spawn_command_line_async (command, error);
223
224=== modified file 'panels/midori-history.c'
225--- panels/midori-history.c 2013-06-21 23:18:01 +0000
226+++ panels/midori-history.c 2013-06-26 21:57:40 +0000
227@@ -117,37 +117,12 @@
228 return STOCK_HISTORY;
229 }
230
231-#if !GLIB_CHECK_VERSION (2, 26, 0)
232-static gint
233-sokoke_days_between (const time_t* day1,
234- const time_t* day2)
235-{
236- GDate* date1;
237- GDate* date2;
238- gint age;
239-
240- date1 = g_date_new ();
241- date2 = g_date_new ();
242-
243- g_date_set_time_t (date1, *day1);
244- g_date_set_time_t (date2, *day2);
245-
246- age = g_date_days_between (date1, date2);
247-
248- g_date_free (date1);
249- g_date_free (date2);
250-
251- return age;
252-}
253-#endif
254-
255 static gchar*
256 midori_history_format_date (KatzeItem *item)
257 {
258 gint64 day = katze_item_get_added (item);
259 gchar* sdate;
260 gint age;
261- #if GLIB_CHECK_VERSION (2, 26, 0)
262 GDateTime* now = g_date_time_new_now_local ();
263 GDateTime* then = g_date_time_new_from_unix_local (day);
264 age = g_date_time_get_day_of_year (now) - g_date_time_get_day_of_year (then);
265@@ -167,31 +142,7 @@
266 sdate = g_date_time_format (then, "%x");
267 g_date_time_unref (now);
268 g_date_time_unref (then);
269- #else
270- gchar token[50];
271- time_t current_time;
272-
273- current_time = time (NULL);
274- age = sokoke_days_between ((time_t*)&day, &current_time);
275-
276- /* A negative age is a date in the future, the clock is probably off */
277- if (age < -1)
278- sdate = g_strdup ("");
279- else if (age > 7 || age < 0)
280- {
281- strftime (token, sizeof (token), "%x", localtime ((time_t*)&day));
282- sdate = g_strdup (token);
283- }
284- else if (age > 6)
285- sdate = g_strdup (_("A week ago"));
286- else if (age > 1)
287- sdate = g_strdup_printf (ngettext ("%d day ago",
288- "%d days ago", (gint)age), (gint)age);
289- else if (age == 0)
290- sdate = g_strdup (_("Today"));
291- else
292- sdate = g_strdup (_("Yesterday"));
293- #endif
294+
295 return sdate;
296 }
297
298@@ -466,7 +417,6 @@
299 gtk_tree_model_get (model, &iter, 0, &today, -1);
300
301 day = katze_item_get_added (today);
302- #if GLIB_CHECK_VERSION (2, 26, 0)
303 has_today = g_date_time_get_day_of_month (
304 g_date_time_new_from_unix_local (day))
305 == g_date_time_get_day_of_month (
306@@ -475,10 +425,8 @@
307 g_date_time_new_from_unix_local (day))
308 == g_date_time_get_day_of_year (
309 g_date_time_new_from_unix_local (current_time));
310- #else
311- has_today = sokoke_days_between ((time_t*)&day, &current_time) == 0;
312- #endif
313 g_object_unref (today);
314+
315 if (has_today)
316 {
317 gchar* tooltip = g_markup_escape_text (katze_item_get_uri (item), -1);
318
319=== modified file 'wscript'
320--- wscript 2013-06-22 19:53:16 +0000
321+++ wscript 2013-06-26 21:57:40 +0000
322@@ -219,11 +219,7 @@
323
324 conf.check (lib='m')
325 check_pkg ('gmodule-2.0')
326- check_pkg ('gio-2.0', '2.22.0')
327- if check_version (conf.env['GIO_VERSION'], 2, 30, 0) \
328- and check_version (conf.env['VALAC_VERSION'], 0, 16, 0):
329- # Older Vala doesn't have GLib 2.30 bindings
330- conf.env.append_value ('VALAFLAGS', '-D HAVE_GLIB_2_30')
331+ check_pkg ('gio-2.0', '2.32.4')
332
333 args = ''
334 if Options.platform == 'win32':
335@@ -302,10 +298,6 @@
336 conf.env['docs'] = option_enabled ('docs')
337 if 'LINGUAS' in os.environ: conf.env['LINGUAS'] = os.environ['LINGUAS']
338
339- if not check_version (conf.env['GIO_VERSION'], 2, 26, 0):
340- conf.env['addons'] = False
341- Utils.pprint ('YELLOW', 'Glib < 2.26.0, disabling addons')
342-
343 conf.check (header_name='unistd.h')
344 if not conf.env['HAVE_UNIQUE']:
345 if Options.platform == 'win32':
346@@ -366,13 +358,6 @@
347 Utils.pprint ('RED', 'unique 1.0.4 found, this version is erroneous.')
348 Utils.pprint ('RED', 'Please use an older or newer version.')
349 sys.exit (1)
350- if check_version (conf.env['LIBSOUP_VERSION'], 2, 33, 4) \
351- and check_version (conf.env['GIO_VERSION'], 2, 32, 1) \
352- and not check_version (conf.env['GIO_VERSION'], 2, 32, 3):
353- Utils.pprint ('RED', 'libsoup >= 2.33.4 found with glib >= 2.32.1 < 2.32.3:')
354- Utils.pprint ('RED', 'This combination breaks the download GUI.')
355- Utils.pprint ('RED', 'See https://bugs.launchpad.net/midori/+bug/780133/comments/14')
356- sys.exit (1)
357
358 def set_options (opt):
359 def add_enable_option (option, desc, group=None, disable=False):

Subscribers

People subscribed via source and target branches

to all changes: