~matttbe/ubuntu/raring/rhythmbox/lp1010619_RB_2.98

« back to all changes in this revision

Viewing changes to metadata/rb-ext-db.c

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2012-11-06 20:52:57 UTC
  • mfrom: (1.1.67) (214.1.1 quantal-proposed)
  • Revision ID: package-import@ubuntu.com-20121106205257-0btjh8jqley153el
Tags: 2.98-0ubuntu1
* New upstream release (LP: #1060601)
* debian/control.in:
  - Bump minimum glib, gtk, totem-plparser, clutter, and clutter-gst
  - Drop no longer needed musicbrainz dependency
* Refreshed 09_keywords.patch
* Updated 11_fix_cd_pausing.patch with fix from git
* Dropped patches applied in new version:
  - 00git_musicbrainz5.patch
  - 08_CVE-2012-3355.patch
  - dont_free_consumed_floating_gvariant.patch
  - git_scale_click.patch
  - git_crash_during_monitor.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
#include <lib/rb-file-helpers.h>
39
39
#include <lib/rb-debug.h>
40
40
#include <lib/rb-util.h>
 
41
#include <lib/rb-marshal.h>
41
42
 
42
43
/**
43
44
 * SECTION:rb-ext-db
191
192
                g_free (sreq->value);
192
193
        }
193
194
        g_free (sreq->uri);
 
195
        g_free (sreq->filename);
 
196
        rb_ext_db_key_free (sreq->key);
194
197
        g_slice_free (RBExtDBStoreRequest, sreq);
195
198
}
196
199
 
223
226
        data.dsize = g_variant_get_size (v);
224
227
        data.dptr = g_malloc0 (data.dsize);
225
228
        g_variant_store (v, data.dptr);
 
229
        g_variant_unref (v);
226
230
        return data;
227
231
}
228
232
 
359
363
                        /* umm */
360
364
                        g_assert_not_reached ();
361
365
                }
 
366
                g_free (tdbfile);
362
367
        }
363
368
        g_free (storedir);
364
369
 
413
418
        klass->store = default_store;
414
419
 
415
420
        /**
416
 
         * RBExtDB:name
 
421
         * RBExtDB:name:
417
422
         *
418
423
         * Name of the metadata store.  Used to locate instances.
419
424
         */
468
473
                              G_OBJECT_CLASS_TYPE (object_class),
469
474
                              G_SIGNAL_RUN_LAST,
470
475
                              G_STRUCT_OFFSET (RBExtDBClass, store),
471
 
                              rb_signal_accumulator_value_handled, NULL, NULL,
472
 
                              G_TYPE_VALUE,
 
476
                              g_signal_accumulator_first_wins, NULL,
 
477
                              rb_marshal_POINTER__BOXED,
 
478
                              G_TYPE_POINTER,
473
479
                              1, G_TYPE_VALUE);
474
480
        /**
475
481
         * RBExtDB::load:
482
488
                              G_OBJECT_CLASS_TYPE (object_class),
483
489
                              G_SIGNAL_RUN_LAST,
484
490
                              G_STRUCT_OFFSET (RBExtDBClass, load),
485
 
                              rb_signal_accumulator_value_handled, NULL, NULL,
486
 
                              G_TYPE_VALUE,
 
491
                              g_signal_accumulator_first_wins, NULL,
 
492
                              rb_marshal_POINTER__BOXED,
 
493
                              G_TYPE_POINTER,
487
494
                              1, G_TYPE_VALUE);
488
495
 
489
496
        g_type_class_add_private (klass, sizeof (RBExtDBPrivate));
619
626
 
620
627
                /* convert the encoded data into a useful object */
621
628
                rb_debug ("converting %" G_GSIZE_FORMAT " bytes of file data", file_data_size);
622
 
                s = g_string_new_len (file_data, file_data_size);
 
629
                s = g_slice_new0 (GString);
 
630
                s->str = file_data;
 
631
                s->len = file_data_size;
 
632
                s->allocated_len = file_data_size;
623
633
                g_value_init (&d, G_TYPE_GSTRING);
624
634
                g_value_take_boxed (&d, s);
 
635
                req->data = NULL;
625
636
                g_signal_emit (object, signals[LOAD], 0, &d, &req->data);
626
637
                g_value_unset (&d);
627
638
 
628
 
                rb_debug ("converted data into value of type %s", G_VALUE_TYPE_NAME (req->data));
 
639
                if (req->data) {
 
640
                        rb_debug ("converted data into value of type %s",
 
641
                                  G_VALUE_TYPE_NAME (req->data));
 
642
                } else {
 
643
                        rb_debug ("data conversion failed");
 
644
                }
629
645
        }
630
646
 
631
647
        g_object_unref (f);
647
663
 */
648
664
gboolean
649
665
rb_ext_db_request (RBExtDB *store,
650
 
                              RBExtDBKey *key,
651
 
                              RBExtDBRequestCallback callback,
652
 
                              gpointer user_data,
653
 
                              GDestroyNotify destroy)
 
666
                   RBExtDBKey *key,
 
667
                   RBExtDBRequestCallback callback,
 
668
                   gpointer user_data,
 
669
                   GDestroyNotify destroy)
654
670
{
655
671
        RBExtDBRequest *req;
656
672
        gboolean result;
860
876
                 * can write it to a file
861
877
                 */
862
878
                g_signal_emit (store, signals[STORE], 0, req->value, &req->data);
 
879
 
863
880
                rb_debug ("stored value into encoded data of type %s", G_VALUE_TYPE_NAME (req->data));
864
881
        } else {
865
882
                /* indicates we actually didn't get anything, as opposed to communication errors etc.