From cf021281c17cd0a07c2b7a7ec17b386594647a65 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Wed, 15 Oct 2008 07:46:37 +0000 Subject: fixed playlist loading when using drag and drop and command line git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@587 90c681e8-e032-0410-971d-27865f9a5e38 --- src/ui/playlistmodel.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/ui/playlistmodel.cpp') diff --git a/src/ui/playlistmodel.cpp b/src/ui/playlistmodel.cpp index d891fe02c..b155114ec 100644 --- a/src/ui/playlistmodel.cpp +++ b/src/ui/playlistmodel.cpp @@ -1,11 +1,11 @@ /*************************************************************************** - * Copyright(C) 2006-2008 by Ilya Kotov * + * Copyright(C) 2006-2008 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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. * + * (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 * @@ -487,7 +487,10 @@ bool PlayListModel::setFileList(const QStringList & l) if (f_info.isDir()) addDirectory(str); else + { addFile(str); + loadPlaylist(str); + } } // Do processing the rest of events to avoid GUI freezing QApplication::processEvents(QEventLoop::AllEvents,10); @@ -845,7 +848,7 @@ void PlayListModel::setUpdatesEnabled(bool yes) } } -void PlayListModel::loadPlaylist(const QString & f_name) +void PlayListModel::loadPlaylist(const QString &f_name) { PlaylistFormat* prs = PlaylistParser::instance()->findByPath(f_name); if (prs) @@ -853,7 +856,7 @@ void PlayListModel::loadPlaylist(const QString & f_name) QFile file(f_name); if (file.open(QIODevice::ReadOnly)) { - clear(); + //clear(); addFiles(prs->decode(QTextStream(&file).readAll())); file.close(); } -- cgit v1.2.3-13-gbd6f