diff --git a/kcmkwin/kwindecoration/buttons.h b/kcmkwin/kwindecoration/buttons.h index 965b6cb42a..1c62b2545d 100644 --- a/kcmkwin/kwindecoration/buttons.h +++ b/kcmkwin/kwindecoration/buttons.h @@ -112,7 +112,7 @@ class ButtonSource : public QListWidget Q_OBJECT public: - explicit ButtonSource(QWidget *parent = 0); + explicit ButtonSource(QWidget *parent = nullptr); virtual ~ButtonSource(); QSize sizeHint() const; @@ -143,7 +143,7 @@ class ButtonDropSite: public QFrame Q_OBJECT public: - explicit ButtonDropSite(QWidget* parent = 0); + explicit ButtonDropSite(QWidget* parent = nullptr); ~ButtonDropSite(); // Allow external classes access our buttons - ensure buttons are @@ -196,7 +196,7 @@ class ButtonPositionWidget : public QWidget Q_OBJECT public: - explicit ButtonPositionWidget(QWidget *parent = 0); + explicit ButtonPositionWidget(QWidget *parent = nullptr); ~ButtonPositionWidget(); QList buttonsLeft() const; diff --git a/kcmkwin/kwindecoration/buttonsconfigdialog.h b/kcmkwin/kwindecoration/buttonsconfigdialog.h index 740a32ba87..5ebbf55714 100644 --- a/kcmkwin/kwindecoration/buttonsconfigdialog.h +++ b/kcmkwin/kwindecoration/buttonsconfigdialog.h @@ -43,7 +43,7 @@ class KWinDecorationButtonsConfigDialog : public QDialog { Q_OBJECT public: - KWinDecorationButtonsConfigDialog(DecorationButtons const *buttons, bool showTooltips, QWidget* parent = 0, Qt::WFlags flags = 0); + KWinDecorationButtonsConfigDialog(DecorationButtons const *buttons, bool showTooltips, QWidget* parent = nullptr, Qt::WFlags flags = 0); ~KWinDecorationButtonsConfigDialog(); bool customPositions() const; diff --git a/kcmkwin/kwindecoration/configdialog.cpp b/kcmkwin/kwindecoration/configdialog.cpp index b06eb1ce72..5083d604c6 100644 --- a/kcmkwin/kwindecoration/configdialog.cpp +++ b/kcmkwin/kwindecoration/configdialog.cpp @@ -74,8 +74,8 @@ KWinDecorationConfigDialog::KWinDecorationConfigDialog(QString deco, const QList : QDialog(parent, flags) , m_borderSizes(borderSizes) , m_kwinConfig(KSharedConfig::openConfig("kwinrc")) - , m_pluginObject(0) - , m_pluginConfigWidget(0) + , m_pluginObject(nullptr) + , m_pluginConfigWidget(nullptr) { m_ui = new KWinDecorationConfigForm(this); setWindowTitle(i18n("Decoration Options")); @@ -92,7 +92,7 @@ KWinDecorationConfigDialog::KWinDecorationConfigDialog(QString deco, const QList KLibrary library(styleToConfigLib(deco)); if (library.load()) { KLibrary::void_function_ptr alloc_ptr = library.resolveFunction("allocate_config"); - if (alloc_ptr != NULL) { + if (alloc_ptr != nullptr) { allocatePlugin = (QObject * (*)(KConfigGroup & conf, QWidget * parent))alloc_ptr; KConfigGroup config(m_kwinConfig, "Style"); m_pluginConfigWidget = new QWidget(this); diff --git a/kcmkwin/kwindecoration/configdialog.h b/kcmkwin/kwindecoration/configdialog.h index 2f53b4a601..1b99f39d17 100644 --- a/kcmkwin/kwindecoration/configdialog.h +++ b/kcmkwin/kwindecoration/configdialog.h @@ -54,7 +54,7 @@ class KWinDecorationConfigDialog : public QDialog, public KDecorationDefines Q_OBJECT public: KWinDecorationConfigDialog(QString decoLib, const QList& borderSizes, - KDecorationDefines::BorderSize size, QWidget* parent = 0, + KDecorationDefines::BorderSize size, QWidget* parent = nullptr, Qt::WFlags flags = 0); ~KWinDecorationConfigDialog(); diff --git a/kcmkwin/kwindecoration/decorationmodel.h b/kcmkwin/kwindecoration/decorationmodel.h index 58da01acc7..f55e6ddd5e 100644 --- a/kcmkwin/kwindecoration/decorationmodel.h +++ b/kcmkwin/kwindecoration/decorationmodel.h @@ -89,7 +89,7 @@ public: QmlMainScriptRole = Qt::UserRole + 14, CloseOnDblClickRole = Qt::UserRole + 15 }; - explicit DecorationModel(KSharedConfigPtr config, QObject* parent = 0); + explicit DecorationModel(KSharedConfigPtr config, QObject* parent = nullptr); ~DecorationModel(); virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const; diff --git a/kcmkwin/kwindecoration/kwindecoration.cpp b/kcmkwin/kwindecoration/kwindecoration.cpp index 3172d77fae..b1c79097bf 100644 --- a/kcmkwin/kwindecoration/kwindecoration.cpp +++ b/kcmkwin/kwindecoration/kwindecoration.cpp @@ -73,8 +73,8 @@ KWinDecorationModule::KWinDecorationModule(QWidget* parent, const QVariantList & : KCModule(parent) , kwinConfig(KSharedConfig::openConfig("kwinrc")) , m_showTooltips(false) - , m_model(NULL) - , m_proxyModel(NULL) + , m_model(nullptr) + , m_proxyModel(nullptr) , m_configLoaded(false) , m_decorationButtons(new DecorationButtons(this)) , m_listView(new QQuickView()) @@ -381,7 +381,7 @@ void KWinDecorationModule::slotConfigureDecoration() form->buttonSizesCombo->setCurrentIndex(index.data(DecorationModel::ButtonSizeRole).toInt()); form->closeWindowsDoubleClick->setChecked(index.data(DecorationModel::CloseOnDblClickRole).toBool()); // in case of QmlDecoration look for a config.ui in the package structure - KConfigDialogManager *configManager = NULL; + KConfigDialogManager *configManager = nullptr; if (index.data(DecorationModel::TypeRole).toInt() == DecorationModelData::QmlDecoration) { const QString packageName = index.data(DecorationModel::AuroraeNameRole).toString(); const QString uiPath = QStandardPaths::locate(QStandardPaths::GenericDataLocation, "kwin/decorations/" + packageName + "/contents/ui/config.ui"); diff --git a/kcmkwin/kwindecoration/kwindecoration.h b/kcmkwin/kwindecoration/kwindecoration.h index fb70ba0891..fb9ac7cf12 100644 --- a/kcmkwin/kwindecoration/kwindecoration.h +++ b/kcmkwin/kwindecoration/kwindecoration.h @@ -58,7 +58,7 @@ class DecorationButtons : public QObject, public KDecorationDefines Q_OBJECT Q_PROPERTY(bool customButtonPositions READ customPositions WRITE setCustomPositions NOTIFY customPositionsChanged) public: - explicit DecorationButtons(QObject *parent = 0); + explicit DecorationButtons(QObject *parent = nullptr); virtual ~DecorationButtons(); bool customPositions() const; diff --git a/kcmkwin/kwindecoration/preview.h b/kcmkwin/kwindecoration/preview.h index df3ef3bdab..05404fb354 100644 --- a/kcmkwin/kwindecoration/preview.h +++ b/kcmkwin/kwindecoration/preview.h @@ -84,7 +84,7 @@ public: // and an inactive window. enum Windows { Inactive = 0, Active, NumWindows }; - explicit KDecorationPreview(QWidget* parent = NULL); + explicit KDecorationPreview(QWidget* parent = nullptr); virtual ~KDecorationPreview(); void disablePreview(); KDecorationFactory *factory() const; diff --git a/kcmkwin/kwindesktop/main.cpp b/kcmkwin/kwindesktop/main.cpp index 3d835a1d23..28902b2943 100644 --- a/kcmkwin/kwindesktop/main.cpp +++ b/kcmkwin/kwindesktop/main.cpp @@ -59,8 +59,8 @@ KWinDesktopConfigForm::KWinDesktopConfigForm(QWidget* parent) KWinDesktopConfig::KWinDesktopConfig(QWidget* parent, const QVariantList& args) : KCModule(KAboutData::pluginData(QStringLiteral("kcm_kwindesktop")), parent, args) , m_config(KSharedConfig::openConfig("kwinrc")) - , m_actionCollection(NULL) - , m_switchDesktopCollection(NULL) + , m_actionCollection(nullptr) + , m_switchDesktopCollection(nullptr) { init(); } diff --git a/kcmkwin/kwinrules/detectwidget.cpp b/kcmkwin/kwinrules/detectwidget.cpp index 723bdee7bb..035acc1b45 100644 --- a/kcmkwin/kwinrules/detectwidget.cpp +++ b/kcmkwin/kwinrules/detectwidget.cpp @@ -176,7 +176,7 @@ void DetectDialog::selectWindow() // use a dialog, so that all user input is blocked // use WX11BypassWM and moving away so that it's not actually visible // grab only mouse, so that keyboard can be used e.g. for switching windows - grabber.reset(new QDialog(0, Qt::X11BypassWindowManagerHint)); + grabber.reset(new QDialog(nullptr, Qt::X11BypassWindowManagerHint)); grabber->move(-1000, -1000); grabber->setModal(true); grabber->show(); @@ -233,7 +233,7 @@ WId DetectDialog::findWindow() unsigned char* prop; if (XGetWindowProperty(QX11Info::display(), child, wm_state, 0, 0, False, AnyPropertyType, &type, &format, &nitems, &after, &prop) == Success) { - if (prop != NULL) + if (prop != nullptr) XFree(prop); if (type != None) return child; diff --git a/kcmkwin/kwinrules/detectwidget.h b/kcmkwin/kwinrules/detectwidget.h index 4fdd3614f2..6c7e4efac3 100644 --- a/kcmkwin/kwinrules/detectwidget.h +++ b/kcmkwin/kwinrules/detectwidget.h @@ -39,7 +39,7 @@ class DetectWidget { Q_OBJECT public: - explicit DetectWidget(QWidget* parent = NULL); + explicit DetectWidget(QWidget* parent = nullptr); }; class DetectDialog @@ -47,7 +47,7 @@ class DetectDialog { Q_OBJECT public: - explicit DetectDialog(QWidget* parent = NULL, const char* name = NULL); + explicit DetectDialog(QWidget* parent = nullptr, const char* name = nullptr); void detect(WId window, int secs = 0); QByteArray selectedClass() const; bool selectedWholeClass() const; diff --git a/kcmkwin/kwinrules/main.cpp b/kcmkwin/kwinrules/main.cpp index 678e25a76e..98885948f3 100644 --- a/kcmkwin/kwinrules/main.cpp +++ b/kcmkwin/kwinrules/main.cpp @@ -72,7 +72,7 @@ static Rules* findRule(const QList< Rules* >& rules, Window wid, bool whole_app) NET::WMName | NET::WMWindowType, NET::WM2WindowClass | NET::WM2WindowRole | NET::WM2ClientMachine); if (!info.valid()) // shouldn't really happen - return NULL; + return nullptr; ClientMachine clientMachine; clientMachine.resolve(info.win(), info.groupLeader()); QByteArray wmclass_class = info.windowClassClass().toLower(); @@ -83,7 +83,7 @@ static Rules* findRule(const QList< Rules* >& rules, Window wid, bool whole_app) | NET::UtilityMask | NET::SplashMask); QString title = info.name(); QByteArray machine = clientMachine.hostName(); - Rules* best_match = NULL; + Rules* best_match = nullptr; int match_quality = 0; for (QList< Rules* >::ConstIterator it = rules.constBegin(); it != rules.constEnd(); @@ -136,7 +136,7 @@ static Rules* findRule(const QList< Rules* >& rules, Window wid, bool whole_app) match_quality = quality; } } - if (best_match != NULL) + if (best_match != nullptr) return best_match; Rules* ret = new Rules; if (whole_app) { @@ -215,7 +215,7 @@ static int edit(Window wid, bool whole_app) dlg.setWindowTitle(i18nc("Window caption for the application wide rules dialog", "Edit Application-Specific Settings")); // dlg.edit() creates new Rules instance if edited Rules* edited_rule = dlg.edit(orig_rule, wid, true); - if (edited_rule == NULL || edited_rule->isEmpty()) { + if (edited_rule == nullptr || edited_rule->isEmpty()) { rules.removeAll(orig_rule); delete orig_rule; if (orig_rule != edited_rule) diff --git a/kcmkwin/kwinrules/ruleslist.cpp b/kcmkwin/kwinrules/ruleslist.cpp index 842a22ab51..0353c66da1 100644 --- a/kcmkwin/kwinrules/ruleslist.cpp +++ b/kcmkwin/kwinrules/ruleslist.cpp @@ -72,20 +72,20 @@ void KCMRulesList::activeChanged() QListWidgetItem *item = rules_listbox->currentItem(); int itemRow = rules_listbox->row(item); - if (item != NULL) // make current==selected + if (item != nullptr) // make current==selected rules_listbox->setCurrentItem(item, QItemSelectionModel::ClearAndSelect); - modify_button->setEnabled(item != NULL); - delete_button->setEnabled(item != NULL); - export_button->setEnabled(item != NULL); - moveup_button->setEnabled(item != NULL && itemRow > 0); - movedown_button->setEnabled(item != NULL && itemRow < (rules_listbox->count() - 1)); + modify_button->setEnabled(item != nullptr); + delete_button->setEnabled(item != nullptr); + export_button->setEnabled(item != nullptr); + moveup_button->setEnabled(item != nullptr && itemRow > 0); + movedown_button->setEnabled(item != nullptr && itemRow < (rules_listbox->count() - 1)); } void KCMRulesList::newClicked() { RulesDialog dlg(this); - Rules* rule = dlg.edit(NULL, 0, false); - if (rule == NULL) + Rules* rule = dlg.edit(nullptr, 0, false); + if (rule == nullptr) return; int pos = rules_listbox->currentRow() + 1; rules_listbox->insertItem(pos , rule->description); @@ -191,7 +191,7 @@ void KCMRulesList::importClicked() } else rules[i] = new_rule; - new_rule = 0; + new_rule = nullptr; break; } } @@ -199,7 +199,7 @@ void KCMRulesList::importClicked() // don't add "to be deleted" if not present if (remove) { delete new_rule; - new_rule = 0; + new_rule = nullptr; } // plain insertion @@ -234,7 +234,7 @@ void KCMRulesList::load() if (rules.count() > 0) rules_listbox->setCurrentItem(rules_listbox->item(0)); else - rules_listbox->setCurrentItem(NULL); + rules_listbox->setCurrentItem(nullptr); activeChanged(); } diff --git a/kcmkwin/kwinrules/ruleslist.h b/kcmkwin/kwinrules/ruleslist.h index 19b8768f42..eb9a1ad1a0 100644 --- a/kcmkwin/kwinrules/ruleslist.h +++ b/kcmkwin/kwinrules/ruleslist.h @@ -32,7 +32,7 @@ class KCMRulesList { Q_OBJECT public: - explicit KCMRulesList(QWidget* parent = NULL); + explicit KCMRulesList(QWidget* parent = nullptr); virtual ~KCMRulesList(); void load(); void save(); diff --git a/kcmkwin/kwinrules/ruleswidget.cpp b/kcmkwin/kwinrules/ruleswidget.cpp index ea322abbf3..370ae1a8d9 100644 --- a/kcmkwin/kwinrules/ruleswidget.cpp +++ b/kcmkwin/kwinrules/ruleswidget.cpp @@ -54,7 +54,7 @@ namespace KWin rule_##var->setWhatsThis( type##RuleDesc ); RulesWidget::RulesWidget(QWidget* parent) - : detect_dlg(NULL) + : detect_dlg(nullptr) { Q_UNUSED(parent); QRegularExpressionValidator* validator = new QRegularExpressionValidator(QRegularExpression("[0-9\-+,xX:]*"), this); @@ -426,7 +426,7 @@ static NET::WindowType comboToType(int val) void RulesWidget::setRules(Rules* rules) { Rules tmp; - if (rules == NULL) + if (rules == nullptr) rules = &tmp; // empty description->setText(rules->description); wmclass->setText(rules->wmclass); @@ -634,7 +634,7 @@ STRING_MATCH_COMBO(machine) void RulesWidget::detectClicked() { - assert(detect_dlg == NULL); + assert(detect_dlg == nullptr); detect_dlg = new DetectDialog; connect(detect_dlg, SIGNAL(detectionDone(bool)), this, SLOT(detected(bool))); detect_dlg->detect(0, Ui::RulesWidgetBase::detection_delay->value()); @@ -675,7 +675,7 @@ void RulesWidget::detected(bool ok) prefillUnusedValues(info); } delete detect_dlg; - detect_dlg = NULL; + detect_dlg = nullptr; detect_dlg_ok = ok; } diff --git a/kcmkwin/kwinrules/ruleswidget.h b/kcmkwin/kwinrules/ruleswidget.h index 7e0e7b4cad..1420986618 100644 --- a/kcmkwin/kwinrules/ruleswidget.h +++ b/kcmkwin/kwinrules/ruleswidget.h @@ -40,7 +40,7 @@ class RulesWidget { Q_OBJECT public: - explicit RulesWidget(QWidget* parent = NULL); + explicit RulesWidget(QWidget* parent = nullptr); void setRules(Rules* r); Rules* rules() const; bool finalCheck(); @@ -116,7 +116,7 @@ class RulesDialog { Q_OBJECT public: - explicit RulesDialog(QWidget* parent = NULL, const char* name = NULL); + explicit RulesDialog(QWidget* parent = nullptr, const char* name = nullptr); Rules* edit(Rules* r, WId window, bool show_hints); protected: virtual void accept(); @@ -132,7 +132,7 @@ class EditShortcut { Q_OBJECT public: - explicit EditShortcut(QWidget* parent = NULL); + explicit EditShortcut(QWidget* parent = nullptr); protected Q_SLOTS: void editShortcut(); void clearShortcut(); @@ -143,7 +143,7 @@ class EditShortcutDialog { Q_OBJECT public: - explicit EditShortcutDialog(QWidget* parent = NULL, const char* name = NULL); + explicit EditShortcutDialog(QWidget* parent = nullptr, const char* name = nullptr); void setShortcut(const QString& cut); QString shortcut() const; private: @@ -156,7 +156,7 @@ class ShortcutDialog { Q_OBJECT public: - explicit ShortcutDialog(const QKeySequence& cut, QWidget* parent = NULL); + explicit ShortcutDialog(const QKeySequence& cut, QWidget* parent = nullptr); virtual void accept(); QKeySequence shortcut() const; private: diff --git a/kcmkwin/kwintabbox/layoutpreview.h b/kcmkwin/kwintabbox/layoutpreview.h index 0203909eda..8180d34589 100644 --- a/kcmkwin/kwintabbox/layoutpreview.h +++ b/kcmkwin/kwintabbox/layoutpreview.h @@ -48,7 +48,7 @@ class ExampleClientModel : public QAbstractListModel { Q_OBJECT public: - explicit ExampleClientModel(QObject *parent = NULL); + explicit ExampleClientModel(QObject *parent = nullptr); virtual ~ExampleClientModel(); virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; diff --git a/kcmkwin/kwintabbox/main.cpp b/kcmkwin/kwintabbox/main.cpp index 5bda6887e0..70b18bfbfd 100644 --- a/kcmkwin/kwintabbox/main.cpp +++ b/kcmkwin/kwintabbox/main.cpp @@ -461,7 +461,7 @@ void KWinTabBoxConfig::updateConfigFromUi(const KWin::KWinTabBoxConfigForm* ui, #define CHECK_CURRENT_TABBOX_UI \ Q_ASSERT(sender());\ - KWinTabBoxConfigForm *ui = 0;\ + KWinTabBoxConfigForm *ui = nullptr;\ QObject *dad = sender();\ while (!ui && (dad = dad->parent()))\ ui = qobject_cast(dad);\