diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2008-10-15 07:46:37 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2008-10-15 07:46:37 +0000 |
| commit | cf021281c17cd0a07c2b7a7ec17b386594647a65 (patch) | |
| tree | afb6c996858c5075329d5b57b3304401cabde16e | |
| parent | 9f11ea7336c89b6206e5eb82c31746b10149e451 (diff) | |
| download | qmmp-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
| -rw-r--r-- | src/ui/listwidget.cpp | 1 | ||||
| -rw-r--r-- | src/ui/mainwindow.cpp | 1 | ||||
| -rw-r--r-- | src/ui/playlistmodel.cpp | 11 | ||||
| -rw-r--r-- | src/ui/qmmp.desktop | 2 |
4 files changed, 10 insertions, 5 deletions
diff --git a/src/ui/listwidget.cpp b/src/ui/listwidget.cpp index c4dea03dd..7238cb00f 100644 --- a/src/ui/listwidget.cpp +++ b/src/ui/listwidget.cpp @@ -398,6 +398,7 @@ void ListWidget::processFileInfo(const QFileInfo& info) else { m_model->addFile(info.absoluteFilePath()); + m_model->loadPlaylist(info.absoluteFilePath()); } } diff --git a/src/ui/mainwindow.cpp b/src/ui/mainwindow.cpp index 1cd0a26d3..eb4d2c118 100644 --- a/src/ui/mainwindow.cpp +++ b/src/ui/mainwindow.cpp @@ -592,6 +592,7 @@ void MainWindow::loadPlaylist() QString f_name = FileDialog::getOpenFileName(this,tr("Open Playlist"),m_lastDir,mask); if (!f_name.isEmpty()) { + m_playListModel->clear(); m_playListModel->loadPlaylist(f_name); m_playlistName = QFileInfo(f_name).baseName(); m_lastDir = QFileInfo(f_name).absoluteDir().path(); 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(); } diff --git a/src/ui/qmmp.desktop b/src/ui/qmmp.desktop index 86e052351..f3eab418d 100644 --- a/src/ui/qmmp.desktop +++ b/src/ui/qmmp.desktop @@ -21,4 +21,4 @@ Icon=qmmp Terminal=false Type=Application Categories=AudioVideo;Player;Audio;Qt -MimeType=application/x-ogg;audio/mp3;audio/mpeg;audio/x-flac;audio/x-mp3;audio/x-mpeg;audio/x-ms-wma;audio/x-musepack;application/ogg;audio/x-vorbis+ogg +MimeType=application/x-ogg;audio/mp3;audio/mpeg;audio/x-flac;audio/x-mp3;audio/x-mpeg;audio/x-ms-wma;audio/x-musepack;application/ogg;audio/x-vorbis+ogg;audio/x-scpls;audio/x-mpegurl;audio/x-it;audio/x-mod; |
