mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-12-03 07:29:59 +08:00
Raise main window when starting another instance w/o params
This commit is contained in:
parent
d3b4ec77bc
commit
88960556e3
@ -197,6 +197,8 @@ int main(int argc, char *argv[]) {
|
||||
qDebug("Passing program parameters to running instance...");
|
||||
qDebug("Message: %s", qPrintable(message));
|
||||
app.sendMessage(message);
|
||||
} else { // Raise main window
|
||||
app.sendMessage("qbt://show");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -960,6 +960,14 @@ void MainWindow::processParams(const QStringList& params) {
|
||||
if (misc::isUrl(param)) {
|
||||
QBtSession::instance()->downloadFromUrl(param);
|
||||
}else{
|
||||
if(param.startsWith("qbt://show", Qt::CaseInsensitive)) {
|
||||
if(!ui_locked) {
|
||||
show();
|
||||
activateWindow();
|
||||
raise();
|
||||
}
|
||||
return; // Do not process more params
|
||||
}
|
||||
if (param.startsWith("bc://bt/", Qt::CaseInsensitive)) {
|
||||
qDebug("Converting bc link to magnet link");
|
||||
param = misc::bcLinkToMagnet(param);
|
||||
|
Loading…
Reference in New Issue
Block a user