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

@ -8,104 +8,98 @@
#include "data_base_management.h"
ImportComicsInfoDialog::ImportComicsInfoDialog(QWidget *parent)
: QDialog(parent)
: QDialog(parent)
{
setModal(true);
setWindowTitle(tr("Import comics info"));
setModal(true);
setWindowTitle(tr("Import comics info"));
textLabel = new QLabel(tr("Info database location : "));
path = new QLineEdit;
textLabel->setBuddy(path);
textLabel = new QLabel(tr("Info database location : "));
path = new QLineEdit;
textLabel->setBuddy(path);
accept = new QPushButton(tr("Import"));
accept->setDisabled(true);
connect(accept, SIGNAL(clicked()), this, SLOT(import()));
accept = new QPushButton(tr("Import"));
accept->setDisabled(true);
connect(accept,SIGNAL(clicked()),this,SLOT(import()));
cancel = new QPushButton(tr("Cancel"));
connect(cancel, SIGNAL(clicked()), this, SLOT(close()));
//connect(cancel,SIGNAL(clicked()),this,SIGNAL(rejected()));
cancel = new QPushButton(tr("Cancel"));
connect(cancel,SIGNAL(clicked()),this,SLOT(close()));
//connect(cancel,SIGNAL(clicked()),this,SIGNAL(rejected()));
find = new QPushButton(QIcon(":/images/find_folder.png"), "");
connect(find, SIGNAL(clicked()), this, SLOT(findPath()));
find = new QPushButton(QIcon(":/images/find_folder.png"),"");
connect(find,SIGNAL(clicked()),this,SLOT(findPath()));
QHBoxLayout *libraryLayout = new QHBoxLayout;
QHBoxLayout *libraryLayout = new QHBoxLayout;
libraryLayout->addWidget(textLabel);
libraryLayout->addWidget(path);
libraryLayout->addWidget(find);
libraryLayout->setStretchFactor(find, 0); //TODO
libraryLayout->addWidget(textLabel);
libraryLayout->addWidget(path);
libraryLayout->addWidget(find);
libraryLayout->setStretchFactor(find,0); //TODO
progressBar = new QProgressBar(this);
progressBar->setMinimum(0);
progressBar->setMaximum(0);
progressBar->setTextVisible(false);
progressBar->hide();
connect(accept, SIGNAL(clicked()), progressBar, SLOT(show()));
progressBar = new QProgressBar(this);
progressBar->setMinimum(0);
progressBar->setMaximum(0);
progressBar->setTextVisible(false);
progressBar->hide();
connect(accept,SIGNAL(clicked()),progressBar,SLOT(show()));
QHBoxLayout *bottomLayout = new QHBoxLayout;
bottomLayout->addStretch();
bottomLayout->addWidget(accept);
bottomLayout->addWidget(cancel);
QHBoxLayout *bottomLayout = new QHBoxLayout;
bottomLayout->addStretch();
bottomLayout->addWidget(accept);
bottomLayout->addWidget(cancel);
QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout->addLayout(libraryLayout);
mainLayout->addStretch();
mainLayout->addWidget(progressBar);
mainLayout->addLayout(bottomLayout);
QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout->addLayout(libraryLayout);
mainLayout->addStretch();
mainLayout->addWidget(progressBar);
mainLayout->addLayout(bottomLayout);
QHBoxLayout *imgMainLayout = new QHBoxLayout;
QLabel *imgLabel = new QLabel(this);
QPixmap p(":/images/importComicsInfo.png");
imgLabel->setPixmap(p);
imgMainLayout->addWidget(imgLabel);
imgMainLayout->addLayout(mainLayout);
QHBoxLayout * imgMainLayout = new QHBoxLayout;
QLabel * imgLabel = new QLabel(this);
QPixmap p(":/images/importComicsInfo.png");
imgLabel->setPixmap(p);
imgMainLayout->addWidget(imgLabel);
imgMainLayout->addLayout(mainLayout);
setLayout(imgMainLayout);
setLayout(imgMainLayout);
setModal(true);
setModal(true);
}
ImportComicsInfoDialog::~ImportComicsInfoDialog()
{
}
void ImportComicsInfoDialog::findPath()
{
QString s = QFileDialog::getOpenFileName(0,"Comics Info",".",tr("Comics info file (*.ydb)"));
if(!s.isEmpty())
{
path->setText(s);
accept->setEnabled(true);
}
QString s = QFileDialog::getOpenFileName(0, "Comics Info", ".", tr("Comics info file (*.ydb)"));
if (!s.isEmpty()) {
path->setText(s);
accept->setEnabled(true);
}
}
void ImportComicsInfoDialog::import()
{
progressBar->show();
progressBar->show();
Importer * importer = new Importer();
importer->source = path->text();
importer->dest = dest;
connect(importer,SIGNAL(finished()),this,SLOT(close()));
connect(importer,SIGNAL(finished()),this,SLOT(hide()));
importer->start();
Importer *importer = new Importer();
importer->source = path->text();
importer->dest = dest;
connect(importer, SIGNAL(finished()), this, SLOT(close()));
connect(importer, SIGNAL(finished()), this, SLOT(hide()));
importer->start();
}
void ImportComicsInfoDialog::close()
{
path->clear();
progressBar->hide();
accept->setDisabled(true);
QDialog::close();
emit(finished(0));
path->clear();
progressBar->hide();
accept->setDisabled(true);
QDialog::close();
emit(finished(0));
}
void Importer::run()
{
DataBaseManagement::importComicsInfo(source,dest);
DataBaseManagement::importComicsInfo(source, dest);
}