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
uses: Chocobo1/setup-ccache-action@v1
with:
store_cache: ${{ startsWith(github.ref, 'refs/heads/') }}
store_cache: ${{ github.ref == 'refs/heads/master' }}
update_packager_index: false
ccache_options: |
max_size=2G
- name: Install boost
run: |
@ -136,8 +138,18 @@ jobs:
if [ "${{ matrix.qbt_gui }}" = "GUI=OFF" ]; then
appName="qbittorrent-nox"
fi
# package
pushd build
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
# prepare upload folder
mkdir upload

View file

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

View file

@ -33,19 +33,19 @@
<screenshots>
<screenshot type="default">
<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>
<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>
<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>
<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>
</screenshots>
<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
#endif
setQuitOnLastWindowClosed(false);
setQuitLockEnabled(false);
QPixmapCache::setCacheLimit(PIXMAP_CACHE_SIZE);
#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.
m_nativeStatus.state = lt::torrent_status::checking_resume_data;
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_completedFiles.fill(false);

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -95,7 +95,7 @@ StatusFilterWidget::StatusFilterWidget(QWidget *parent, TransferListWidget *tran
connect(pref, &Preferences::changed, this, &StatusFilterWidget::configure);
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);
else
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));
}
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
if (selectionModel()->selectedRows(0).empty() && (m_sortFilterModel->rowCount() > 0))
{

View file

@ -93,7 +93,7 @@ public slots:
void previewSelectedTorrents();
void hideQueuePosColumn(bool hide);
void applyFilter(const QString &name, const TransferListModel::Column &type);
void applyStatusFilter(int f);
void applyStatusFilter(int filterIndex);
void applyCategoryFilter(const QString &category);
void applyTagFilter(const QString &tag);
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"
},
"devDependencies": {
"eslint": "*",
"eslint-plugin-html": "*",
"eslint": "^8",
"eslint-plugin-html": "^8",
"html-validate": "*",
"js-beautify": "*",
"prettier": "*",

View file

@ -100,7 +100,7 @@ window.qBittorrent.PropTrackers = (function() {
tier: (tracker.tier >= 0) ? tracker.tier : "",
url: tracker.url,
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]",
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]",