Backport changes to v4.6.x branch

PR #20636.
This commit is contained in:
Vladimir Golovnev 2024-05-12 14:20:30 +03:00 committed by GitHub
commit 21143a9764
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 54 additions and 27 deletions

View file

@ -49,8 +49,10 @@ jobs:
- name: Setup ccache - name: Setup ccache
uses: Chocobo1/setup-ccache-action@v1 uses: Chocobo1/setup-ccache-action@v1
with: with:
store_cache: ${{ startsWith(github.ref, 'refs/heads/') }} store_cache: ${{ github.ref == 'refs/heads/master' }}
update_packager_index: false update_packager_index: false
ccache_options: |
max_size=2G
- name: Install boost - name: Install boost
run: | run: |
@ -136,8 +138,18 @@ jobs:
if [ "${{ matrix.qbt_gui }}" = "GUI=OFF" ]; then if [ "${{ matrix.qbt_gui }}" = "GUI=OFF" ]; then
appName="qbittorrent-nox" appName="qbittorrent-nox"
fi fi
# package
pushd build pushd build
macdeployqt "$appName.app" -dmg -no-strip PACKAGE_RETRY=0
while [ "$PACKAGE_RETRY" -lt "3" ]; do
macdeployqt "$appName.app" -dmg -no-strip
if [ -f "$appName.dmg" ]; then
break
fi
sleep 5
PACKAGE_RETRY=$((PACKAGE_RETRY + 1))
echo "Retry $PACKAGE_RETRY..."
done
popd popd
# prepare upload folder # prepare upload folder
mkdir upload mkdir upload

View file

@ -39,7 +39,7 @@ jobs:
- name: Setup ccache - name: Setup ccache
uses: Chocobo1/setup-ccache-action@v1 uses: Chocobo1/setup-ccache-action@v1
with: with:
store_cache: ${{ startsWith(github.ref, 'refs/heads/') }} store_cache: ${{ github.ref == 'refs/heads/master' }}
update_packager_index: false update_packager_index: false
ccache_options: | ccache_options: |
max_size=2G max_size=2G

View file

@ -33,19 +33,19 @@
<screenshots> <screenshots>
<screenshot type="default"> <screenshot type="default">
<caption>Main window (General tab collapsed)</caption> <caption>Main window (General tab collapsed)</caption>
<image height="675" width="1200">https://alexpl.fedorapeople.org/AppData/qbittorrent/screens/qbittorrent_01.png</image> <image>https://raw.githubusercontent.com/qbittorrent/qBittorrent-website/2741f2a90854604e268c6bba9e6859aad0103583/src/img/screenshots/linux/1.webp</image>
</screenshot> </screenshot>
<screenshot> <screenshot>
<caption>Main window (General tab expanded)</caption> <caption>Main window (General tab expanded)</caption>
<image height="675" width="1200">https://alexpl.fedorapeople.org/AppData/qbittorrent/screens/qbittorrent_03.png</image> <image>https://raw.githubusercontent.com/qbittorrent/qBittorrent-website/2741f2a90854604e268c6bba9e6859aad0103583/src/img/screenshots/linux/2.webp</image>
</screenshot> </screenshot>
<screenshot> <screenshot>
<caption>Options dialog</caption> <caption>Options dialog</caption>
<image height="675" width="1200">https://alexpl.fedorapeople.org/AppData/qbittorrent/screens/qbittorrent_04.png</image> <image>https://raw.githubusercontent.com/qbittorrent/qBittorrent-website/2741f2a90854604e268c6bba9e6859aad0103583/src/img/screenshots/linux/3.webp</image>
</screenshot> </screenshot>
<screenshot> <screenshot>
<caption>Search engine</caption> <caption>Search engine</caption>
<image height="675" width="1200">https://alexpl.fedorapeople.org/AppData/qbittorrent/screens/qbittorrent_02.png</image> <image>https://raw.githubusercontent.com/qbittorrent/qBittorrent-website/2741f2a90854604e268c6bba9e6859aad0103583/src/img/screenshots/linux/4.webp</image>
</screenshot> </screenshot>
</screenshots> </screenshots>
<update_contact>sledgehammer999@qbittorrent.org</update_contact> <update_contact>sledgehammer999@qbittorrent.org</update_contact>

View file

@ -258,6 +258,7 @@ Application::Application(int &argc, char **argv)
setAttribute(Qt::AA_UseHighDpiPixmaps, true); // opt-in to the high DPI pixmap support setAttribute(Qt::AA_UseHighDpiPixmaps, true); // opt-in to the high DPI pixmap support
#endif #endif
setQuitOnLastWindowClosed(false); setQuitOnLastWindowClosed(false);
setQuitLockEnabled(false);
QPixmapCache::setCacheLimit(PIXMAP_CACHE_SIZE); QPixmapCache::setCacheLimit(PIXMAP_CACHE_SIZE);
#endif #endif

View file

