diff options
| author | vovanec <vovanec@90c681e8-e032-0410-971d-27865f9a5e38> | 2007-07-24 16:05:25 +0000 |
|---|---|---|
| committer | vovanec <vovanec@90c681e8-e032-0410-971d-27865f9a5e38> | 2007-07-24 16:05:25 +0000 |
| commit | 6f1f9ca43a8773cdfb5e3a7d72fda79c4a442016 (patch) | |
| tree | e48d4fc57cf018e8f33442521a3f08682ff3437e /src/playlistmodel.cpp | |
| parent | e838956a1dee86e490701e72c1f04ced7a4fdda6 (diff) | |
| download | qmmp-6f1f9ca43a8773cdfb5e3a7d72fda79c4a442016.tar.gz qmmp-6f1f9ca43a8773cdfb5e3a7d72fda79c4a442016.tar.bz2 qmmp-6f1f9ca43a8773cdfb5e3a7d72fda79c4a442016.zip | |
added filedialog interface, fixed plugin paths
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@38 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/playlistmodel.cpp')
| -rw-r--r-- | src/playlistmodel.cpp | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/src/playlistmodel.cpp b/src/playlistmodel.cpp index 7a61563b0..06915daf1 100644 --- a/src/playlistmodel.cpp +++ b/src/playlistmodel.cpp @@ -361,6 +361,23 @@ void PlayListModel::addDirectory(const QString& s) f_loader->start(QThread::IdlePriority); } +void PlayListModel::addFileList(const QStringList &l) +{ + foreach(QString str,l) + { + QFileInfo f_info(str); + if (f_info.exists()) + { + if (f_info.isDir()) + addDirectory(str); + else + addFile(str); + } + // Do processing the rest of events to avoid GUI freezing + QApplication::processEvents(QEventLoop::AllEvents,10); + } +} + bool PlayListModel::setFileList(const QStringList & l) { bool model_cleared = FALSE; @@ -379,7 +396,7 @@ bool PlayListModel::setFileList(const QStringList & l) else addFile(str); } - // Do the processing the rest of events to avoid GUI freezing + // Do processing the rest of events to avoid GUI freezing QApplication::processEvents(QEventLoop::AllEvents,10); } @@ -763,9 +780,9 @@ void PlayListModel::savePlaylist(const QString & f_name) void PlayListModel::loadExternalPlaylistFormats() { - QDir pluginsDir (qApp->applicationDirPath()); - pluginsDir.cdUp(); - pluginsDir.cd("Plugins/PlaylistFormats"); + QDir pluginsDir (QDir::homePath()+"/.qmmp/plugins/PlaylistFormats"); + //pluginsDir.cdUp(); + //pluginsDir.cd("plugins/PlaylistFormats"); foreach (QString fileName, pluginsDir.entryList(QDir::Files)) { QPluginLoader loader(pluginsDir.absoluteFilePath(fileName)); |
