mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-10 15:32:48 -07:00
Fix coding style for various things
This commit is contained in:
parent
5efdd211cc
commit
d668a4fe6d
35 changed files with 120 additions and 121 deletions
|
@ -148,7 +148,7 @@ OptionsDialog::OptionsDialog(QWidget *parent)
|
|||
QList<QAbstractButton *> buttons = m_ui->buttonBox->buttons();
|
||||
foreach (QAbstractButton *button, buttons) {
|
||||
if (m_ui->buttonBox->buttonRole(button) == QDialogButtonBox::ApplyRole) {
|
||||
applyButton = button;
|
||||
m_applyButton = button;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -410,13 +410,13 @@ OptionsDialog::OptionsDialog(QWidget *parent)
|
|||
connect(m_ui->btnEditRules, &QPushButton::clicked, this, [this]() { AutomatedRssDownloader(this).exec(); });
|
||||
|
||||
// Disable apply Button
|
||||
applyButton->setEnabled(false);
|
||||
m_applyButton->setEnabled(false);
|
||||
// Tab selection mechanism
|
||||
connect(m_ui->tabSelection, &QListWidget::currentItemChanged, this, &ThisType::changePage);
|
||||
// Load Advanced settings
|
||||
advancedSettings = new AdvancedSettings(m_ui->tabAdvancedPage);
|
||||
m_ui->advPageLayout->addWidget(advancedSettings);
|
||||
connect(advancedSettings, &AdvancedSettings::settingsChanged, this, &ThisType::enableApplyButton);
|
||||
m_advancedSettings = new AdvancedSettings(m_ui->tabAdvancedPage);
|
||||
m_ui->advPageLayout->addWidget(m_advancedSettings);
|
||||
connect(m_advancedSettings, &AdvancedSettings::settingsChanged, this, &ThisType::enableApplyButton);
|
||||
|
||||
m_ui->textFileLogPath->setDialogCaption(tr("Choose a save directory"));
|
||||
m_ui->textFileLogPath->setMode(FileSystemPathEdit::Mode::DirectorySave);
|
||||
|
@ -479,7 +479,7 @@ OptionsDialog::~OptionsDialog()
|
|||
|
||||
saveWindowState();
|
||||
|
||||
foreach (const QString &path, addedScanDirs)
|
||||
foreach (const QString &path, m_addedScanDirs)
|
||||
ScanFoldersModel::instance()->removePath(path);
|
||||
ScanFoldersModel::instance()->configure(); // reloads "removed" paths
|
||||
delete m_ui;
|
||||
|
@ -527,7 +527,7 @@ void OptionsDialog::saveWindowState() const
|
|||
|
||||
void OptionsDialog::saveOptions()
|
||||
{
|
||||
applyButton->setEnabled(false);
|
||||
m_applyButton->setEnabled(false);
|
||||
Preferences *const pref = Preferences::instance();
|
||||
// Load the translation
|
||||
QString locale = getLocale();
|
||||
|
@ -611,11 +611,11 @@ void OptionsDialog::saveOptions()
|
|||
AddNewTorrentDialog::setTopLevel(m_ui->checkAdditionDialogFront->isChecked());
|
||||
session->setAddTorrentPaused(addTorrentsInPause());
|
||||
session->setCreateTorrentSubfolder(m_ui->checkCreateSubfolder->isChecked());
|
||||
ScanFoldersModel::instance()->removeFromFSWatcher(removedScanDirs);
|
||||
ScanFoldersModel::instance()->addToFSWatcher(addedScanDirs);
|
||||
ScanFoldersModel::instance()->removeFromFSWatcher(m_removedScanDirs);
|
||||
ScanFoldersModel::instance()->addToFSWatcher(m_addedScanDirs);
|
||||
ScanFoldersModel::instance()->makePersistent();
|
||||
removedScanDirs.clear();
|
||||
addedScanDirs.clear();
|
||||
m_removedScanDirs.clear();
|
||||
m_addedScanDirs.clear();
|
||||
session->setTorrentExportDirectory(getTorrentExportDir());
|
||||
session->setFinishedTorrentExportDirectory(getFinishedTorrentExportDir());
|
||||
pref->setMailNotificationEnabled(m_ui->groupMailNotification->isChecked());
|
||||
|
@ -734,7 +734,7 @@ void OptionsDialog::saveOptions()
|
|||
// End Web UI
|
||||
// End preferences
|
||||
// Save advanced settings
|
||||
advancedSettings->saveAdvancedSettings();
|
||||
m_advancedSettings->saveAdvancedSettings();
|
||||
// Assume that user changed multiple settings
|
||||
// so it's best to save immediately
|
||||
pref->apply();
|
||||
|
@ -1226,7 +1226,7 @@ int OptionsDialog::getMaxUploadsPerTorrent() const
|
|||
|
||||
void OptionsDialog::on_buttonBox_accepted()
|
||||
{
|
||||
if (applyButton->isEnabled()) {
|
||||
if (m_applyButton->isEnabled()) {
|
||||
if (!schedTimesOk()) {
|
||||
m_ui->tabSelection->setCurrentRow(TAB_SPEED);
|
||||
return;
|
||||
|
@ -1235,7 +1235,7 @@ void OptionsDialog::on_buttonBox_accepted()
|
|||
m_ui->tabSelection->setCurrentRow(TAB_WEBUI);
|
||||
return;
|
||||
}
|
||||
applyButton->setEnabled(false);
|
||||
m_applyButton->setEnabled(false);
|
||||
this->hide();
|
||||
saveOptions();
|
||||
}
|
||||
|
@ -1245,7 +1245,7 @@ void OptionsDialog::on_buttonBox_accepted()
|
|||
|
||||
void OptionsDialog::applySettings(QAbstractButton *button)
|
||||
{
|
||||
if (button == applyButton) {
|
||||
if (button == m_applyButton) {
|
||||
if (!schedTimesOk()) {
|
||||
m_ui->tabSelection->setCurrentRow(TAB_SPEED);
|
||||
return;
|
||||
|
@ -1277,7 +1277,7 @@ bool OptionsDialog::useAdditionDialog() const
|
|||
|
||||
void OptionsDialog::enableApplyButton()
|
||||
{
|
||||
applyButton->setEnabled(true);
|
||||
m_applyButton->setEnabled(true);
|
||||
}
|
||||
|
||||
void OptionsDialog::toggleComboRatioLimitAct()
|
||||
|
@ -1472,7 +1472,7 @@ void OptionsDialog::on_addScanFolderButton_clicked()
|
|||
break;
|
||||
default:
|
||||
pref->setScanDirsLastPath(dir);
|
||||
addedScanDirs << dir;
|
||||
m_addedScanDirs << dir;
|
||||
for (int i = 0; i < ScanFoldersModel::instance()->columnCount(); ++i)
|
||||
m_ui->scanFoldersView->resizeColumnToContents(i);
|
||||
enableApplyButton();
|
||||
|
@ -1492,7 +1492,7 @@ void OptionsDialog::on_removeScanFolderButton_clicked()
|
|||
Q_ASSERT(selected.count() == ScanFoldersModel::instance()->columnCount());
|
||||
foreach (const QModelIndex &index, selected) {
|
||||
if (index.column() == ScanFoldersModel::WATCH)
|
||||
removedScanDirs << index.data().toString();
|
||||
m_removedScanDirs << index.data().toString();
|
||||
}
|
||||
ScanFoldersModel::instance()->removePath(selected.first().row(), false);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue