Skip to content

Commit

Permalink
Backport changes to v4.6.x branch
Browse files Browse the repository at this point in the history
PR #20636.
  • Loading branch information
glassez committed May 12, 2024
2 parents 769de08 + f86a574 commit 21143a9
Show file tree
Hide file tree
Showing 15 changed files with 54 additions and 27 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/ci_macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down Expand Up @@ -136,8 +138,18 @@ jobs:
if [ "${{ matrix.qbt_gui }}" = "GUI=OFF" ]; then
appName="qbittorrent-nox"
fi
# package
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
# prepare upload folder
mkdir upload
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_ubuntu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions dist/unix/org.qbittorrent.qBittorrent.metainfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
1 change: 1 addition & 0 deletions src/app/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 11 additions & 1 deletion src/base/bittorrent/torrentimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

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_completedFiles.fill(false);
Expand Down
4 changes: 3 additions & 1 deletion src/base/torrentfilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ class TorrentFilter
StalledDownloading,
Checking,
Moving,
Errored
Errored,

_Count
};

// These mean any permutation, including no category / tag.
Expand Down
3 changes: 2 additions & 1 deletion src/gui/addnewtorrentdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
11 changes: 5 additions & 6 deletions src/gui/fspathedit_p.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);
Expand All @@ -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());
Expand All @@ -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()
Expand Down
2 changes: 0 additions & 2 deletions src/gui/fspathedit_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
#include "base/pathfwd.h"

class QAction;
class QCompleter;
class QContextMenuEvent;
class QFileIconProvider;
class QFileSystemModel;
Expand Down Expand Up @@ -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;
Expand Down
7 changes: 5 additions & 2 deletions src/gui/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -781,8 +781,11 @@ void MainWindow::saveSplitterSettings() const

void MainWindow::cleanup()
{
saveSettings();
saveSplitterSettings();
if (!m_neverShown)
{
saveSettings();
saveSplitterSettings();
}

// delete RSSWidget explicitly to avoid crash in
// handleRSSUnreadCountUpdated() at application shutdown
Expand Down
2 changes: 1 addition & 1 deletion src/gui/transferlistfilters/statusfilterwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 3 additions & 2 deletions src/gui/transferlistwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
{
Expand Down
2 changes: 1 addition & 1 deletion src/gui/transferlistwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions src/webui/www/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "*",
Expand Down
2 changes: 1 addition & 1 deletion src/webui/www/private/scripts/prop-trackers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]",
Expand Down

0 comments on commit 21143a9

Please sign in to comment.