aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2016-11-16 14:22:36 +0100
committerSimon Hausmann <simon.hausmann@qt.io>2016-11-29 10:10:27 +0000
commite579076bb36e6594003b2ade7f3d062944ef6f47 (patch)
tree1c00c8a02c638582d342504f3bebd45dbcd46be1 /src/imports
parent4e1463c20aa6ec52f23e1e5f6426b68edb2255f0 (diff)
Get rid of most QT_NO_FOO usages
Instead use QT_CONFIG(foo). This change actually detected a few mis-spelled macros and invalid usages. Change-Id: I06ac327098dd1a458e6bc379d637b8e2dac52f85 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/imports')
-rw-r--r--src/imports/folderlistmodel/fileinfothread.cpp16
-rw-r--r--src/imports/folderlistmodel/fileinfothread_p.h4
-rw-r--r--src/imports/folderlistmodel/plugin.cpp2
-rw-r--r--src/imports/localstorage/plugin.cpp6
4 files changed, 13 insertions, 15 deletions
diff --git a/src/imports/folderlistmodel/fileinfothread.cpp b/src/imports/folderlistmodel/fileinfothread.cpp
index 0b62935f87..d3e256bb7e 100644
--- a/src/imports/folderlistmodel/fileinfothread.cpp
+++ b/src/imports/folderlistmodel/fileinfothread.cpp
@@ -46,7 +46,7 @@
FileInfoThread::FileInfoThread(QObject *parent)
: QThread(parent),
abort(false),
-#ifndef QT_NO_FILESYSTEMWATCHER
+#if QT_CONFIG(filesystemwatcher)
watcher(0),
#endif
sortFlags(QDir::Name),
@@ -61,11 +61,11 @@ FileInfoThread::FileInfoThread(QObject *parent)
showOnlyReadable(false),
caseSensitive(true)
{
-#ifndef QT_NO_FILESYSTEMWATCHER
+#if QT_CONFIG(filesystemwatcher)
watcher = new QFileSystemWatcher(this);
connect(watcher, SIGNAL(directoryChanged(QString)), this, SLOT(dirChanged(QString)));
connect(watcher, SIGNAL(fileChanged(QString)), this, SLOT(updateFile(QString)));
-#endif // !QT_NO_FILESYSTEMWATCHER
+#endif // filesystemwatcher
}
FileInfoThread::~FileInfoThread()
@@ -80,7 +80,7 @@ FileInfoThread::~FileInfoThread()
void FileInfoThread::clear()
{
QMutexLocker locker(&mutex);
-#ifndef QT_NO_FILESYSTEMWATCHER
+#if QT_CONFIG(filesystemwatcher)
watcher->removePaths(watcher->files());
watcher->removePaths(watcher->directories());
#endif
@@ -89,7 +89,7 @@ void FileInfoThread::clear()
void FileInfoThread::removePath(const QString &path)
{
QMutexLocker locker(&mutex);
-#ifndef QT_NO_FILESYSTEMWATCHER
+#if QT_CONFIG(filesystemwatcher)
if (!path.startsWith(QLatin1Char(':')))
watcher->removePath(path);
#else
@@ -103,7 +103,7 @@ void FileInfoThread::setPath(const QString &path)
Q_ASSERT(!path.isEmpty());
QMutexLocker locker(&mutex);
-#ifndef QT_NO_FILESYSTEMWATCHER
+#if QT_CONFIG(filesystemwatcher)
if (!path.startsWith(QLatin1Char(':')))
watcher->addPath(path);
#endif
@@ -120,7 +120,7 @@ void FileInfoThread::setRootPath(const QString &path)
rootPath = path;
}
-#ifndef QT_NO_FILESYSTEMWATCHER
+#if QT_CONFIG(filesystemwatcher)
void FileInfoThread::dirChanged(const QString &directoryPath)
{
Q_UNUSED(directoryPath);
@@ -204,7 +204,7 @@ void FileInfoThread::setCaseSensitive(bool on)
condition.wakeAll();
}
-#ifndef QT_NO_FILESYSTEMWATCHER
+#if QT_CONFIG(filesystemwatcher)
void FileInfoThread::updateFile(const QString &path)
{
Q_UNUSED(path);
diff --git a/src/imports/folderlistmodel/fileinfothread_p.h b/src/imports/folderlistmodel/fileinfothread_p.h
index 8a154f264e..75da12a421 100644
--- a/src/imports/folderlistmodel/fileinfothread_p.h
+++ b/src/imports/folderlistmodel/fileinfothread_p.h
@@ -88,7 +88,7 @@ public:
void setCaseSensitive(bool on);
public Q_SLOTS:
-#ifndef QT_NO_FILESYSTEMWATCHER
+#if QT_CONFIG(filesystemwatcher)
void dirChanged(const QString &directoryPath);
void updateFile(const QString &path);
#endif
@@ -103,7 +103,7 @@ private:
QWaitCondition condition;
volatile bool abort;
-#ifndef QT_NO_FILESYSTEMWATCHER
+#if QT_CONFIG(filesystemwatcher)
QFileSystemWatcher *watcher;
#endif
QList<FileProperty> currentFileList;
diff --git a/src/imports/folderlistmodel/plugin.cpp b/src/imports/folderlistmodel/plugin.cpp
index affde1c3aa..ef719109bd 100644
--- a/src/imports/folderlistmodel/plugin.cpp
+++ b/src/imports/folderlistmodel/plugin.cpp
@@ -62,12 +62,10 @@ public:
void registerTypes(const char *uri) Q_DECL_OVERRIDE
{
Q_ASSERT(QLatin1String(uri) == QLatin1String("Qt.labs.folderlistmodel"));
-#ifndef QT_NO_DIRMODEL
qmlRegisterType<QQuickFolderListModel>(uri,1,0,"FolderListModel");
qmlRegisterType<QQuickFolderListModel>(uri,2,0,"FolderListModel");
qmlRegisterType<QQuickFolderListModel,1>(uri,2,1,"FolderListModel");
qmlRegisterType<QQuickFolderListModel,2>(uri,2,2,"FolderListModel");
-#endif
}
};
//![class decl]
diff --git a/src/imports/localstorage/plugin.cpp b/src/imports/localstorage/plugin.cpp
index bf70fd1050..cd6d37ea5a 100644
--- a/src/imports/localstorage/plugin.cpp
+++ b/src/imports/localstorage/plugin.cpp
@@ -449,7 +449,7 @@ static ReturnedValue qmlsqldatabase_changeVersion(CallContext *ctx)
if (ok) {
*w->d()->version = to_version;
-#ifndef QT_NO_SETTINGS
+#if QT_CONFIG(settings)
QSettings ini(qmlsqldatabase_databaseFile(db.connectionName(), scope.engine) + QLatin1String(".ini"), QSettings::IniFormat);
ini.setValue(QLatin1String("Version"), to_version);
#endif
@@ -700,7 +700,7 @@ public:
void QQuickLocalStorage::openDatabaseSync(QQmlV4Function *args)
{
-#ifndef QT_NO_SETTINGS
+#if QT_CONFIG(settings)
QV4::Scope scope(args->v4engine());
if (scope.engine->qmlEngine()->offlineStoragePath().isEmpty())
V4THROW_SQL2(SQLEXCEPTION_DATABASE_ERR, QQmlEngine::tr("SQL: can't create database, offline storage is disabled."));
@@ -770,7 +770,7 @@ void QQuickLocalStorage::openDatabaseSync(QQmlV4Function *args)
}
args->setReturnValue(db.asReturnedValue());
-#endif // QT_NO_SETTINGS
+#endif // settings
}
static QObject *module_api_factory(QQmlEngine *engine, QJSEngine *scriptEngine)