Commit 42e9b063 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

USe auto foo directly

parent 8d33b7ef
Pipeline #171075 passed with stage
in 1 minute and 36 seconds
......@@ -30,7 +30,7 @@ void PimDataBackupThread::run()
{
QTemporaryFile tmp;
tmp.open();
KZip *archiveFile = new KZip(tmp.fileName());
auto archiveFile = new KZip(tmp.fileName());
archiveFile->setCompression(KZip::NoCompression);
bool result = archiveFile->open(QIODevice::WriteOnly);
if (!result) {
......
......@@ -30,7 +30,7 @@ PimDataExporterKernel::PimDataExporterKernel(QObject *parent)
: QObject(parent)
{
mIdentityManager = KIdentityManagement::IdentityManager::self();
Akonadi::Session *session = new Akonadi::Session("Backup Mail Kernel ETM", this);
auto session = new Akonadi::Session("Backup Mail Kernel ETM", this);
mFolderCollectionMonitor = new MailCommon::FolderCollectionMonitor(session, this);
mFolderCollectionMonitor->monitor()->setMimeTypeMonitored(KContacts::Addressee::mimeType(), true);
......
......@@ -28,13 +28,13 @@ BackupFileStructureInfoDialog::BackupFileStructureInfoDialog(QWidget *parent)
{
setWindowTitle(i18nc("@title:window", "Archive File Structure"));
auto mainLayout = new QVBoxLayout(this);
QLabel *lab = new QLabel(i18n("Backup Archive Structure:"));
auto lab = new QLabel(i18n("Backup Archive Structure:"));
mainLayout->addWidget(lab);
mEditor->editor()->setWebShortcutSupport(false);
mEditor->setReadOnly(true);
mainLayout->addWidget(mEditor);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close, this);
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Close, this);
connect(buttonBox, &QDialogButtonBox::accepted, this, &BackupFileStructureInfoDialog::accept);
connect(buttonBox, &QDialogButtonBox::rejected, this, &BackupFileStructureInfoDialog::reject);
buttonBox->button(QDialogButtonBox::Close)->setDefault(true);
......
......@@ -28,7 +28,7 @@ PimDataExporterConfigureDialog::PimDataExporterConfigureDialog(QWidget *parent)
setWindowTitle(i18nc("@title:window", "Configure PimDataExporter"));
// General page
QWidget *generalConfigureWiget = new QWidget(this);
auto generalConfigureWiget = new QWidget(this);
auto layout = new QVBoxLayout(generalConfigureWiget);
mConfigureWidget->setObjectName(QStringLiteral("configurewidget"));
......@@ -39,7 +39,7 @@ PimDataExporterConfigureDialog::PimDataExporterConfigureDialog(QWidget *parent)
addPage(generalPageWidgetPage);
#ifdef WITH_KUSERFEEDBACK
QWidget *userFeedBackWidget = new QWidget;
auto userFeedBackWidget = new QWidget;
userFeedBackWidget->setObjectName(QStringLiteral("userFeedBackWidget"));
mUserFeedbackWidget = new KUserFeedback::FeedbackConfigWidget(this);
......@@ -49,7 +49,7 @@ PimDataExporterConfigureDialog::PimDataExporterConfigureDialog(QWidget *parent)
userFeedBackLayout->addWidget(mUserFeedbackWidget);
mUserFeedbackWidget->setFeedbackProvider(UserFeedBackManager::self()->userFeedbackProvider());
KPageWidgetItem *userFeedBackPageWidgetPage = new KPageWidgetItem(userFeedBackWidget, i18n("User Feedback"));
auto userFeedBackPageWidgetPage = new KPageWidgetItem(userFeedBackWidget, i18n("User Feedback"));
userFeedBackPageWidgetPage->setIcon(QIcon::fromTheme(QStringLiteral("preferences-other")));
addPage(userFeedBackPageWidgetPage);
#endif
......
......@@ -25,10 +25,10 @@ SelectionTypeDialog::SelectionTypeDialog(bool backupData, QWidget *parent)
auto topLayout = new QVBoxLayout(this);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
buttonBox->setObjectName(QStringLiteral("buttonbox"));
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
auto okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
connect(buttonBox, &QDialogButtonBox::accepted, this, &SelectionTypeDialog::accept);
connect(buttonBox, &QDialogButtonBox::rejected, this, &SelectionTypeDialog::reject);
......@@ -47,7 +47,7 @@ SelectionTypeDialog::SelectionTypeDialog(bool backupData, QWidget *parent)
connect(selectAll, &QPushButton::clicked, this, &SelectionTypeDialog::slotSelectAll);
hbox->addWidget(selectAll);
QPushButton *unselectAll = new QPushButton(i18n("Unselect All"), this);
auto unselectAll = new QPushButton(i18n("Unselect All"), this);
unselectAll->setObjectName(QStringLiteral("unselectAll"));
connect(unselectAll, &QPushButton::clicked, this, &SelectionTypeDialog::slotUnselectAll);
hbox->addWidget(unselectAll);
......
......@@ -42,7 +42,7 @@ ShowArchiveStructureDialog::ShowArchiveStructureDialog(const QString &filename,
auto searchLine = new KTreeWidgetSearchLine(this, mTreeWidget);
searchLine->setPlaceholderText(i18n("Search..."));
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close, this);
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Close, this);
auto user1Button = new QPushButton(this);
user1Button->setText(i18n("Save As Text..."));
buttonBox->addButton(user1Button, QDialogButtonBox::ActionRole);
......@@ -104,7 +104,7 @@ void ShowArchiveStructureDialog::slotOpenFile()
qCWarning(PIMDATAEXPORTERGUI_LOG) << "Impossible to copy file: " << currentItem->text(0);
return;
}
KIO::OpenUrlJob *job = new KIO::OpenUrlJob(QUrl::fromLocalFile(fileName));
auto job = new KIO::OpenUrlJob(QUrl::fromLocalFile(fileName));
job->setUiDelegate(new KIO::JobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, this));
job->setRunExecutables(false);
job->start();
......
......@@ -23,11 +23,11 @@ SynchronizeResourceDialog::SynchronizeResourceDialog(QWidget *parent)
setWindowTitle(i18nc("@title:window", "Synchronize Resources"));
auto topLayout = new QVBoxLayout(this);
QLabel *lab = new QLabel(i18n("Some resources were added but data were not sync. Select resources that you want to sync:"), this);
auto lab = new QLabel(i18n("Some resources were added but data were not sync. Select resources that you want to sync:"), this);
lab->setWordWrap(true);
lab->setObjectName(QStringLiteral("label"));
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
buttonBox->setObjectName(QStringLiteral("buttonbox"));
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setDefault(true);
......@@ -37,12 +37,12 @@ SynchronizeResourceDialog::SynchronizeResourceDialog(QWidget *parent)
listWidgetSearchLine->setObjectName(QStringLiteral("listwidgetsearchline"));
auto hbox = new QHBoxLayout;
QPushButton *selectAll = new QPushButton(i18n("Select All"));
auto selectAll = new QPushButton(i18n("Select All"));
selectAll->setObjectName(QStringLiteral("selectall_button"));
connect(selectAll, &QPushButton::clicked, this, &SynchronizeResourceDialog::slotSelectAll);
hbox->addWidget(selectAll);
QPushButton *unselectAll = new QPushButton(i18n("Unselect All"));
auto unselectAll = new QPushButton(i18n("Unselect All"));
unselectAll->setObjectName(QStringLiteral("unselectall_button"));
connect(unselectAll, &QPushButton::clicked, this, &SynchronizeResourceDialog::slotUnselectAll);
hbox->addWidget(unselectAll);
......
......@@ -20,7 +20,7 @@ PimDataExporterConfigureWidget::PimDataExporterConfigureWidget(QWidget *parent)
auto layout = new QVBoxLayout(this);
layout->setContentsMargins(0, 0, 0, 0);
QGroupBox *groupBox = new QGroupBox(i18n("Import"));
auto groupBox = new QGroupBox(i18n("Import"));
groupBox->setObjectName(QStringLiteral("import_groupbox"));
layout->addWidget(groupBox);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment