Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/gui/addnewtorrentdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ AddNewTorrentDialog::AddNewTorrentDialog(const BitTorrent::TorrentDescriptor &to
});
dlg->open();
});
connect(m_filterLine, &LineEdit::textChanged, this, &AddNewTorrentDialog::setContentFilterPattern);
connect(m_filterLine, &LineEdit::textUpdated, this, &AddNewTorrentDialog::setContentFilterPattern);
connect(m_ui->buttonSelectAll, &QPushButton::clicked, m_ui->contentTreeView, &TorrentContentWidget::checkAll);
connect(m_ui->buttonSelectNone, &QPushButton::clicked, m_ui->contentTreeView, &TorrentContentWidget::checkNone);
connect(Preferences::instance(), &Preferences::changed, this, []
Expand Down
2 changes: 1 addition & 1 deletion src/gui/addnewtorrentdialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::TextInteractionFlag::TextSelectableByKeyboard|Qt::TextInteractionFlag::TextSelectableByMouse</set>
<set>Qt::TextInteractionFlag::LinksAccessibleByKeyboard|Qt::TextInteractionFlag::LinksAccessibleByMouse|Qt::TextInteractionFlag::TextSelectableByKeyboard|Qt::TextInteractionFlag::TextSelectableByMouse</set>
</property>
</widget>
</item>
Expand Down
2 changes: 1 addition & 1 deletion src/gui/lineedit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ LineEdit::LineEdit(QWidget *parent)
m_delayedTextChangedTimer->setSingleShot(true);
connect(m_delayedTextChangedTimer, &QTimer::timeout, this, [this]
{
emit textChanged(text());
emit textUpdated(text());
});
connect(this, &QLineEdit::textChanged, this, [this]
{
Expand Down
2 changes: 1 addition & 1 deletion src/gui/lineedit.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class LineEdit final : public QLineEdit
explicit LineEdit(QWidget *parent = nullptr);

signals:
void textChanged(const QString &text);
void textUpdated(const QString &text);

private:
void keyPressEvent(QKeyEvent *event) override;
Expand Down
2 changes: 1 addition & 1 deletion src/gui/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ MainWindow::MainWindow(IGUIApplication *app, const WindowState initialState, con
m_columnFilterComboBox->addItem(typeName, type);
}
connect(m_columnFilterComboBox, &QComboBox::currentIndexChanged, this, &MainWindow::applyTransferListFilter);
connect(m_columnFilterEdit, &LineEdit::textChanged, this, &MainWindow::applyTransferListFilter);
connect(m_columnFilterEdit, &LineEdit::textUpdated, this, &MainWindow::applyTransferListFilter);
connect(hSplitter, &QSplitter::splitterMoved, this, &MainWindow::saveSettings);
connect(m_splitter, &QSplitter::splitterMoved, this, &MainWindow::saveSplitterSettings);

Expand Down
2 changes: 1 addition & 1 deletion src/gui/properties/propertieswidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ PropertiesWidget::PropertiesWidget(QWidget *parent)
m_contentFilterLine->setFixedWidth(300);
m_contentFilterLine->setContextMenuPolicy(Qt::CustomContextMenu);
connect(m_contentFilterLine, &QWidget::customContextMenuRequested, this, &PropertiesWidget::showContentFilterContextMenu);
connect(m_contentFilterLine, &LineEdit::textChanged, this, &PropertiesWidget::setContentFilterPattern);
connect(m_contentFilterLine, &LineEdit::textUpdated, this, &PropertiesWidget::setContentFilterPattern);
m_ui->contentFilterLayout->insertWidget(3, m_contentFilterLine);

m_ui->filesList->setContentDragAllowed(true);
Expand Down
2 changes: 1 addition & 1 deletion src/gui/search/searchjobwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ SearchJobWidget::SearchJobWidget(const QString &id, IGUIApplication *app, QWidge
m_lineEditSearchResultsFilter->setPlaceholderText(tr("Filter search results..."));
m_lineEditSearchResultsFilter->setContextMenuPolicy(Qt::CustomContextMenu);
connect(m_lineEditSearchResultsFilter, &QWidget::customContextMenuRequested, this, &SearchJobWidget::showFilterContextMenu);
connect(m_lineEditSearchResultsFilter, &LineEdit::textChanged, this, &SearchJobWidget::filterSearchResults);
connect(m_lineEditSearchResultsFilter, &LineEdit::textUpdated, this, &SearchJobWidget::filterSearchResults);
m_ui->horizontalLayout->insertWidget(0, m_lineEditSearchResultsFilter);

connect(m_ui->filterMode, qOverload<int>(&QComboBox::currentIndexChanged), this, &SearchJobWidget::updateNameFilter);
Expand Down
12 changes: 7 additions & 5 deletions src/gui/torrentcreatordialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include <QMessageBox>
#include <QMimeData>
#include <QThread>
#include <QThreadPool>
#include <QUrl>

#include "base/bittorrent/session.h"
Expand Down Expand Up @@ -99,7 +100,7 @@ namespace
TorrentCreatorDialog::TorrentCreatorDialog(QWidget *parent, const Path &defaultPath)
: QDialog(parent)
, m_ui(new Ui::TorrentCreatorDialog)
, m_threadPool(this)
, m_threadPool {new QThreadPool(this)}
, m_storeDialogSize(SETTINGS_KEY(u"Size"_s))
, m_storePieceSize(SETTINGS_KEY(u"PieceSize"_s))
, m_storePrivateTorrent(SETTINGS_KEY(u"PrivateTorrent"_s))
Expand Down Expand Up @@ -141,8 +142,8 @@ TorrentCreatorDialog::TorrentCreatorDialog(QWidget *parent, const Path &defaultP
loadSettings();
updateInputPath(defaultPath);

m_threadPool.setMaxThreadCount(1);
m_threadPool.setObjectName("TorrentCreatorDialog m_threadPool");
m_threadPool->setMaxThreadCount(1);
m_threadPool->setObjectName("TorrentCreatorDialog m_threadPool");

#ifdef QBT_USES_LIBTORRENT2
m_ui->checkOptimizeAlignment->hide();
Expand All @@ -155,6 +156,7 @@ TorrentCreatorDialog::~TorrentCreatorDialog()
{
saveSettings();

delete m_threadPool;
delete m_ui;
}

Expand Down Expand Up @@ -321,7 +323,7 @@ void TorrentCreatorDialog::onCreateButtonClicked()
connect(torrentCreator, &BitTorrent::TorrentCreator::progressUpdated, this, &TorrentCreatorDialog::updateProgressBar);

// run the torrentCreator in a thread
m_threadPool.start(torrentCreator);
m_threadPool->start(torrentCreator);
}

void TorrentCreatorDialog::handleCreationFailure(const QString &msg)
Expand Down Expand Up @@ -371,7 +373,7 @@ void TorrentCreatorDialog::handleCreationSuccess(const BitTorrent::TorrentCreato
}
}

void TorrentCreatorDialog::updateProgressBar(int progress)
void TorrentCreatorDialog::updateProgressBar(const int progress)
{
m_ui->progressBar->setValue(progress);
}
Expand Down
5 changes: 3 additions & 2 deletions src/gui/torrentcreatordialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@
#pragma once

#include <QDialog>
#include <QThreadPool>

#include "base/path.h"
#include "base/settingvalue.h"

class QThreadPool;

namespace BitTorrent
{
enum class TorrentFormat;
Expand Down Expand Up @@ -82,7 +83,7 @@ private slots:
#endif

Ui::TorrentCreatorDialog *m_ui = nullptr;
QThreadPool m_threadPool;
QThreadPool *m_threadPool = nullptr;

// settings
SettingValue<QSize> m_storeDialogSize;
Expand Down
2 changes: 1 addition & 1 deletion src/gui/uithememanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ namespace

Path resolveThemePath(const Path &themePath)
{
return (themePath.isAbsolute() ? themePath : (Profile::instance()->rootPath() / themePath));
return (themePath.isAbsolute() ? themePath : (Profile::instance()->location(SpecialFolder::Config) / themePath));
}
}

Expand Down
Loading