Commit 8db6ba80 authored by Jan Möbius's avatar Jan Möbius

Correctly handle command line scripts

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@6374 383ad7c9-94d9-4d36-a494-682f7c89f535
parent cc153314
......@@ -106,6 +106,14 @@ void Core::slotExecuteAfterStartup() {
}
for ( uint i = 0 ; i < commandLineFileNames_.size() ; ++i ) {
// Skip scripts here as they will be handled by a different function
QString tmp(commandLineFileNames_[i].first);
if ( tmp.endsWith("ofs") ) {
commandLineScriptNames_.push_back(commandLineFileNames_[i].first);
continue;
}
if (commandLineFileNames_[i].second)
loadObject(DATA_POLY_MESH, commandLineFileNames_[i].first);
else
......@@ -113,8 +121,12 @@ void Core::slotExecuteAfterStartup() {
}
if ( scriptingSupport )
for ( uint i = 0 ; i < commandLineScriptNames_.size() ; ++i )
emit executeFileScript(commandLineScriptNames_[i]);
for ( uint i = 0 ; i < commandLineScriptNames_.size() ; ++i ) {
// Add the full path to the script to set scripting dir right
QString tmp(commandLineScriptNames_[i]);
tmp = QDir::currentPath() + QDir::separator() + tmp;
emit executeFileScript(tmp);
}
if ( !OpenFlipper::Options::gui() && !OpenFlipper::Options::remoteControl())
exitApplication();
......
Markdown is supported
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