Skip to content

Commit

Permalink
fix file opening on ubuntu
Browse files Browse the repository at this point in the history
  • Loading branch information
orion-project committed Feb 10, 2022
1 parent 3723b48 commit e1360fe
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
3 changes: 3 additions & 0 deletions release/history.json
Expand Up @@ -18,6 +18,9 @@
},
{
"text": "Fixed typos (https://github.com/orion-project/rezonator2/issues/16)"
},
{
"text": "Fixed file opening on Ubuntu and macOS"
}
]
},
Expand Down
18 changes: 9 additions & 9 deletions src/ProjectOperations.cpp
Expand Up @@ -118,22 +118,22 @@ void ProjectOperations::openSchemaFile(const QString& fileName, const OpenFileOp
if (!schema()->state().isNew())
{
QStringList args;
#ifdef Q_OS_MAC
QString exe = qApp->applicationFilePath();
if (opts.isExample)
args << "--example";
args << fileName;
bool ok = QProcess::startDetached(exe, args);
if (!ok)
qWarning() << "Unable to start another instance" << exe << args.join(' ');
#else
#ifdef Q_OS_WIN
args << qApp->applicationFilePath();
if (opts.isExample)
args << "--example";
args << " \"" + fileName + "\"";
bool ok = QProcess::startDetached(args.join(' '), {});
if (!ok)
qWarning() << "Unable to start another instance" << args.join(' ');
#else
QString exe = qApp->applicationFilePath();
if (opts.isExample)
args << "--example";
args << fileName;
bool ok = QProcess::startDetached(exe, args);
if (!ok)
qWarning() << "Unable to start another instance" << exe << args.join(' ');
#endif
return;
}
Expand Down

0 comments on commit e1360fe

Please sign in to comment.