mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-20 07:27:22 -06:00
Add option to start qbt with Windows startup.
This commit is contained in:
@@ -181,6 +181,24 @@ public:
|
||||
setValue("Preferences/General/PreventFromSuspend", b);
|
||||
}
|
||||
|
||||
#ifdef Q_WS_WIN
|
||||
bool Startup() const {
|
||||
QSettings settings("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Run", QSettings::NativeFormat);
|
||||
return settings.contains("qBittorrent");
|
||||
}
|
||||
|
||||
void setStartup(bool b) {
|
||||
QSettings settings("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Run", QSettings::NativeFormat);
|
||||
if (b) {
|
||||
const QString bin_path = "\""+qApp->applicationFilePath().replace("/", "\\")+"\"";
|
||||
settings.setValue("qBittorrent", bin_path);
|
||||
}
|
||||
else {
|
||||
settings.remove("qBittorrent");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// Downloads
|
||||
QString getSavePath() const {
|
||||
QString save_path = value(QString::fromUtf8("Preferences/Downloads/SavePath")).toString();
|
||||
|
||||
Reference in New Issue
Block a user