Commit 04541fd2 authored by Laurent Montel's avatar Laurent Montel 😁

Modernize code

parent ce04b61b
Pipeline #48553 failed with stage
in 12 minutes and 49 seconds
......@@ -112,10 +112,10 @@ AutoCorrectionWidget::AutoCorrectionWidget(QWidget *parent)
slotEnableDisableAbreviationList();
slotEnableDisableTwoUpperEntry();
auto *menu = new QMenu(this);
auto menu = new QMenu(this);
d->ui->importAutoCorrection->setMenu(menu);
QAction *act = new QAction(i18n("LibreOffice Autocorrection"), this);
auto act = new QAction(i18n("LibreOffice Autocorrection"), this);
act->setData(QVariant::fromValue(AutoCorrectionWidget::LibreOffice));
menu->addAction(act);
......
......@@ -415,7 +415,7 @@ void AutoCorrectionTest::shouldNotUpperCaseFirstCharOfSentence()
QCOMPARE(doc.toPlainText(), result);
}
typedef QHash<QString, QString> mapAutoCorrect;
using mapAutoCorrect = QHash<QString, QString>;
Q_DECLARE_METATYPE(mapAutoCorrect)
void AutoCorrectionTest::shouldAutocorrectMultiWord_data()
......
......@@ -91,7 +91,7 @@ bool ImportLibreOfficeAutocorrection::importFile(Type type, const KArchiveDirect
}
documentList = archiveDirectory->entry(archiveFileName);
if (documentList && documentList->isFile()) {
const auto *archiveFile = static_cast<const KArchiveFile *>(documentList);
const auto archiveFile = static_cast<const KArchiveFile *>(documentList);
archiveFile->copyTo(mTempDir->path());
QFile file(mTempDir->path() + QLatin1Char('/') + archiveFileName);
QDomDocument doc;
......
......@@ -26,7 +26,7 @@ ConfigureTestDialog::ConfigureTestDialog(PimCommon::AutoCorrection *autoCorrecti
: QDialog(parent)
{
setWindowTitle(QStringLiteral("Configure Autocorrection"));
auto *mainLayout = new QVBoxLayout(this);
auto mainLayout = new QVBoxLayout(this);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setDefault(true);
......@@ -92,11 +92,11 @@ AutocorrectionTestWidget::AutocorrectionTestWidget(QWidget *parent)
PimCommon::PimCommonSettings::self()->load();
mAutoCorrection = new PimCommon::AutoCorrection;
auto *lay = new QVBoxLayout(this);
auto *bar = new QToolBar;
auto lay = new QVBoxLayout(this);
auto bar = new QToolBar;
lay->addWidget(bar);
bar->addAction(QStringLiteral("Configure..."), this, &AutocorrectionTestWidget::slotConfigure);
QAction *richText = new QAction(QStringLiteral("HTML mode"), this);
auto richText = new QAction(QStringLiteral("HTML mode"), this);
richText->setCheckable(true);
connect(richText, &QAction::toggled, this, &AutocorrectionTestWidget::slotChangeMode);
bar->addAction(richText);
......@@ -138,7 +138,7 @@ int main(int argc, char **argv)
parser.addHelpOption();
parser.process(app);
auto *w = new AutocorrectionTestWidget();
auto w = new AutocorrectionTestWidget();
w->resize(800, 600);
w->show();
......
......@@ -21,7 +21,7 @@ int main(int argc, char **argv)
parser.addHelpOption();
parser.process(app);
auto *w = new PimCommon::RichTextEditWithAutoCorrection;
auto w = new PimCommon::RichTextEditWithAutoCorrection;
w->show();
app.exec();
......
......@@ -26,7 +26,7 @@ ConfigurePluginDialog::~ConfigurePluginDialog()
void ConfigurePluginDialog::initLayout(bool addSpacer)
{
auto *layout = new QVBoxLayout(this);
auto layout = new QVBoxLayout(this);
layout->addWidget(createLayout());
if (addSpacer) {
layout->addStretch(1);
......
......@@ -20,7 +20,7 @@ using namespace PimCommon;
ConfigurePluginsListWidget::ConfigurePluginsListWidget(QWidget *parent)
: QWidget(parent)
{
auto *mainLayout = new QVBoxLayout(this);
auto mainLayout = new QVBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainlayout"));
mainLayout->setContentsMargins(0, 0, 0, 0);
......@@ -111,11 +111,11 @@ void ConfigurePluginsListWidget::fillTopItems(const QVector<PimCommon::PluginUti
{
itemsList.clear();
if (!lst.isEmpty()) {
QTreeWidgetItem *topLevel = new QTreeWidgetItem(mListWidget, {topLevelItemName});
auto topLevel = new QTreeWidgetItem(mListWidget, {topLevelItemName});
topLevel->setFlags(topLevel->flags() & ~Qt::ItemIsSelectable);
const QPair<QStringList, QStringList> pair = PimCommon::PluginUtil::loadPluginSetting(groupName, prefixKey);
for (const PimCommon::PluginUtilData &data : lst) {
auto *subItem = new PluginItem(topLevel);
auto subItem = new PluginItem(topLevel);
subItem->setText(0, data.mName);
subItem->mIdentifier = data.mIdentifier;
subItem->mDescription = data.mDescription;
......@@ -127,8 +127,8 @@ void ConfigurePluginsListWidget::fillTopItems(const QVector<PimCommon::PluginUti
subItem->setCheckState(0, isPluginActivated ? Qt::Checked : Qt::Unchecked);
}
if (data.mHasConfigureDialog) {
auto *but = new QToolButton(mListWidget);
auto *act = new QAction(but);
auto but = new QToolButton(mListWidget);
auto act = new QAction(but);
const QStringList actData {
configureGroupName, data.mIdentifier
};
......
......@@ -37,7 +37,7 @@ ConfigurePluginsWidget::~ConfigurePluginsWidget()
void ConfigurePluginsWidget::initLayout(ConfigurePluginsListWidget *configurePluginListWidget)
{
auto *layout = new QVBoxLayout(this);
auto layout = new QVBoxLayout(this);
layout->setContentsMargins(0, 0, 0, 0);
mMessageWidget = new KMessageWidget(i18n("Restart is necessary for applying the changes."), this);
......
......@@ -31,7 +31,7 @@ CustomToolsWidgetNg::CustomToolsWidgetNg(QWidget *parent)
: QWidget(parent)
, d(new PimCommon::CustomToolsWidgetNgPrivate)
{
auto *lay = new QHBoxLayout(this);
auto lay = new QHBoxLayout(this);
d->mStackedWidget = new QStackedWidget;
d->mStackedWidget->setObjectName(QStringLiteral("stackedwidget"));
lay->addWidget(d->mStackedWidget);
......
......@@ -27,7 +27,7 @@ void ActionTypeTest::shouldHaveDefaultValue()
void ActionTypeTest::shouldAssignValue()
{
auto *act = new QAction(nullptr);
auto act = new QAction(nullptr);
PimCommon::ActionType::Type type = PimCommon::ActionType::File;
PimCommon::ActionType actionType(act, type);
QCOMPARE(actionType.action(), act);
......
......@@ -23,7 +23,7 @@ LogActivitiesDialog::LogActivitiesDialog(QWidget *parent)
: QDialog(parent)
{
setWindowTitle(i18nc("@title:window", "Log activities"));
auto *mainLayout = new QVBoxLayout(this);
auto mainLayout = new QVBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainLayout"));
mLogWidget = new LogActivitiesWidget(this);
......@@ -35,7 +35,7 @@ LogActivitiesDialog::LogActivitiesDialog(QWidget *parent)
mainLayout->addWidget(mEnableLogActivities);
connect(mEnableLogActivities, &QCheckBox::toggled, this, &LogActivitiesDialog::slotEnableLogActivities);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close | QDialogButtonBox::Save, this);
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Close | QDialogButtonBox::Save, this);
buttonBox->setObjectName(QStringLiteral("buttonbox"));
mClearButton = new QPushButton(i18n("Clear"), this);
......@@ -46,7 +46,7 @@ LogActivitiesDialog::LogActivitiesDialog(QWidget *parent)
mSaveButton->setObjectName(QStringLiteral("savebutton"));
mSaveButton->setEnabled(false);
auto *purposeMenu = new LogactivitiesPurposeMenuWidget(this, this);
auto purposeMenu = new LogactivitiesPurposeMenuWidget(this, this);
mShareButton = new QPushButton(i18n("Share..."), this);
mShareButton->setMenu(purposeMenu->menu());
mShareButton->setIcon(QIcon::fromTheme(QStringLiteral("document-share")));
......
......@@ -13,7 +13,7 @@ using namespace PimCommon;
LogActivitiesWidget::LogActivitiesWidget(QWidget *parent)
: QWidget(parent)
{
auto *mainLayout = new QVBoxLayout(this);
auto mainLayout = new QVBoxLayout(this);
mainLayout->setContentsMargins(0, 0, 0, 0);
mainLayout->setObjectName(QStringLiteral("mainLayout"));
......
......@@ -14,20 +14,20 @@
LogActivitiesMainWidget::LogActivitiesMainWidget(QWidget *parent)
: QWidget(parent)
{
auto *mainLayout = new QHBoxLayout(this);
QPushButton *button = new QPushButton(QStringLiteral("Open Log"), this);
auto mainLayout = new QHBoxLayout(this);
auto button = new QPushButton(QStringLiteral("Open Log"), this);
connect(button, &QPushButton::clicked, this, &LogActivitiesMainWidget::slotOpenDialog);
mainLayout->addWidget(button);
QPushButton *addLog = new QPushButton(QStringLiteral("Append Log"), this);
auto addLog = new QPushButton(QStringLiteral("Append Log"), this);
connect(addLog, &QPushButton::clicked, this, &LogActivitiesMainWidget::slotAddLog);
mainLayout->addWidget(addLog);
QPushButton *clearLogButton = new QPushButton(QStringLiteral("Clear log"), this);
auto clearLogButton = new QPushButton(QStringLiteral("Clear log"), this);
connect(clearLogButton, &QPushButton::clicked, this, &LogActivitiesMainWidget::slotClearLog);
mainLayout->addWidget(clearLogButton);
QCheckBox *enableLog = new QCheckBox(QStringLiteral("Enable Log Activities"), this);
auto enableLog = new QCheckBox(QStringLiteral("Enable Log Activities"), this);
connect(enableLog, &QPushButton::toggled, this, &LogActivitiesMainWidget::slotEnableLogActivities);
enableLog->setChecked(true);
mainLayout->addWidget(enableLog);
......
......@@ -19,7 +19,7 @@ int main(int argc, char **argv)
parser.process(app);
auto *w = new LogActivitiesMainWidget;
auto w = new LogActivitiesMainWidget;
w->show();
app.exec();
return 0;
......
......@@ -35,7 +35,7 @@ void ShareServiceUrlManagerPrivate::initializeMenu()
mMenu = new KActionMenu(QIcon::fromTheme(QStringLiteral("document-share")), i18n("Share On..."), q);
for (int i = 0; i < ShareServiceUrlManager::ServiceEndType; ++i) {
const auto type = static_cast<ShareServiceUrlManager::ServiceType>(i);
QAction *action = new QAction(i18nc("@action:inmenu Share On...", "%1", typeToI18n(type)), q);
auto action = new QAction(i18nc("@action:inmenu Share On...", "%1", typeToI18n(type)), q);
action->setData(QVariant::fromValue(type));
const QIcon icon = typeToIcon(type);
if (!icon.isNull()) {
......
......@@ -26,7 +26,7 @@ TemplateEditDialog::TemplateEditDialog(QWidget *parent, bool defaultTemplate)
: QDialog(parent)
{
setWindowTitle(defaultTemplate ? i18n("Default template") : i18n("Template"));
auto *mainLayout = new QVBoxLayout(this);
auto mainLayout = new QVBoxLayout(this);
QDialogButtonBox *buttonBox = nullptr;
if (defaultTemplate) {
buttonBox = new QDialogButtonBox(QDialogButtonBox::Close, this);
......@@ -40,15 +40,15 @@ TemplateEditDialog::TemplateEditDialog(QWidget *parent, bool defaultTemplate)
connect(buttonBox, &QDialogButtonBox::rejected, this, &TemplateEditDialog::reject);
mOkButton->setFocus();
}
QWidget *w = new QWidget;
auto w = new QWidget;
mainLayout->addWidget(w);
mainLayout->addWidget(buttonBox);
auto *vbox = new QVBoxLayout;
auto vbox = new QVBoxLayout;
vbox->setContentsMargins(0, 0, 0, 0);
auto *hbox = new QHBoxLayout;
QLabel *label = new QLabel(i18n("Name:"));
auto hbox = new QHBoxLayout;
auto label = new QLabel(i18n("Name:"));
hbox->addWidget(label);
mTemplateNameEdit = new QLineEdit;
......
......@@ -39,7 +39,7 @@ public:
void createListWidgetItem(const QString &name, const QString &text, bool isDefaultTemplate)
{
auto *item = new QListWidgetItem(name, q);
auto item = new QListWidgetItem(name, q);
item->setData(TemplateListWidget::Text, text);
item->setData(TemplateListWidget::DefaultTemplate, isDefaultTemplate);
if (isDefaultTemplate) {
......@@ -154,7 +154,7 @@ public:
{
const QList<QListWidgetItem *> lstSelectedItems = q->selectedItems();
const bool listSelectedIsEmpty = lstSelectedItems.isEmpty();
auto *menu = new QMenu(q);
auto menu = new QMenu(q);
if (!listSelectedIsEmpty) {
menu->addAction(i18n("Insert template"), q, [this]() {
......@@ -328,7 +328,7 @@ QMimeData *TemplateListWidget::mimeData(const QList<QListWidgetItem *> items) co
if (items.isEmpty()) {
return nullptr;
}
auto *mimeData = new QMimeData();
auto mimeData = new QMimeData();
QListWidgetItem *item = items.first();
mimeData->setText(item->data(TemplateListWidget::Text).toString());
return mimeData;
......
......@@ -19,7 +19,7 @@ int main(int argc, char **argv)
parser.addHelpOption();
parser.process(app);
auto *w = new PimCommon::TranslatorWidget();
auto w = new PimCommon::TranslatorWidget();
w->show();
app.exec();
delete w;
......
......@@ -19,9 +19,9 @@ TranslatorDebugDialog::TranslatorDebugDialog(QWidget *parent)
: QDialog(parent)
{
setWindowTitle(i18nc("@title:window", "Translator Debug"));
auto *mainLayout = new QVBoxLayout(this);
auto mainLayout = new QVBoxLayout(this);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close, this);
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Close, this);
mUser1Button = new QPushButton(this);
buttonBox->addButton(mUser1Button, QDialogButtonBox::ActionRole);
connect(buttonBox, &QDialogButtonBox::accepted, this, &TranslatorDebugDialog::accept);
......
......@@ -201,10 +201,10 @@ void TranslatorWidget::init()
connect(d->abstractTranslator, &PimCommon::GoogleTranslator::translateDone, this, &TranslatorWidget::slotTranslateDone);
connect(d->abstractTranslator, &PimCommon::GoogleTranslator::translateFailed, this, &TranslatorWidget::slotTranslateFailed);
auto *layout = new QVBoxLayout(this);
auto layout = new QVBoxLayout(this);
layout->setContentsMargins(0, 0, 0, 0);
auto *hboxLayout = new QHBoxLayout;
auto *closeBtn = new QToolButton(this);
auto hboxLayout = new QHBoxLayout;
auto closeBtn = new QToolButton(this);
closeBtn->setObjectName(QStringLiteral("close-button"));
closeBtn->setIcon(QIcon::fromTheme(QStringLiteral("dialog-close")));
closeBtn->setIconSize(QSize(16, 16));
......@@ -217,7 +217,7 @@ void TranslatorWidget::init()
hboxLayout->addWidget(closeBtn);
connect(closeBtn, &QToolButton::clicked, this, &TranslatorWidget::slotCloseWidget);
QLabel *label = new QLabel(i18nc("Translate from language", "From:"));
auto label = new QLabel(i18nc("Translate from language", "From:"));
hboxLayout->addWidget(label);
d->from = new QComboBox;
d->from->setMinimumWidth(50);
......@@ -232,7 +232,7 @@ void TranslatorWidget::init()
hboxLayout->addWidget(d->to);
KSeparator *separator = new KSeparator;
auto separator = new KSeparator;
separator->setOrientation(Qt::Vertical);
hboxLayout->addWidget(separator);
......@@ -260,7 +260,7 @@ void TranslatorWidget::init()
connect(d->translate, &QPushButton::clicked, this, &TranslatorWidget::slotTranslate);
if (!qEnvironmentVariableIsEmpty("KDEPIM_DEBUGGING")) {
QPushButton *debugButton = new QPushButton(i18n("Debug"));
auto debugButton = new QPushButton(i18n("Debug"));
hboxLayout->addWidget(debugButton);
connect(debugButton, &QPushButton::clicked, this, &TranslatorWidget::slotDebug);
}
......@@ -275,7 +275,7 @@ void TranslatorWidget::init()
d->splitter = new QSplitter;
d->splitter->setChildrenCollapsible(false);
d->inputText = new TranslatorTextEdit(this);
auto *editorWidget = new KPIMTextEdit::PlainTextEditorWidget(d->inputText);
auto editorWidget = new KPIMTextEdit::PlainTextEditorWidget(d->inputText);
d->inputText->setObjectName(QStringLiteral("inputtext"));
d->inputText->setPlaceholderText(i18n("Drag text that you want to translate. (Be careful text will be send to Google Server)."));
connect(d->inputText, &TranslatorTextEdit::textChanged, this, &TranslatorWidget::slotTextChanged);
......@@ -432,7 +432,7 @@ bool TranslatorWidget::event(QEvent *e)
// window-global actions (e.g. Emil Sedgh binds Esc to "close tab").
// With a shortcut override we can catch this before it gets to kactions.
if (e->type() == QEvent::ShortcutOverride || e->type() == QEvent::KeyPress) {
auto *kev = static_cast<QKeyEvent * >(e);
auto kev = static_cast<QKeyEvent * >(e);
if (kev->key() == Qt::Key_Escape) {
e->accept();
slotCloseWidget();
......
......@@ -45,7 +45,7 @@ void ConfigureImmutableWidgetUtils::populateButtonGroup(QGroupBox *box, QButtonG
}
const int numberChoices(e->choices().size());
for (int i = 0; i < numberChoices; ++i) {
QRadioButton *button = new QRadioButton(e->choices().at(i).label, box);
auto button = new QRadioButton(e->choices().at(i).label, box);
group->addButton(button, i);
box->layout()->addWidget(button);
}
......
......@@ -26,7 +26,7 @@ QTextDocument *LogItemDelegate::document(const QStyleOptionViewItem &option, con
if (!index.isValid()) {
return nullptr;
}
auto *document = new QTextDocument(nullptr);
auto document = new QTextDocument(nullptr);
document->setDocumentMargin(1);
const QColor textColor = index.data(Qt::ForegroundRole).value<QColor>();
QStyleOptionViewItem option4 = option;
......@@ -97,7 +97,7 @@ QWidget *LogItemDelegate::createEditor(QWidget *, const QStyleOptionViewItem &,
CustomLogWidget::CustomLogWidget(QWidget *parent)
: QListWidget(parent)
{
auto *itemDelegate = new LogItemDelegate(this);
auto itemDelegate = new LogItemDelegate(this);
setItemDelegate(itemDelegate);
}
......@@ -107,7 +107,7 @@ CustomLogWidget::~CustomLogWidget()
void CustomLogWidget::addTitleLogEntry(const QString &log)
{
auto *item = new QListWidgetItem(log);
auto item = new QListWidgetItem(log);
item->setForeground(Qt::black);
QFont font = item->font();
font.setBold(true);
......@@ -119,7 +119,7 @@ void CustomLogWidget::addTitleLogEntry(const QString &log)
void CustomLogWidget::addInfoLogEntry(const QString &log)
{
auto *item = new QListWidgetItem(log);
auto item = new QListWidgetItem(log);
item->setForeground(Qt::blue);
item->setData(ItemLogType, Info);
addItem(item);
......@@ -128,7 +128,7 @@ void CustomLogWidget::addInfoLogEntry(const QString &log)
void CustomLogWidget::addErrorLogEntry(const QString &log)
{
auto *item = new QListWidgetItem(log);
auto item = new QListWidgetItem(log);
item->setForeground(Qt::red);
item->setData(ItemLogType, Error);
addItem(item);
......@@ -137,7 +137,7 @@ void CustomLogWidget::addErrorLogEntry(const QString &log)
void CustomLogWidget::addEndLineLogEntry()
{
auto *item = new QListWidgetItem;
auto item = new QListWidgetItem;
item->setData(ItemLogType, EndLine);
addItem(item);
scrollToItem(item);
......
......@@ -16,7 +16,7 @@ using namespace PimCommon;
LineEditWithCompleterNg::LineEditWithCompleterNg(QWidget *parent)
: QLineEdit(parent)
{
auto *completer = new QCompleter(this);
auto completer = new QCompleter(this);
mCompleterListModel = new QStringListModel(this);
completer->setModel(mCompleterListModel);
setCompleter(completer);
......
......@@ -97,12 +97,12 @@ RenameFileDialog::RenameFileDialog(const QUrl &url, bool multiFiles, QWidget *pa
, d(new RenameFileDialogPrivate(url, this))
{
setWindowTitle(i18nc("@title:window", "File Already Exists"));
auto *pLayout = new QVBoxLayout(this);
auto pLayout = new QVBoxLayout(this);
QLabel *label = new QLabel(xi18n("A file named <filename>%1</filename> already exists. Do you want to overwrite it?", url.fileName()), this);
auto label = new QLabel(xi18n("A file named <filename>%1</filename> already exists. Do you want to overwrite it?", url.fileName()), this);
pLayout->addWidget(label);
auto *renameLayout = new QHBoxLayout();
auto renameLayout = new QHBoxLayout();
pLayout->addLayout(renameLayout);
d->nameEdit = new QLineEdit(this);
......@@ -113,20 +113,20 @@ RenameFileDialog::RenameFileDialog(const QUrl &url, bool multiFiles, QWidget *pa
renameLayout->addWidget(d->suggestNewNameBtn);
connect(d->suggestNewNameBtn, &QPushButton::clicked, this, &RenameFileDialog::slotSuggestNewNamePressed);
auto *overWrite = new QPushButton(this);
auto overWrite = new QPushButton(this);
KStandardGuiItem::assign(overWrite, KStandardGuiItem::Overwrite);
connect(overWrite, &QPushButton::clicked, this, &RenameFileDialog::slotOverwritePressed);
QPushButton *ignore = new QPushButton(i18n("&Ignore"), this);
auto ignore = new QPushButton(i18n("&Ignore"), this);
connect(ignore, &QPushButton::clicked, this, &RenameFileDialog::slotIgnorePressed);
d->renameBtn = new QPushButton(i18n("&Rename"), this);
connect(d->renameBtn, &QPushButton::clicked, this, &RenameFileDialog::slotRenamePressed);
KSeparator *separator = new KSeparator(this);
auto separator = new KSeparator(this);
pLayout->addWidget(separator);
auto *layout = new QHBoxLayout();
auto layout = new QHBoxLayout();
pLayout->addLayout(layout);
if (multiFiles) {
......
......@@ -64,7 +64,7 @@ SimpleStringListEditor::SimpleStringListEditor(QWidget *parent, ButtonCode butto
{
setAddDialogLabel(addDialogLabel);
setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
auto *hlay = new QHBoxLayout(this);
auto hlay = new QHBoxLayout(this);
hlay->setContentsMargins(0, 0, 0, 0);
d->mListBox = new QListWidget(this);
......
......@@ -20,9 +20,9 @@
CustomToolWidgetNgTest::CustomToolWidgetNgTest(QWidget *parent)
: QWidget(parent)
{
auto *lay = new QVBoxLayout(this);
auto lay = new QVBoxLayout(this);
auto *menu = new QToolBar(this);
auto menu = new QToolBar(this);
lay->addWidget(menu);
mCustomTools = new PimCommon::CustomToolsWidgetNg(this);
......@@ -48,7 +48,7 @@ int main(int argc, char **argv)
parser.addHelpOption();
parser.process(app);
auto *w = new CustomToolWidgetNgTest();
auto w = new CustomToolWidgetNgTest();
w->resize(800, 200);
w->show();
const int ret = app.exec();
......
......@@ -20,10 +20,10 @@ int main(int argc, char *argv[])
parser.addHelpOption();
parser.process(app);
QWidget *w = new QWidget;
auto *vbox = new QVBoxLayout(w);
auto w = new QWidget;
auto vbox = new QVBoxLayout(w);
PimCommon::SpellCheckLineEdit *spellCheckLineEdit = new PimCommon::SpellCheckLineEdit(w, QStringLiteral("testspecklineeditrc"));
auto spellCheckLineEdit = new PimCommon::SpellCheckLineEdit(w, QStringLiteral("testspecklineeditrc"));
vbox->addWidget(spellCheckLineEdit);
vbox->addStretch();
......
......@@ -68,22 +68,22 @@ AclEntryDialog::AclEntryDialog(QWidget *parent)
: QDialog(parent)
, d(new Private(this))
{
auto *mainLayout = new QVBoxLayout(this);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
auto mainLayout = new QVBoxLayout(this);
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
d->mOkButton = buttonBox->button(QDialogButtonBox::Ok);
d->mOkButton->setDefault(true);
d->mOkButton->setShortcut(Qt::CTRL | Qt::Key_Return);
connect(buttonBox, &QDialogButtonBox::accepted, this, &AclEntryDialog::accept);
connect(buttonBox, &QDialogButtonBox::rejected, this, &AclEntryDialog::reject);
QWidget *page = new QWidget(this);
auto page = new QWidget(this);
mainLayout->addWidget(page);
mainLayout->addWidget(buttonBox);
auto *layout = new QGridLayout(page);
auto layout = new QGridLayout(page);
layout->setContentsMargins(0, 0, 0, 0);
QLabel *label = new QLabel(i18n("&User identifier:"), page);
auto label = new QLabel(i18n("&User identifier:"), page);
layout->addWidget(label, 0,