Merge lp:~mterry/unity-lens-music/valac-0.18 into lp:unity-lens-music

Proposed by Michael Terry on 2012-12-10
Status: Merged
Approved by: Michal Hruby on 2012-12-12
Approved revision: 122
Merged at revision: 124
Proposed branch: lp:~mterry/unity-lens-music/valac-0.18
Merge into: lp:unity-lens-music
Prerequisite: lp:~mterry/unity-lens-music/gst1
Diff against target: 242 lines (+48/-48)
9 files modified
configure.ac (+1/-1)
debian/control (+1/-1)
debian/rules (+5/-0)
src/Makefile.am (+3/-1)
src/banshee-scope.vala (+4/-11)
src/musicstore-collection.vala (+2/-2)
src/player.vala (+3/-3)
src/rhythmbox-collection.vala (+2/-2)
src/rhythmbox-scope.vala (+27/-27)
To merge this branch: bzr merge lp:~mterry/unity-lens-music/valac-0.18
Reviewer Review Type Date Requested Status
Michal Hruby (community) 2012-12-10 Approve on 2012-12-12
PS Jenkins bot continuous-integration Pending
Review via email: mp+139037@code.launchpad.net

This proposal supersedes a proposal from 2012-12-06.

Description of the Change

This fixes all the code and deprecation warnings we see with valac-0.18. It also makes sure to prefer valac-0.18 if there are more than one valac executables installed.

I also bumped the minimum glib to 2.32 for the new, non-deprecated glib thread API.

To post a comment you must log in.
121. By Michael Terry on 2012-12-12

don't use custom valac m4 macro

122. By Michael Terry on 2012-12-12

merge from trunk

Michal Hruby (mhr3) wrote :

