From 6f1f9ca43a8773cdfb5e3a7d72fda79c4a442016 Mon Sep 17 00:00:00 2001 From: vovanec Date: Tue, 24 Jul 2007 16:05:25 +0000 Subject: 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 --- src/playlistmodel.cpp | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'src/playlistmodel.cpp') 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)); -- cgit v1.2.3-13-gbd6f