mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-13 16:53:08 -07:00
Use unmodified QtSingleApplication on Windows.
Get running application instance PID without QtSingleApplication modification.
This commit is contained in:
parent
e52a8fb0b0
commit
2dd473eb28
7 changed files with 47 additions and 89 deletions
|
@ -90,10 +90,6 @@ public:
|
|||
|
||||
#include "main.moc"
|
||||
|
||||
#if defined(Q_OS_WIN) && !defined(QBT_HAS_GETCURRENTPID)
|
||||
#error You seem to have updated QtSingleApplication without porting our custom QtSingleApplication::getRunningPid() function. Please see previous version to understate how it works.
|
||||
#endif
|
||||
|
||||
// Signal handlers
|
||||
#if defined(Q_OS_UNIX) || defined(STACKTRACE_WIN)
|
||||
void sigintHandler(int);
|
||||
|
@ -217,14 +213,8 @@ int main(int argc, char *argv[])
|
|||
#else
|
||||
qDebug("qBittorrent is already running for this user.");
|
||||
#endif
|
||||
|
||||
misc::msleep(300);
|
||||
#ifdef Q_OS_WIN
|
||||
DWORD pid = (DWORD)app->getRunningPid();
|
||||
if (pid > 0) {
|
||||
BOOL b = AllowSetForegroundWindow(pid);
|
||||
qDebug("AllowSetForegroundWindow() returns %s", b ? "TRUE" : "FALSE");
|
||||
}
|
||||
#endif
|
||||
if (!params.torrents.isEmpty()) {
|
||||
QString message = params.torrents.join("|");
|
||||
qDebug("Passing program parameters to running instance...");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue