Skip to content

Commit

Permalink
Merge branch 'c0re100:v5_0_x' into v5_0_x
Browse files Browse the repository at this point in the history
  • Loading branch information
Rirmach authored Nov 19, 2024
2 parents 8f8c2aa + 7333035 commit be4fd43
Show file tree
Hide file tree
Showing 162 changed files with 46,453 additions and 41,977 deletions.
34 changes: 34 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,37 @@
Sun Nov 17th 2024 - sledgehammer999 <[email protected]> - v5.0.2
- BUGFIX: Remove trackers from previous category when moved to new one (glassez)
- BUGFIX: Fix `.torrent` file could not be deleted when torrent is canceled (glassez)
- BUGFIX: Reset tracker entries when pausing the session (glassez)
- BUGFIX: Check real palette darkness to detect "dark theme" (glassez)
- BUGFIX: Correctly handle "torrent finished" events (glassez)
- BUGFIX: Preserve initial torrent progress while checking resume data (glassez)
- BUGFIX: Avoid reapplying Mark-of-the-Web when it already exists (Chocobo1)
- BUGFIX: Don't apply Mark-of-the-Web on existing files (Chocobo1)
- WEBUI: Add color scheme switcher (sledgehammer999)
- SEARCH: Correctly delete the moved search tab (glassez)
- WINDOWS: Correctly save and restore Qt style setting (glassez)
- WINDOWS: NSIS: update Luxembourgish, Simplified Chinese and Traditional Chinese translations (Ikko Eltociear Ashimine, 3gf8jv4dv)

Mon Oct 28th 2024 - sledgehammer999 <[email protected]> - v5.0.1
- FEATURE: Add "Simple pread/pwrite" disk IO type (Hanabishi)
- BUGFIX: Don't ignore SSL errors (sledgehammer999)
- BUGFIX: Don't try to apply Mark-of-the-Web to nonexistent files (glassez)
- BUGFIX: Disable "Move to trash" option by default (glassez)
- BUGFIX: Disable the ability to create torrents with a piece size of 256MiB (stalkerok)
- BUGFIX: Allow to choose Qt style (glassez)
- BUGFIX: Always notify user about duplicate torrent (glassez)
- BUGFIX: Correctly handle "torrent finished after move" event (glassez)
- BUGFIX: Correctly apply filename filter when `!qB` extension is enabled (glassez)
- BUGFIX: Improve color scheme change detection (glassez)
- BUGFIX: Fix button state for SSL certificate check (Chocobo1)
- WEBUI: Fix CSS that results in hidden torrent list in some browsers (skomerko)
- WEBUI: Use proper text color to highlight items in all filter lists (skomerko)
- WEBUI: Fix 'rename files' dialog cannot be opened more than once (Chocobo1)
- WEBUI: Fix UI of Advanced Settings to show all settings (glassez)
- WEBUI: Free resources allocated by web session once it is destructed (dyseg)
- SEARCH: Import correct libraries (Chocobo1)
- OTHER: Sync flag icons with upstream (xavier2k6)

Sun Sep 29th 2024 - sledgehammer999 <[email protected]> - v5.0.0
- FEATURE: Support creating .torrent with larger piece size (Chocobo1)
- FEATURE: Improve tracker entries handling (glassez)
Expand Down
2 changes: 1 addition & 1 deletion dist/mac/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>5.0.0</string>
<string>5.0.2</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
Expand Down
4 changes: 2 additions & 2 deletions dist/unix/org.qbittorrent.qBittorrent.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ Name[ta]=qBittorrent
GenericName[te]=క్యు బిట్ టొరెంట్ క్లయింట్
Comment[te]=క్యు బిట్ టొరెంట్ తో ఫైల్స్ దిగుమతి చేసుకోండి , పంచుకోండి
Name[te]=qBittorrent
GenericName[th]=โปรแกรมบิททอเร้นท์
Comment[th]=ดาวน์โหลดและแชร์ไฟล์ผ่าน BitTorrent
GenericName[th]=โปรแกรมบิตทอร์เรนต์
Comment[th]=ดาวน์โหลดและแชร์ไฟล์ผ่านบิตทอร์เรนต์
Name[th]=qBittorrent
GenericName[tr]=BitTorrent istemcisi
Comment[tr]=Dosyaları BitTorrent üzerinden indirin ve paylaşın
Expand Down
2 changes: 1 addition & 1 deletion dist/unix/org.qbittorrent.qBittorrent.metainfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,6 @@
<url type="contribute">https://github.com/qbittorrent/qBittorrent/blob/master/CONTRIBUTING.md</url>
<content_rating type="oars-1.1"/>
<releases>
<release version="5.0.0" date="2024-09-29"/>
<release version="5.0.2" date="2024-11-17"/>
</releases>
</component>
2 changes: 1 addition & 1 deletion dist/windows/config.nsh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
; 4.5.1.3 -> good
; 4.5.1.3.2 -> bad
; 4.5.0beta -> bad
!define /ifndef QBT_VERSION "5.0.0.10"
!define /ifndef QBT_VERSION "5.0.2.10"

