From: APTX Date: Sun, 16 Feb 2014 13:07:53 +0000 (+0100) Subject: Activate window when AniPlayer is told to open a new file. X-Git-Url: https://gitweb.aptx.org/?a=commitdiff_plain;h=5d59a3838582d3aecb49b9379e3dddc4d9ea9596;p=aniplayer2.git Activate window when AniPlayer is told to open a new file. --- diff --git a/aniplayer/aniplayerapplication.cpp b/aniplayer/aniplayerapplication.cpp index b9dd7c8..6443d33 100644 --- a/aniplayer/aniplayerapplication.cpp +++ b/aniplayer/aniplayerapplication.cpp @@ -19,17 +19,20 @@ AniPlayerApplication::AniPlayerApplication(int &argc, char **argv) : void AniPlayerApplication::handleMessage(const QString &message) { - if (message.left(4) != "open") - return; + if (message.left(4) != "open") + return; - QString file; + QString file; - int pos = -1; - if ((pos = message.indexOf(' ')) != -1) - file = message.mid(pos + 1); + int pos = -1; + if ((pos = message.indexOf(' ')) != -1) + file = message.mid(pos + 1); - if (!file.isEmpty()) - emit openFileRequested(file); + if (file.isEmpty()) + return; + + emit openFileRequested(file); + activateWindow(); } const char * const AniPlayerApplication::revision()