on xenial help sign in
Use empty qstring instead of nullptr
ac69b16Dalton Durst
plugins/Utils/windowstatestorage.cpp+1−1
@@ -275,7 +275,7 @@ WindowStateStorage::WindowStateStorage(const QString &dbName, QObject *parent):
275{
275{
276 qRegisterMetaType<WindowStateStorage::WindowState>("WindowStateStorage::WindowState");
276 qRegisterMetaType<WindowStateStorage::WindowState>("WindowStateStorage::WindowState");
277 QString dbFile;
277 QString dbFile;
278− if (dbName == nullptr) {
278+ if (dbName.isEmpty()) {
279 const QString dbPath = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + QStringLiteral("/unity8/");
279 const QString dbPath = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + QStringLiteral("/unity8/");
280 QDir dir;
280 QDir dir;
281 dir.mkpath(dbPath);
281 dir.mkpath(dbPath);
plugins/Utils/windowstatestorage.h+1−1
@@ -50,7 +50,7 @@ public:
50 Q_DECLARE_FLAGS(WindowStates, WindowState)
50 Q_DECLARE_FLAGS(WindowStates, WindowState)
51 Q_FLAG(WindowStates)
51 Q_FLAG(WindowStates)
52
52
53− WindowStateStorage(const QString &dbName = nullptr, QObject *parent = nullptr);
53+ WindowStateStorage(const QString &dbName = QString(), QObject *parent = nullptr);
54 virtual ~WindowStateStorage();
54 virtual ~WindowStateStorage();
55
55
56 Q_INVOKABLE WindowState getState(const QString &windowId, WindowState defaultValue) const;
56 Q_INVOKABLE WindowState getState(const QString &windowId, WindowState defaultValue) const;
tests/plugins/Utils/WindowStateStorageTest.cpp+1−1
@@ -46,7 +46,7 @@ private Q_SLOTS:
46 // copy the old database or risk the wrath of long-time users.
46 // copy the old database or risk the wrath of long-time users.
47 void testDbNameDefault() {
47 void testDbNameDefault() {
48 delete storage;
48 delete storage;
49− storage = new WindowStateStorage(nullptr, this);
49+ storage = new WindowStateStorage(QString(), this);
50 QCOMPARE(storage->getDbName(), QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + QStringLiteral("/unity8/windowstatestorage.sqlite"));
50 QCOMPARE(storage->getDbName(), QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + QStringLiteral("/unity8/windowstatestorage.sqlite"));
51 }
51 }
52
52