; Option that controls the installer's window name
; If set, its value will be used like this:
Expand Down
2 changes: 1 addition & 1 deletion dist/windows/installer-translations/luxembourgish.nsh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ LangString inst_magnet ${LANG_LUXEMBOURGISH} "Magnet-Linken mat qBittorrent opma
;LangString inst_firewall ${LANG_ENGLISH} "Add Windows Firewall rule"
LangString inst_firewall ${LANG_LUXEMBOURGISH} "Reegel an der Windows Firewall dobäisetzen"
;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_LUXEMBOURGISH} "D'Windows path lenght (Padlängtbeschränkung) desaktivéieren (260 Zeechen MAX_PATH Beschränkung, erfuerdert min. Windows 10 1607)"
LangString inst_pathlimit ${LANG_LUXEMBOURGISH} "D'Windows path length (Padlängtbeschränkung) desaktivéieren (260 Zeechen MAX_PATH Beschränkung, erfuerdert min. Windows 10 1607)"
;LangString inst_firewallinfo ${LANG_ENGLISH} "Adding Windows Firewall rule"
LangString inst_firewallinfo ${LANG_LUXEMBOURGISH} "Reegel an der Windows Firewall dobäisetzen"
;LangString inst_warning ${LANG_ENGLISH} "qBittorrent is running. Please close the application before installing."
Expand Down
4 changes: 2 additions & 2 deletions dist/windows/installer-translations/simpchinese.nsh
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ LangString inst_warning ${LANG_SIMPCHINESE} "qBittorrent 正在运行。 安装
;LangString inst_uninstall_question ${LANG_ENGLISH} "Current version will be uninstalled. User settings and torrents will remain intact."
LangString inst_uninstall_question ${LANG_SIMPCHINESE} "当前版本会被卸载。 用户设置和种子会被完整保留。"
;LangString inst_unist ${LANG_ENGLISH} "Uninstalling previous version."
LangString inst_unist ${LANG_SIMPCHINESE} "卸载以前的版本"
LangString inst_unist ${LANG_SIMPCHINESE} "正在卸载以前的版本"
;LangString launch_qbt ${LANG_ENGLISH} "Launch qBittorrent."
LangString launch_qbt ${LANG_SIMPCHINESE} "启动 qBittorrent。"
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_SIMPCHINESE} "此安装程序仅支持 64 位 Windows 系统。"
;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
LangString inst_requires_win10 ${LANG_SIMPCHINESE} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
LangString inst_requires_win10 ${LANG_SIMPCHINESE} "此安装程序仅支持 Windows 10 (1809) / Windows Server 2019 或更新的系统。"
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_SIMPCHINESE} "卸载 qBittorrent"

Expand Down
2 changes: 1 addition & 1 deletion dist/windows/installer-translations/tradchinese.nsh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ LangString launch_qbt ${LANG_TRADCHINESE} "啟動 qBittorrent"
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_TRADCHINESE} "此安裝程式僅支援 64 位元版本的 Windows。"
;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
LangString inst_requires_win10 ${LANG_TRADCHINESE} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
LangString inst_requires_win10 ${LANG_TRADCHINESE} "此安裝程式僅支援 Windows 10 (1809) / Windows Server 2019 以上的系統。"
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_TRADCHINESE} "移除 qBittorrent"

Expand Down
6 changes: 2 additions & 4 deletions src/base/addtorrentmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,9 @@ void AddTorrentManager::setTorrentFileGuard(const QString &source, std::shared_p
m_guardedTorrentFiles.emplace(source, std::move(torrentFileGuard));
}

void AddTorrentManager::releaseTorrentFileGuard(const QString &source)
std::shared_ptr<TorrentFileGuard> AddTorrentManager::releaseTorrentFileGuard(const QString &source)
{
auto torrentFileGuard = m_guardedTorrentFiles.take(source);
if (torrentFileGuard)
torrentFileGuard->setAutoRemove(false);
return m_guardedTorrentFiles.take(source);
}

