diff options
| author | Yoann Lopes <yoann.lopes@nokia.com> | 2011-11-30 00:57:31 +0100 |
|---|---|---|
| committer | Yoann Lopes <yoann.lopes@nokia.com> | 2011-11-30 00:57:31 +0100 |
| commit | 2774d43cff763cb1e5502c2369a32a049a2e1e0d (patch) | |
| tree | 71f874902c08b58cf60254ca65fd27eecf1c4f1b | |
| parent | 1de5be2ec9c1022d8449186b60d863e0ad7501fa (diff) | |
Update playlist dialog when a playlist is renamed.
| -rw-r--r-- | libQtSpotify/qspotifyplaylist.cpp | 1 | ||||
| -rw-r--r-- | libQtSpotify/qspotifyplaylist.h | 1 | ||||
| -rw-r--r-- | libQtSpotify/qspotifyplaylistcontainer.cpp | 11 | ||||
| -rw-r--r-- | libQtSpotify/qspotifyplaylistcontainer.h | 11 | ||||
| -rw-r--r-- | libQtSpotify/qspotifyuser.cpp | 1 | ||||
| -rw-r--r-- | libQtSpotify/qspotifyuser.h | 1 | ||||
| -rw-r--r-- | qml/MainPage.qml | 9 |
7 files changed, 24 insertions, 11 deletions
diff --git a/libQtSpotify/qspotifyplaylist.cpp b/libQtSpotify/qspotifyplaylist.cpp index d64780f..4a541bd 100644 --- a/libQtSpotify/qspotifyplaylist.cpp +++ b/libQtSpotify/qspotifyplaylist.cpp @@ -315,6 +315,7 @@ bool QSpotifyPlaylist::event(QEvent *e) // Playlist renamed m_name = QString::fromUtf8(sp_playlist_name(m_sp_playlist)); emit dataChanged(); + emit nameChanged(); e->accept(); return true; } else if (e->type() == QEvent::User + 3) { diff --git a/libQtSpotify/qspotifyplaylist.h b/libQtSpotify/qspotifyplaylist.h index 9542550..c5be45b 100644 --- a/libQtSpotify/qspotifyplaylist.h +++ b/libQtSpotify/qspotifyplaylist.h @@ -142,6 +142,7 @@ Q_SIGNALS: void hasOfflineTracksChanged(); void trackFilterChanged(); void tracksChanged(); + void nameChanged(); protected: bool updateData(); diff --git a/libQtSpotify/qspotifyplaylistcontainer.cpp b/libQtSpotify/qspotifyplaylistcontainer.cpp index c7dff6e..41bc979 100644 --- a/libQtSpotify/qspotifyplaylistcontainer.cpp +++ b/libQtSpotify/qspotifyplaylistcontainer.cpp @@ -5,22 +5,22 @@ ** Contact: Yoann Lopes (yoann.lopes@nokia.com) ** ** This file is part of the MeeSpot project. -** +** ** Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions ** are met: -** +** ** Redistributions of source code must retain the above copyright notice, ** this list of conditions and the following disclaimer. -** +** ** Redistributions in binary form must reproduce the above copyright ** notice, this list of conditions and the following disclaimer in the ** documentation and/or other materials provided with the distribution. -** +** ** Neither the name of Nokia Corporation and its Subsidiary(-ies) nor the names of its ** contributors may be used to endorse or promote products derived from ** this software without specific prior written permission. -** +** ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS @@ -169,6 +169,7 @@ void QSpotifyPlaylistContainer::addPlaylist(sp_playlist *playlist, int pos) else m_playlists.insert(pos, pl); connect(pl, SIGNAL(playlistDataChanged()), this, SIGNAL(playlistContainerDataChanged())); + connect(pl, SIGNAL(nameChanged()), this, SIGNAL(playlistsNameChanged())); } bool QSpotifyPlaylistContainer::event(QEvent *e) diff --git a/libQtSpotify/qspotifyplaylistcontainer.h b/libQtSpotify/qspotifyplaylistcontainer.h index 05645fa..cf4c466 100644 --- a/libQtSpotify/qspotifyplaylistcontainer.h +++ b/libQtSpotify/qspotifyplaylistcontainer.h @@ -5,22 +5,22 @@ ** Contact: Yoann Lopes (yoann.lopes@nokia.com) ** ** This file is part of the MeeSpot project. -** +** ** Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions ** are met: -** +** ** Redistributions of source code must retain the above copyright notice, ** this list of conditions and the following disclaimer. -** +** ** Redistributions in binary form must reproduce the above copyright ** notice, this list of conditions and the following disclaimer in the ** documentation and/or other materials provided with the distribution. -** +** ** Neither the name of Nokia Corporation and its Subsidiary(-ies) nor the names of its ** contributors may be used to endorse or promote products derived from ** this software without specific prior written permission. -** +** ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS @@ -62,6 +62,7 @@ public: Q_SIGNALS: void playlistContainerDataChanged(); + void playlistsNameChanged(); protected: bool updateData(); diff --git a/libQtSpotify/qspotifyuser.cpp b/libQtSpotify/qspotifyuser.cpp index 32502dd..803350e 100644 --- a/libQtSpotify/qspotifyuser.cpp +++ b/libQtSpotify/qspotifyuser.cpp @@ -105,6 +105,7 @@ QSpotifyPlaylistContainer *QSpotifyUser::playlistContainer() const } m_playlistContainer = new QSpotifyPlaylistContainer(pc); connect(m_playlistContainer, SIGNAL(playlistContainerDataChanged()), this, SIGNAL(playlistsChanged())); + connect(m_playlistContainer, SIGNAL(playlistsNameChanged()), this, SIGNAL(playlistsNameChanged())); } return m_playlistContainer; } diff --git a/libQtSpotify/qspotifyuser.h b/libQtSpotify/qspotifyuser.h index ca73ba9..482ac46 100644 --- a/libQtSpotify/qspotifyuser.h +++ b/libQtSpotify/qspotifyuser.h @@ -81,6 +81,7 @@ public: Q_SIGNALS: void userDataChanged(); void playlistsChanged(); + void playlistsNameChanged(); protected: bool updateData(); diff --git a/qml/MainPage.qml b/qml/MainPage.qml index 3c8e8f3..f341ae7 100644 --- a/qml/MainPage.qml +++ b/qml/MainPage.qml @@ -80,7 +80,14 @@ Page { } property variant playlists: spotifySession.user ? spotifySession.user.playlists : null - onPlaylistsChanged: { + Connections { + target: spotifySession.user + onPlaylistsNameChanged: updatePlaylistDialog() + } + + onPlaylistsChanged: updatePlaylistDialog() + + function updatePlaylistDialog() { playlistSelectionDialog.model.clear(); if (playlists === null) |
