~ubuntu-desktop/unity-lens-music/ubuntu

« back to all changes in this revision

Viewing changes to src/daemon.c

  • Committer: Didier Roche
  • Date: 2012-03-23 14:20:37 UTC
  • mfrom: (6.3.11)
  • Revision ID: didier.roche@canonical.com-20120323142037-28ngwz3u82egksi4
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
60
60
 
61
61
typedef struct _UnityMusicLensBansheeScopeProxy UnityMusicLensBansheeScopeProxy;
62
62
typedef struct _UnityMusicLensBansheeScopeProxyClass UnityMusicLensBansheeScopeProxyClass;
 
63
 
 
64
#define UNITY_MUSIC_LENS_TYPE_RHYTHMBOX_SCOPE (unity_music_lens_rhythmbox_scope_get_type ())
 
65
#define UNITY_MUSIC_LENS_RHYTHMBOX_SCOPE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_MUSIC_LENS_TYPE_RHYTHMBOX_SCOPE, UnityMusicLensRhythmboxScope))
 
66
#define UNITY_MUSIC_LENS_RHYTHMBOX_SCOPE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_MUSIC_LENS_TYPE_RHYTHMBOX_SCOPE, UnityMusicLensRhythmboxScopeClass))
 
67
#define UNITY_MUSIC_LENS_IS_RHYTHMBOX_SCOPE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_MUSIC_LENS_TYPE_RHYTHMBOX_SCOPE))
 
68
#define UNITY_MUSIC_LENS_IS_RHYTHMBOX_SCOPE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_MUSIC_LENS_TYPE_RHYTHMBOX_SCOPE))
 
69
#define UNITY_MUSIC_LENS_RHYTHMBOX_SCOPE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_MUSIC_LENS_TYPE_RHYTHMBOX_SCOPE, UnityMusicLensRhythmboxScopeClass))
 
70
 
 
71
typedef struct _UnityMusicLensRhythmboxScope UnityMusicLensRhythmboxScope;
 
72
typedef struct _UnityMusicLensRhythmboxScopeClass UnityMusicLensRhythmboxScopeClass;
63
73
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
64
74
#define __g_list_free__g_object_unref0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__g_object_unref0_ (var), NULL)))
65
75
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
76
86
struct _UnityMusicLensDaemonPrivate {
77
87
        UnityLens* lens;
78
88
        UnityMusicLensBansheeScopeProxy* banshee;
 
89
        UnityMusicLensRhythmboxScope* rb;
79
90
};
80
91
 
81
92
 
85
96
GType unity_music_lens_daemon_get_type (void) G_GNUC_CONST;
86
97
GType unity_music_lens_simple_scope_get_type (void) G_GNUC_CONST;
87
98
GType unity_music_lens_banshee_scope_proxy_get_type (void) G_GNUC_CONST;
 
99
GType unity_music_lens_rhythmbox_scope_get_type (void) G_GNUC_CONST;
88
100
#define UNITY_MUSIC_LENS_DAEMON_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UNITY_MUSIC_LENS_TYPE_DAEMON, UnityMusicLensDaemonPrivate))
89
101
enum  {
90
102
        UNITY_MUSIC_LENS_DAEMON_DUMMY_PROPERTY
116
128
static GObject * unity_music_lens_daemon_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
117
129
UnityMusicLensBansheeScopeProxy* unity_music_lens_banshee_scope_proxy_new (void);
118
130
UnityMusicLensBansheeScopeProxy* unity_music_lens_banshee_scope_proxy_construct (GType object_type);
 
131
UnityMusicLensRhythmboxScope* unity_music_lens_rhythmbox_scope_new (void);
 
132
UnityMusicLensRhythmboxScope* unity_music_lens_rhythmbox_scope_construct (GType object_type);
119
133
UnityScope* unity_music_lens_simple_scope_get_scope (UnityMusicLensSimpleScope* self);
120
134
static void unity_music_lens_daemon_finalize (GObject* obj);
121
135
 
467
481
        GObjectClass * parent_class;
468
482
        UnityMusicLensDaemon * self;
469
483
        UnityMusicLensBansheeScopeProxy* _tmp0_;
470
 
        UnityLens* _tmp1_;
 
484
        UnityMusicLensRhythmboxScope* _tmp1_;
471
485
        UnityLens* _tmp2_;
472
486
        UnityLens* _tmp3_;
473
 
        const gchar* _tmp4_ = NULL;
474
 
        UnityLens* _tmp5_;
 
487
        UnityLens* _tmp4_;
 
488
        const gchar* _tmp5_ = NULL;
475
489
        UnityLens* _tmp6_;
476
 
        UnityMusicLensBansheeScopeProxy* _tmp7_;
477
 
        UnityScope* _tmp8_;
478
 
        UnityScope* _tmp9_;
 
490
        const gchar* _tmp7_ = NULL;
 
491
        UnityLens* _tmp8_;
 
492
        UnityLens* _tmp9_;
 
493
        UnityMusicLensBansheeScopeProxy* _tmp10_;
 
494
        UnityScope* _tmp11_;
 
495
        UnityScope* _tmp12_;
 
496
        UnityLens* _tmp13_;
 
497
        UnityMusicLensRhythmboxScope* _tmp14_;
 
498
        UnityScope* _tmp15_;
 
499
        UnityScope* _tmp16_;
479
500
        GError * _inner_error_ = NULL;
480
501
        parent_class = G_OBJECT_CLASS (unity_music_lens_daemon_parent_class);
481
502
        obj = parent_class->constructor (type, n_construct_properties, construct_properties);
483
504
        _tmp0_ = unity_music_lens_banshee_scope_proxy_new ();
484
505
        _g_object_unref0 (self->priv->banshee);
485
506
        self->priv->banshee = _tmp0_;
486
 
