Commit 1667afd2 authored by Christophe Courtaut's avatar Christophe Courtaut

Save previously selected folder in mediaLibrary

parent 6b4495c8
......@@ -103,12 +103,17 @@ ListViewMediaItem* LibraryWidget::insertNewMedia( QString fileNam
void LibraryWidget::insertNewMediasFromFileDialog( QString title, QString filter, ListViewMediaItem::fType filetype )
{
QStringList fileNames = QFileDialog::getOpenFileNames( this, title, QDir::homePath(), filter);
QSettings settings;
QString path = settings.value( "mediaLibraryDialogPath", QDir::homePath() ).toString();
QStringList fileNames = QFileDialog::getOpenFileNames( this, title, path, filter );
if ( fileNames.isEmpty() )
return ;
QString fileName;
ListViewMediaItem* item = NULL;
foreach ( fileName, fileNames )
insertNewMedia( fileName, filetype );
item = insertNewMedia( fileName, filetype );
if ( item != NULL )
settings.setValue( "mediaLibraryDialogPath" , item->fileInfo()->absoluteDir().absolutePath() );
return ;
}
......
......@@ -33,6 +33,7 @@
#include <QMimeData>
#include <QDrag>
#include <QList>
#include <QSettings>
#include "ListViewMediaItem.h"
#include "ui_LibraryWidget.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment