#2555 Summary cases. Convert paths to have internal separators ('/')

This commit is contained in:
Bjørn Erik Jensen 2018-04-10 13:10:55 +02:00
parent d0905c518b
commit 5cc3af4586
2 changed files with 13 additions and 3 deletions

View File

@ -20,6 +20,7 @@
#include "RiaApplication.h"
#include "RiaPreferences.h"
#include "RiaFilePathTools.h"
#include "RicImportSummaryCasesFeature.h"
@ -55,9 +56,17 @@ void RicImportSummaryCaseFeature::onActionTriggered(bool isChecked)
RiaApplication* app = RiaApplication::instance();
RiaPreferences* prefs = app->preferences();
QString defaultDir = app->lastUsedDialogDirectory("INPUT_FILES");
QStringList fileNames = QFileDialog::getOpenFileNames(nullptr, "Import Summary Case", defaultDir, "Eclipse Summary File (*.SMSPEC);;All Files (*.*)");
QStringList fileNames_ = QFileDialog::getOpenFileNames(nullptr, "Import Summary Case", defaultDir, "Eclipse Summary File (*.SMSPEC);;All Files (*.*)");
if (fileNames.isEmpty()) return;
if (fileNames_.isEmpty()) return;
QStringList fileNames;
// Convert to internal path separator
for (QString s : fileNames_)
{
fileNames.push_back(RiaFilePathTools::toInternalSeparator(s));
}
// Remember the path to next time
app->setLastUsedDialogDirectory("INPUT_FILES", QFileInfo(fileNames.last()).absolutePath());

View File

@ -19,6 +19,7 @@
#include "RiuRecentFileActionProvider.h"
#include "RiaApplication.h"
#include "RiaFilePathTools.h"
#include <QAction>
#include <QFileInfo>
@ -122,7 +123,7 @@ void RiuRecentFileActionProvider::slotOpenRecentFile()
QAction* action = qobject_cast<QAction *>(sender());
if (action)
{
QString fileName = action->data().toString();
QString fileName = RiaFilePathTools::toInternalSeparator(action->data().toString());
RiaApplication* app = RiaApplication::instance();
if (RiaApplication::hasValidProjectFileExtension(fileName))