bool AddTorrentManager::processTorrent(const QString &source, const BitTorrent::TorrentDescriptor &torrentDescr
Expand Down
2 changes: 1 addition & 1 deletion src/base/addtorrentmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class AddTorrentManager : public ApplicationComponent<QObject>
void handleAddTorrentFailed(const QString &source, const QString &reason);
void handleDuplicateTorrent(const QString &source, const BitTorrent::TorrentDescriptor &torrentDescr, BitTorrent::Torrent *existingTorrent);
void setTorrentFileGuard(const QString &source, std::shared_ptr<TorrentFileGuard> torrentFileGuard);
void releaseTorrentFileGuard(const QString &source);
std::shared_ptr<TorrentFileGuard> releaseTorrentFileGuard(const QString &source);

private:
void onDownloadFinished(const Net::DownloadResult &result);
Expand Down
44 changes: 34 additions & 10 deletions src/base/bittorrent/sessionimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4188,14 +4188,29 @@ bool SessionImpl::isPaused() const

void SessionImpl::pause()
{
if (!m_isPaused)
if (m_isPaused)
return;

if (isRestored())
{
if (isRestored())
m_nativeSession->pause();
m_nativeSession->pause();

m_isPaused = true;
emit paused();
for (TorrentImpl *torrent : asConst(m_torrents))
{
torrent->resetTrackerEntryStatuses();

const QList<TrackerEntryStatus> trackers = torrent->trackers();
QHash<QString, TrackerEntryStatus> updatedTrackers;
updatedTrackers.reserve(trackers.size());

for (const TrackerEntryStatus &status : trackers)
updatedTrackers.emplace(status.url, status);
emit trackerEntryStatusesUpdated(torrent, updatedTrackers);
}
}

m_isPaused = true;
emit paused();
}

void SessionImpl::resume()
Expand Down Expand Up @@ -5417,9 +5432,6 @@ void SessionImpl::handleMoveTorrentStorageJobFinished(const Path &newPath)
if (torrent)
{
torrent->handleMoveStorageJobFinished(newPath, finishedJob.context, torrentHasOutstandingJob);
// The torrent may become "finished" at the end of the move if it was moved
// from the "incomplete" location after downloading finished.
processPendingFinishedTorrents();
}
else if (!torrentHasOutstandingJob)
{
Expand Down Expand Up @@ -5683,6 +5695,11 @@ void SessionImpl::setTorrentContentLayout(const TorrentContentLayout value)
// Read alerts sent by libtorrent session
void SessionImpl::readAlerts()
{
// cache current datetime of Qt and libtorrent clocks in order
// to optimize conversion of time points from lt to Qt clocks
m_ltNow = lt::clock_type::now();
m_qNow = QDateTime::currentDateTime();

const std::vector<lt::alert *> alerts = getPendingAlerts();

Q_ASSERT(m_loadedTorrents.isEmpty());
Expand All @@ -5709,6 +5726,9 @@ void SessionImpl::readAlerts()
}
}

// Some torrents may become "finished" after different alerts handling.
processPendingFinishedTorrents();

processTrackerStatuses();
}

Expand Down Expand Up @@ -6348,8 +6368,6 @@ void SessionImpl::handleStateUpdateAlert(const lt::state_update_alert *alert)
if (!updatedTorrents.isEmpty())
emit torrentsUpdated(updatedTorrents);

processPendingFinishedTorrents();

if (m_needSaveTorrentsQueue)
saveTorrentsQueue();

Expand Down Expand Up @@ -6546,3 +6564,9 @@ void SessionImpl::handleRemovedTorrent(const TorrentID &torrentID, const QString

m_removingTorrents.erase(removingTorrentDataIter);
}

QDateTime SessionImpl::fromLTTimePoint32(const libtorrent::time_point32 &timePoint) const
{
const auto secsSinceNow = lt::duration_cast<lt::seconds>(timePoint - m_ltNow + lt::milliseconds(500)).count();
return m_qNow.addSecs(secsSinceNow);
}
5 changes: 5 additions & 0 deletions src/base/bittorrent/sessionimpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,8 @@ namespace BitTorrent
void addMappedPorts(const QSet<quint16> &ports);
void removeMappedPorts(const QSet<quint16> &ports);

QDateTime fromLTTimePoint32(const lt::time_point32 &timePoint) const;

template <typename Func>
void invoke(Func &&func)
{
Expand Down Expand Up @@ -858,6 +860,9 @@ namespace BitTorrent

QList<TorrentImpl *> m_pendingFinishedTorrents;

QDateTime m_qNow;
lt::clock_type::time_point m_ltNow;

friend void Session::initInstance();
friend void Session::freeInstance();
friend Session *Session::instance();
Expand Down
Loading

0 comments on commit be4fd43

Please sign in to comment.