~ubuntu-branches/ubuntu/precise/rhythmbox/precise-201203091205

« back to all changes in this revision

Viewing changes to sources/rb-daap-source.c

Tags: upstream-0.9.2cvs20060102
ImportĀ upstreamĀ versionĀ 0.9.2cvs20060102

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
 
1
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
 
2
 *
2
3
 *  Implementation of DAAP (iTunes Music Sharing) source object
3
4
 *
4
5
 *  Copyright (C) 2005 Charles Schmidt <cschmidt2@emich.edu>
21
22
 
22
23
#include <config.h>
23
24
 
24
 
#include <gtk/gtktreeview.h>
25
 
#include <gtk/gtkicontheme.h>
26
 
#include <gtk/gtkiconfactory.h>
27
25
#include <string.h>
 
26
 
 
27
#include <glib/gi18n.h>
 
28
#include <gtk/gtk.h>
 
29
 
28
30
#include "rhythmdb.h"
29
31
#include "rb-shell.h"
30
 
#include <libgnome/gnome-i18n.h>
31
32
#include "eel-gconf-extensions.h"
32
33
#include "rb-daap-source.h"
33
34
#include "rb-stock-icons.h"
40
41
#include "rb-daap-mdns.h"
41
42
#include "rb-daap-src.h"
42
43
 
43
 
#include "rb-playlist-source.h"
 
44
#include "rb-static-playlist-source.h"
44
45
 
45
46
 
46
47
static void rb_daap_source_dispose (GObject *object);
85
86
        GSList *playlist_sources;
86
87
};
87
88
 
 
89
#define RB_DAAP_SOURCE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), RB_TYPE_DAAP_SOURCE, RBDAAPSourcePrivate))
88
90
 
89
91
enum {
90
92
        PROP_0,
164
166
                                                               "Whether the share is password protected",
165
167
                                                               FALSE,
166
168
                                                               G_PARAM_READWRITE));
 
169
 
 
170
        g_type_class_add_private (klass, sizeof (RBDAAPSourcePrivate));
167
171
}
168
172
 
169
173
static void
170
174
rb_daap_source_init (RBDAAPSource *source)
171
175
{
172
 
        source->priv = g_new0 (RBDAAPSourcePrivate, 1);
 
176
        source->priv = RB_DAAP_SOURCE_GET_PRIVATE (source);
173
177
}
174
178
 
175
179
 
184
188
        
185
189
                g_free (source->priv->service_name);
186
190
                g_free (source->priv->host);
187
 
                g_free (source->priv);
188
 
                source->priv = NULL;
189
191
        }
190
192
 
191
193
        G_OBJECT_CLASS (rb_daap_source_parent_class)->dispose (object);
583
585
                RBDAAPPlaylist *playlist = l->data;
584
586
                RBSource *playlist_source;
585
587
 
586
 
                playlist_source = RB_SOURCE (g_object_new (RB_TYPE_PLAYLIST_SOURCE,
587
 
                                                           "name", playlist->name,
588
 
                                                           "shell", shell,
589
 
                                                           "visibility", TRUE,
590
 
                                                           "is-local", FALSE,
591
 
                                                           "entry-type", entry_type,
592
 
                                                           NULL));
593
 
                /* this is set here instead of in construction so that
594
 
                 * rb_playlist_source_constructor has a chance to be run to set things up */
595
 
                rb_playlist_source_add_locations (RB_PLAYLIST_SOURCE (playlist_source), playlist->uris);
 
588
                playlist_source = rb_static_playlist_source_new (shell, playlist->name, FALSE, entry_type);
 
589
                rb_static_playlist_source_add_locations (RB_STATIC_PLAYLIST_SOURCE (playlist_source), playlist->uris);
596
590
 
597
591
                rb_shell_append_source (shell, playlist_source, RB_SOURCE (daap_source));
598
592
                daap_source->priv->playlist_sources = g_slist_prepend (daap_source->priv->playlist_sources, playlist_source);