~titan-lien/ubuntu/saucy/totem/totem.dev

« back to all changes in this revision

Viewing changes to src/plugins/zeitgeist-dp/totem-zeitgeist-dp-plugin.c

  • Committer: Package Import Robot
  • Author(s): Michael Biebl, Sjoerd Simons, Michael Biebl, Josselin Mouette
  • Date: 2011-11-27 06:21:34 UTC
  • mfrom: (1.4.8) (5.1.23 sid)
  • Revision ID: package-import@ubuntu.com-20111127062134-c3ikko9wdfn9m2av
Tags: 3.2.1-1
[ Sjoerd Simons ]
* New upstream release
* debian/control.in: Update build-depends
* debian/rules: Enable vala plugins
* debian/totem-plugins.install:
  - Add grilo and rotation plugins
  - Remove jamendo, thumbnail and tracker plugins

[ Michael Biebl ]
* debian/control.in:
  - Bump Depends on python-gobject to (>= 2.90.3).

[ Josselin Mouette ]
* Replace python-gobject dependencies by python-gi.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* totem-zeitgeist-dp-plugin.c generated by valac 0.11.7, the Vala compiler
 
1
/* totem-zeitgeist-dp-plugin.c generated by valac 0.13.3.24-7e20e7, the Vala compiler
2
2
 * generated from totem-zeitgeist-dp-plugin.vala, do not modify */
3
3
 
4
4
 
71
71
        GSimpleAsyncResult* _async_result;
72
72
        ZeitgeistDpPlugin* self;
73
73
        gchar* current_mrl;
74
 
        gchar* _tmp0_;
 
74
        const gchar* _tmp0_;
 
75
        gchar* _tmp1_;
75
76
        gchar* mrl;
76
 
        GFile* _tmp1_;
 
77
        const gchar* _tmp2_;
 
78
        GFile* _tmp3_;
77
79
        GFile* f;
78
 
        GFileInfo* _tmp2_;
 
80
        GFile* _tmp4_;
 
81
        GFileInfo* _tmp5_;
79
82
        GFileInfo* fi;
80
 
        gboolean _tmp3_;
81
 
        gboolean _tmp4_;
82
 
        const gchar* _tmp5_;
83
 
        gchar* _tmp6_;
84
 
        GError * err;
 
83
        gboolean _tmp6_;
 
84
        MediaInfo _tmp7_;
 
85
        const gchar* _tmp8_;
 
86
        const gchar* _tmp9_;
 
87
        TotemObject* _tmp10_;
 
88
        gboolean _tmp11_;
 
89
        gboolean _tmp12_;
 
90
        GFileInfo* _tmp13_;
 
91
        const gchar* _tmp14_;
 
92
        gchar* _tmp15_;
 
93
        GError* err;
85
94
        GError * _inner_error_;
86
95
};
87
96
 
123
132
static void zeitgeist_dp_plugin_query_media_mimetype_data_free (gpointer _data);
124
133
static void zeitgeist_dp_plugin_query_media_mimetype (ZeitgeistDpPlugin* self, const gchar* current_mrl, GAsyncReadyCallback _callback_, gpointer _user_data_);
125
134
static void zeitgeist_dp_plugin_query_media_mimetype_finish (ZeitgeistDpPlugin* self, GAsyncResult* _res_);
126
 
static gboolean zeitgeist_dp_plugin_query_media_mimetype_co (ZeitgeistDpPluginQueryMediaMimetypeData* data);
 
135
static gboolean zeitgeist_dp_plugin_query_media_mimetype_co (ZeitgeistDpPluginQueryMediaMimetypeData* _data_);
127
136
static void zeitgeist_dp_plugin_query_media_mimetype_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
128
137
ZeitgeistDpPlugin* zeitgeist_dp_plugin_new (void);
129
138
ZeitgeistDpPlugin* zeitgeist_dp_plugin_construct (GType object_type);
135
144
 
136
145
 
137
146
void media_info_copy (const MediaInfo* self, MediaInfo* dest) {
138
 
        dest->timestamp = self->timestamp;
139
 
        dest->sent_access = self->sent_access;
140
 
        dest->mrl = g_strdup (self->mrl);
141
 
        dest->mimetype = g_strdup (self->mimetype);
142
 
        dest->title = g_strdup (self->title);
143
 
        dest->interpretation = g_strdup (self->interpretation);
144
 
        dest->artist = g_strdup (self->artist);
145
 
        dest->album = g_strdup (self->album);
 
147
        gint64 _tmp0_;
 
148
        gboolean _tmp1_;
 
149
        const gchar* _tmp2_;
 
150
        const gchar* _tmp3_;
 
151
        const gchar* _tmp4_;
 
152
        const gchar* _tmp5_;
 
153
        const gchar* _tmp6_;
 
154
        const gchar* _tmp7_;
 
155
        const gchar* _tmp8_;
 
156
        const gchar* _tmp9_;
 
157
        const gchar* _tmp10_;
 
158
        const gchar* _tmp11_;
 
159
        const gchar* _tmp12_;
 
160
        const gchar* _tmp13_;
 
161
        _tmp0_ = (*self).timestamp;
 
162
        (*dest).timestamp = _tmp0_;
 
163
        _tmp1_ = (*self).sent_access;
 
164
        (*dest).sent_access = _tmp1_;
 
165
        _tmp2_ = (*self).mrl;
 
166
        _tmp3_ = g_strdup (_tmp2_);
 
167
        _g_free0 ((*dest).mrl);
 
168
        (*dest).mrl = _tmp3_;
 
169
        _tmp4_ = (*self).mimetype;
 
170
        _tmp5_ = g_strdup (_tmp4_);
 
171
        _g_free0 ((*dest).mimetype);
 
172
        (*dest).mimetype = _tmp5_;
 
173
        _tmp6_ = (*self).title;
 
174
        _tmp7_ = g_strdup (_tmp6_);
 
175
        _g_free0 ((*dest).title);
 
176
        (*dest).title = _tmp7_;
 
177
        _tmp8_ = (*self).interpretation;
 
178
        _tmp9_ = g_strdup (_tmp8_);
 
179
        _g_free0 ((*dest).interpretation);
 
180
        (*dest).interpretation = _tmp9_;
 
181
        _tmp10_ = (*self).artist;
 
182
        _tmp11_ = g_strdup (_tmp10_);
 
183
        _g_free0 ((*dest).artist);
 
184
        (*dest).artist = _tmp11_;
 
185
        _tmp12_ = (*self).album;
 
186
        _tmp13_ = g_strdup (_tmp12_);
 
187
        _g_free0 ((*dest).album);
 
188
        (*dest).album = _tmp13_;
146
189
}
147
190
 
148
191
 
224
267
 
