mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4429 Implement return status handling for command file interface
This commit is contained in:
@@ -20,6 +20,8 @@
|
||||
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include <QDir>
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RicfSetStartDir, "setStartDir");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -33,7 +35,22 @@ RicfSetStartDir::RicfSetStartDir()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicfSetStartDir::execute()
|
||||
RicfCommandResponse RicfSetStartDir::execute()
|
||||
{
|
||||
QDir directory(m_path);
|
||||
if (!directory.exists())
|
||||
{
|
||||
QString error = QString("Path does not exist: %1").arg(m_path);
|
||||
RiaLogging::error(error);
|
||||
return RicfCommandResponse(RicfCommandResponse::COMMAND_ERROR, error);
|
||||
}
|
||||
if (!directory.isReadable())
|
||||
{
|
||||
QString error = QString("Path does not exist: %1").arg(m_path);
|
||||
RiaLogging::error(error);
|
||||
return RicfCommandResponse(RicfCommandResponse::COMMAND_ERROR, error);
|
||||
}
|
||||
|
||||
RiaApplication::instance()->setStartDir(m_path);
|
||||
return RicfCommandResponse();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user