@ -1519,7 +1519,17 @@ void TorrentImpl::forceRecheck()
// an incorrect one during the interval until the cached state is updated in a regular way. // an incorrect one during the interval until the cached state is updated in a regular way.
m_nativeStatus.state = lt::torrent_status::checking_resume_data; m_nativeStatus.state = lt::torrent_status::checking_resume_data;
m_hasMissingFiles = false; if (m_hasMissingFiles)
{
m_hasMissingFiles = false;
if (!isPaused())
{
setAutoManaged(m_operatingMode == TorrentOperatingMode::AutoManaged);
if (m_operatingMode == TorrentOperatingMode::Forced)
m_nativeHandle.resume();
}
}
m_unchecked = false; m_unchecked = false;
m_completedFiles.fill(false); m_completedFiles.fill(false);

View file

@ -60,7 +60,9 @@ public:
StalledDownloading, StalledDownloading,
Checking, Checking,
Moving, Moving,
Errored Errored,
_Count
}; };
// These mean any permutation, including no category / tag. // These mean any permutation, including no category / tag.

View file

@ -159,7 +159,8 @@ namespace
delta.setY(0); delta.setY(0);
dialogGeometry.translate(delta); dialogGeometry.translate(delta);
delta = screenGeometry.topLeft() - dialogGeometry.topLeft(); const QPoint frameOffset {10, 40};
delta = screenGeometry.topLeft() - dialogGeometry.topLeft() + frameOffset;
if (delta.x() < 0) if (delta.x() < 0)
delta.setX(0); delta.setX(0);
if (delta.y() < 0) if (delta.y() < 0)

View file