225
268
static void zeitgeist_dp_plugin_real_activate (PeasActivatable* base) {
226
269
        ZeitgeistDpPlugin * self;
227
 
        ZeitgeistLog* _tmp0_ = NULL;
228
 
        ZeitgeistDataSourceRegistry* _tmp1_ = NULL;
 
270
        ZeitgeistLog* _tmp0_;
 
271
        ZeitgeistDataSourceRegistry* _tmp1_;
229
272
        MediaInfo _tmp2_ = {0};
230
 
        MediaInfo _tmp3_ = {0};
231
 
        gulong _tmp4_;
232
 
        gulong _tmp5_;
233
 
        gulong _tmp6_;
234
 
        gulong _tmp7_;
235
 
        GPtrArray* _tmp8_ = NULL;
 
273
        gulong* _tmp3_;
 
274
        gint _tmp3__length1;
 
275
        TotemObject* _tmp4_;
 
276
        gulong _tmp5_ = 0UL;
 
277
        gulong* _tmp6_;
 
278
        gint _tmp6__length1;
 
279
        TotemObject* _tmp7_;
 
280
        gulong _tmp8_ = 0UL;
 
281
        gulong* _tmp9_;
 
282
        gint _tmp9__length1;
 
283
        TotemObject* _tmp10_;
 
284
        gulong _tmp11_ = 0UL;
 
285
        gulong* _tmp12_;
 
286
        gint _tmp12__length1;
 
287
        TotemObject* _tmp13_;
 
288
        gulong _tmp14_ = 0UL;
 
289
        GPtrArray* _tmp15_;
236
290
        GPtrArray* templates;
237
 
        ZeitgeistEvent* _tmp9_ = NULL;
 
291
        ZeitgeistEvent* _tmp16_;
 
292
        ZeitgeistEvent* _tmp17_;
238
293
        ZeitgeistEvent* event;
239
 
        GPtrArray* _tmp10_;
240
 
        ZeitgeistDataSource* _tmp11_ = NULL;
 
294
        GPtrArray* _tmp18_;
 
295
        GPtrArray* _tmp19_;
 
296
        ZeitgeistDataSource* _tmp20_;
 
297
        ZeitgeistDataSource* _tmp21_;
241
298
        ZeitgeistDataSource* ds;
242
 
        ZeitgeistDataSource* _tmp12_;
 
299
        ZeitgeistDataSourceRegistry* _tmp22_;
 
300
        ZeitgeistDataSource* _tmp23_;
243
301
        self = (ZeitgeistDpPlugin*) base;
244
302
        _tmp0_ = zeitgeist_log_new ();
245
303
        _g_object_unref0 (self->priv->zg_log);
248
306
        _g_object_unref0 (self->priv->zg_registry);
249
307
        self->priv->zg_registry = _tmp1_;
250
308
        memset (&_tmp2_, 0, sizeof (MediaInfo));
251
 
        _tmp3_ = _tmp2_;
252
309
        media_info_destroy (&self->priv->current_media);
253
 
        self->priv->current_media = _tmp3_;
254
 
        _tmp4_ = g_signal_connect_swapped (self->priv->_object, "file-opened", (GCallback) zeitgeist_dp_plugin_file_opened, self);
255
 
        _vala_array_add1 (&self->priv->signals, &self->priv->signals_length1, &self->priv->_signals_size_, _tmp4_);
256
 
        _tmp5_ = g_signal_connect_swapped (self->priv->_object, "file-closed", (GCallback) zeitgeist_dp_plugin_file_closed, self);
257
 
        _vala_array_add2 (&self->priv->signals, &self->priv->signals_length1, &self->priv->_signals_size_, _tmp5_);
258
 
        _tmp6_ = g_signal_connect_swapped (self->priv->_object, "metadata-updated", (GCallback) zeitgeist_dp_plugin_metadata_changed, self);
259
 
        _vala_array_add3 (&self->priv->signals, &self->priv->signals_length1, &self->priv->_signals_size_, _tmp6_);
260
 
        _tmp7_ = g_signal_connect_swapped (self->priv->_object, "notify::playing", (GCallback) zeitgeist_dp_plugin_playing_changed, self);
261
 
        _vala_array_add4 (&self->priv->signals, &self->priv->signals_length1, &self->priv->_signals_size_, _tmp7_);
262
 
        _tmp8_ = g_ptr_array_new ();
263
 
        templates = _tmp8_;
264
 
        _tmp9_ = zeitgeist_event_new_full ("", ZEITGEIST_ZG_USER_ACTIVITY, "application://totem.desktop", NULL, NULL);
265
 
        event = g_object_ref_sink (_tmp9_);
266
 
        g_ptr_array_add (templates, event);
267
 
        _tmp10_ = templates;
 
310
        self->priv->current_media = _tmp2_;
 
311
        _tmp3_ = self->priv->signals;
 
312
        _tmp3__length1 = self->priv->signals_length1;
 
313
        _tmp4_ = self->priv->_object;
 
314
        _tmp5_ = g_signal_connect_swapped (_tmp4_, "file-opened", (GCallback) zeitgeist_dp_plugin_file_opened, self);
 
315
        _vala_array_add1 (&self->priv->signals, &self->priv->signals_length1, &self->priv->_signals_size_, _tmp5_);
 
316
        _tmp6_ = self->priv->signals;
 
317
        _tmp6__length1 = self->priv->signals_length1;
 
318
        _tmp7_ = self->priv->_object;
 
319
        _tmp8_ = g_signal_connect_swapped (_tmp7_, "file-closed", (GCallback) zeitgeist_dp_plugin_file_closed, self);
 
320
        _vala_array_add2 (&self->priv->signals, &self->priv->signals_length1, &self->priv->_signals_size_, _tmp8_);
 
321
        _tmp9_ = self->priv->signals;
 
322
        _tmp9__length1 = self->priv->signals_length1;
 
323
        _tmp10_ = self->priv->_object;
 
324
        _tmp11_ = g_signal_connect_swapped (_tmp10_, "metadata-updated", (GCallback) zeitgeist_dp_plugin_metadata_changed, self);
 
325
        _vala_array_add3 (&self->priv->signals, &self->priv->signals_length1, &self->priv->_signals_size_, _tmp11_);
 
326
        _tmp12_ = self->priv->signals;
 
327
        _tmp12__length1 = self->priv->signals_length1;
 
328
        _tmp13_ = self->priv->_object;
 
329
        _tmp14_ = g_signal_connect_swapped (_tmp13_, "notify::playing", (GCallback) zeitgeist_dp_plugin_playing_changed, self);
 
330
        _vala_array_add4 (&self->priv->signals, &self->priv->signals_length1, &self->priv->_signals_size_, _tmp14_);
 
331
        _tmp15_ = g_ptr_array_new ();
 
332
        templates = _tmp15_;
 
333
        _tmp16_ = zeitgeist_event_new_full ("", ZEITGEIST_ZG_USER_ACTIVITY, "application://totem.desktop", NULL, NULL);
 
334
        _tmp17_ = g_object_ref_sink (_tmp16_);
 
335
        event = _tmp17_;
 
336
        _tmp18_ = templates;
 
337
        g_ptr_array_add (_tmp18_, event);
 
338
        _tmp19_ = templates;
268
339
        templates = NULL;
269
 
        _tmp11_ = zeitgeist_data_source_new_full ("org.gnome.Totem,dataprovider", "Totem dataprovider", "Logs access/leave events for media files played with Totem", _tmp10_);
270
 
        ds = g_object_ref_sink (_tmp11_);
271
 
        _tmp12_ = _g_object_ref0 (ds);
272
 
        zeitgeist_data_source_registry_register_data_source (self->priv->zg_registry, _tmp12_, NULL, NULL, NULL);
 
340
        _tmp20_ = zeitgeist_data_source_new_full ("org.gnome.Totem,dataprovider", "Totem dataprovider", "Logs access/leave events for media files played with Totem", _tmp19_);
 
341
        _tmp21_ = g_object_ref_sink (_tmp20_);
 
342
        ds = _tmp21_;
 
343
        _tmp22_ = self->priv->zg_registry;
 
344
        _tmp23_ = _g_object_ref0 (ds);
 
345
        zeitgeist_data_source_registry_register_data_source (_tmp22_, _tmp23_, NULL, NULL, NULL);
273
346
        _g_object_unref0 (ds);
274
347
        _g_object_unref0 (event);
275
348
        _g_ptr_array_free0 (templates);
278
351
 
279
352
static void zeitgeist_dp_plugin_real_deactivate (PeasActivatable* base) {
280
353
        ZeitgeistDpPlugin * self;
 
354
        TotemObject* _tmp0_;
 
355
        gulong* _tmp1_;
 
356
        gint _tmp1__length1;
 
357
        guint _tmp4_;
 
358
        guint _tmp6_;
281
359
        self = (ZeitgeistDpPlugin*) base;
282
 
        zeitgeist_dp_plugin_file_closed (self, self->priv->_object);
 
360
        _tmp0_ = self->priv->_object;
 
361
        zeitgeist_dp_plugin_file_closed (self, _tmp0_);
 
362
        _tmp1_ = self->priv->signals;
 
363
        _tmp1__length1 = self->priv->signals_length1;
283
364
        {
284
 
                gulong* id_collection;
285
 
                int id_collection_length1;
286
 
                int id_it;
287
 
                id_collection = self->priv->signals;
288
 
                id_collection_length1 = self->priv->signals_length1;
289
 
                for (id_it = 0; id_it < self->priv->signals_length1; id_it = id_it + 1) {
290
 
                        gulong id;
 
365
                gulong* id_collection = NULL;
 
366
                gint id_collection_length1 = 0;
 
367
                gint _id_collection_size_ = 0;
 
368
                gint id_it = 0;
 
369
                id_collection = _tmp1_;
 
370
                id_collection_length1 = _tmp1__length1;
 
371
                for (id_it = 0; id_it < _tmp1__length1; id_it = id_it + 1) {
 
372
                        gulong id = 0UL;
291
373
                        id = id_collection[id_it];
292
374
                        {
293
 
                                g_signal_handler_disconnect (self->priv->_object, id);
 
375
                                TotemObject* _tmp2_;
 
376
                                gulong _tmp3_;
 
377
                                _tmp2_ = self->priv->_object;
 
378
                                _tmp3_ = id;
 
379
                                g_signal_handler_disconnect (_tmp2_, _tmp3_);
294
380
                        }
295
381
                }
296
382
        }
297
383
        self->priv->signals = (g_free (self->priv->signals), NULL);
298
384
        self->priv->signals = NULL;
299
385
        self->priv->signals_length1 = 0;
300
 
        self->priv->_signals_size_ = 0;
301
 
        if (self->priv->media_info_timeout != 0) {
302
 
                g_source_remove (self->priv->media_info_timeout);
 
386
        self->priv->_signals_size_ = self->priv->signals_length1;
 
387
        _tmp4_ = self->priv->media_info_timeout;
 
388
        if (_tmp4_ != ((guint) 0)) {
 
389
                guint _tmp5_;
 
390
                _tmp5_ = self->priv->media_info_timeout;
 
391
                g_source_remove (_tmp5_);
303
392
        }
304
 
        if (self->priv->timeout_id != 0) {
305
 
                g_source_remove (self->priv->timeout_id);
 
393
        _tmp6_ = self->priv->timeout_id;
 
394
        if (_tmp6_ != ((guint) 0)) {
 
395
                guint _tmp7_;
 
396
                _tmp7_ = self->priv->timeout_id;
 
397
                g_source_remove (_tmp7_);
306
398
        }
307
399
        self->priv->media_info_timeout = (guint) 0;
308
400
        self->priv->timeout_id = (guint) 0;
324
416
 
325
417
static void zeitgeist_dp_plugin_restart_watcher (ZeitgeistDpPlugin* self, guint interval) {
326
418
        guint _tmp0_;
 
419
        guint _tmp2_;
 
420
        guint _tmp3_ = 0U;
327
421
        g_return_if_fail (self != NULL);
328
 
        if (self->priv->timeout_id != 0) {
329
 
                g_source_remove (self->priv->timeout_id);
 
422
        _tmp0_ = self->priv->timeout_id;
 
423
        if (_tmp0_ != ((guint) 0)) {
 
424
                guint _tmp1_;
 
425
                _tmp1_ = self->priv->timeout_id;
 
426
                g_source_remove (_tmp1_);
330
427
        }
331
 
        _tmp0_ = g_timeout_add_full (G_PRIORITY_DEFAULT, interval, _zeitgeist_dp_plugin_timeout_cb_gsource_func, g_object_ref (self), g_object_unref);
332
 
        self->priv->timeout_id = _tmp0_;
 
428
        _tmp2_ = interval;
 
429
        _tmp3_ = g_timeout_add_full (G_PRIORITY_DEFAULT, _tmp2_, _zeitgeist_dp_plugin_timeout_cb_gsource_func, g_object_ref (self), g_object_unref);
 
430
        self->priv->timeout_id = _tmp3_;
333
431
}
334
432
 
335
433
 
341
439
 
342
440
 
343
441
static void zeitgeist_dp_plugin_file_opened (ZeitgeistDpPlugin* self, const gchar* mrl, TotemObject* totem) {
344
 
        MediaInfo _tmp0_ = {0};
345
 
        MediaInfo _tmp1_ = {0};
346
 
        gchar* _tmp2_;
 
442
        MediaInfo _tmp0_;
 
443
        const gchar* _tmp1_;
 
444
        MediaInfo _tmp3_ = {0};
 
445
        const gchar* _tmp4_;
 
446
        gchar* _tmp5_;
347
447
        GTimeVal cur_time = {0};
348
 
        gint64 _tmp3_;
 
448
        GTimeVal _tmp6_;
 
449
        gint64 _tmp7_ = 0LL;
 
450
        guint _tmp8_;
349
451
        g_return_if_fail (self != NULL);
350
452
        g_return_if_fail (mrl != NULL);
351
453
        g_return_if_fail (totem != NULL);
352
 
        if (self->priv->current_media.mrl != NULL) {
353
 
                zeitgeist_dp_plugin_file_closed (self, totem);
 
454
        _tmp0_ = self->priv->current_media;
 
455
        _tmp1_ = _tmp0_.mrl;
 
456
        if (_tmp1_ != NULL) {
 
457
                TotemObject* _tmp2_;
 
458
                _tmp2_ = totem;
 
459
                zeitgeist_dp_plugin_file_closed (self, _tmp2_);
354
460
        }
355
 
        memset (&_tmp0_, 0, sizeof (MediaInfo));
356
 
        _tmp1_ = _tmp0_;
 
461
        memset (&_tmp3_, 0, sizeof (MediaInfo));
357
462
        media_info_destroy (&self->priv->current_media);
358
 
        self->priv->current_media = _tmp1_;
359
 
        _tmp2_ = g_strdup (mrl);
 
463
        self->priv->current_media = _tmp3_;
 
464
        _tmp4_ = mrl;
 
465
        _tmp5_ = g_strdup (_tmp4_);
360
466
        _g_free0 (self->priv->current_media.mrl);
361
 
        self->priv->current_media.mrl = _tmp2_;
 
467
        self->priv->current_media.mrl = _tmp5_;
362
468
        g_get_current_time (&cur_time);
363
 
        _tmp3_ = zeitgeist_timestamp_from_timeval (&cur_time);
364
 
        self->priv->current_media.timestamp = _tmp3_;
365
 
        if (self->priv->media_info_timeout == 0) {
366
 
                guint _tmp4_;
367
 
                _tmp4_ = g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 250, _zeitgeist_dp_plugin_wait_for_media_info_gsource_func, g_object_ref (self), g_object_unref);
368
 
                self->priv->media_info_timeout = _tmp4_;
 
469
        _tmp6_ = cur_time;
 
470
        _tmp7_ = zeitgeist_timestamp_from_timeval (&_tmp6_);
 
471
        self->priv->current_media.timestamp = _tmp7_;
 
472
        _tmp8_ = self->priv->media_info_timeout;
 
473
        if (_tmp8_ == ((guint) 0)) {
 
474
                guint _tmp9_ = 0U;
 
475
                _tmp9_ = g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 250, _zeitgeist_dp_plugin_wait_for_media_info_gsource_func, g_object_ref (self), g_object_unref);
 
476
                self->priv->media_info_timeout = _tmp9_;
369
477
                zeitgeist_dp_plugin_restart_watcher (self, (guint) 15000);
370
478
        }
371
479
}
373
481
 
374
482
static void zeitgeist_dp_plugin_file_closed (ZeitgeistDpPlugin* self, TotemObject* totem) {
375
483
        gboolean _tmp0_ = FALSE;
 
484
        MediaInfo _tmp1_;
 
485
        gboolean _tmp2_;
 
486
        gboolean _tmp5_;
 
487
        guint _tmp8_;
 
488
        guint _tmp10_;
376
489
        g_return_if_fail (self != NULL);
377
490
        g_return_if_fail (totem != NULL);
378
 
        if (self->priv->current_media.sent_access) {
379
 
                _tmp0_ = self->priv->current_media.mrl != NULL;
 
491
        _tmp1_ = self->priv->current_media;
 
492
        _tmp2_ = _tmp1_.sent_access;
 
493
        if (_tmp2_) {
 
494
                MediaInfo _tmp3_;
 
495
                const gchar* _tmp4_;
 
496
                _tmp3_ = self->priv->current_media;
 
497
                _tmp4_ = _tmp3_.mrl;
 
498
                _tmp0_ = _tmp4_ != NULL;
380
499
        } else {
381
500
                _tmp0_ = FALSE;
382
501
        }
383
 
        if (_tmp0_) {
 
502
        _tmp5_ = _tmp0_;
 
503
        if (_tmp5_) {
384
504
                GTimeVal cur_time = {0};
385
 
                gint64 _tmp1_;
 
505
                GTimeVal _tmp6_;
 
506
                gint64 _tmp7_ = 0LL;
386
507
                g_get_current_time (&cur_time);
387
 
                _tmp1_ = zeitgeist_timestamp_from_timeval (&cur_time);
388
 
                self->priv->current_media.timestamp = _tmp1_;
 
508
                _tmp6_ = cur_time;
 
509
                _tmp7_ = zeitgeist_timestamp_from_timeval (&_tmp6_);
 
510
                self->priv->current_media.timestamp = _tmp7_;
389
511
                zeitgeist_dp_plugin_send_event_to_zg (self, TRUE);
390
512
                _g_free0 (self->priv->current_media.mrl);
391
513
                self->priv->current_media.mrl = NULL;
392
514
        }
393
 
        if (self->priv->media_info_timeout != 0) {
394
 
                g_source_remove (self->priv->media_info_timeout);
 
515
        _tmp8_ = self->priv->media_info_timeout;
 
516
        if (_tmp8_ != ((guint) 0)) {
 
517
                guint _tmp9_;
 
518
                _tmp9_ = self->priv->media_info_timeout;
 
519
                g_source_remove (_tmp9_);
395
520
        }
396
521
        self->priv->media_info_timeout = (guint) 0;
397
 
        if (self->priv->timeout_id != 0) {
398
 
                g_source_remove (self->priv->timeout_id);
 
522
        _tmp10_ = self->priv->timeout_id;
 
523
        if (_tmp10_ != ((guint) 0)) {
 
524
                guint _tmp11_;
 
525
                _tmp11_ = self->priv->timeout_id;
 
526
                g_source_remove (_tmp11_);
399
527
        }
400
528
        self->priv->timeout_id = (guint) 0;
401
529
}
402
530
 
403
531
 
404
532
static void zeitgeist_dp_plugin_metadata_changed (ZeitgeistDpPlugin* self, const gchar* artist, const gchar* title, const gchar* album, guint track_num, TotemObject* totem) {
 
533
        guint _tmp0_;
405
534
        g_return_if_fail (self != NULL);
406
535
        g_return_if_fail (totem != NULL);
407
 
        if (self->priv->media_info_timeout != 0) {
408
 
                gchar* _tmp0_;
409
 
                gchar* _tmp1_;
 
536
        _tmp0_ = self->priv->media_info_timeout;
 
537
        if (_tmp0_ != ((guint) 0)) {
 
538
                const gchar* _tmp1_;
410
539
                gchar* _tmp2_;
411
 
                _tmp0_ = g_strdup (artist);
 
540
                const gchar* _tmp3_;
 
541
                gchar* _tmp4_;
 
542
                const gchar* _tmp5_;
 
543
                gchar* _tmp6_;
 
544
                _tmp1_ = artist;
 
545
                _tmp2_ = g_strdup (_tmp1_);
412
546
                _g_free0 (self->priv->current_media.artist);
413
 
                self->priv->current_media.artist = _tmp0_;
414
 
                _tmp1_ = g_strdup (title);
 
547
                self->priv->current_media.artist = _tmp2_;
 
548
                _tmp3_ = title;
 
549
                _tmp4_ = g_strdup (_tmp3_);
415
550
                _g_free0 (self->priv->current_media.title);
416
 
                self->priv->current_media.title = _tmp1_;
417
 
                _tmp2_ = g_strdup (album);
 
551
                self->priv->current_media.title = _tmp4_;
 
552
                _tmp5_ = album;
 
553
                _tmp6_ = g_strdup (_tmp5_);
418
554
                _g_free0 (self->priv->current_media.album);
419
 
                self->priv->current_media.album = _tmp2_;
 
555
                self->priv->current_media.album = _tmp6_;
420
556
        }
421
557
}
422
558
 
423
559
 
424
560
static gboolean zeitgeist_dp_plugin_timeout_cb (ZeitgeistDpPlugin* self) {
425
561
        gboolean result = FALSE;
 
562
        guint _tmp0_;
426
563
        g_return_val_if_fail (self != NULL, FALSE);
427
 
        if (self->priv->media_info_timeout != 0) {
428
 
                gchar* _tmp0_ = NULL;
429
 
                g_source_remove (self->priv->media_info_timeout);
 
564
        _tmp0_ = self->priv->media_info_timeout;
 
565
        if (_tmp0_ != ((guint) 0)) {
 
566
                guint _tmp1_;
 
567
                TotemObject* _tmp2_;
 
568
                gchar* _tmp3_ = NULL;
 
569
                _tmp1_ = self->priv->media_info_timeout;
 
570
                g_source_remove (_tmp1_);
430
571
                self->priv->media_info_timeout = (guint) 0;
431
 
                _tmp0_ = totem_get_short_title (self->priv->_object);
 
572
                _tmp2_ = self->priv->_object;
 
573
                _tmp3_ = totem_get_short_title (_tmp2_);
432
574
                _g_free0 (self->priv->current_media.title);
433
 
                self->priv->current_media.title = _tmp0_;
 
575
                self->priv->current_media.title = _tmp3_;
434
576
                self->priv->timeout_id = (guint) 0;
435
577
                zeitgeist_dp_plugin_wait_for_media_info (self);
436
578
        }
441
583
 
442
584
 
443
585
static void zeitgeist_dp_plugin_query_media_mimetype_data_free (gpointer _data) {
444
 
        ZeitgeistDpPluginQueryMediaMimetypeData* data;
445
 
        data = _data;
446
 
        _g_free0 (data->current_mrl);
447
 
        _g_object_unref0 (data->self);
448
 
        g_slice_free (ZeitgeistDpPluginQueryMediaMimetypeData, data);
 
586
        ZeitgeistDpPluginQueryMediaMimetypeData* _data_;
 
587
        _data_ = _data;
 
588
        _g_free0 (_data_->current_mrl);
 
589
        _g_object_unref0 (_data_->self);
 
590
        g_slice_free (ZeitgeistDpPluginQueryMediaMimetypeData, _data_);
449
591
}
450
592
 
451
593
 
452
594
static void zeitgeist_dp_plugin_query_media_mimetype (ZeitgeistDpPlugin* self, const gchar* current_mrl, GAsyncReadyCallback _callback_, gpointer _user_data_) {
453
595
        ZeitgeistDpPluginQueryMediaMimetypeData* _data_;
 
596
        ZeitgeistDpPlugin* _tmp0_;
 
597
        const gchar* _tmp1_;
 
598
        const gchar* _tmp2_;
454
599
        _data_ = g_slice_new0 (ZeitgeistDpPluginQueryMediaMimetypeData);
455
600
        _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, zeitgeist_dp_plugin_query_media_mimetype);
456
601
        g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, zeitgeist_dp_plugin_query_media_mimetype_data_free);
457
 
        _data_->self = _g_object_ref0 (self);
458
 
        _data_->current_mrl = g_strdup (current_mrl);
 
602
        _tmp0_ = _g_object_ref0 (self);
 
603
        _data_->self = _tmp0_;
 
604
        _tmp1_ = current_mrl;
 
605
        _tmp2_ = g_strdup (_tmp1_);
 
606
        _data_->current_mrl = _tmp2_;
459
607
        zeitgeist_dp_plugin_query_media_mimetype_co (_data_);
460
608
}
461
609
 
467
615
 
468
616
 
469
617
static void zeitgeist_dp_plugin_query_media_mimetype_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
470
 
        ZeitgeistDpPluginQueryMediaMimetypeData* data;
471
 
        data = _user_data_;
472
 
        data->_source_object_ = source_object;
473
 
        data->_res_ = _res_;
474
 
        zeitgeist_dp_plugin_query_media_mimetype_co (data);
 
618
        ZeitgeistDpPluginQueryMediaMimetypeData* _data_;
 
619
        _data_ = _user_data_;
 
620
        _data_->_source_object_ = source_object;
 
621
        _data_->_res_ = _res_;
 
622
        zeitgeist_dp_plugin_query_media_mimetype_co (_data_);
475
623
}
476
624
 
477
625
 
478
 
static gboolean zeitgeist_dp_plugin_query_media_mimetype_co (ZeitgeistDpPluginQueryMediaMimetypeData* data) {
479
 
        switch (data->_state_) {
 
626
static gboolean zeitgeist_dp_plugin_query_media_mimetype_co (ZeitgeistDpPluginQueryMediaMimetypeData* _data_) {
 
627
        switch (_data_->_state_) {
480
628
                case 0:
481
629
                goto _state_0;
482
630
                case 1:
485
633
                g_assert_not_reached ();
486
634
        }
487
635
        _state_0:
488
 
        data->_tmp0_ = g_strdup (data->current_mrl);
489
 
        data->mrl = data->_tmp0_;
490
 
        data->_tmp1_ = NULL;
491
 
        data->_tmp1_ = g_file_new_for_uri (data->mrl);
492
 
        data->f = data->_tmp1_;
493
 
        data->_state_ = 1;
494
 
        g_file_query_info_async (data->f, G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE, 0, G_PRIORITY_DEFAULT_IDLE, NULL, zeitgeist_dp_plugin_query_media_mimetype_ready, data);
495
 
        return FALSE;
496
 
        _state_1:
497
 
        data->_tmp2_ = NULL;
498
 
        data->_tmp2_ = g_file_query_info_finish (data->f, data->_res_, &data->_inner_error_);
499
 
        data->fi = data->_tmp2_;
500
 
        if (data->_inner_error_ != NULL) {
501
 
                goto __catch0_g_error;
502
 
        }
503
 
        if (g_strcmp0 (data->self->priv->current_media.mrl, data->mrl) != 0) {
504
 
                data->_tmp3_ = TRUE;
505
 
        } else {
506
 
                data->_tmp4_ = totem_object_is_playing (data->self->priv->_object);
507
 
                data->_tmp3_ = !data->_tmp4_;
508
 
        }
509
 
        if (data->_tmp3_) {
510
 
                _g_object_unref0 (data->fi);
511
 
                _g_object_unref0 (data->f);
512
 
                _g_free0 (data->mrl);
513
 
                if (data->_state_ == 0) {
514
 
                        g_simple_async_result_complete_in_idle (data->_async_result);
 
636
        _data_->_tmp0_ = _data_->current_mrl;
 
637
        _data_->_tmp1_ = g_strdup (_data_->_tmp0_);
 
638
        _data_->mrl = _data_->_tmp1_;
 
639
        _data_->_tmp2_ = _data_->mrl;
 
640
        _data_->_tmp3_ = NULL;
 
641
        _data_->_tmp3_ = g_file_new_for_uri (_data_->_tmp2_);
 
642
        _data_->f = _data_->_tmp3_;
 
643
        {
 
644
                _data_->_tmp4_ = _data_->f;
 
645
                _data_->_state_ = 1;
 
646
                g_file_query_info_async (_data_->_tmp4_, G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE, 0, G_PRIORITY_DEFAULT_IDLE, NULL, zeitgeist_dp_plugin_query_media_mimetype_ready, _data_);
 
647
                return FALSE;
 
648
                _state_1:
 
649
                _data_->_tmp5_ = NULL;
 
650
                _data_->_tmp5_ = g_file_query_info_finish (_data_->_tmp4_, _data_->_res_, &_data_->_inner_error_);
 
651
                _data_->fi = _data_->_tmp5_;
 
652
                if (_data_->_inner_error_ != NULL) {
 
653
                        goto __catch0_g_error;
 
654
                }
 
655
                _data_->_tmp7_ = _data_->self->priv->current_media;
 
656
                _data_->_tmp8_ = _data_->_tmp7_.mrl;
 
657
                _data_->_tmp9_ = _data_->mrl;
 
658
                if (g_strcmp0 (_data_->_tmp8_, _data_->_tmp9_) != 0) {
 
659
                        _data_->_tmp6_ = TRUE;
515
660
                } else {
516
 
                        g_simple_async_result_complete (data->_async_result);
517
 
                }
518
 
                g_object_unref (data->_async_result);
519
 
                return FALSE;
 
661
                        _data_->_tmp10_ = _data_->self->priv->_object;
 
662
                        _data_->_tmp11_ = FALSE;
 
663
                        _data_->_tmp11_ = totem_object_is_playing (_data_->_tmp10_);
 
664
                        _data_->_tmp6_ = !_data_->_tmp11_;
 
665
                }
 
666
                _data_->_tmp12_ = _data_->_tmp6_;
 
667
                if (_data_->_tmp12_) {
 
668
                        _g_object_unref0 (_data_->fi);
 
669
                        _g_object_unref0 (_data_->f);
 
670
                        _g_free0 (_data_->mrl);
 
671
                        if (_data_->_state_ == 0) {
 
672
                                g_simple_async_result_complete_in_idle (_data_->_async_result);
 
673
                        } else {
 
674
                                g_simple_async_result_complete (_data_->_async_result);
 
675
                        }
 
676
                        g_object_unref (_data_->_async_result);
 
677
                        return FALSE;
 
678
                }
 
679
                _data_->_tmp13_ = _data_->fi;
 
680
                _data_->_tmp14_ = NULL;
 
681
                _data_->_tmp14_ = g_file_info_get_content_type (_data_->_tmp13_);
 
682
                _data_->_tmp15_ = g_strdup (_data_->_tmp14_);
 
683
                _g_free0 (_data_->self->priv->current_media.mimetype);
 
684
                _data_->self->priv->current_media.mimetype = _data_->_tmp15_;
 
685
                zeitgeist_dp_plugin_send_event_to_zg (_data_->self, FALSE);
 
686
                _data_->self->priv->current_media.sent_access = TRUE;
 
687
                _g_object_unref0 (_data_->fi);
520
688
        }
521
 
        data->_tmp5_ = NULL;
522
 
        data->_tmp5_ = g_file_info_get_content_type (data->fi);
523
 
        data->_tmp6_ = g_strdup (data->_tmp5_);
524
 
        _g_free0 (data->self->priv->current_media.mimetype);
525
 
        data->self->priv->current_media.mimetype = data->_tmp6_;
526
 
        zeitgeist_dp_plugin_send_event_to_zg (data->self, FALSE);
527
 
        data->self->priv->current_media.sent_access = TRUE;
528
 
        _g_object_unref0 (data->fi);
529
689
        goto __finally0;
530
690
        __catch0_g_error:
531
691
        {
532
 
                data->err = data->_inner_error_;
533
 
                data->_inner_error_ = NULL;
534
 
                _g_error_free0 (data->err);
 
692
                _data_->err = _data_->_inner_error_;
 
693
                _data_->_inner_error_ = NULL;
 
694
                _g_error_free0 (_data_->err);
535
695
        }
536
696
        __finally0:
537
 
        if (data->_inner_error_ != NULL) {
538
 
                _g_object_unref0 (data->f);
539
 
                _g_free0 (data->mrl);
540
 
                g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, data->_inner_error_->message, g_quark_to_string (data->_inner_error_->domain), data->_inner_error_->code);
541
 
                g_clear_error (&data->_inner_error_);
 
697
        if (_data_->_inner_error_ != NULL) {
 
698
                _g_object_unref0 (_data_->f);
 
699
                _g_free0 (_data_->mrl);
 
700
                g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
 
701
                g_clear_error (&_data_->_inner_error_);
542
702
                return FALSE;
543
703
        }
544
 
        _g_object_unref0 (data->f);
545
 
        _g_free0 (data->mrl);
546
 
        if (data->_state_ == 0) {
547
 
                g_simple_async_result_complete_in_idle (data->_async_result);
 
704
        _g_object_unref0 (_data_->f);
 
705
        _g_free0 (_data_->mrl);
 
706
        if (_data_->_state_ == 0) {
 
707
                g_simple_async_result_complete_in_idle (_data_->_async_result);
548
708
        } else {
549
 
                g_simple_async_result_complete (data->_async_result);
 
709
                g_simple_async_result_complete (_data_->_async_result);
550
710
        }
551
 
        g_object_unref (data->_async_result);
 
711
        g_object_unref (_data_->_async_result);
552
712
        return FALSE;
553
713
}
554
714
 
556
716
static gboolean zeitgeist_dp_plugin_wait_for_media_info (ZeitgeistDpPlugin* self) {
557
717
        gboolean result = FALSE;
558
718
        gboolean _tmp0_ = FALSE;
 
719
        MediaInfo _tmp1_;
 
720
        const gchar* _tmp2_;
 
721
        gboolean _tmp5_;
559
722
        g_return_val_if_fail (self != NULL, FALSE);
560
 
        if (self->priv->current_media.title != NULL) {
561
 
                gboolean _tmp1_;
562
 
                _tmp1_ = totem_object_is_playing (self->priv->_object);
563
 
                _tmp0_ = _tmp1_;
 
723
        _tmp1_ = self->priv->current_media;
 
724
        _tmp2_ = _tmp1_.title;
 
725
        if (_tmp2_ != NULL) {
 
726
                TotemObject* _tmp3_;
 
727
                gboolean _tmp4_ = FALSE;
 
728
                _tmp3_ = self->priv->_object;
 
729
                _tmp4_ = totem_object_is_playing (_tmp3_);
 
730
                _tmp0_ = _tmp4_;
564
731
        } else {
565
732
                _tmp0_ = FALSE;
566
733
        }
567
 
        if (_tmp0_) {
 
734
        _tmp5_ = _tmp0_;
 
735
        if (_tmp5_) {
568
736
                GValue val = {0};
569
 
                GtkWidget* _tmp2_ = NULL;
570
 
                GtkWidget* _tmp3_;
 
737
                TotemObject* _tmp6_;
 
738
                GtkWidget* _tmp7_ = NULL;
571
739
                BaconVideoWidget* video;
572
 
                GValue _tmp4_ = {0};
573
 
                const gchar* _tmp5_ = NULL;
574
 
                gboolean _tmp6_;
575
 
                gchar* _tmp7_;
576
 
                _tmp2_ = totem_get_video_widget (self->priv->_object);
577
 
                _tmp3_ = _tmp2_;
578
 
                video = BACON_IS_VIDEO_WIDGET (_tmp3_) ? ((BaconVideoWidget*) _tmp3_) : NULL;
579
 
                bacon_video_widget_get_metadata (video, BVW_INFO_HAS_VIDEO, &_tmp4_);
 
740
                BaconVideoWidget* _tmp8_;
 
741
                GValue _tmp9_ = {0};
 
742
                const gchar* _tmp10_ = NULL;
 
743
                gboolean _tmp11_ = FALSE;
 
744
                const gchar* _tmp12_;
 
745
                gchar* _tmp13_;
 
746
                MediaInfo _tmp14_;
 
747
                const gchar* _tmp15_;
 
748
                guint _tmp16_;
 
749
                _tmp6_ = self->priv->_object;
 
750
                _tmp7_ = totem_get_video_widget (_tmp6_);
 
751
                video = BACON_IS_VIDEO_WIDGET (_tmp7_) ? ((BaconVideoWidget*) _tmp7_) : NULL;
 
752
                _tmp8_ = video;
 
753
                bacon_video_widget_get_metadata (_tmp8_, BVW_INFO_HAS_VIDEO, &_tmp9_);
580
754
                G_IS_VALUE (&val) ? (g_value_unset (&val), NULL) : NULL;
581
 
                val = _tmp4_;
582
 
                _tmp6_ = g_value_get_boolean (&val);
583
 
                if (_tmp6_) {
584
 
                        _tmp5_ = ZEITGEIST_NFO_VIDEO;
 
755
                val = _tmp9_;
 
756
                _tmp11_ = g_value_get_boolean (&val);
 
757
                if (_tmp11_) {
 
758
                        _tmp10_ = ZEITGEIST_NFO_VIDEO;
585
759
                } else {
586
 
                        _tmp5_ = ZEITGEIST_NFO_AUDIO;
 
760
                        _tmp10_ = ZEITGEIST_NFO_AUDIO;
587
761
                }
588
 
                _tmp7_ = g_strdup (_tmp5_);
 
762
                _tmp12_ = _tmp10_;
 
763
                _tmp13_ = g_strdup (_tmp12_);
589
764
                _g_free0 (self->priv->current_media.interpretation);
590
 
                self->priv->current_media.interpretation = _tmp7_;
591
 
                zeitgeist_dp_plugin_query_media_mimetype (self, self->priv->current_media.mrl, NULL, NULL);
592
 
                if (self->priv->timeout_id != 0) {
593
 
                        g_source_remove (self->priv->timeout_id);
 
765
                self->priv->current_media.interpretation = _tmp13_;
 
766
                _tmp14_ = self->priv->current_media;
 
767
                _tmp15_ = _tmp14_.mrl;
 
768
                zeitgeist_dp_plugin_query_media_mimetype (self, _tmp15_, NULL, NULL);
 
769
                _tmp16_ = self->priv->timeout_id;
 
770
                if (_tmp16_ != ((guint) 0)) {
 
771
                        guint _tmp17_;
 
772
                        _tmp17_ = self->priv->timeout_id;
 
773
                        g_source_remove (_tmp17_);
594
774
                }
595
775
                self->priv->timeout_id = (guint) 0;
596
776
                self->priv->media_info_timeout = (guint) 0;
606
786
 
607
787
static void zeitgeist_dp_plugin_playing_changed (ZeitgeistDpPlugin* self) {
608
788
        gboolean _tmp0_ = FALSE;
609
 
        gboolean _tmp1_ = FALSE;
610
 
        gboolean _tmp2_;
 
789
        guint _tmp1_;
 
790
        gboolean _tmp4_;
 
791
        gboolean _tmp5_ = FALSE;
 
792
        TotemObject* _tmp6_;
 
793
        gboolean _tmp7_ = FALSE;
 
794
        gboolean _tmp10_;
611
795
        g_return_if_fail (self != NULL);
612
 
        if (self->priv->media_info_timeout == 0) {
613
 
                _tmp0_ = self->priv->current_media.sent_access == FALSE;
 
796
        _tmp1_ = self->priv->media_info_timeout;
 
797
        if (_tmp1_ == ((guint) 0)) {
 
798
                MediaInfo _tmp2_;
 
799
                gboolean _tmp3_;
 
800
                _tmp2_ = self->priv->current_media;
 
801
                _tmp3_ = _tmp2_.sent_access;
 
802
                _tmp0_ = _tmp3_ == FALSE;
614
803
        } else {
615
804
                _tmp0_ = FALSE;
616
805
        }
617
 
        if (_tmp0_) {
 
806
        _tmp4_ = _tmp0_;
 
807
        if (_tmp4_) {
618
808
                zeitgeist_dp_plugin_wait_for_media_info (self);
619
809
        }
620
 
        _tmp2_ = totem_object_is_playing (self->priv->_object);
621
 
        if (!_tmp2_) {
622
 
                _tmp1_ = self->priv->current_media.sent_access;
 
810
        _tmp6_ = self->priv->_object;
 
811
        _tmp7_ = totem_object_is_playing (_tmp6_);
 
812
        if (!_tmp7_) {
 
813
                MediaInfo _tmp8_;
 
814
                gboolean _tmp9_;
 
815
                _tmp8_ = self->priv->current_media;
 
816
                _tmp9_ = _tmp8_.sent_access;
 
817
                _tmp5_ = _tmp9_;
623
818
        } else {
624
 
                _tmp1_ = FALSE;
 
819
                _tmp5_ = FALSE;
625
820
        }
626
 
        if (_tmp1_) {
627
 
                zeitgeist_dp_plugin_file_closed (self, self->priv->_object);
 
821
        _tmp10_ = _tmp5_;
 
822
        if (_tmp10_) {
 
823
                TotemObject* _tmp11_;
 
824
                _tmp11_ = self->priv->_object;
 
825
                zeitgeist_dp_plugin_file_closed (self, _tmp11_);
628
826
        }
629
827
}
630
828
 
631
829
 
632
830
static void zeitgeist_dp_plugin_send_event_to_zg (ZeitgeistDpPlugin* self, gboolean leave_event) {
633
831
        gboolean _tmp0_ = FALSE;
 
832
        MediaInfo _tmp1_;
 
833
        const gchar* _tmp2_;
 
834
        gboolean _tmp5_;
634
835
        g_return_if_fail (self != NULL);
635
 
        if (self->priv->current_media.mrl != NULL) {
636
 
                _tmp0_ = self->priv->current_media.title != NULL;
 
836
        _tmp1_ = self->priv->current_media;
 
837
        _tmp2_ = _tmp1_.mrl;
 
838
        if (_tmp2_ != NULL) {
 
839
                MediaInfo _tmp3_;
 
840
                const gchar* _tmp4_;
 
841
                _tmp3_ = self->priv->current_media;
 
842
                _tmp4_ = _tmp3_.title;
 
843
                _tmp0_ = _tmp4_ != NULL;
637
844
        } else {
638
845
                _tmp0_ = FALSE;
639
846
        }
640
 
        if (_tmp0_) {
641
 
                const gchar* _tmp1_ = NULL;
642
 
                gchar* _tmp2_;
 
847
        _tmp5_ = _tmp0_;
 
848
        if (_tmp5_) {
 
849
                const gchar* _tmp6_ = NULL;
 
850
                gboolean _tmp7_;
 
851
                const gchar* _tmp8_;
 
852
                gchar* _tmp9_;
643
853
                gchar* event_interpretation;
644
 
                gchar* _tmp3_ = NULL;
 
854
                MediaInfo _tmp10_;
 
855
                const gchar* _tmp11_;
 
856
                gchar* _tmp12_ = NULL;
645
857
                gchar* origin;
646
 
                const gchar* _tmp4_ = NULL;
647
 
                ZeitgeistSubject* _tmp5_ = NULL;
 
858
                MediaInfo _tmp13_;
 
859
                const gchar* _tmp14_;
 
860
                MediaInfo _tmp15_;
 
861
                const gchar* _tmp16_;
 
862
                MediaInfo _tmp17_;
 
863
                const gchar* _tmp18_;
 
864
                const gchar* _tmp19_ = NULL;
 
865
                MediaInfo _tmp20_;
 
866
                const gchar* _tmp21_;
 
867
                const gchar* _tmp22_;
 
868
                MediaInfo _tmp23_;
 
869
                const gchar* _tmp24_;
 
870
                ZeitgeistSubject* _tmp25_;
 
871
                ZeitgeistSubject* _tmp26_;
648
872
                ZeitgeistSubject* subject;
649
 
                ZeitgeistEvent* _tmp6_ = NULL;
 
873
                const gchar* _tmp27_;
 
874
                ZeitgeistSubject* _tmp28_;
 
875
                ZeitgeistEvent* _tmp29_;
 
876
                ZeitgeistEvent* _tmp30_;
650
877
                ZeitgeistEvent* event;
651
 
                if (leave_event) {
652
 
                        _tmp1_ = ZEITGEIST_ZG_LEAVE_EVENT;
 
878
                ZeitgeistEvent* _tmp31_;
 
879
                MediaInfo _tmp32_;
 
880
                gint64 _tmp33_;
 
881
                ZeitgeistLog* _tmp34_;
 
882
                ZeitgeistEvent* _tmp35_;
 
883
                _tmp7_ = leave_event;
 
884
                if (_tmp7_) {
 
885
                        _tmp6_ = ZEITGEIST_ZG_LEAVE_EVENT;
653
886
                } else {
654
 
                        _tmp1_ = ZEITGEIST_ZG_ACCESS_EVENT;
 
887
                        _tmp6_ = ZEITGEIST_ZG_ACCESS_EVENT;
655
888
                }
656
 
                _tmp2_ = g_strdup (_tmp1_);
657
 
                event_interpretation = _tmp2_;
658
 
                _tmp3_ = g_path_get_dirname (self->priv->current_media.mrl);
659
 
                origin = _tmp3_;
660
 
                _tmp4_ = zeitgeist_manifestation_for_uri (self->priv->current_media.mrl);
661
 
                _tmp5_ = zeitgeist_subject_new_full (self->priv->current_media.mrl, self->priv->current_media.interpretation, _tmp4_, self->priv->current_media.mimetype, origin, self->priv->current_media.title, "");
662
 
                subject = g_object_ref_sink (_tmp5_);
663
 
                _tmp6_ = zeitgeist_event_new_full (event_interpretation, ZEITGEIST_ZG_USER_ACTIVITY, "application://totem.desktop", subject, NULL, NULL);
664
 
                event = g_object_ref_sink (_tmp6_);
665
 
                zeitgeist_event_set_timestamp (event, self->priv->current_media.timestamp);
666
 
                zeitgeist_log_insert_events_no_reply (self->priv->zg_log, event, NULL, NULL);
 
889
                _tmp8_ = _tmp6_;
 
890
                _tmp9_ = g_strdup (_tmp8_);
 
891
                event_interpretation = _tmp9_;
 
892
                _tmp10_ = self->priv->current_media;
 
893
                _tmp11_ = _tmp10_.mrl;
 
894
                _tmp12_ = g_path_get_dirname (_tmp11_);
 
895
                origin = _tmp12_;
 
896
                _tmp13_ = self->priv->current_media;
 
897
                _tmp14_ = _tmp13_.mrl;
 
898
                _tmp15_ = self->priv->current_media;
 
899
                _tmp16_ = _tmp15_.interpretation;
 
900
                _tmp17_ = self->priv->current_media;
 
901
                _tmp18_ = _tmp17_.mrl;
 
902
                _tmp19_ = zeitgeist_manifestation_for_uri (_tmp18_);
 
903
                _tmp20_ = self->priv->current_media;
 
904
                _tmp21_ = _tmp20_.mimetype;
 
905
                _tmp22_ = origin;
 
906
                _tmp23_ = self->priv->current_media;
 
907
                _tmp24_ = _tmp23_.title;
 
908
                _tmp25_ = zeitgeist_subject_new_full (_tmp14_, _tmp16_, _tmp19_, _tmp21_, _tmp22_, _tmp24_, "");
 
909
                _tmp26_ = g_object_ref_sink (_tmp25_);
 
910
                subject = _tmp26_;
 
911
                _tmp27_ = event_interpretation;
 
912
                _tmp28_ = subject;
 
913
                _tmp29_ = zeitgeist_event_new_full (_tmp27_, ZEITGEIST_ZG_USER_ACTIVITY, "application://totem.desktop", _tmp28_, NULL, NULL);
 
914
                _tmp30_ = g_object_ref_sink (_tmp29_);
 
915
                event = _tmp30_;
 
916
                _tmp31_ = event;
 
917
                _tmp32_ = self->priv->current_media;
 
918
                _tmp33_ = _tmp32_.timestamp;
 
919
                zeitgeist_event_set_timestamp (_tmp31_, _tmp33_);
 
920
                _tmp34_ = self->priv->zg_log;
 
921
                _tmp35_ = event;
 
922
                zeitgeist_log_insert_events_no_reply (_tmp34_, _tmp35_, NULL, NULL);
667
923
                _g_object_unref0 (event);
668
924
                _g_object_unref0 (subject);
669
925
                _g_free0 (origin);
686
942
 
687
943
TotemObject* zeitgeist_dp_plugin_get_object (ZeitgeistDpPlugin* self) {
688
944
        TotemObject* result;
 
945
        TotemObject* _tmp0_;
689
946
        g_return_val_if_fail (self != NULL, NULL);
690
 
        result = self->priv->_object;
 
947
        _tmp0_ = self->priv->_object;
 
948
        result = _tmp0_;
691
949
        return result;
692
950
}
693
951
 
694
952
 
695
953
void zeitgeist_dp_plugin_set_object (ZeitgeistDpPlugin* self, TotemObject* value) {
 
954
        TotemObject* _tmp0_;
696
955
        g_return_if_fail (self != NULL);
697
 
        self->priv->_object = value;
 
956
        _tmp0_ = value;
 
957
        self->priv->_object = _tmp0_;
698
958
        g_object_notify ((GObject *) self, "object");
699
959
}
700
960
 
705
965
        G_OBJECT_CLASS (klass)->get_property = _vala_zeitgeist_dp_plugin_get_property;
706
966
        G_OBJECT_CLASS (klass)->set_property = _vala_zeitgeist_dp_plugin_set_property;
707
967
        G_OBJECT_CLASS (klass)->finalize = zeitgeist_dp_plugin_finalize;
708
 
        g_object_class_install_property (G_OBJECT_CLASS (klass), ZEITGEIST_DP_PLUGIN_OBJECT, g_param_spec_object ("object", "object", "object", TOTEM_TYPE_OBJECT, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
 
968
        g_object_class_install_property (G_OBJECT_CLASS (klass), ZEITGEIST_DP_PLUGIN_OBJECT, g_param_spec_object ("object", "object", "object", totem_object_get_type (), G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
709
969
}
710
970
 
711
971
 
742
1002
        static const GTypeInfo g_define_type_info = { sizeof (ZeitgeistDpPluginClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) zeitgeist_dp_plugin_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ZeitgeistDpPlugin), 0, (GInstanceInitFunc) zeitgeist_dp_plugin_instance_init, NULL };
743
1003
        static const GInterfaceInfo peas_activatable_info = { (GInterfaceInitFunc) zeitgeist_dp_plugin_peas_activatable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
744
1004
        zeitgeist_dp_plugin_type_id = g_type_module_register_type (module, G_TYPE_OBJECT, "ZeitgeistDpPlugin", &g_define_type_info, 0);
745
 
        g_type_module_add_interface (module, zeitgeist_dp_plugin_type_id, PEAS_TYPE_ACTIVATABLE, &peas_activatable_info);
 
1005
        g_type_module_add_interface (module, zeitgeist_dp_plugin_type_id, peas_activatable_get_type (), &peas_activatable_info);
746
1006
        return zeitgeist_dp_plugin_type_id;
747
1007
}
748
1008
 
784
1044
        _tmp0_ = module;
785
1045
        _tmp1_ = _g_object_ref0 (PEAS_IS_OBJECT_MODULE (_tmp0_) ? ((PeasObjectModule*) _tmp0_) : NULL);
786
1046
        objmodule = _tmp1_;
787
 
        peas_object_module_register_extension_type (objmodule, PEAS_TYPE_ACTIVATABLE, TYPE_ZEITGEIST_DP_PLUGIN);
 
1047
        peas_object_module_register_extension_type (objmodule, peas_activatable_get_type (), TYPE_ZEITGEIST_DP_PLUGIN);
788
1048
        _g_object_unref0 (objmodule);
789
1049
}
790
1050