mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-02 21:52:32 -06:00
Use 'auto' to avoid duplicating the type name
This commit is contained in:
@@ -198,7 +198,7 @@ void PropertiesWidget::showPiecesDownloaded(bool show)
|
||||
void PropertiesWidget::setVisibility(bool visible)
|
||||
{
|
||||
if (!visible && (m_state == VISIBLE)) {
|
||||
QSplitter *hSplitter = static_cast<QSplitter *>(parentWidget());
|
||||
auto *hSplitter = static_cast<QSplitter *>(parentWidget());
|
||||
m_ui->stackedProperties->setVisible(false);
|
||||
m_slideSizes = hSplitter->sizes();
|
||||
hSplitter->handle(1)->setVisible(false);
|
||||
@@ -211,7 +211,7 @@ void PropertiesWidget::setVisibility(bool visible)
|
||||
|
||||
if (visible && (m_state == REDUCED)) {
|
||||
m_ui->stackedProperties->setVisible(true);
|
||||
QSplitter *hSplitter = static_cast<QSplitter *>(parentWidget());
|
||||
auto *hSplitter = static_cast<QSplitter *>(parentWidget());
|
||||
hSplitter->handle(1)->setDisabled(false);
|
||||
hSplitter->handle(1)->setVisible(true);
|
||||
hSplitter->setSizes(m_slideSizes);
|
||||
@@ -344,7 +344,7 @@ void PropertiesWidget::readSettings()
|
||||
if (sizesStr.size() == 2) {
|
||||
m_slideSizes << sizesStr.first().toInt();
|
||||
m_slideSizes << sizesStr.last().toInt();
|
||||
QSplitter *hSplitter = static_cast<QSplitter *>(parentWidget());
|
||||
auto *hSplitter = static_cast<QSplitter *>(parentWidget());
|
||||
hSplitter->setSizes(m_slideSizes);
|
||||
}
|
||||
const int currentTab = pref->getPropCurTab();
|
||||
@@ -360,7 +360,7 @@ void PropertiesWidget::saveSettings()
|
||||
Preferences *const pref = Preferences::instance();
|
||||
pref->setPropVisible(m_state == VISIBLE);
|
||||
// Splitter sizes
|
||||
QSplitter *hSplitter = static_cast<QSplitter *>(parentWidget());
|
||||
auto *hSplitter = static_cast<QSplitter *>(parentWidget());
|
||||
QList<int> sizes;
|
||||
if (m_state == VISIBLE)
|
||||
sizes = hSplitter->sizes();
|
||||
|
||||
@@ -153,7 +153,7 @@ void PropListDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti
|
||||
|
||||
void PropListDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const
|
||||
{
|
||||
QComboBox *combobox = static_cast<QComboBox *>(editor);
|
||||
auto *combobox = static_cast<QComboBox *>(editor);
|
||||
// Set combobox index
|
||||
switch (static_cast<BitTorrent::FilePriority>(index.data().toInt())) {
|
||||
case BitTorrent::FilePriority::Ignored:
|
||||
@@ -184,7 +184,7 @@ QWidget *PropListDelegate::createEditor(QWidget *parent, const QStyleOptionViewI
|
||||
if (index.data().toInt() == static_cast<int>(BitTorrent::FilePriority::Mixed))
|
||||
return nullptr;
|
||||
|
||||
QComboBox *editor = new QComboBox(parent);
|
||||
auto *editor = new QComboBox(parent);
|
||||
editor->setFocusPolicy(Qt::StrongFocus);
|
||||
editor->addItem(tr("Do not download", "Do not download (priority)"));
|
||||
editor->addItem(tr("Normal", "Normal (priority)"));
|
||||
@@ -195,7 +195,7 @@ QWidget *PropListDelegate::createEditor(QWidget *parent, const QStyleOptionViewI
|
||||
|
||||
void PropListDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
|
||||
{
|
||||
QComboBox *combobox = static_cast<QComboBox *>(editor);
|
||||
auto *combobox = static_cast<QComboBox *>(editor);
|
||||
int value = combobox->currentIndex();
|
||||
qDebug("PropListDelegate: setModelData(%d)", value);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user