mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-07 14:43:10 -06:00
#2555 Summary cases. Convert paths to have internal separators ('/')
This commit is contained in:
parent
d0905c518b
commit
5cc3af4586
@ -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());
|
||||
|
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user