I have made the following changes intended for : CE:MW:Shared / nemo-qml-plugin-grilo
Please review and accept or decline. BOSS has already run some checks on this request. See the "Messages from BOSS" section below. https://build.pub.meego.com//request/show/7085 Thank You, msameer [This message was auto-generated] --- Request # 7085: Messages from BOSS: State: review at 2012-10-19T14:56:43 by bossbot Reviews: accepted by bossbot : Prechecks succeeded. new for CE-maintainers : Please replace this text with a review and approve/reject the review (not the SR). BOSS will take care of the rest Changes: submit: home:msameer:grilo / nemo-qml-plugin-grilo -> CE:MW:Shared / nemo-qml-plugin-grilo changes files: -------------- --- nemo-qml-plugin-grilo.changes +++ nemo-qml-plugin-grilo.changes @@ -0,0 +1,5 @@ +* Fri Oct 19 2012 Mohammed Hassan <[email protected]> - 0.0.20121019 +- New release +- Expose the author property in GriloMedia +- Delay constructing the root GrlMedia until needed + old: ---- qtgrilo-0.0.20121017.tar.gz new: ---- qtgrilo-0.0.20121019.tar.gz spec files: ----------- --- nemo-qml-plugin-grilo.spec +++ nemo-qml-plugin-grilo.spec @@ -1,6 +1,6 @@ Name: nemo-qml-plugin-grilo Summary: Framework for discovering and browsing media -Version: 0.0.20121017 +Version: 0.0.20121019 Release: 1 Group: Development/Libraries License: LGPLv2.1 other changes: -------------- ++++++ qtgrilo-0.0.20121017.tar.gz -> qtgrilo-0.0.20121019.tar.gz --- declarative/grilobrowse.cpp +++ declarative/grilobrowse.cpp @@ -55,18 +55,12 @@ return false; } - GrlMedia *root = 0; - GList *keys = keysAsList(); GrlOperationOptions *options = operationOptions(src, Browse); - m_opId = grl_source_browse(src, m_media ? m_media->media() : NULL, + m_opId = grl_source_browse(src, rootMedia(), keys, options, grilo_source_result_cb, this); - if (root) { - g_object_unref(root); - } - g_object_unref(options); g_list_free(keys); @@ -102,17 +96,6 @@ m_baseMedia = media; - if (!media.isEmpty()) { - GrlMedia *m = grl_media_unserialize(media.toUtf8().data()); - - if (m) { - m_media = new GriloMedia(m); - } - else { - qDebug() << "Failed to create GrlMedia from" << media; - } - } - emit baseMediaChanged(); } @@ -162,3 +145,23 @@ m_opId = 0; } } + +GrlMedia *GriloBrowse::rootMedia() { + if (m_media) { + return m_media->media(); + } + else if (m_baseMedia.isEmpty()) { + return NULL; + } + + GrlMedia *m = grl_media_unserialize(m_baseMedia.toUtf8().data()); + if (m) { + m_media = new GriloMedia(m); + return m_media->media(); + } + else { + qDebug() << "Failed to create GrlMedia from" << m_baseMedia; + } + + return NULL; +} --- declarative/grilobrowse.h +++ declarative/grilobrowse.h @@ -64,7 +64,10 @@ private: void availableSourcesChanged(); + GrlMedia *rootMedia(); + QString m_source; + GriloMedia *m_media; QString m_baseMedia; QVariantList m_slowKeys; --- declarative/grilomedia.cpp +++ declarative/grilomedia.cpp @@ -69,3 +69,7 @@ bool GriloMedia::isContainer() const { return GRL_IS_MEDIA_BOX(m_media) == TRUE; } + +QString GriloMedia::author() const { + return grl_media_get_author(m_media); +} --- declarative/grilomedia.h +++ declarative/grilomedia.h @@ -36,6 +36,7 @@ Q_PROPERTY(QUrl url READ url CONSTANT); Q_PROPERTY(bool container READ isContainer CONSTANT); Q_PROPERTY(int duration READ duration CONSTANT); + Q_PROPERTY(QString author READ author CONSTANT); public: GriloMedia(GrlMedia *media, QObject *parent = 0); @@ -46,6 +47,8 @@ QUrl url() const; bool isContainer() const; int duration() const; + QString author() const; + GrlMedia *media(); Q_INVOKABLE QString serialize();
