Use C++11 keywords directly.

This commit is contained in:
Felix Geyer 2015-10-11 10:47:30 +02:00
parent dc7b6623a9
commit 6e45cf0dab
9 changed files with 28 additions and 28 deletions

View File

@ -79,7 +79,7 @@ void AutoType::loadPlugin(const QString& pluginPath)
QObject* pluginInstance = m_pluginLoader->instance(); QObject* pluginInstance = m_pluginLoader->instance();
if (pluginInstance) { if (pluginInstance) {
m_plugin = qobject_cast<AutoTypePlatformInterface*>(pluginInstance); m_plugin = qobject_cast<AutoTypePlatformInterface*>(pluginInstance);
m_executor = Q_NULLPTR; m_executor = nullptr;
if (m_plugin) { if (m_plugin) {
if (m_plugin->isAvailable()) { if (m_plugin->isAvailable()) {

View File

@ -33,24 +33,24 @@ class AutoTypePlatformTest : public QObject,
Q_INTERFACES(AutoTypePlatformInterface AutoTypeTestInterface) Q_INTERFACES(AutoTypePlatformInterface AutoTypeTestInterface)
public: public:
QString keyToString(Qt::Key key) Q_DECL_OVERRIDE; QString keyToString(Qt::Key key) override;
bool isAvailable() Q_DECL_OVERRIDE; bool isAvailable() override;
QStringList windowTitles() Q_DECL_OVERRIDE; QStringList windowTitles() override;
WId activeWindow() Q_DECL_OVERRIDE; WId activeWindow() override;
QString activeWindowTitle() Q_DECL_OVERRIDE; QString activeWindowTitle() override;
bool registerGlobalShortcut(Qt::Key key, Qt::KeyboardModifiers modifiers) Q_DECL_OVERRIDE; bool registerGlobalShortcut(Qt::Key key, Qt::KeyboardModifiers modifiers) override;
void unregisterGlobalShortcut(Qt::Key key, Qt::KeyboardModifiers modifiers) Q_DECL_OVERRIDE; void unregisterGlobalShortcut(Qt::Key key, Qt::KeyboardModifiers modifiers) override;
int platformEventFilter(void* event) Q_DECL_OVERRIDE; int platformEventFilter(void* event) override;
int initialTimeout() Q_DECL_OVERRIDE; int initialTimeout() override;
bool raiseWindow(WId window) Q_DECL_OVERRIDE; bool raiseWindow(WId window) override;
AutoTypeExecutor* createExecutor() Q_DECL_OVERRIDE; AutoTypeExecutor* createExecutor() override;
void setActiveWindowTitle(const QString& title) Q_DECL_OVERRIDE; void setActiveWindowTitle(const QString& title) override;
QString actionChars() Q_DECL_OVERRIDE; QString actionChars() override;
int actionCount() Q_DECL_OVERRIDE; int actionCount() override;
void clearActions() Q_DECL_OVERRIDE; void clearActions() override;
void addActionChar(AutoTypeChar* action); void addActionChar(AutoTypeChar* action);
void addActionKey(AutoTypeKey* action); void addActionKey(AutoTypeKey* action);
@ -69,8 +69,8 @@ class AutoTypeExecturorTest : public AutoTypeExecutor
public: public:
explicit AutoTypeExecturorTest(AutoTypePlatformTest* platform); explicit AutoTypeExecturorTest(AutoTypePlatformTest* platform);
void execChar(AutoTypeChar* action) Q_DECL_OVERRIDE; void execChar(AutoTypeChar* action) override;
void execKey(AutoTypeKey* action) Q_DECL_OVERRIDE; void execKey(AutoTypeKey* action) override;
private: private:
AutoTypePlatformTest* const m_platform; AutoTypePlatformTest* const m_platform;

View File

@ -578,7 +578,7 @@ XkbDescPtr AutoTypePlatformX11::getKeyboard()
XID keyboard_id = XkbUseCoreKbd; XID keyboard_id = XkbUseCoreKbd;
XDeviceInfo* devices = XListInputDevices(m_dpy, &num_devices); XDeviceInfo* devices = XListInputDevices(m_dpy, &num_devices);
if (!devices) { if (!devices) {
return Q_NULLPTR; return nullptr;
} }
for (int i = 0; i < num_devices; i++) { for (int i = 0; i < num_devices; i++) {

View File

@ -124,8 +124,8 @@ class AutoTypeExecturorX11 : public AutoTypeExecutor
public: public:
explicit AutoTypeExecturorX11(AutoTypePlatformX11* platform); explicit AutoTypeExecturorX11(AutoTypePlatformX11* platform);
void execChar(AutoTypeChar* action) Q_DECL_OVERRIDE; void execChar(AutoTypeChar* action) override;
void execKey(AutoTypeKey* action) Q_DECL_OVERRIDE; void execKey(AutoTypeKey* action) override;
private: private:
AutoTypePlatformX11* const m_platform; AutoTypePlatformX11* const m_platform;

View File

@ -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" "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 " "This is a one-way migration. You won't be able to open the imported "
"database with the old KeePassX 0.4 version.")); "database with the old KeePassX 0.4 version."));
return Q_NULLPTR; return nullptr;
} }
else if (!ok || signature2 != KeePass2::SIGNATURE_2) { else if (!ok || signature2 != KeePass2::SIGNATURE_2) {
raiseError(tr("Not a KeePass database.")); raiseError(tr("Not a KeePass database."));

View File

@ -45,7 +45,7 @@ public:
Application::Application(int& argc, char** argv) Application::Application(int& argc, char** argv)
: QApplication(argc, argv) : QApplication(argc, argv)
, m_mainWindow(Q_NULLPTR) , m_mainWindow(nullptr)
{ {
#if defined(Q_OS_UNIX) && !defined(Q_OS_OSX) #if defined(Q_OS_UNIX) && !defined(Q_OS_OSX)
installNativeEventFilter(new XcbEventFilter()); installNativeEventFilter(new XcbEventFilter());

View File

@ -333,7 +333,7 @@ bool DatabaseTabWidget::saveDatabaseAs(Database* db)
} }
QString fileName = fileDialog()->getSaveFileName(this, tr("Save database as"), QString fileName = fileDialog()->getSaveFileName(this, tr("Save database as"),
oldFileName, tr("KeePass 2 Database").append(" (*.kdbx)"), oldFileName, tr("KeePass 2 Database").append(" (*.kdbx)"),
Q_NULLPTR, 0, "kdbx"); nullptr, 0, "kdbx");
if (!fileName.isEmpty()) { if (!fileName.isEmpty()) {
QFileInfo fileInfo(fileName); QFileInfo fileInfo(fileName);
QString lockFilePath; QString lockFilePath;
@ -454,7 +454,7 @@ void DatabaseTabWidget::exportToCsv()
QString fileName = fileDialog()->getSaveFileName(this, tr("Export database to CSV file"), QString fileName = fileDialog()->getSaveFileName(this, tr("Export database to CSV file"),
QString(), tr("CSV file").append(" (*.csv)"), QString(), tr("CSV file").append(" (*.csv)"),
Q_NULLPTR, 0, "csv"); nullptr, 0, "csv");
if (fileName.isEmpty()) { if (fileName.isEmpty()) {
return; return;
} }

View File

@ -47,7 +47,7 @@ private Q_SLOTS:
void modelReset(); void modelReset();
protected: protected:
void dragMoveEvent(QDragMoveEvent* event) Q_DECL_OVERRIDE; void dragMoveEvent(QDragMoveEvent* event) override;
private: private:
void recInitExpanded(Group* group); void recInitExpanded(Group* group);

View File

@ -31,8 +31,8 @@ public:
HashedBlockStream(QIODevice* baseDevice, qint32 blockSize); HashedBlockStream(QIODevice* baseDevice, qint32 blockSize);
~HashedBlockStream(); ~HashedBlockStream();
bool reset() Q_DECL_OVERRIDE; bool reset() override;
void close() Q_DECL_OVERRIDE; void close() override;
protected: protected:
qint64 readData(char* data, qint64 maxSize) override; qint64 readData(char* data, qint64 maxSize) override;