~ubuntu-branches/ubuntu/precise/indicator-sound/precise-proposed

« back to all changes in this revision

Viewing changes to src/transport-menu-item.c

Tags: 0.8.3.0-0ubuntu1
* New upstream release.
  - Fixed memory corruption issue (LP: #897218)
  - crashed with SIGABRT in pa_operation_unref (LP: #908682)
  - Banshee shown in sound menu after removal until reboot (LP: #771202)
  - Coverity PASS_BY_VALUE - CID 10620 (LP: #937451)
  - App icon and name are not aligned (LP: #939929)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* transport-menu-item.c generated by valac 0.12.1, the Vala compiler
 
1
/* transport-menu-item.c generated by valac 0.14.2, the Vala compiler
2
2
 * generated from transport-menu-item.vala, do not modify */
3
3
 
4
4
/*
157
157
 
158
158
TransportMenuitem* transport_menuitem_construct (GType object_type, PlayerController* parent) {
159
159
        TransportMenuitem * self = NULL;
 
160
        PlayerController* _tmp0_;
160
161
        g_return_val_if_fail (parent != NULL, NULL);
161
 
        self = (TransportMenuitem*) g_object_new (object_type, "item-type", DBUSMENU_TRANSPORT_MENUITEM_TYPE, "owner", parent, NULL);
 
162
        _tmp0_ = parent;
 
163
        self = (TransportMenuitem*) g_object_new (object_type, "item-type", DBUSMENU_TRANSPORT_MENUITEM_TYPE, "owner", _tmp0_, NULL);
162
164
        return self;
163
165
}
164
166
 
180
182
 
181
183
 
182
184
void transport_menuitem_handle_cached_action (TransportMenuitem* self) {
 
185
        TransportAction _tmp0_;
183
186
        g_return_if_fail (self != NULL);
184
 
        if (self->priv->cached_action != TRANSPORT_ACTION_NO_ACTION) {
 
187
        _tmp0_ = self->priv->cached_action;
 
188
        if (_tmp0_ != TRANSPORT_ACTION_NO_ACTION) {
185
189
                g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, (guint) 1, _transport_menuitem_send_cached_action_gsource_func, g_object_ref (self), g_object_unref);
186
190
        }
187
191
}
189
193
 
190
194
static gboolean transport_menuitem_send_cached_action (TransportMenuitem* self) {
191
195
        gboolean result = FALSE;
192
 
        PlayerController* _tmp0_ = NULL;
 
196
        PlayerController* _tmp0_;
 
197
        PlayerController* _tmp1_;
 
198
        Mpris2Controller* _tmp2_;
 
199
        TransportAction _tmp3_;
193
200
        g_return_val_if_fail (self != NULL, FALSE);
194
201
        _tmp0_ = player_item_get_owner ((PlayerItem*) self);
195
 
        mpris2_controller_transport_update (_tmp0_->mpris_bridge, self->priv->cached_action);
 
202
        _tmp1_ = _tmp0_;
 
203
        _tmp2_ = _tmp1_->mpris_bridge;
 
204
        _tmp3_ = self->priv->cached_action;
 
205
        mpris2_controller_transport_update (_tmp2_, _tmp3_);
196
206
        self->priv->cached_action = TRANSPORT_ACTION_NO_ACTION;
197
207
        result = FALSE;
198
208
        return result;
200
210
 
201
211
 
202
212
void transport_menuitem_change_play_state (TransportMenuitem* self, TransportState update) {
 
213
        TransportState _tmp0_;
203
214
        gint temp;
204
215
        g_return_if_fail (self != NULL);
205
 
        temp = (gint) update;
 
216
        _tmp0_ = update;
 
217
        temp = (gint) _tmp0_;
206
218
        dbusmenu_menuitem_property_set_int ((DbusmenuMenuitem*) self, DBUSMENU_TRANSPORT_MENUITEM_PLAY_STATE, temp);
207
219
}
208
220
 
215
227
static void transport_menuitem_real_handle_event (DbusmenuMenuitem* base, const gchar* name, GVariant* input_value, guint timestamp) {
216
228
        TransportMenuitem * self;
217
229
        GVariant* _tmp0_;
 
230
        GVariant* _tmp1_;
218
231
        GVariant* v;
219
 
        gboolean _tmp1_;
220
 
        gint32 _tmp3_;
 
232
        GVariant* _tmp2_;
 
233
        const GVariantType* _tmp3_;
 
234
        gboolean _tmp4_ = FALSE;
 
235
        GVariant* _tmp7_;
 
236
        gint32 _tmp8_ = 0;
221
237
        gint32 input;
222
 
        gboolean _tmp4_;
 
238
        gboolean _tmp9_;
 
239
        gboolean _tmp10_;
223
240
        self = (TransportMenuitem*) base;
224
241
        g_return_if_fail (name != NULL);
225
242
        g_return_if_fail (input_value != NULL);
226
 
        _tmp0_ = _g_variant_ref0 (input_value);
227
 
        v = _tmp0_;
228
 
        _tmp1_ = g_variant_is_of_type (input_value, G_VARIANT_TYPE_VARIANT);
229
 
        if (_tmp1_) {
230
 
                GVariant* _tmp2_ = NULL;
231
 
                _tmp2_ = g_variant_get_variant (input_value);
 
243
        _tmp0_ = input_value;
 
244
        _tmp1_ = _g_variant_ref0 (_tmp0_);
 
245
        v = _tmp1_;
 
246
        _tmp2_ = input_value;
 
247
        _tmp3_ = G_VARIANT_TYPE_VARIANT;
 
248
        _tmp4_ = g_variant_is_of_type (_tmp2_, _tmp3_);
 
249
        if (_tmp4_) {
 
250
                GVariant* _tmp5_;
 
251
                GVariant* _tmp6_ = NULL;
 
252
                _tmp5_ = input_value;
 
253
                _tmp6_ = g_variant_get_variant (_tmp5_);
232
254
                _g_variant_unref0 (v);
233
 
                v = _tmp2_;
 
255
                v = _tmp6_;
234
256
        }
235
 
        _tmp3_ = g_variant_get_int32 (v);
236
 
        input = _tmp3_;
237
 
        _tmp4_ = transport_menuitem_get_running (self);
238
 
        if (_tmp4_ == TRUE) {
239
 
                PlayerController* _tmp5_ = NULL;
240
 
                _tmp5_ = player_item_get_owner ((PlayerItem*) self);
241
 
                mpris2_controller_transport_update (_tmp5_->mpris_bridge, (TransportAction) input);
 
257
        _tmp7_ = v;
 
258
        _tmp8_ = g_variant_get_int32 (_tmp7_);
 
259
        input = _tmp8_;
 
260
        _tmp9_ = transport_menuitem_get_running (self);
 
261
        _tmp10_ = _tmp9_;
 
262
        if (_tmp10_ == TRUE) {
 
263
                PlayerController* _tmp11_;
 
264
                PlayerController* _tmp12_;
 
265
                Mpris2Controller* _tmp13_;
 
266
                gint32 _tmp14_;
 
267
                _tmp11_ = player_item_get_owner ((PlayerItem*) self);
 
268
                _tmp12_ = _tmp11_;
 
269
                _tmp13_ = _tmp12_->mpris_bridge;
 
270
                _tmp14_ = input;
 
271
                mpris2_controller_transport_update (_tmp13_, (TransportAction) _tmp14_);
242
272
        } else {
243
 
                PlayerController* _tmp6_ = NULL;
244
 
                self->priv->cached_action = (TransportAction) input;
245
 
                _tmp6_ = player_item_get_owner ((PlayerItem*) self);
246
 
                player_controller_instantiate (_tmp6_);
 
273
                gint32 _tmp15_;
 
274
                PlayerController* _tmp16_;
 
275
                PlayerController* _tmp17_;
 
276
                _tmp15_ = input;
 
277
                self->priv->cached_action = (TransportAction) _tmp15_;
 
278
                _tmp16_ = player_item_get_owner ((PlayerItem*) self);
 
279
                _tmp17_ = _tmp16_;
 
280
                player_controller_instantiate (_tmp17_);
247
281
                dbusmenu_menuitem_property_set_int ((DbusmenuMenuitem*) self, DBUSMENU_TRANSPORT_MENUITEM_PLAY_STATE, (gint) TRANSPORT_STATE_LAUNCHING);
248
282
        }
249
283
        _g_variant_unref0 (v);
252
286
 
253
287
GeeHashSet* transport_menuitem_attributes_format (void) {
254
288
        GeeHashSet* result = NULL;
255
 
        GeeHashSet* _tmp0_ = NULL;
 
289
        GeeHashSet* _tmp0_;
256
290
        GeeHashSet* attrs;
257
291
        _tmp0_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL);
258
292
        attrs = _tmp0_;
264
298
 
265
299
static gboolean transport_menuitem_get_running (TransportMenuitem* self) {
266
300
        gboolean result;
267
 
        PlayerController* _tmp0_ = NULL;
 
301
        PlayerController* _tmp0_;
 
302
        PlayerController* _tmp1_;
 
303
        gint _tmp2_;
268
304
        g_return_val_if_fail (self != NULL, FALSE);
269
305
        _tmp0_ = player_item_get_owner ((PlayerItem*) self);
270
 
        result = _tmp0_->current_state == PLAYER_CONTROLLER_STATE_CONNECTED;
 
306
        _tmp1_ = _tmp0_;
 
307
        _tmp2_ = _tmp1_->current_state;
 
308
        result = _tmp2_ == ((gint) PLAYER_CONTROLLER_STATE_CONNECTED);
271
309
        return result;
272
310
}
273
311