        _tmp1_ = unity_lens_new ("/com/canonical/unity/lens/music", "music");
 
507
        _tmp1_ = unity_music_lens_rhythmbox_scope_new ();
 
508
        _g_object_unref0 (self->priv->rb);
 
509
        self->priv->rb = _tmp1_;
 
510
        _tmp2_ = unity_lens_new ("/com/canonical/unity/lens/music", "music");
487
511
        _g_object_unref0 (self->priv->lens);
488
 
        self->priv->lens = _tmp1_;
489
 
        _tmp2_ = self->priv->lens;
490
 
        unity_lens_set_search_in_global (_tmp2_, TRUE);
 
512
        self->priv->lens = _tmp2_;
491
513
        _tmp3_ = self->priv->lens;
492
 
        _tmp4_ = _ ("Search Music Collection");
493
 
        unity_lens_set_search_hint (_tmp3_, _tmp4_);
494
 
        _tmp5_ = self->priv->lens;
495
 
        unity_lens_set_visible (_tmp5_, TRUE);
 
514
        unity_lens_set_search_in_global (_tmp3_, TRUE);
 
515
        _tmp4_ = self->priv->lens;
 
516
        _tmp5_ = _ ("Search Music Collection");
 
517
        unity_lens_set_search_hint (_tmp4_, _tmp5_);
 
518
        _tmp6_ = self->priv->lens;
 
519
        _tmp7_ = _ ("Sources");
 
520
        unity_lens_set_sources_display_name (_tmp6_, _tmp7_);
 
521
        _tmp8_ = self->priv->lens;
 
522
        unity_lens_set_visible (_tmp8_, TRUE);
496
523
        unity_music_lens_daemon_populate_categories (self);
497
524
        unity_music_lens_daemon_populate_filters (self);
498
 
        _tmp6_ = self->priv->lens;
499
 
        _tmp7_ = self->priv->banshee;
500
 
        _tmp8_ = unity_music_lens_simple_scope_get_scope ((UnityMusicLensSimpleScope*) _tmp7_);
501
 
        _tmp9_ = _tmp8_;
502
 
        unity_lens_add_local_scope (_tmp6_, _tmp9_);
 
525
        _tmp9_ = self->priv->lens;
 
526
        _tmp10_ = self->priv->banshee;
 
527
        _tmp11_ = unity_music_lens_simple_scope_get_scope ((UnityMusicLensSimpleScope*) _tmp10_);
 
528
        _tmp12_ = _tmp11_;
 
529
        unity_lens_add_local_scope (_tmp9_, _tmp12_);
 
530
        _tmp13_ = self->priv->lens;
 
531
        _tmp14_ = self->priv->rb;
 
532
        _tmp15_ = unity_music_lens_simple_scope_get_scope ((UnityMusicLensSimpleScope*) _tmp14_);
 
533
        _tmp16_ = _tmp15_;
 
534
        unity_lens_add_local_scope (_tmp13_, _tmp16_);
503
535
        {
504
 
                UnityLens* _tmp10_;
505
 
                _tmp10_ = self->priv->lens;
506
 
                unity_lens_export (_tmp10_, &_inner_error_);
 
536
                UnityLens* _tmp17_;
 
537
                _tmp17_ = self->priv->lens;
 
538
                unity_lens_export (_tmp17_, &_inner_error_);
507
539
                if (_inner_error_ != NULL) {
508
540
                        if (_inner_error_->domain == G_IO_ERROR) {
509
541
                                goto __catch2_g_io_error;
516
548
        __catch2_g_io_error:
517
549
        {
518
550
                GError* e = NULL;
519
 
                FILE* _tmp11_;
520
 
                GError* _tmp12_;
521
 
                const gchar* _tmp13_;
 
551
                FILE* _tmp18_;
 
552
                GError* _tmp19_;
 
553
                const gchar* _tmp20_;
522
554
                e = _inner_error_;
523
555
                _inner_error_ = NULL;
524
 
                _tmp11_ = stdout;
525
 
                _tmp12_ = e;
526
 
                _tmp13_ = _tmp12_->message;
527
 
                fprintf (_tmp11_, "error %s\n", _tmp13_);
 
556
                _tmp18_ = stdout;
 
557
                _tmp19_ = e;
 
558
                _tmp20_ = _tmp19_->message;
 
559
                fprintf (_tmp18_, "error %s\n", _tmp20_);
528
560
                _g_error_free0 (e);
529
561
        }
530
562
        __finally2:
554
586
        self = UNITY_MUSIC_LENS_DAEMON (obj);
555
587
        _g_object_unref0 (self->priv->lens);
556
588
        _g_object_unref0 (self->priv->banshee);
 
589
        _g_object_unref0 (self->priv->rb);
557
590
        G_OBJECT_CLASS (unity_music_lens_daemon_parent_class)->finalize (obj);
558
591
}
559
592