Commit b368bd1b authored by Kevin Funk's avatar Kevin Funk
Browse files

clang-tidy: use-modernize-nullptr run

parent 52bf6bec
......@@ -255,7 +255,7 @@ bool ComputerModel::trigger(int row, const QString &actionId, const QVariant &ar
const QUrl &url = m_filteredPlacesModel->url(sourceIndex);
if (url.isValid()) {
new KRun(url, 0);
new KRun(url, nullptr);
return true;
}
......@@ -297,5 +297,5 @@ void ComputerModel::onSetupDone(Solid::ErrorType error, QVariant errorData, cons
Q_ASSERT(access);
new KRun(QUrl::fromLocalFile(access->filePath()), 0);
new KRun(QUrl::fromLocalFile(access->filePath()), nullptr);
}
......@@ -108,7 +108,7 @@ bool FileEntry::run(const QString& actionId, const QVariant &argument)
}
if (actionId.isEmpty()) {
new KRun(m_fileItem->url(), 0);
new KRun(m_fileItem->url(), nullptr);
return true;
} else {
......
......@@ -159,13 +159,13 @@ QString ForwardingModel::labelForRow(int row)
AbstractModel* ForwardingModel::modelForRow(int row)
{
if (!m_sourceModel) {
return 0;
return nullptr;
}
AbstractModel *abstractModel = qobject_cast<AbstractModel *>(m_sourceModel);
if (!abstractModel) {
return 0;
return nullptr;
}
return abstractModel->modelForRow(row);
......@@ -261,5 +261,5 @@ void ForwardingModel::disconnectSignals()
return;
}
disconnect(m_sourceModel, 0, this, 0);
disconnect(m_sourceModel, nullptr, this, nullptr);
}
......@@ -51,7 +51,7 @@ void MenuEntryEditor::edit(const QString& entryPath, const QString& menuId)
const QString &fileName = entryUrl.fileName();
if (appsDir.exists(fileName)) {
KPropertiesDialog::showDialog(entryUrl, 0, false);
KPropertiesDialog::showDialog(entryUrl, nullptr, false);
} else {
if (!appsDir.exists()) {
if (!QDir::root().mkpath(appsPath)) {
......
......@@ -228,7 +228,7 @@ AbstractModel* PlaceholderModel::modelForRow(int row)
return abstractModel->modelForRow(rowToSourceRow(row));
} else {
return 0;
return nullptr;
}
}
......@@ -361,7 +361,7 @@ void PlaceholderModel::disconnectSignals()
return;
}
disconnect(m_sourceModel, 0, this, 0);
disconnect(m_sourceModel, nullptr, this, nullptr);
}
int PlaceholderModel::dropPlaceholderIndex() const
......
......@@ -182,10 +182,10 @@ App::App(int &argc, char* argv[]): QGuiApplication(argc, argv)
,m_eventFilter(new XcbEventFilter)
,m_init(false)
,m_bus(ibus_bus_new ())
,m_impanel(0)
,m_impanel(nullptr)
,m_keyboardGrabbed(false)
,m_doGrab(false)
,m_syms(0)
,m_syms(nullptr)
,m_watcher(new QDBusServiceWatcher(this))
{
m_syms = xcb_key_symbols_alloc(QX11Info::connection());
......@@ -268,7 +268,7 @@ void App::keyRelease(const xcb_key_release_event_t* event)
release = true;
else {
auto cookie = xcb_get_modifier_mapping(QX11Info::connection());
auto reply = xcb_get_modifier_mapping_reply(QX11Info::connection(), cookie, NULL);
auto reply = xcb_get_modifier_mapping_reply(QX11Info::connection(), cookie, nullptr);
if (reply) {
auto keycodes = xcb_get_modifier_mapping_keycodes(reply);
for (int i = 0; i < reply->keycodes_per_modifier; i++) {
......@@ -308,7 +308,7 @@ void App::init()
"NameAcquired",
"/org/freedesktop/DBus",
IBUS_SERVICE_PANEL, G_DBUS_SIGNAL_FLAGS_NONE,
name_acquired_cb, this, NULL);
name_acquired_cb, this, nullptr);
g_dbus_connection_signal_subscribe (connection,
"org.freedesktop.DBus",
......@@ -316,7 +316,7 @@ void App::init()
"NameLost",
"/org/freedesktop/DBus",
IBUS_SERVICE_PANEL, G_DBUS_SIGNAL_FLAGS_NONE,
name_lost_cb, this, NULL);
name_lost_cb, this, nullptr);
ibus_bus_request_name (m_bus, IBUS_SERVICE_PANEL, IBUS_BUS_NAME_FLAG_ALLOW_REPLACEMENT | IBUS_BUS_NAME_FLAG_REPLACE_EXISTING);
m_init = true;
......@@ -338,7 +338,7 @@ void App::nameLost()
if (m_impanel) {
g_object_unref(m_impanel);
}
m_impanel = NULL;
m_impanel = nullptr;
}
QByteArray App::normalizeIconName(const QByteArray& icon) const
......@@ -418,7 +418,7 @@ bool App::grabXKeyboard() {
auto w = QX11Info::appRootWindow();
auto cookie = xcb_grab_keyboard(QX11Info::connection(), false, w, XCB_CURRENT_TIME,
XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_ASYNC);
auto reply = xcb_grab_keyboard_reply(QX11Info::connection(), cookie, NULL);
auto reply = xcb_grab_keyboard_reply(QX11Info::connection(), cookie, nullptr);
if (reply && reply->status == XCB_GRAB_STATUS_SUCCESS) {
m_keyboardGrabbed = true;
......@@ -456,14 +456,14 @@ void App::clean()
{
if (m_impanel) {
g_object_unref(m_impanel);
m_impanel = 0;
m_impanel = nullptr;
}
if (m_bus) {
g_signal_handlers_disconnect_by_func(m_bus, (gpointer) ibus_disconnected_cb, this);
g_signal_handlers_disconnect_by_func(m_bus, (gpointer) ibus_connected_cb, this);
g_object_unref(m_bus);
m_bus = 0;
m_bus = nullptr;
}
ungrabKey();
}
......
......@@ -22,7 +22,7 @@
#define THRESHOLD 256
EngineManager::EngineManager() : m_engines(0), m_length(0)
EngineManager::EngineManager() : m_engines(nullptr), m_length(0)
{
}
......
......@@ -20,7 +20,7 @@
#include "propertymanager.h"
#include <QByteArray>
PropertyManager::PropertyManager() : m_props(0)
PropertyManager::PropertyManager() : m_props(nullptr)
{
}
......@@ -43,7 +43,7 @@ void PropertyManager::setProperties(IBusPropList* props)
IBusProperty* PropertyManager::property(const QByteArray& key)
{
if (!m_props)
return NULL;
return nullptr;
return searchList(key, m_props);
}
......@@ -51,7 +51,7 @@ IBusProperty* PropertyManager::property(const QByteArray& key)
IBusProperty* PropertyManager::searchList(const QByteArray& key, IBusPropList* props)
{
if (!props)
return NULL;
return nullptr;
int i = 0;
while (true) {
......@@ -67,7 +67,7 @@ IBusProperty* PropertyManager::searchList(const QByteArray& key, IBusPropList* p
}
i++;
}
return NULL;
return nullptr;
}
void PropertyManager::updateProperty(IBusProperty* prop)
......
......@@ -477,7 +477,7 @@ void PagerModel::moveWindow(int window, double x, double y, int targetItemId, in
dest = QPointF(qMax(dest.x(), qreal(0.0)), qMax(dest.y(), qreal(0.0)));
// Use _NET_MOVERESIZE_WINDOW rather than plain move, so that the WM knows this is a pager request.
NETRootInfo info(QX11Info::connection(), 0);
NETRootInfo info(QX11Info::connection(), nullptr);
const int flags = (0x20 << 12) | (0x03 << 8) | 1; // From tool, x/y, northwest gravity.
if (!KWindowSystem::mapViewport()) {
......@@ -591,7 +591,7 @@ void PagerModel::drop(QMimeData *mimeData, int itemId)
}
for (const auto &id : ids) {
QStringList activities = KWindowInfo(id, 0, NET::WM2Activities).activities();
QStringList activities = KWindowInfo(id, nullptr, NET::WM2Activities).activities();
if (!activities.contains(newActivity)) {
KWindowSystem::setOnActivities(id, activities << newActivity);
......
......@@ -65,7 +65,7 @@ void FolderModelTest::init()
void FolderModelTest::cleanup()
{
delete m_folderDir;
m_folderDir = 0;
m_folderDir = nullptr;
delete m_folderModel;
m_folderModel = nullptr;
}
......
......@@ -53,7 +53,7 @@ void LabelGenerator::setFolderModel(FolderModel *folderModel)
{
if (m_folderModel.data() != folderModel) {
if (m_folderModel.data()) {
disconnect(m_folderModel.data(), 0, this, 0);
disconnect(m_folderModel.data(), nullptr, this, nullptr);
}
m_folderModel = folderModel;
......
......@@ -443,7 +443,7 @@ void SortedActivitiesModel::onBackgroundsUpdated(const QStringList &activities)
void SortedActivitiesModel::onWindowAdded(WId window)
{
KWindowInfo info(window, 0, NET::WM2Activities);
KWindowInfo info(window, nullptr, NET::WM2Activities);
const QStringList activities = info.activities();
if (activities.isEmpty() || activities.contains("00000000-0000-0000-0000-000000000000")) return;
......
......@@ -982,9 +982,9 @@ void KAccessApp::noClicked()
void KAccessApp::dialogClosed()
{
if (dialog != 0)
if (dialog != nullptr)
dialog->deleteLater();
dialog = 0;
dialog = nullptr;
requestedFeatures = features;
}
......
......@@ -117,7 +117,7 @@ class VisualBell : public QWidget
public:
VisualBell(int pause)
: QWidget((QWidget*)0, Qt::X11BypassWindowManagerHint), _pause(pause)
: QWidget((QWidget*)nullptr, Qt::X11BypassWindowManagerHint), _pause(pause)
{}
......
......@@ -451,10 +451,10 @@ void Autostart::slotChangeStartup( ScriptStartItem* item, int index )
void Autostart::slotSelectionChanged()
{
const bool hasItems = ( dynamic_cast<AutoStartItem*>( widget->listCMD->currentItem() )!=0 ) ;
const bool hasItems = ( dynamic_cast<AutoStartItem*>( widget->listCMD->currentItem() )!=nullptr ) ;
widget->btnRemove->setEnabled(hasItems);
const bool isDesktopItem = (dynamic_cast<DesktopStartItem*>(widget->listCMD->currentItem() ) != 0) ;
const bool isDesktopItem = (dynamic_cast<DesktopStartItem*>(widget->listCMD->currentItem() ) != nullptr) ;
widget->btnProperties->setEnabled(isDesktopItem);
widget->btnAdvanced->setEnabled(isDesktopItem) ;
}
......
......@@ -71,7 +71,7 @@ const char* const s_defaultFileExcludeFilters[] = {
"*.elc", // Emacs Lisp
// end of list
0
nullptr
};
const int s_defaultFileExcludeFiltersVersion = 2;
......@@ -101,7 +101,7 @@ const char* const s_defaultFolderExcludeFilters[] = {
"lost+found",
// end of list
0
nullptr
};
const int s_defaultFolderExcludeFiltersVersion = 1;
......@@ -135,7 +135,7 @@ const char* const s_sourceCodeMimeTypes[] = {
"application/x-tex",
// end of list
0
nullptr
};
const int s_sourceCodeMimeTypesVersion = 1;
}
......
......@@ -273,7 +273,7 @@ void FolderSelectionWidget::slotRemoveButtonClicked()
void FolderSelectionWidget::slotCurrentItemChanged(QListWidgetItem* current, QListWidgetItem*)
{
m_removeButton->setEnabled(current != 0);
m_removeButton->setEnabled(current != nullptr);
}
void FolderSelectionWidget::showMessage(const QString& message)
......
......@@ -30,7 +30,7 @@ class FolderSelectionWidget : public QWidget
{
Q_OBJECT
public:
explicit FolderSelectionWidget(QWidget* parent = 0, Qt::WindowFlags f = 0);
explicit FolderSelectionWidget(QWidget* parent = nullptr, Qt::WindowFlags f = nullptr);
void setDirectoryList(QStringList includeDirs, QStringList exclude);
QStringList includeFolders() const;
......
......@@ -88,7 +88,7 @@ void SchemeEditorColors::setupColorTable()
if (i > 8 && i < 18)
{
// Inactive Text row through Positive Text role all need a varies button
QPushButton * variesButton = new QPushButton(NULL);
QPushButton * variesButton = new QPushButton(nullptr);
variesButton->setText(i18n("Varies"));
variesButton->setObjectName(QString::number(i));
connect(variesButton, &QPushButton::clicked, this, &SchemeEditorColors::variesClicked);
......
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