Commit 7ea9c1e5 authored by Victor Poughon's avatar Victor Poughon
Browse files

RFC-91: CommandLineLauncher::LoadApplication return bool to fail earlier

No related merge requests found
Showing with 6 additions and 6 deletions
+6 -6
...@@ -131,7 +131,7 @@ protected: ...@@ -131,7 +131,7 @@ protected:
* Pay attention, the executable paths have to be loaded or set in * Pay attention, the executable paths have to be loaded or set in
* the environment before calling the function. * the environment before calling the function.
*/ */
void LoadApplication(); bool LoadApplication();
/** Parse the user expression, extract the key and the associated /** Parse the user expression, extract the key and the associated
* string and set it as value of each corresponding application * string and set it as value of each corresponding application
......
...@@ -124,9 +124,7 @@ bool CommandLineLauncher::Load() ...@@ -124,9 +124,7 @@ bool CommandLineLauncher::Load()
} }
} }
this->LoadApplication(); return this->LoadApplication();
return true;
} }
bool CommandLineLauncher::Execute() bool CommandLineLauncher::Execute()
...@@ -283,7 +281,7 @@ bool CommandLineLauncher::LoadPath() ...@@ -283,7 +281,7 @@ bool CommandLineLauncher::LoadPath()
return true; return true;
} }
void CommandLineLauncher::LoadApplication() bool CommandLineLauncher::LoadApplication()
{ {
// Look for the module name // Look for the module name
std::string moduleName; std::string moduleName;
...@@ -291,7 +289,7 @@ void CommandLineLauncher::LoadApplication() ...@@ -291,7 +289,7 @@ void CommandLineLauncher::LoadApplication()
if (m_Parser->GetModuleName(moduleName, m_VExpression) != CommandLineParser::OK) if (m_Parser->GetModuleName(moduleName, m_VExpression) != CommandLineParser::OK)
{ {
std::cerr << "ERROR: LoadApplication, no module found." << std::endl; std::cerr << "ERROR: LoadApplication, no module found." << std::endl;
return; return false;
} }
// Instantiate the application using the factory // Instantiate the application using the factory
...@@ -316,6 +314,7 @@ void CommandLineLauncher::LoadApplication() ...@@ -316,6 +314,7 @@ void CommandLineLauncher::LoadApplication()
std::cerr << "\t" << *it << std::endl; std::cerr << "\t" << *it << std::endl;
} }
} }
return false;
} }
else else
{ {
...@@ -327,6 +326,7 @@ void CommandLineLauncher::LoadApplication() ...@@ -327,6 +326,7 @@ void CommandLineLauncher::LoadApplication()
// Add an observer to the AddedProcess event // Add an observer to the AddedProcess event
m_Application->AddObserver(AddProcessToWatchEvent(), m_AddProcessCommand.GetPointer()); m_Application->AddObserver(AddProcessToWatchEvent(), m_AddProcessCommand.GetPointer());
return true;
} }
} }
......
Supports Markdown
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