From 54fd38bf965da405df481b9749a84ccf264bab81 Mon Sep 17 00:00:00 2001 From: Mark Watkins Date: Fri, 25 Nov 2011 16:56:39 +1000 Subject: [PATCH] Multi Directory import support. This may cause delays starting the import dialog on windows (again). --- mainwindow.cpp | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index eefcb77e..e844fcfa 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -16,6 +16,7 @@ #include #include #include +#include #include "mainwindow.h" #include "ui_mainwindow.h" @@ -246,15 +247,33 @@ void MainWindow::on_action_Import_Data_triggered() } if (asknew) { - newdir=QFileDialog::getExistingDirectory(this,"Select a folder to import","",QFileDialog::ShowDirsOnly); + QFileDialog w; + w.setFileMode(QFileDialog::DirectoryOnly); + w.setOption(QFileDialog::DontUseNativeDialog,false); + + QListView *l = w.findChild("listView"); + if (l) { + l->setSelectionMode(QAbstractItemView::MultiSelection); + } + QTreeView *t = w.findChild(); + if (t) { + t->setSelectionMode(QAbstractItemView::MultiSelection); + } + if (w.exec()!=QDialog::Accepted) { + return; + } + for (int i=0;i