aboutsummaryrefslogtreecommitdiff
path: root/src/ui/playlistmodel.cpp
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2008-10-15 07:46:37 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2008-10-15 07:46:37 +0000
commitcf021281c17cd0a07c2b7a7ec17b386594647a65 (patch)
treeafb6c996858c5075329d5b57b3304401cabde16e /src/ui/playlistmodel.cpp
parent9f11ea7336c89b6206e5eb82c31746b10149e451 (diff)
downloadqmmp-cf021281c17cd0a07c2b7a7ec17b386594647a65.tar.gz
qmmp-cf021281c17cd0a07c2b7a7ec17b386594647a65.tar.bz2
qmmp-cf021281c17cd0a07c2b7a7ec17b386594647a65.zip
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
Diffstat (limited to 'src/ui/playlistmodel.cpp')
-rw-r--r--src/ui/playlistmodel.cpp11
1 files changed, 7 insertions, 4 deletions
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();
}