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();
if (pluginInstance) {
m_plugin = qobject_cast<AutoTypePlatformInterface*>(pluginInstance);
m_executor = Q_NULLPTR;
m_executor = nullptr;
if (m_plugin) {
if (m_plugin->isAvailable()) {

View File

@ -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;

View File

@ -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++) {

View File

@ -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;

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"
"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."));

View File

@ -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());

View File

@ -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;
}

View File

@ -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);

View File

@ -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;