mirror of
https://github.com/OPM/ResInsight.git
synced 2026-11-19 04:19:46 -06:00
Moved static method to the class where it belongs (more than it did).
This commit is contained in:
1 parent
803cc4328d
commit
aa36a3f5e6
5 files changed
+43
-38
No files matched your search
@@ -24,8 +24,11 @@
|
||||
|
||||
#include "RigWellLogFile.h"
|
||||
|
||||
#include "RiuMainWindow.h"
|
||||
|
||||
#include <QStringList>
|
||||
#include <QFileInfo>
|
||||
#include <QMessageBox>
|
||||
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimWellLogFile, "WellLogFile");
|
||||
@@ -64,6 +67,42 @@ RimWellLogFile::~RimWellLogFile()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellLogFile* RimWellLogFile::readWellLogFile(const QString& logFilePath)
|
||||
{
|
||||
QFileInfo fi(logFilePath);
|
||||
|
||||
RimWellLogFile* wellLogFile = NULL;
|
||||
|
||||
if (fi.suffix().toUpper().compare("LAS") == 0)
|
||||
{
|
||||
QString errorMessage;
|
||||
wellLogFile = new RimWellLogFile();
|
||||
wellLogFile->setFileName(logFilePath);
|
||||
if (!wellLogFile->readFile(&errorMessage))
|
||||
{
|
||||
QString displayMessage = "Could not open the LAS file: \n" + logFilePath;
|
||||
|
||||
if (!errorMessage.isEmpty())
|
||||
{
|
||||
displayMessage += "\n\n";
|
||||
displayMessage += errorMessage;
|
||||
}
|
||||
|
||||
QMessageBox::warning(RiuMainWindow::instance(),
|
||||
"File open error",
|
||||
displayMessage);
|
||||
|
||||
delete wellLogFile;
|
||||
wellLogFile = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return wellLogFile;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in new issue
Block a user