Format code using clang-format

This commit is contained in:
Luis Ángel San Martín
2019-05-30 19:46:37 +02:00
parent e0eb94e3ae
commit e3ec56aa43
356 changed files with 19824 additions and 21874 deletions

View File

@ -11,23 +11,23 @@
FlowType flowType = Strip;
#endif
OptionsDialog::OptionsDialog(QWidget * parent)
:YACReaderOptionsDialog(parent)
OptionsDialog::OptionsDialog(QWidget *parent)
: YACReaderOptionsDialog(parent)
{
QTabWidget * tabWidget = new QTabWidget();
QTabWidget *tabWidget = new QTabWidget();
QVBoxLayout * layout = new QVBoxLayout(this);
QVBoxLayout *layout = new QVBoxLayout(this);
QVBoxLayout * flowLayout = new QVBoxLayout;
QVBoxLayout * gridViewLayout = new QVBoxLayout();
QVBoxLayout * generalLayout = new QVBoxLayout();
QVBoxLayout *flowLayout = new QVBoxLayout;
QVBoxLayout *gridViewLayout = new QVBoxLayout();
QVBoxLayout *generalLayout = new QVBoxLayout();
QHBoxLayout * switchFlowType = new QHBoxLayout();
QHBoxLayout *switchFlowType = new QHBoxLayout();
switchFlowType->addStretch();
#ifndef NO_OPENGL
switchFlowType->addWidget(useGL);
#endif
QHBoxLayout * buttons = new QHBoxLayout();
QHBoxLayout *buttons = new QHBoxLayout();
buttons->addStretch();
buttons->addWidget(accept);
buttons->addWidget(cancel);
@ -42,14 +42,14 @@ OptionsDialog::OptionsDialog(QWidget * parent)
sw->hide();
#endif
QVBoxLayout * apiKeyLayout = new QVBoxLayout();
QPushButton * apiKeyButton = new QPushButton(tr("Edit Comic Vine API key"));
QVBoxLayout *apiKeyLayout = new QVBoxLayout();
QPushButton *apiKeyButton = new QPushButton(tr("Edit Comic Vine API key"));
apiKeyLayout->addWidget(apiKeyButton);
QGroupBox * apiKeyBox = new QGroupBox(tr("Comic Vine API key"));
QGroupBox *apiKeyBox = new QGroupBox(tr("Comic Vine API key"));
apiKeyBox->setLayout(apiKeyLayout);
connect(apiKeyButton,SIGNAL(clicked()),this,SLOT(editApiKey()));
connect(apiKeyButton, SIGNAL(clicked()), this, SLOT(editApiKey()));
//grid view background config
useBackgroundImageCheck = new QCheckBox(tr("Enable background image"));
@ -57,27 +57,27 @@ OptionsDialog::OptionsDialog(QWidget * parent)
opacityLabel = new QLabel(tr("Opacity level"));
backgroundImageOpacitySlider = new QSlider(Qt::Horizontal);
backgroundImageOpacitySlider->setRange(5,100);
backgroundImageOpacitySlider->setRange(5, 100);
blurLabel = new QLabel(tr("Blur level"));
backgroundImageBlurRadiusSlider = new QSlider(Qt::Horizontal);
backgroundImageBlurRadiusSlider->setRange(0,100);
backgroundImageBlurRadiusSlider->setRange(0, 100);
useCurrentComicCoverCheck = new QCheckBox(tr("Use selected comic cover as background"));
resetButton = new QPushButton(tr("Restore defautls"));
QVBoxLayout * gridBackgroundLayout = new QVBoxLayout();
QVBoxLayout *gridBackgroundLayout = new QVBoxLayout();
gridBackgroundLayout->addWidget(useBackgroundImageCheck);
gridBackgroundLayout->addWidget(opacityLabel);
gridBackgroundLayout->addWidget(backgroundImageOpacitySlider);
gridBackgroundLayout->addWidget(blurLabel);
gridBackgroundLayout->addWidget(backgroundImageBlurRadiusSlider);
gridBackgroundLayout->addWidget(useCurrentComicCoverCheck);
gridBackgroundLayout->addWidget(resetButton,0,Qt::AlignRight);
gridBackgroundLayout->addWidget(resetButton, 0, Qt::AlignRight);
QGroupBox * gridBackgroundGroup = new QGroupBox(tr("Background"));
QGroupBox *gridBackgroundGroup = new QGroupBox(tr("Background"));
gridBackgroundGroup->setLayout(gridBackgroundLayout);
gridViewLayout->addWidget(gridBackgroundGroup);
@ -90,30 +90,30 @@ OptionsDialog::OptionsDialog(QWidget * parent)
connect(resetButton, &QPushButton::clicked, this, &OptionsDialog::resetToDefaults);
//end grid view background config
QWidget * comicFlowW = new QWidget;
QWidget *comicFlowW = new QWidget;
comicFlowW->setLayout(flowLayout);
QWidget * gridViewW = new QWidget;
QWidget *gridViewW = new QWidget;
gridViewW->setLayout(gridViewLayout);
QWidget * generalW = new QWidget;
QWidget *generalW = new QWidget;
generalW->setLayout(generalLayout);
generalLayout->addWidget(shortcutsBox);
generalLayout->addWidget(apiKeyBox);
generalLayout->addStretch();
tabWidget->addTab(comicFlowW,tr("Comic Flow"));
tabWidget->addTab(comicFlowW, tr("Comic Flow"));
#ifndef NO_OPENGL
tabWidget->addTab(gridViewW,tr("Grid view"));
tabWidget->addTab(gridViewW, tr("Grid view"));
#endif
tabWidget->addTab(generalW,tr("General"));
tabWidget->addTab(generalW, tr("General"));
layout->addWidget(tabWidget);
layout->addLayout(buttons);
setLayout(layout);
//restoreOptions(settings); //load options
//resize(200,0);
setModal (true);
setModal(true);
setWindowTitle(tr("Options"));
this->layout()->setSizeConstraint(QLayout::SetFixedSize);
@ -125,14 +125,14 @@ void OptionsDialog::editApiKey()
d.exec();
}
void OptionsDialog::restoreOptions(QSettings * settings)
void OptionsDialog::restoreOptions(QSettings *settings)
{
YACReaderOptionsDialog::restoreOptions(settings);
bool useBackgroundImage = settings->value(USE_BACKGROUND_IMAGE_IN_GRID_VIEW, true).toBool();
useBackgroundImageCheck->setChecked(useBackgroundImage);
backgroundImageOpacitySlider->setValue(settings->value(OPACITY_BACKGROUND_IMAGE_IN_GRID_VIEW, 0.2).toFloat()*100);
backgroundImageOpacitySlider->setValue(settings->value(OPACITY_BACKGROUND_IMAGE_IN_GRID_VIEW, 0.2).toFloat() * 100);
backgroundImageBlurRadiusSlider->setValue(settings->value(BLUR_RADIUS_BACKGROUND_IMAGE_IN_GRID_VIEW, 75).toInt());
useCurrentComicCoverCheck->setChecked(settings->value(USE_SELECTED_COMIC_COVER_AS_BACKGROUND_IMAGE_IN_GRID_VIEW, false).toBool());
@ -158,7 +158,7 @@ void OptionsDialog::useBackgroundImageCheckClicked(bool checked)
void OptionsDialog::backgroundImageOpacitySliderChanged(int value)
{
settings->setValue(OPACITY_BACKGROUND_IMAGE_IN_GRID_VIEW, value/100.0);
settings->setValue(OPACITY_BACKGROUND_IMAGE_IN_GRID_VIEW, value / 100.0);
emit optionsChanged();
}