From 5d59a3838582d3aecb49b9379e3dddc4d9ea9596 Mon Sep 17 00:00:00 2001 From: APTX Date: Sun, 16 Feb 2014 14:07:53 +0100 Subject: [PATCH] Activate window when AniPlayer is told to open a new file. --- aniplayer/aniplayerapplication.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) 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() -- 2.52.0