From 6e45cf0dab5270dd245991adaa94ad7c13d75d52 Mon Sep 17 00:00:00 2001 From: Felix Geyer Date: Sun, 11 Oct 2015 10:47:30 +0200 Subject: [PATCH] Use C++11 keywords directly. --- src/autotype/AutoType.cpp | 2 +- src/autotype/test/AutoTypeTest.h | 34 ++++++++++++++++---------------- src/autotype/xcb/AutoTypeXCB.cpp | 2 +- src/autotype/xcb/AutoTypeXCB.h | 4 ++-- src/format/KeePass2Reader.cpp | 2 +- src/gui/Application.cpp | 2 +- src/gui/DatabaseTabWidget.cpp | 4 ++-- src/gui/group/GroupView.h | 2 +- src/streams/HashedBlockStream.h | 4 ++-- 9 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/autotype/AutoType.cpp b/src/autotype/AutoType.cpp index cd7e1f665..15185b297 100644 --- a/src/autotype/AutoType.cpp +++ b/src/autotype/AutoType.cpp @@ -79,7 +79,7 @@ void AutoType::loadPlugin(const QString& pluginPath) QObject* pluginInstance = m_pluginLoader->instance(); if (pluginInstance) { m_plugin = qobject_cast(pluginInstance); - m_executor = Q_NULLPTR; + m_executor = nullptr; if (m_plugin) { if (m_plugin->isAvailable()) { diff --git a/src/autotype/test/AutoTypeTest.h b/src/autotype/test/AutoTypeTest.h index bd2dfc02a..8c6e52443 100644 --- a/src/autotype/test/AutoTypeTest.h +++ b/src/autotype/test/AutoTypeTest.h @@ -33,24 +33,24 @@ class AutoTypePlatformTest : public QObject, Q_INTERFACES(AutoTypePlatformInterface AutoTypeTestInterface) public: - QString keyToString(Qt::Key key) Q_DECL_OVERRIDE; + QString keyToString(Qt::Key key) override; - bool isAvailable() Q_DECL_OVERRIDE; - QStringList windowTitles() Q_DECL_OVERRIDE; - WId activeWindow() Q_DECL_OVERRIDE; - QString activeWindowTitle() Q_DECL_OVERRIDE; - bool registerGlobalShortcut(Qt::Key key, Qt::KeyboardModifiers modifiers) Q_DECL_OVERRIDE; - void unregisterGlobalShortcut(Qt::Key key, Qt::KeyboardModifiers modifiers) Q_DECL_OVERRIDE; - int platformEventFilter(void* event) Q_DECL_OVERRIDE; - int initialTimeout() Q_DECL_OVERRIDE; - bool raiseWindow(WId window) Q_DECL_OVERRIDE; - AutoTypeExecutor* createExecutor() Q_DECL_OVERRIDE; + bool isAvailable() override; + QStringList windowTitles() override; + WId activeWindow() override; + QString activeWindowTitle() override; + bool registerGlobalShortcut(Qt::Key key, Qt::KeyboardModifiers modifiers) override; + void unregisterGlobalShortcut(Qt::Key key, Qt::KeyboardModifiers modifiers) override; + int platformEventFilter(void* event) override; + int initialTimeout() override; + bool raiseWindow(WId window) override; + AutoTypeExecutor* createExecutor() override; - void setActiveWindowTitle(const QString& title) Q_DECL_OVERRIDE; + void setActiveWindowTitle(const QString& title) override; - QString actionChars() Q_DECL_OVERRIDE; - int actionCount() Q_DECL_OVERRIDE; - void clearActions() Q_DECL_OVERRIDE; + QString actionChars() override; + int actionCount() override; + void clearActions() override; void addActionChar(AutoTypeChar* action); void addActionKey(AutoTypeKey* action); @@ -69,8 +69,8 @@ class AutoTypeExecturorTest : public AutoTypeExecutor public: explicit AutoTypeExecturorTest(AutoTypePlatformTest* platform); - void execChar(AutoTypeChar* action) Q_DECL_OVERRIDE; - void execKey(AutoTypeKey* action) Q_DECL_OVERRIDE; + void execChar(AutoTypeChar* action) override; + void execKey(AutoTypeKey* action) override; private: AutoTypePlatformTest* const m_platform; diff --git a/src/autotype/xcb/AutoTypeXCB.cpp b/src/autotype/xcb/AutoTypeXCB.cpp index 8502a93c8..4c6597040 100644 --- a/src/autotype/xcb/AutoTypeXCB.cpp +++ b/src/autotype/xcb/AutoTypeXCB.cpp @@ -578,7 +578,7 @@ XkbDescPtr AutoTypePlatformX11::getKeyboard() XID keyboard_id = XkbUseCoreKbd; XDeviceInfo* devices = XListInputDevices(m_dpy, &num_devices); if (!devices) { - return Q_NULLPTR; + return nullptr; } for (int i = 0; i < num_devices; i++) { diff --git a/src/autotype/xcb/AutoTypeXCB.h b/src/autotype/xcb/AutoTypeXCB.h index c23d69a79..8adee7701 100644 --- a/src/autotype/xcb/AutoTypeXCB.h +++ b/src/autotype/xcb/AutoTypeXCB.h @@ -124,8 +124,8 @@ class AutoTypeExecturorX11 : public AutoTypeExecutor public: explicit AutoTypeExecturorX11(AutoTypePlatformX11* platform); - void execChar(AutoTypeChar* action) Q_DECL_OVERRIDE; - void execKey(AutoTypeKey* action) Q_DECL_OVERRIDE; + void execChar(AutoTypeChar* action) override; + void execKey(AutoTypeKey* action) override; private: AutoTypePlatformX11* const m_platform; diff --git a/src/format/KeePass2Reader.cpp b/src/format/KeePass2Reader.cpp index 1aa5fee69..4949158a8 100644 --- a/src/format/KeePass2Reader.cpp +++ b/src/format/KeePass2Reader.cpp @@ -76,7 +76,7 @@ Database* KeePass2Reader::readDatabase(QIODevice* device, const CompositeKey& ke "You can import it by clicking on Database > 'Import KeePass 1 database'.\n" "This is a one-way migration. You won't be able to open the imported " "database with the old KeePassX 0.4 version.")); - return Q_NULLPTR; + return nullptr; } else if (!ok || signature2 != KeePass2::SIGNATURE_2) { raiseError(tr("Not a KeePass database.")); diff --git a/src/gui/Application.cpp b/src/gui/Application.cpp index 779a6cc84..b0aef8c99 100644 --- a/src/gui/Application.cpp +++ b/src/gui/Application.cpp @@ -45,7 +45,7 @@ public: Application::Application(int& argc, char** argv) : QApplication(argc, argv) - , m_mainWindow(Q_NULLPTR) + , m_mainWindow(nullptr) { #if defined(Q_OS_UNIX) && !defined(Q_OS_OSX) installNativeEventFilter(new XcbEventFilter()); diff --git a/src/gui/DatabaseTabWidget.cpp b/src/gui/DatabaseTabWidget.cpp index b9ccccd86..69b4f7e72 100644 --- a/src/gui/DatabaseTabWidget.cpp +++ b/src/gui/DatabaseTabWidget.cpp @@ -333,7 +333,7 @@ bool DatabaseTabWidget::saveDatabaseAs(Database* db) } QString fileName = fileDialog()->getSaveFileName(this, tr("Save database as"), oldFileName, tr("KeePass 2 Database").append(" (*.kdbx)"), - Q_NULLPTR, 0, "kdbx"); + nullptr, 0, "kdbx"); if (!fileName.isEmpty()) { QFileInfo fileInfo(fileName); QString lockFilePath; @@ -454,7 +454,7 @@ void DatabaseTabWidget::exportToCsv() QString fileName = fileDialog()->getSaveFileName(this, tr("Export database to CSV file"), QString(), tr("CSV file").append(" (*.csv)"), - Q_NULLPTR, 0, "csv"); + nullptr, 0, "csv"); if (fileName.isEmpty()) { return; } diff --git a/src/gui/group/GroupView.h b/src/gui/group/GroupView.h index e6d2b660c..69ca82817 100644 --- a/src/gui/group/GroupView.h +++ b/src/gui/group/GroupView.h @@ -47,7 +47,7 @@ private Q_SLOTS: void modelReset(); protected: - void dragMoveEvent(QDragMoveEvent* event) Q_DECL_OVERRIDE; + void dragMoveEvent(QDragMoveEvent* event) override; private: void recInitExpanded(Group* group); diff --git a/src/streams/HashedBlockStream.h b/src/streams/HashedBlockStream.h index ca4b1fda0..93e4af59c 100644 --- a/src/streams/HashedBlockStream.h +++ b/src/streams/HashedBlockStream.h @@ -31,8 +31,8 @@ public: HashedBlockStream(QIODevice* baseDevice, qint32 blockSize); ~HashedBlockStream(); - bool reset() Q_DECL_OVERRIDE; - void close() Q_DECL_OVERRIDE; + bool reset() override; + void close() override; protected: qint64 readData(char* data, qint64 maxSize) override;