Commit c1de24a5 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use auto vs "auto *" as we know that it's a pointer

parent 85998ee1
......@@ -29,7 +29,7 @@
ConfigureCustomSettingDialog::ConfigureCustomSettingDialog(QWidget *parent)
: QDialog(parent)
{
auto *mainLayout = new QVBoxLayout(this);
auto mainLayout = new QVBoxLayout(this);
setWindowTitle(i18nc("@title:window", "Add custom rule"));
mCustomSettingWidget = new ConfigureCustomSettingWidget(this);
......
......@@ -32,7 +32,7 @@
ConfigureCustomSettingWidget::ConfigureCustomSettingWidget(QWidget *parent)
: QWidget(parent)
{
auto *vbox = new QVBoxLayout(this);
auto vbox = new QVBoxLayout(this);
QLabel *lab = new QLabel(i18n("Category:"), this);
lab->setObjectName(QStringLiteral("category_label"));
......@@ -41,7 +41,7 @@ ConfigureCustomSettingWidget::ConfigureCustomSettingWidget(QWidget *parent)
mCategoryLineEdit->setClearButtonEnabled(true);
mCategoryLineEdit->setObjectName(QStringLiteral("category_lineedit"));
connect(mCategoryLineEdit, &KLineEdit::textChanged, this, &ConfigureCustomSettingWidget::slotTextChanged);
auto *categoryLayout = new QHBoxLayout;
auto categoryLayout = new QHBoxLayout;
vbox->addLayout(categoryLayout);
categoryLayout->addWidget(lab);
categoryLayout->addWidget(mCategoryLineEdit);
......
......@@ -34,17 +34,17 @@
CustomDebugSettingsPage::CustomDebugSettingsPage(QWidget *parent)
: QWidget(parent)
{
auto *mainLayout = new QVBoxLayout(this);
auto mainLayout = new QVBoxLayout(this);
QLabel *lab = new QLabel(i18n("Rules:"), this);
lab->setObjectName(QStringLiteral("custom_label"));
mainLayout->addWidget(lab);
auto *horizontalLayout = new QHBoxLayout;
auto horizontalLayout = new QHBoxLayout;
horizontalLayout->setContentsMargins(0, 0, 0, 0);
mainLayout->addLayout(horizontalLayout);
auto *vbox = new QVBoxLayout;
auto vbox = new QVBoxLayout;
horizontalLayout->addLayout(vbox);
mListWidget = new QListWidget(this);
......@@ -52,13 +52,13 @@ CustomDebugSettingsPage::CustomDebugSettingsPage(QWidget *parent)
mListWidget->setSelectionMode(QAbstractItemView::MultiSelection);
connect(mListWidget, &QListWidget::itemSelectionChanged, this, &CustomDebugSettingsPage::updateButtons);
connect(mListWidget, &QListWidget::itemDoubleClicked, this, &CustomDebugSettingsPage::slotEditRule);
auto *searchLine = new KListWidgetSearchLine(this, mListWidget);
auto searchLine = new KListWidgetSearchLine(this, mListWidget);
searchLine->setObjectName(QStringLiteral("searchline"));
searchLine->setPlaceholderText(i18n("Search..."));
vbox->addWidget(searchLine);
vbox->addWidget(mListWidget);
auto *buttonLayout = new QVBoxLayout;
auto buttonLayout = new QVBoxLayout;
horizontalLayout->addLayout(buttonLayout);
mAddRule = new QPushButton(i18n("Add..."), this);
......
......@@ -27,7 +27,7 @@
EnvironmentSettingsRulesPage::EnvironmentSettingsRulesPage(QWidget *parent)
: QWidget(parent)
{
auto *mainLayout = new QVBoxLayout(this);
auto mainLayout = new QVBoxLayout(this);
QLabel *lab = new QLabel(i18n("Rules:"), this);
lab->setObjectName(QStringLiteral("label"));
mRichTextEdit = new EnvironmentPlainTextEdit(this);
......
......@@ -30,7 +30,7 @@
KDEApplicationDebugSettingPage::KDEApplicationDebugSettingPage(QWidget *parent)
: QWidget(parent)
{
auto *mainLayout = new QVBoxLayout(this);
auto mainLayout = new QVBoxLayout(this);
mTreeListWidget = new KDEApplicationTreeListWidget(this);
mTreeListWidget->setObjectName(QStringLiteral("listwidget"));
......@@ -43,7 +43,7 @@ KDEApplicationDebugSettingPage::KDEApplicationDebugSettingPage(QWidget *parent)
mainLayout->addWidget(mTreeListWidget);
auto *buttonLayout = new QHBoxLayout;
auto buttonLayout = new QHBoxLayout;
mainLayout->addLayout(buttonLayout);
mEnableDebug = new QPushButton(i18n("Enable All Debug"), this);
......@@ -76,7 +76,7 @@ void KDEApplicationDebugSettingPage::forceFocus()
bool KDEApplicationDebugSettingPage::eventFilter(QObject *obj, QEvent *event)
{
if (event->type() == QEvent::KeyPress && obj == mTreeListWidgetSearchLine) {
auto *key = static_cast<QKeyEvent *>(event);
auto key = static_cast<QKeyEvent *>(event);
if ((key->key() == Qt::Key_Enter) || (key->key() == Qt::Key_Return)) {
event->accept();
return true;
......
......@@ -94,7 +94,7 @@ QList<int> KDEApplicationTreeListWidget::searchColumns() const
void KDEApplicationTreeListWidget::selectAllDebugCategories()
{
for (int i = 0; i < topLevelItemCount(); ++i) {
auto *itemWidget = static_cast<KDEApplicationTreeListWidgetItem *>(topLevelItem(i));
auto itemWidget = static_cast<KDEApplicationTreeListWidgetItem *>(topLevelItem(i));
if (!itemWidget->isHidden()) {
itemWidget->setType(LoggingCategory::Debug);
}
......@@ -104,7 +104,7 @@ void KDEApplicationTreeListWidget::selectAllDebugCategories()
void KDEApplicationTreeListWidget::deSelectAllDebugCategories()
{
for (int i = 0; i < topLevelItemCount(); ++i) {
auto *itemWidget = static_cast<KDEApplicationTreeListWidgetItem *>(topLevelItem(i));
auto itemWidget = static_cast<KDEApplicationTreeListWidgetItem *>(topLevelItem(i));
if (!itemWidget->isHidden()) {
itemWidget->setType(LoggingCategory::Info);
}
......@@ -114,7 +114,7 @@ void KDEApplicationTreeListWidget::deSelectAllDebugCategories()
void KDEApplicationTreeListWidget::deSelectAllMessagesCategories()
{
for (int i = 0; i < topLevelItemCount(); ++i) {
auto *itemWidget = static_cast<KDEApplicationTreeListWidgetItem *>(topLevelItem(i));
auto itemWidget = static_cast<KDEApplicationTreeListWidgetItem *>(topLevelItem(i));
if (!itemWidget->isHidden()) {
itemWidget->setType(LoggingCategory::Off);
}
......@@ -142,7 +142,7 @@ void KDEApplicationTreeListWidget::addListItems(const LoggingCategory::List &lis
clear();
}
for (const LoggingCategory &cat : list) {
auto *item = new KDEApplicationTreeListWidgetItem(cat.categoryName, this);
auto item = new KDEApplicationTreeListWidgetItem(cat.categoryName, this);
item->setToolTip(0, generateToolTip(cat));
item->setText(KDEApplicationTreeListWidgetItem::Description, cat.description);
item->setType(cat.loggingType);
......@@ -162,7 +162,7 @@ LoggingCategory::List KDEApplicationTreeListWidget::rules(bool forceSavingAllRul
{
LoggingCategory::List lst;
for (int i = 0; i < topLevelItemCount(); ++i) {
auto *listWidgetItem = static_cast<KDEApplicationTreeListWidgetItem *>(topLevelItem(i));
auto listWidgetItem = static_cast<KDEApplicationTreeListWidgetItem *>(topLevelItem(i));
const LoggingCategory cat = listWidgetItem->rule(forceSavingAllRules);
if (cat.isValid()) {
lst.append(cat);
......@@ -174,7 +174,7 @@ LoggingCategory::List KDEApplicationTreeListWidget::rules(bool forceSavingAllRul
void KDEApplicationTreeListWidget::restoreToDefault()
{
for (int i = 0; i < topLevelItemCount(); ++i) {
auto *itemWidget = static_cast<KDEApplicationTreeListWidgetItem *>(topLevelItem(i));
auto itemWidget = static_cast<KDEApplicationTreeListWidgetItem *>(topLevelItem(i));
itemWidget->restoreToDefault();
}
}
......@@ -48,7 +48,7 @@ constexpr char KDebugSettingsDialogGroupName[] = "KDebugSettingsDialog";
KDebugSettingsDialog::KDebugSettingsDialog(QWidget *parent)
: QDialog(parent)
{
auto *mainLayout = new QVBoxLayout(this);
auto mainLayout = new QVBoxLayout(this);
mCategoryWarning = new CategoryWarning(this);
mCategoryWarning->setObjectName(QStringLiteral("categorywarning"));
......
......@@ -99,7 +99,7 @@ int main(int argc, char **argv)
return 1;
} else {
KDBusService service(KDBusService::Unique);
auto *dialog = new KDebugSettingsDialog;
auto dialog = new KDebugSettingsDialog;
const int ret = dialog->exec();
delete dialog;
return ret;
......
Markdown is supported
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