mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-03 06:02:29 -06:00
@@ -43,7 +43,7 @@ GuiIconProvider::GuiIconProvider(QObject *parent)
|
||||
connect(Preferences::instance(), SIGNAL(changed()), SLOT(configure()));
|
||||
}
|
||||
|
||||
GuiIconProvider::~GuiIconProvider() {}
|
||||
GuiIconProvider::~GuiIconProvider() = default;
|
||||
|
||||
void GuiIconProvider::initInstance()
|
||||
{
|
||||
@@ -138,7 +138,6 @@ QString GuiIconProvider::getIconPath(const QString &iconId)
|
||||
return IconProvider::getIconPath(iconId);
|
||||
}
|
||||
|
||||
|
||||
void GuiIconProvider::configure()
|
||||
{
|
||||
#if (defined(Q_OS_UNIX) && !defined(Q_OS_MAC))
|
||||
|
||||
@@ -860,7 +860,7 @@ void MainWindow::createKeyboardShortcuts()
|
||||
m_ui->actionDocumentation->setShortcut(QKeySequence::HelpContents);
|
||||
m_ui->actionOptions->setShortcut(Qt::ALT + Qt::Key_O);
|
||||
m_ui->actionStart->setShortcut(Qt::CTRL + Qt::Key_S);
|
||||
m_ui->actionStartAll->setShortcut(Qt::CTRL + Qt::SHIFT +Qt::Key_S);
|
||||
m_ui->actionStartAll->setShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_S);
|
||||
m_ui->actionPause->setShortcut(Qt::CTRL + Qt::Key_P);
|
||||
m_ui->actionPauseAll->setShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_P);
|
||||
m_ui->actionBottomPriority->setShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_Minus);
|
||||
|
||||
@@ -312,8 +312,7 @@ OptionsDialog::OptionsDialog(QWidget *parent)
|
||||
connect(m_ui->comboRatioLimitAct, qComboBoxCurrentIndexChanged, this, &ThisType::enableApplyButton);
|
||||
connect(m_ui->checkMaxSeedingMinutes, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
|
||||
connect(m_ui->checkMaxSeedingMinutes, &QAbstractButton::toggled, this, &ThisType::toggleComboRatioLimitAct);
|
||||
connect(m_ui->spinMaxSeedingMinutes, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged),
|
||||
this, &ThisType::enableApplyButton);
|
||||
connect(m_ui->spinMaxSeedingMinutes, qSpinBoxValueChanged, this, &ThisType::enableApplyButton);
|
||||
// Proxy tab
|
||||
connect(m_ui->comboProxyType, qComboBoxCurrentIndexChanged, this, &ThisType::enableApplyButton);
|
||||
connect(m_ui->textProxyIP, &QLineEdit::textChanged, this, &ThisType::enableApplyButton);
|
||||
|
||||
@@ -88,10 +88,10 @@ private slots:
|
||||
void on_buttonBox_accepted();
|
||||
void closeEvent(QCloseEvent *e);
|
||||
void on_buttonBox_rejected();
|
||||
void applySettings(QAbstractButton* button);
|
||||
void applySettings(QAbstractButton *button);
|
||||
void enableApplyButton();
|
||||
void toggleComboRatioLimitAct();
|
||||
void changePage(QListWidgetItem*, QListWidgetItem*);
|
||||
void changePage(QListWidgetItem *, QListWidgetItem *);
|
||||
void loadWindowState();
|
||||
void loadSplitterState();
|
||||
void saveWindowState() const;
|
||||
@@ -132,7 +132,7 @@ private:
|
||||
bool addTorrentsInPause() const;
|
||||
QString getTorrentExportDir() const;
|
||||
QString getFinishedTorrentExportDir() const;
|
||||
QString askForExportDir(const QString& currentExportPath);
|
||||
QString askForExportDir(const QString ¤tExportPath);
|
||||
int getActionOnDblClOnTorrentDl() const;
|
||||
int getActionOnDblClOnTorrentFn() const;
|
||||
// Connection options
|
||||
|
||||
@@ -58,7 +58,7 @@ void TransferListDelegate::paint(QPainter * painter, const QStyleOptionViewItem
|
||||
bool isHideState = true;
|
||||
if (Preferences::instance()->getHideZeroComboValues() == 1) { // paused torrents only
|
||||
QModelIndex stateIndex = index.sibling(index.row(), TorrentModel::TR_STATUS);
|
||||
if (stateIndex.data().toInt() != BitTorrent::TorrentState::PausedDownloading)
|
||||
if (stateIndex.data().value<BitTorrent::TorrentState>() != BitTorrent::TorrentState::PausedDownloading)
|
||||
isHideState = false;
|
||||
}
|
||||
const bool hideValues = Preferences::instance()->getHideZeroValues() & isHideState;
|
||||
@@ -98,7 +98,7 @@ void TransferListDelegate::paint(QPainter * painter, const QStyleOptionViewItem
|
||||
break;
|
||||
}
|
||||
case TorrentModel::TR_STATUS: {
|
||||
const int state = index.data().toInt();
|
||||
const auto state = index.data().value<BitTorrent::TorrentState>();
|
||||
QString display = getStatusString(state);
|
||||
QItemDelegate::drawDisplay(painter, opt, opt.rect, display);
|
||||
break;
|
||||
@@ -223,7 +223,7 @@ QSize TransferListDelegate::sizeHint(const QStyleOptionViewItem & option, const
|
||||
return size;
|
||||
}
|
||||
|
||||
QString TransferListDelegate::getStatusString(const int state) const
|
||||
QString TransferListDelegate::getStatusString(const BitTorrent::TorrentState state) const
|
||||
{
|
||||
QString str;
|
||||
|
||||
|
||||
@@ -39,6 +39,10 @@ class QStyleOptionViewItem;
|
||||
class QModelIndex;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace BitTorrent
|
||||
{
|
||||
enum class TorrentState;
|
||||
}
|
||||
// Defines for download list list columns
|
||||
|
||||
class TransferListDelegate: public QItemDelegate
|
||||
@@ -52,7 +56,7 @@ public:
|
||||
QSize sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const;
|
||||
|
||||
private:
|
||||
QString getStatusString(const int state) const;
|
||||
QString getStatusString(const BitTorrent::TorrentState state) const;
|
||||
};
|
||||
|
||||
#endif // TRANSFERLISTDELEGATE_H
|
||||
|
||||
Reference in New Issue
Block a user