diff --git a/dist/windows/installer-translations/slovak.nsi b/dist/windows/installer-translations/slovak.nsi index 748c735b9..e3e9c92c4 100644 --- a/dist/windows/installer-translations/slovak.nsi +++ b/dist/windows/installer-translations/slovak.nsi @@ -1,62 +1,62 @@ ;Installer strings ;LangString inst_qbt_req ${LANG_ENGLISH} "qBittorrent (required)" -LangString inst_qbt_req ${LANG_SLOVAK} "qBittorrent (required)" +LangString inst_qbt_req ${LANG_SLOVAK} "qBittorrent (požadované)" ;LangString inst_dekstop ${LANG_ENGLISH} "Create Desktop Shortcut" -LangString inst_dekstop ${LANG_SLOVAK} "Create Desktop Shortcut" +LangString inst_dekstop ${LANG_SLOVAK} "Vytvoriť odkaz na pracovnej ploche" ;LangString inst_startmenu ${LANG_ENGLISH} "Create Start Menu Shortcut" -LangString inst_startmenu ${LANG_SLOVAK} "Create Start Menu Shortcut" +LangString inst_startmenu ${LANG_SLOVAK} "Vytvoriť odkaz v štart menu" ;LangString inst_startup ${LANG_ENGLISH} "Start qBittorrent on Windows start up" -LangString inst_startup ${LANG_SLOVAK} "Start qBittorrent on Windows start up" +LangString inst_startup ${LANG_SLOVAK} "Sputiť qBittorrent pri štarte Windowsu" ;LangString inst_torrent ${LANG_ENGLISH} "Open .torrent files with qBittorrent" -LangString inst_torrent ${LANG_SLOVAK} "Open .torrent files with qBittorrent" +LangString inst_torrent ${LANG_SLOVAK} "Otvárať .torrent súbory v qBittorrent" ;LangString inst_magnet ${LANG_ENGLISH} "Open magnet links with qBittorrent" -LangString inst_magnet ${LANG_SLOVAK} "Open magnet links with qBittorrent" +LangString inst_magnet ${LANG_SLOVAK} "Otvárať magnet odkazy v qBittorrent" ;LangString inst_firewall ${LANG_ENGLISH} "Add Windows Firewall rule" -LangString inst_firewall ${LANG_SLOVAK} "Add Windows Firewall rule" +LangString inst_firewall ${LANG_SLOVAK} "Pridať pravidlo do Windows Firewall" ;LangString inst_pathlimit ${LANG_ENGLISH} "Disable Windows path length limit (260 character MAX_PATH limitation, requires Windows 10 1607 or later)" -LangString inst_pathlimit ${LANG_SLOVAK} "Disable Windows path length limit (260 character MAX_PATH limitation, requires Windows 10 1607 or later)" +LangString inst_pathlimit ${LANG_SLOVAK} "Vypnúť limit dĺžky cesty Windowsu (260 znaková MAX_PATH limitácia, vyžaduje Windows 10 1607 alebo novšie)" ;LangString inst_firewallinfo ${LANG_ENGLISH} "Adding Windows Firewall rule" -LangString inst_firewallinfo ${LANG_SLOVAK} "Adding Windows Firewall rule" +LangString inst_firewallinfo ${LANG_SLOVAK} "Pridáva sa pravidlo do Windows Firewall" ;LangString inst_warning ${LANG_ENGLISH} "qBittorrent is running. Please close the application before installing." -LangString inst_warning ${LANG_SLOVAK} "qBittorrent is running. Please close the application before installing." +LangString inst_warning ${LANG_SLOVAK} "qBittorrent je spustený. Zatvorte prosím aplikáciu pred inštaláciou." ;LangString inst_uninstall_question ${LANG_ENGLISH} "Current version will be uninstalled. User settings and torrents will remain intact." -LangString inst_uninstall_question ${LANG_SLOVAK} "Current version will be uninstalled. User settings and torrents will remain intact." +LangString inst_uninstall_question ${LANG_SLOVAK} "Aktuálna verzia bude odinštalovaná. Užívateľské nastavenia a torrenty sa zachovajú." ;LangString inst_unist ${LANG_ENGLISH} "Uninstalling previous version." -LangString inst_unist ${LANG_SLOVAK} "Uninstalling previous version." +LangString inst_unist ${LANG_SLOVAK} "Odinštalácia predchádzajúcej verzie." ;LangString launch_qbt ${LANG_ENGLISH} "Launch qBittorrent." -LangString launch_qbt ${LANG_SLOVAK} "Launch qBittorrent." +LangString launch_qbt ${LANG_SLOVAK} "Spustiť qBittorrent." ;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions." -LangString inst_requires_64bit ${LANG_SLOVAK} "This installer works only in 64-bit Windows versions." +LangString inst_requires_64bit ${LANG_SLOVAK} "Táto inštalácia funguje iba na 64-bitových verziách Windowsu." ;LangString inst_requires_win7 ${LANG_ENGLISH} "This qBittorrent version requires at least Windows 7." -LangString inst_requires_win7 ${LANG_SLOVAK} "This qBittorrent version requires at least Windows 7." +LangString inst_requires_win7 ${LANG_SLOVAK} "Táto qBittorrent verzia vyžaduje aspoň Windows 7." ;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809." -LangString inst_requires_win10 ${LANG_SLOVAK} "This installer requires at least Windows 10 1809." +LangString inst_requires_win10 ${LANG_SLOVAK} "Tento inštalátor vyžaduje aspoň Windows 10 1809." ;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent" -LangString inst_uninstall_link_description ${LANG_SLOVAK} "Uninstall qBittorrent" +LangString inst_uninstall_link_description ${LANG_SLOVAK} "Odinštalovať qBittorrent" ;------------------------------------ ;Uninstaller strings ;LangString remove_files ${LANG_ENGLISH} "Remove files" -LangString remove_files ${LANG_SLOVAK} "Remove files" +LangString remove_files ${LANG_SLOVAK} "Odstrániť súbory" ;LangString remove_shortcuts ${LANG_ENGLISH} "Remove shortcuts" -LangString remove_shortcuts ${LANG_SLOVAK} "Remove shortcuts" +LangString remove_shortcuts ${LANG_SLOVAK} "Odstrániť odkazy" ;LangString remove_associations ${LANG_ENGLISH} "Remove file associations" -LangString remove_associations ${LANG_SLOVAK} "Remove file associations" +LangString remove_associations ${LANG_SLOVAK} "Odstrániť asociácie súborov" ;LangString remove_registry ${LANG_ENGLISH} "Remove registry keys" -LangString remove_registry ${LANG_SLOVAK} "Remove registry keys" +LangString remove_registry ${LANG_SLOVAK} "Odstrániť kľúče registrov" ;LangString remove_conf ${LANG_ENGLISH} "Remove configuration files" -LangString remove_conf ${LANG_SLOVAK} "Remove configuration files" +LangString remove_conf ${LANG_SLOVAK} "Odstrániť konfiguračné súbory" ;LangString remove_firewall ${LANG_ENGLISH} "Remove Windows Firewall rule" -LangString remove_firewall ${LANG_SLOVAK} "Remove Windows Firewall rule" +LangString remove_firewall ${LANG_SLOVAK} "Odstrániť pravidlo z Windows Firewall" ;LangString remove_firewallinfo ${LANG_ENGLISH} "Removing Windows Firewall rule" -LangString remove_firewallinfo ${LANG_SLOVAK} "Removing Windows Firewall rule" +LangString remove_firewallinfo ${LANG_SLOVAK} "Odstraňuje sa pravidlo z Windows Firewall" ;LangString remove_cache ${LANG_ENGLISH} "Remove torrents and cached data" -LangString remove_cache ${LANG_SLOVAK} "Remove torrents and cached data" +LangString remove_cache ${LANG_SLOVAK} "Odstrániť torrenty a dáta z vyrovnávacej pamäti" ;LangString uninst_warning ${LANG_ENGLISH} "qBittorrent is running. Please close the application before uninstalling." -LangString uninst_warning ${LANG_SLOVAK} "qBittorrent is running. Please close the application before uninstalling." +LangString uninst_warning ${LANG_SLOVAK} "qBittorrent je spustený. Zatvorte prosím aplikáciu pred odinštaláciou." ;LangString uninst_tor_warn ${LANG_ENGLISH} "Not removing .torrent association. It is associated with:" -LangString uninst_tor_warn ${LANG_SLOVAK} "Not removing .torrent association. It is associated with:" +LangString uninst_tor_warn ${LANG_SLOVAK} "Neodstraňuje sa .torrent asociácia. Asociované s:" ;LangString uninst_mag_warn ${LANG_ENGLISH} "Not removing magnet association. It is associated with:" -LangString uninst_mag_warn ${LANG_SLOVAK} "Not removing magnet association. It is associated with:" +LangString uninst_mag_warn ${LANG_SLOVAK} "Neodstraňuje sa magnet asociácia. Asociované s:" diff --git a/src/base/bittorrent/dbresumedatastorage.cpp b/src/base/bittorrent/dbresumedatastorage.cpp index fb0ce3311..73f80e4da 100644 --- a/src/base/bittorrent/dbresumedatastorage.cpp +++ b/src/base/bittorrent/dbresumedatastorage.cpp @@ -272,7 +272,7 @@ BitTorrent::DBResumeDataStorage::DBResumeDataStorage(const Path &dbPath, QObject else { const int dbVersion = (!db.record(DB_TABLE_TORRENTS).contains(DB_COLUMN_DOWNLOAD_PATH.name) ? 1 : currentDBVersion()); - if (dbVersion != DB_VERSION) + if (dbVersion < DB_VERSION) updateDB(dbVersion); } @@ -531,18 +531,28 @@ void BitTorrent::DBResumeDataStorage::updateDB(const int fromVersion) const { if (fromVersion == 1) { - const auto alterTableTorrentsQuery = u"ALTER TABLE %1 ADD %2"_qs - .arg(quoted(DB_TABLE_TORRENTS), makeColumnDefinition(DB_COLUMN_DOWNLOAD_PATH, "TEXT")); - if (!query.exec(alterTableTorrentsQuery)) - throw RuntimeError(query.lastError().text()); + const auto testQuery = u"SELECT COUNT(%1) FROM %2;"_qs + .arg(quoted(DB_COLUMN_DOWNLOAD_PATH.name), quoted(DB_TABLE_TORRENTS)); + if (!query.exec(testQuery)) + { + const auto alterTableTorrentsQuery = u"ALTER TABLE %1 ADD %2"_qs + .arg(quoted(DB_TABLE_TORRENTS), makeColumnDefinition(DB_COLUMN_DOWNLOAD_PATH, "TEXT")); + if (!query.exec(alterTableTorrentsQuery)) + throw RuntimeError(query.lastError().text()); + } } if (fromVersion <= 2) { - const auto alterTableTorrentsQuery = u"ALTER TABLE %1 ADD %2"_qs - .arg(quoted(DB_TABLE_TORRENTS), makeColumnDefinition(DB_COLUMN_STOP_CONDITION, "TEXT NOT NULL DEFAULT `None`")); - if (!query.exec(alterTableTorrentsQuery)) - throw RuntimeError(query.lastError().text()); + const auto testQuery = u"SELECT COUNT(%1) FROM %2;"_qs + .arg(quoted(DB_COLUMN_STOP_CONDITION.name), quoted(DB_TABLE_TORRENTS)); + if (!query.exec(testQuery)) + { + const auto alterTableTorrentsQuery = u"ALTER TABLE %1 ADD %2"_qs + .arg(quoted(DB_TABLE_TORRENTS), makeColumnDefinition(DB_COLUMN_STOP_CONDITION, "TEXT NOT NULL DEFAULT `None`")); + if (!query.exec(alterTableTorrentsQuery)) + throw RuntimeError(query.lastError().text()); + } } const QString updateMetaVersionQuery = makeUpdateStatement(DB_TABLE_META, {DB_COLUMN_NAME, DB_COLUMN_VALUE}); diff --git a/src/base/bittorrent/sessionimpl.cpp b/src/base/bittorrent/sessionimpl.cpp index 59a1eec9d..832d39368 100644 --- a/src/base/bittorrent/sessionimpl.cpp +++ b/src/base/bittorrent/sessionimpl.cpp @@ -5239,10 +5239,13 @@ void SessionImpl::handleTorrentDeletedAlert(const lt::torrent_deleted_alert *p) #endif const auto removingTorrentDataIter = m_removingTorrents.find(id); - if (removingTorrentDataIter == m_removingTorrents.end()) return; + // torrent_deleted_alert can also be posted due to deletion of partfile. Ignore it in such a case. + if (removingTorrentDataIter->deleteOption == DeleteTorrent) + return; + Utils::Fs::smartRemoveEmptyFolderTree(removingTorrentDataIter->pathToRemove); LogMsg(tr("Removed torrent and deleted its content. Torrent: \"%1\"").arg(removingTorrentDataIter->name)); m_removingTorrents.erase(removingTorrentDataIter); @@ -5257,7 +5260,6 @@ void SessionImpl::handleTorrentDeleteFailedAlert(const lt::torrent_delete_failed #endif const auto removingTorrentDataIter = m_removingTorrents.find(id); - if (removingTorrentDataIter == m_removingTorrents.end()) return; @@ -5267,7 +5269,7 @@ void SessionImpl::handleTorrentDeleteFailedAlert(const lt::torrent_delete_failed // so we remove the directory ourselves Utils::Fs::smartRemoveEmptyFolderTree(removingTorrentDataIter->pathToRemove); - LogMsg(tr("Removed torrent but failed to delete its content. Torrent: \"%1\". Error: \"%2\"") + LogMsg(tr("Removed torrent but failed to delete its content and/or partfile. Torrent: \"%1\". Error: \"%2\"") .arg(removingTorrentDataIter->name, QString::fromLocal8Bit(p->error.message().c_str())) , Log::WARNING); } @@ -5275,6 +5277,7 @@ void SessionImpl::handleTorrentDeleteFailedAlert(const lt::torrent_delete_failed { LogMsg(tr("Removed torrent. Torrent: \"%1\"").arg(removingTorrentDataIter->name)); } + m_removingTorrents.erase(removingTorrentDataIter); } diff --git a/src/base/bittorrent/torrentimpl.cpp b/src/base/bittorrent/torrentimpl.cpp index 596b339fc..1f3dd2ef4 100644 --- a/src/base/bittorrent/torrentimpl.cpp +++ b/src/base/bittorrent/torrentimpl.cpp @@ -1841,25 +1841,24 @@ void TorrentImpl::handleTorrentFinishedAlert(const lt::torrent_finished_alert *p m_statusUpdatedTriggers.enqueue([this]() { - m_hasSeedStatus = true; - adjustStorageLocation(); manageIncompleteFiles(); m_session->handleTorrentNeedSaveResumeData(this); const bool recheckTorrentsOnCompletion = Preferences::instance()->recheckTorrentsOnCompletion(); - if (isMoveInProgress() || (m_renameCount > 0)) + if (recheckTorrentsOnCompletion && m_unchecked) { - if (recheckTorrentsOnCompletion) - m_moveFinishedTriggers.enqueue([this]() { forceRecheck(); }); - m_moveFinishedTriggers.enqueue([this]() { m_session->handleTorrentFinished(this); }); + forceRecheck(); } else { - if (recheckTorrentsOnCompletion && m_unchecked) - forceRecheck(); - m_session->handleTorrentFinished(this); + m_hasSeedStatus = true; + + if (isMoveInProgress() || (m_renameCount > 0)) + m_moveFinishedTriggers.enqueue([this]() { m_session->handleTorrentFinished(this); }); + else + m_session->handleTorrentFinished(this); } }); } diff --git a/src/gui/optionsdialog.cpp b/src/gui/optionsdialog.cpp index 2ae1359e1..66ceb7f58 100644 --- a/src/gui/optionsdialog.cpp +++ b/src/gui/optionsdialog.cpp @@ -293,17 +293,18 @@ void OptionsDialog::loadBehaviorTabOptions() m_ui->checkPreventFromSuspendWhenDownloading->setChecked(pref->preventFromSuspendWhenDownloading()); m_ui->checkPreventFromSuspendWhenSeeding->setChecked(pref->preventFromSuspendWhenSeeding()); - m_ui->checkFileLog->setChecked(app()->isFileLoggerEnabled()); + const bool fileLogEnabled = app()->isFileLoggerEnabled(); + m_ui->checkFileLog->setChecked(fileLogEnabled); m_ui->textFileLogPath->setDialogCaption(tr("Choose a save directory")); m_ui->textFileLogPath->setMode(FileSystemPathEdit::Mode::DirectorySave); m_ui->textFileLogPath->setSelectedPath(app()->fileLoggerPath()); const bool fileLogBackup = app()->isFileLoggerBackup(); m_ui->checkFileLogBackup->setChecked(fileLogBackup); - m_ui->spinFileLogSize->setEnabled(fileLogBackup); + m_ui->spinFileLogSize->setEnabled(fileLogEnabled && fileLogBackup); const bool fileLogDelete = app()->isFileLoggerDeleteOld(); m_ui->checkFileLogDelete->setChecked(fileLogDelete); - m_ui->spinFileLogAge->setEnabled(fileLogDelete); - m_ui->comboFileLogAgeType->setEnabled(fileLogDelete); + m_ui->spinFileLogAge->setEnabled(fileLogEnabled && fileLogDelete); + m_ui->comboFileLogAgeType->setEnabled(fileLogEnabled && fileLogDelete); m_ui->spinFileLogSize->setValue(app()->fileLoggerMaxSize() / 1024); m_ui->spinFileLogAge->setValue(app()->fileLoggerAge()); m_ui->comboFileLogAgeType->setCurrentIndex(app()->fileLoggerAgeType()); @@ -352,7 +353,14 @@ void OptionsDialog::loadBehaviorTabOptions() m_ui->checkPreventFromSuspendWhenSeeding->setDisabled(true); #endif - connect(m_ui->checkFileLog, &QGroupBox::toggled, this, &ThisType::enableApplyButton); + connect(m_ui->checkFileLog, &QGroupBox::toggled, this, [this](const bool checked) + { + m_ui->spinFileLogSize->setEnabled(checked && m_ui->checkFileLogBackup->isChecked()); + const bool bothChecked = checked && m_ui->checkFileLogDelete->isChecked(); + m_ui->spinFileLogAge->setEnabled(bothChecked); + m_ui->comboFileLogAgeType->setEnabled(bothChecked); + enableApplyButton(); + }); connect(m_ui->textFileLogPath, &FileSystemPathEdit::selectedPathChanged, this, &ThisType::enableApplyButton); connect(m_ui->checkFileLogBackup, &QAbstractButton::toggled, m_ui->spinFileLogSize, &QWidget::setEnabled); connect(m_ui->checkFileLogBackup, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);