mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-22 20:44:15 +00: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("Passing program parameters to running instance...");
|
||||||
qDebug("Message: %s", qPrintable(message));
|
qDebug("Message: %s", qPrintable(message));
|
||||||
app.sendMessage(message);
|
app.sendMessage(message);
|
||||||
|
} else { // Raise main window
|
||||||
|
app.sendMessage("qbt://show");
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -960,6 +960,14 @@ void MainWindow::processParams(const QStringList& params) {
|
|||||||
if (misc::isUrl(param)) {
|
if (misc::isUrl(param)) {
|
||||||
QBtSession::instance()->downloadFromUrl(param);
|
QBtSession::instance()->downloadFromUrl(param);
|
||||||
}else{
|
}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)) {
|
if (param.startsWith("bc://bt/", Qt::CaseInsensitive)) {
|
||||||
qDebug("Converting bc link to magnet link");
|
qDebug("Converting bc link to magnet link");
|
||||||
param = misc::bcLinkToMagnet(param);
|
param = misc::bcLinkToMagnet(param);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user