@ -164,6 +164,7 @@ QValidator::State Private::FileSystemPathValidator::validate(QString &input, int
Private::FileLineEdit::FileLineEdit(QWidget *parent) Private::FileLineEdit::FileLineEdit(QWidget *parent)
: QLineEdit(parent) : QLineEdit(parent)
{ {
setCompleter(new QCompleter(this));
connect(this, &QLineEdit::textChanged, this, &FileLineEdit::validateText); connect(this, &QLineEdit::textChanged, this, &FileLineEdit::validateText);
} }
@ -222,7 +223,7 @@ void Private::FileLineEdit::keyPressEvent(QKeyEvent *e)
if ((e->key() == Qt::Key_Space) && (e->modifiers() == Qt::CTRL)) if ((e->key() == Qt::Key_Space) && (e->modifiers() == Qt::CTRL))
{ {
if (!m_completer) if (!m_completerModel)
{ {
m_iconProvider = new QFileIconProvider; m_iconProvider = new QFileIconProvider;
m_iconProvider->setOptions(QFileIconProvider::DontUseCustomDirectoryIcons); m_iconProvider->setOptions(QFileIconProvider::DontUseCustomDirectoryIcons);
@ -235,9 +236,7 @@ void Private::FileLineEdit::keyPressEvent(QKeyEvent *e)
| (m_completeDirectoriesOnly ? QDir::Dirs : QDir::AllEntries); | (m_completeDirectoriesOnly ? QDir::Dirs : QDir::AllEntries);
m_completerModel->setFilter(filters); m_completerModel->setFilter(filters);
m_completer = new QCompleter(this); completer()->setModel(m_completerModel);
m_completer->setModel(m_completerModel);
setCompleter(m_completer);
} }
m_completerModel->setRootPath(Path(text()).data()); m_completerModel->setRootPath(Path(text()).data());
@ -261,8 +260,8 @@ void Private::FileLineEdit::contextMenuEvent(QContextMenuEvent *event)
void Private::FileLineEdit::showCompletionPopup() void Private::FileLineEdit::showCompletionPopup()
{ {
m_completer->setCompletionPrefix(text()); completer()->setCompletionPrefix(text());
m_completer->complete(); completer()->complete();
} }
void Private::FileLineEdit::validateText() void Private::FileLineEdit::validateText()

View file

@ -37,7 +37,6 @@
#include "base/pathfwd.h" #include "base/pathfwd.h"
class QAction; class QAction;
class QCompleter;
class QContextMenuEvent; class QContextMenuEvent;
class QFileIconProvider; class QFileIconProvider;
class QFileSystemModel; class QFileSystemModel;
@ -141,7 +140,6 @@ namespace Private
static QString warningText(FileSystemPathValidator::TestResult result); static QString warningText(FileSystemPathValidator::TestResult result);
QFileSystemModel *m_completerModel = nullptr; QFileSystemModel *m_completerModel = nullptr;
QCompleter *m_completer = nullptr;
QAction *m_browseAction = nullptr; QAction *m_browseAction = nullptr;
QAction *m_warningAction = nullptr; QAction *m_warningAction = nullptr;
QFileIconProvider *m_iconProvider = nullptr; QFileIconProvider *m_iconProvider = nullptr;

View file

@ -781,8 +781,11 @@ void MainWindow::saveSplitterSettings() const
void MainWindow::cleanup() void MainWindow::cleanup()
{ {
saveSettings(); if (!m_neverShown)
saveSplitterSettings(); {
saveSettings();
saveSplitterSettings();
}
// delete RSSWidget explicitly to avoid crash in // delete RSSWidget explicitly to avoid crash in
// handleRSSUnreadCountUpdated() at application shutdown // handleRSSUnreadCountUpdated() at application shutdown

View file

@ -95,7 +95,7 @@ StatusFilterWidget::StatusFilterWidget(QWidget *parent, TransferListWidget *tran
connect(pref, &Preferences::changed, this, &StatusFilterWidget::configure); connect(pref, &Preferences::changed, this, &StatusFilterWidget::configure);
const int storedRow = pref->getTransSelFilter(); const int storedRow = pref->getTransSelFilter();
if (item((storedRow < count()) ? storedRow : 0)->isHidden()) if (item(((storedRow >= 0) && (storedRow < count())) ? storedRow : 0)->isHidden())
setCurrentRow(TorrentFilter::All, QItemSelectionModel::SelectCurrent); setCurrentRow(TorrentFilter::All, QItemSelectionModel::SelectCurrent);
else else
setCurrentRow(storedRow, QItemSelectionModel::SelectCurrent); setCurrentRow(storedRow, QItemSelectionModel::SelectCurrent);

View file

@ -1330,9 +1330,10 @@ void TransferListWidget::applyFilter(const QString &name, const TransferListMode
m_sortFilterModel->setFilterRegularExpression(QRegularExpression(pattern, QRegularExpression::CaseInsensitiveOption)); m_sortFilterModel->setFilterRegularExpression(QRegularExpression(pattern, QRegularExpression::CaseInsensitiveOption));
} }
void TransferListWidget::applyStatusFilter(int f) void TransferListWidget::applyStatusFilter(const int filterIndex)
{ {
m_sortFilterModel->setStatusFilter(static_cast<TorrentFilter::Type>(f)); const auto filterType = static_cast<TorrentFilter::Type>(filterIndex);
m_sortFilterModel->setStatusFilter(((filterType >= TorrentFilter::All) && (filterType < TorrentFilter::_Count)) ? filterType : TorrentFilter::All);
// Select first item if nothing is selected // Select first item if nothing is selected
if (selectionModel()->selectedRows(0).empty() && (m_sortFilterModel->rowCount() > 0)) if (selectionModel()->selectedRows(0).empty() && (m_sortFilterModel->rowCount() > 0))
{ {

View file

@ -93,7 +93,7 @@ public slots:
void previewSelectedTorrents(); void previewSelectedTorrents();
void hideQueuePosColumn(bool hide); void hideQueuePosColumn(bool hide);
void applyFilter(const QString &name, const TransferListModel::Column &type); void applyFilter(const QString &name, const TransferListModel::Column &type);
void applyStatusFilter(int f); void applyStatusFilter(int filterIndex);
void applyCategoryFilter(const QString &category); void applyCategoryFilter(const QString &category);
void applyTagFilter(const QString &tag); void applyTagFilter(const QString &tag);
void applyTrackerFilterAll(); void applyTrackerFilterAll();

View file

@ -10,8 +10,8 @@
"lint": "eslint private/*.html private/scripts/*.js private/views/*.html public/*.html public/scripts/*.js && stylelint **/*.css && html-validate private public" "lint": "eslint private/*.html private/scripts/*.js private/views/*.html public/*.html public/scripts/*.js && stylelint **/*.css && html-validate private public"
}, },
"devDependencies": { "devDependencies": {
"eslint": "*", "eslint": "^8",
"eslint-plugin-html": "*", "eslint-plugin-html": "^8",
"html-validate": "*", "html-validate": "*",
"js-beautify": "*", "js-beautify": "*",
"prettier": "*", "prettier": "*",

View file

@ -100,7 +100,7 @@ window.qBittorrent.PropTrackers = (function() {
tier: (tracker.tier >= 0) ? tracker.tier : "", tier: (tracker.tier >= 0) ? tracker.tier : "",
url: tracker.url, url: tracker.url,
status: status, status: status,
peers: tracker.num_peers, peers: (tracker.num_peers >= 0) ? tracker.num_peers : "QBT_TR(N/A)QBT_TR[CONTEXT=TrackerListWidget]",
seeds: (tracker.num_seeds >= 0) ? tracker.num_seeds : "QBT_TR(N/A)QBT_TR[CONTEXT=TrackerListWidget]", seeds: (tracker.num_seeds >= 0) ? tracker.num_seeds : "QBT_TR(N/A)QBT_TR[CONTEXT=TrackerListWidget]",
leeches: (tracker.num_leeches >= 0) ? tracker.num_leeches : "QBT_TR(N/A)QBT_TR[CONTEXT=TrackerListWidget]", leeches: (tracker.num_leeches >= 0) ? tracker.num_leeches : "QBT_TR(N/A)QBT_TR[CONTEXT=TrackerListWidget]",
downloaded: (tracker.num_downloaded >= 0) ? tracker.num_downloaded : "QBT_TR(N/A)QBT_TR[CONTEXT=TrackerListWidget]", downloaded: (tracker.num_downloaded >= 0) ? tracker.num_downloaded : "QBT_TR(N/A)QBT_TR[CONTEXT=TrackerListWidget]",