Fixes in desktop file
[someplayer] / src / library.cpp
index 9a530e8..58d7feb 100644 (file)
@@ -1,3 +1,22 @@
+/*
+ * SomePlayer - An alternate music player for Maemo 5
+ * Copyright (C) 2010 Nikolay (somebody) Tischenko <niktischenko@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+
 #include "library.h"
 
 using namespace SomePlayer::DataObjects;
@@ -12,6 +31,7 @@ Library::Library(QString databasePath, QString playlistsPath) : QObject(0) {
        _scanner = new MediaScanner();
        _resolver = new TagResolver(this);
        connect(_scanner, SIGNAL(scanFinish(QStringList)), _resolver, SLOT(decode(QStringList)));
+       connect(_resolver, SIGNAL(done()), this, SIGNAL(done()));
        connect(_resolver, SIGNAL(decoded(Track)), this, SLOT(addTrack(Track)));
 }
 
@@ -93,11 +113,11 @@ Playlist Library::getPlaylist(QString name) {
        return _playlist_storage->getPlaylist(name);
 }
 
-void Library::savePlaylist(Playlist playlist) {
+void Library::savePlaylist(const Playlist &playlist) {
        _playlist_storage->savePlaylist(playlist);
 }
 
-void Library::removePlaylist(Playlist playlist) {
+void Library::removePlaylist(const Playlist &playlist) {
        _playlist_storage->removePlaylist(playlist);
 }
 
@@ -109,6 +129,6 @@ Playlist Library::getCurrentPlaylist() {
        return _playlist_storage->getCurrentPlaylist();
 }
 
-void Library::saveCurrentPlaylist(Playlist playlist) {
+void Library::saveCurrentPlaylist(const Playlist &playlist) {
        _playlist_storage->saveCurrentPlaylist(playlist);
 }