Awesome, thanks for the fixes!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'configure.ac'
2--- configure.ac 2012-12-11 23:54:13 +0000
3+++ configure.ac 2012-12-12 16:15:25 +0000
4@@ -54,7 +54,7 @@
5 #####################################################
6 # Check for module and library dependancies
7 #####################################################
8-GLIB_REQUIRED=2.27
9+GLIB_REQUIRED=2.32
10 PKG_CHECK_MODULES(LENS_DAEMON,
11 glib-2.0 >= $GLIB_REQUIRED
12 gobject-2.0 >= $GLIB_REQUIRED
13
14=== modified file 'debian/control'
15--- debian/control 2012-12-11 23:54:13 +0000
16+++ debian/control 2012-12-12 16:15:25 +0000
17@@ -8,7 +8,7 @@
18 pkg-config,
19 dh-translations,
20 valac-0.18,
21- libglib2.0-dev (>= 2.27),
22+ libglib2.0-dev (>= 2.32),
23 libgee-dev,
24 libjson-glib-dev,
25 libsoup2.4-dev,
26
27=== modified file 'debian/rules'
28--- debian/rules 2012-11-08 22:38:28 +0000
29+++ debian/rules 2012-12-12 16:15:25 +0000
30@@ -10,6 +10,11 @@
31 override_dh_autoreconf:
32 NOCONFIGURE=1 dh_autoreconf ./autogen.sh
33
34+override_dh_auto_configure:
35+ # Manually specify compiler in case user has multiple valac's lying around,
36+ # in which case 0.18 may not be the default.
37+ dh_auto_configure -- VALAC=/usr/bin/valac-0.18
38+
39 override_dh_auto_build:
40 # TOREMOVE
41 touch tests/test_rhythmbox_parser_vala.stamp
42
43=== modified file 'src/Makefile.am'
44--- src/Makefile.am 2012-12-11 23:54:13 +0000
45+++ src/Makefile.am 2012-12-12 16:15:25 +0000
46@@ -32,7 +32,7 @@
47 --pkg glib-2.0 \
48 --vapidir $(srcdir) \
49 --pkg tdb \
50- --target-glib=2.26 \
51+ --target-glib=2.32 \
52 $(MAINTAINER_VALAFLAGS)
53
54 unity_music_daemon_LDADD = \
55@@ -119,11 +119,13 @@
56 $(music_preview_player_VALASOURCES:.vala=.c) \
57 $(NULL)
58
59+# We pass --enable-experimental to quiet warnings about using Gst-1.0 bindings
60 music_preview_player_VALAFLAGS = \
61 -C \
62 --pkg gstreamer-1.0 \
63 --pkg gstreamer-pbutils-1.0 \
64 --pkg gio-2.0 \
65+ --enable-experimental \
66 $(MAINTAINER_VALAFLAGS)
67
68 BUILT_SOURCES += \
69
70=== modified file 'src/banshee-scope.vala'
71--- src/banshee-scope.vala 2012-10-19 15:48:25 +0000
72+++ src/banshee-scope.vala 2012-12-12 16:15:25 +0000
73@@ -144,8 +144,8 @@
74 string title = split[3];
75 var album = new Album ()
76 {
77- title = split[3],
78- artist = split[2]
79+ title = title,
80+ artist = artist
81 };
82 var tracks = collection.get_track_uris (album);
83 if (tracks.length > 0)
84@@ -169,15 +169,8 @@
85
86 if (file_uri != null)
87 {
88- try
89- {
90- Unity.Extras.show_in_folder (file_uri);
91- return new Unity.ActivationResponse (Unity.HandledType.HIDE_DASH);
92- }
93- catch (GLib.Error e)
94- {
95- warning ("Failed to show in folder '%s': %s", file_uri, e.message);
96- }
97+ Unity.Extras.show_in_folder.begin (file_uri);
98+ return new Unity.ActivationResponse (Unity.HandledType.HIDE_DASH);
99 }
100
101 return new Unity.ActivationResponse (Unity.HandledType.NOT_HANDLED);
102
103=== modified file 'src/musicstore-collection.vala'
104--- src/musicstore-collection.vala 2012-09-18 15:42:08 +0000
105+++ src/musicstore-collection.vala 2012-12-12 16:15:25 +0000
106@@ -50,6 +50,8 @@
107
108 public void get_album_details (string uri, out Album album, out SList<Track> tracks)
109 {
110+ album = new Album ();
111+ tracks = new SList<Track> ();
112 string http_uri = uri.substring (7); // strip off "u1ms://" from the uri
113 if (preview_uri_map.contains (http_uri))
114 {
115@@ -64,8 +66,6 @@
116 {
117 var root_obj = parser.get_root ().get_object ();
118
119- album = new Album ();
120- tracks = new SList<Track> ();
121 album.title = root_obj.get_string_member ("title");
122 album.artwork_path = root_obj.get_string_member ("image");
123 album.artist = root_obj.get_string_member ("artist");
124
125=== modified file 'src/player.vala'
126--- src/player.vala 2012-11-14 14:45:52 +0000
127+++ src/player.vala 2012-12-12 16:15:25 +0000
128@@ -111,7 +111,7 @@
129 case Gst.MessageType.ELEMENT:
130 if (Gst.PbUtils.is_missing_plugin_message (message))
131 {
132- handle_missing_plugin (message);
133+ handle_missing_plugin.begin (message);
134 }
135 break;
136 default:
137@@ -121,7 +121,7 @@
138 return true;
139 }
140
141- private void handle_missing_plugin (Gst.Message message)
142+ private async void handle_missing_plugin (Gst.Message message)
143 {
144 var detail = Gst.PbUtils.missing_plugin_message_get_installer_detail (message);
145 var descr = Gst.PbUtils.missing_plugin_message_get_description (message);
146@@ -135,7 +135,7 @@
147 var dash_proxy = new DashProxy ();
148 try
149 {
150- dash_proxy.hide_dash ();
151+ yield dash_proxy.hide_dash ();
152 }
153 catch (Error e)
154 {
155
156=== modified file 'src/rhythmbox-collection.vala'
157--- src/rhythmbox-collection.vala 2012-12-12 13:26:04 +0000
158+++ src/rhythmbox-collection.vala 2012-12-12 16:15:25 +0000
159@@ -342,8 +342,8 @@
160 try
161 {
162 File artwork_file = File.new_for_uri (track.uri);
163- var info = artwork_file.query_info (FILE_ATTRIBUTE_THUMBNAIL_PATH, 0, null);
164- var thumbnail_path = info.get_attribute_string (FILE_ATTRIBUTE_THUMBNAIL_PATH);
165+ var info = artwork_file.query_info (FileAttribute.THUMBNAIL_PATH, 0, null);
166+ var thumbnail_path = info.get_attribute_string (FileAttribute.THUMBNAIL_PATH);
167 if (thumbnail_path != null) return thumbnail_path;
168 } catch {}
169 }
170
171=== modified file 'src/rhythmbox-scope.vala'
172--- src/rhythmbox-scope.vala 2012-10-19 15:48:25 +0000
173+++ src/rhythmbox-scope.vala 2012-12-12 16:15:25 +0000
174@@ -51,25 +51,32 @@
175
176 private async void prepare_rhythmbox_play_queue (string[] exec_args)
177 {
178- var main_exec = exec_args; //needed from vala >= 0.15.1: captured parameters of array type are no more copied implicitly
179- Thread.create<void> (() =>
180+ var main_exec = exec_args; // copy arguments for thread's benefit
181+ try {
182+ new Thread<void*>.try ("rhythmbox-thread", () =>
183+ {
184+ try
185+ {
186+ Process.spawn_command_line_sync ("rhythmbox-client --pause");
187+ Process.spawn_command_line_sync ("rhythmbox-client --clear-queue");
188+ Process.spawn_sync (null, main_exec, null, SpawnFlags.SEARCH_PATH,
189+ null, null);
190+ Process.spawn_command_line_sync ("rhythmbox-client --next");
191+ // make sure we're playing
192+ Process.spawn_command_line_sync ("rhythmbox-client --play");
193+ }
194+ catch (Error err)
195+ {
196+ warning ("%s", err.message);
197+ }
198+ Idle.add (prepare_rhythmbox_play_queue.callback);
199+ return null;
200+ });
201+ }
202+ catch (Error err)
203 {
204- try
205- {
206- Process.spawn_command_line_sync ("rhythmbox-client --pause");
207- Process.spawn_command_line_sync ("rhythmbox-client --clear-queue");
208- Process.spawn_sync (null, main_exec, null, SpawnFlags.SEARCH_PATH,
209- null, null);
210- Process.spawn_command_line_sync ("rhythmbox-client --next");
211- // make sure we're playing
212- Process.spawn_command_line_sync ("rhythmbox-client --play");
213- }
214- catch (Error err)
215- {
216- warning ("%s", err.message);
217- }
218- Idle.add (prepare_rhythmbox_play_queue.callback);
219- }, false);
220+ warning ("Could not create rhythmbox-thread: %s", err.message);
221+ }
222 yield;
223 }
224
225@@ -176,15 +183,8 @@
226
227 if (file_uri != null)
228 {
229- try
230- {
231- Unity.Extras.show_in_folder (file_uri);
232- return new Unity.ActivationResponse (Unity.HandledType.HIDE_DASH);
233- }
234- catch (GLib.Error e)
235- {
236- warning ("Failed to show in folder '%s': %s", file_uri, e.message);
237- }
238+ Unity.Extras.show_in_folder.begin (file_uri);
239+ return new Unity.ActivationResponse (Unity.HandledType.HIDE_DASH);
240 }
241
242 return new Unity.ActivationResponse (Unity.HandledType.NOT_HANDLED);

Subscribers

People subscribed via source and target branches

to all changes: