Skip to content
This repository has been archived by the owner on Nov 4, 2023. It is now read-only.

Commit

Permalink
Use empty qstring instead of nullptr
Browse files Browse the repository at this point in the history
  • Loading branch information
UniversalSuperBox committed Jan 21, 2021
1 parent 5bed8a1 commit ac69b16
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion plugins/Utils/windowstatestorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ WindowStateStorage::WindowStateStorage(const QString &dbName, QObject *parent):
{
qRegisterMetaType<WindowStateStorage::WindowState>("WindowStateStorage::WindowState");
QString dbFile;
if (dbName == nullptr) {
if (dbName.isEmpty()) {
const QString dbPath = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + QStringLiteral("/unity8/");
QDir dir;
dir.mkpath(dbPath);
Expand Down
2 changes: 1 addition & 1 deletion plugins/Utils/windowstatestorage.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class WindowStateStorage: public QObject
Q_DECLARE_FLAGS(WindowStates, WindowState)
Q_FLAG(WindowStates)

WindowStateStorage(const QString &dbName = nullptr, QObject *parent = nullptr);
WindowStateStorage(const QString &dbName = QString(), QObject *parent = nullptr);
virtual ~WindowStateStorage();

Q_INVOKABLE WindowState getState(const QString &windowId, WindowState defaultValue) const;
Expand Down
2 changes: 1 addition & 1 deletion tests/plugins/Utils/WindowStateStorageTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ private Q_SLOTS:
// copy the old database or risk the wrath of long-time users.
void testDbNameDefault() {
delete storage;
storage = new WindowStateStorage(nullptr, this);
storage = new WindowStateStorage(QString(), this);
QCOMPARE(storage->getDbName(), QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + QStringLiteral("/unity8/windowstatestorage.sqlite"));
}

Expand Down

0 comments on commit ac69b16

Please sign in to comment.