+ implement mechanism to allow only a single application instance

This commit is contained in:
wmayer
2015-11-05 15:56:50 +01:00
parent 899199daf5
commit 3d8d6eca5e
7 changed files with 276 additions and 36 deletions

View File

@@ -999,6 +999,23 @@ void MainWindow::showMainWindow()
#endif
}
void MainWindow::processMessages(const QList<QByteArray> & msg)
{
// handle all the messages to open files
try {
WaitCursor wc;
std::list<std::string> files;
QByteArray action("OpenFile:");
for (QList<QByteArray>::const_iterator it = msg.begin(); it != msg.end(); ++it) {
if (it->startsWith(action))
files.push_back(std::string(it->mid(action.size()).constData()));
}
App::Application::processFiles(files);
}
catch (const Base::SystemExitException&) {
}
}
void MainWindow::delayedStartup()
{
// processing all command line files