Commit 851a1fec authored by sankhesh's avatar sankhesh
Browse files

BUG: Issue 2240. Removed code repetition.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@21521 3bd1e089-480b-0410-8dfb-8563597acbee
parent 30f4972d
......@@ -156,6 +156,13 @@ ctkFileDialog* qSlicerStandardFileDialog::createFileDialog(
{
fileDialog->setSidebarUrls(ioManager->favorites());
}
#ifdef Q_WS_MAC
// Workaround for Mac to show mounted volumes.
// See issue #2240
QList<QUrl> sidebarUrls = fileDialog->sidebarUrls();
sidebarUrls.append(QUrl::fromLocalFile("/Volumes"));
fileDialog->setSidebarUrls(sidebarUrls);
#endif
if (ioProperties["multipleFiles"].toBool())
{
fileDialog->setFileMode(QFileDialog::ExistingFiles);
......@@ -206,14 +213,6 @@ bool qSlicerStandardFileDialog::exec(const qSlicerIO::IOProperties& ioProperties
fileDialog->setAcceptButtonEnable(optionsWidget->isValid());
}
// Workaround for Mac to show mounted volumes.
// See issue #2240
#ifdef Q_WS_MAC
QList<QUrl> sidebarUrls = ioManager->favorites();
sidebarUrls.append(QUrl::fromLocalFile("/Volumes"));
fileDialog->setSidebarUrls(sidebarUrls);
#endif
// we do not delete options now as it is still useful later (even if there is
// no UI.) they are the options of the reader, UI or not.
bool res = fileDialog->exec();
......@@ -268,14 +267,6 @@ QStringList qSlicerStandardFileDialog::getOpenFileName(
ioProperties);
qSlicerIOManager* ioManager = qSlicerApplication::application()->ioManager();
// Workaround for Mac to show mounted volumes.
// See issue #2240
#ifdef Q_WS_MAC
QList<QUrl> sidebarUrls = ioManager->favorites();
sidebarUrls.append(QUrl::fromLocalFile("/Volumes"));
fileDialog->setSidebarUrls(sidebarUrls);
#endif
if(fileDialog->exec() == QDialog::Accepted)
{
files = fileDialog->selectedFiles();
......@@ -296,14 +287,6 @@ QString qSlicerStandardFileDialog::getExistingDirectory(
ioProperties);
qSlicerIOManager* ioManager = qSlicerApplication::application()->ioManager();
// Workaround for Mac to show mounted volumes.
// See issue #2240
#ifdef Q_WS_MAC
QList<QUrl> sidebarUrls = ioManager->favorites();
sidebarUrls.append(QUrl::fromLocalFile("/Volumes"));
fileDialog->setSidebarUrls(sidebarUrls);
#endif
if (fileDialog->exec() == QDialog::Accepted)
{
directory = fileDialog->selectedFiles().value(0);
......
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