summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--backend/backend.pri3
-rw-r--r--backend/win32/win32.pri8
-rw-r--r--backend/win32/win32settings.cpp89
-rw-r--r--backend/win32/win32settings.h67
-rw-r--r--src/settings.cpp14
5 files changed, 176 insertions, 5 deletions
diff --git a/backend/backend.pri b/backend/backend.pri
index 324981c..14aa4db 100644
--- a/backend/backend.pri
+++ b/backend/backend.pri
@@ -1,3 +1,4 @@
-mac:include(cocoa/cocoa.pri)
+win32:include(win32/win32.pri)
+else:mac:include(cocoa/cocoa.pri)
else:unix:include(dconf/dconf.pri)
else:error(Not implemented for $$first(QMAKE_PLATFORM))
diff --git a/backend/win32/win32.pri b/backend/win32/win32.pri
new file mode 100644
index 0000000..0c1301b
--- /dev/null
+++ b/backend/win32/win32.pri
@@ -0,0 +1,8 @@
+INCLUDEPATH += $$PWD
+DEPENDPATH += $$PWD
+
+SOURCES += \
+ $$PWD/win32settings.cpp
+
+HEADERS += \
+ $$PWD/win32settings.h
diff --git a/backend/win32/win32settings.cpp b/backend/win32/win32settings.cpp
new file mode 100644
index 0000000..882ab1c
--- /dev/null
+++ b/backend/win32/win32settings.cpp
@@ -0,0 +1,89 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is prototype code for the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "win32settings.h"
+
+Win32Settings::Win32Settings(QObject *parent) : Settings(parent)
+{
+}
+
+Win32Settings::~Win32Settings()
+{
+}
+
+void Win32Settings::remove(const QString &key)
+{
+}
+
+void Win32Settings::set(const QString &key, const QVariant &value)
+{
+}
+
+bool Win32Settings::get(const QString &key, QVariant *value) const
+{
+ return false;
+}
+
+QStringList Win32Settings::children(const QString &prefix, ChildSpec spec) const
+{
+ return QStringList();
+}
+
+void Win32Settings::clear()
+{
+}
+
+void Win32Settings::sync()
+{
+}
+
+void Win32Settings::flush()
+{
+}
+
+bool Win32Settings::isWritable() const
+{
+ return false;
+}
+
+QString Win32Settings::fileName() const
+{
+ return QString();
+}
diff --git a/backend/win32/win32settings.h b/backend/win32/win32settings.h
new file mode 100644
index 0000000..2da4066
--- /dev/null
+++ b/backend/win32/win32settings.h
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is prototype code for the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef WIN32SETTINGS_H
+#define WIN32SETTINGS_H
+
+#include "settings.h"
+
+class Win32Settings : public Settings
+{
+ Q_OBJECT
+
+public:
+ explicit Win32Settings(QObject *parent = 0);
+ ~Win32Settings();
+
+ void remove(const QString &key);
+ void set(const QString &key, const QVariant &value);
+ bool get(const QString &key, QVariant *value) const;
+
+ QStringList children(const QString &prefix, ChildSpec spec) const;
+
+ void clear();
+ void sync();
+ void flush();
+ bool isWritable() const;
+ QString fileName() const;
+};
+
+#endif // WIN32SETTINGS_H
diff --git a/src/settings.cpp b/src/settings.cpp
index 7505e28..330afc1 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -39,10 +39,14 @@
**
****************************************************************************/
#include "settings.h"
-#ifdef Q_OS_MAC
+#if defined(Q_OS_WIN)
+#include "win32settings.h"
+#elif defined(Q_OS_MAC)
#include "cocoasettings.h"
-#else
+#elif defined(Q_OS_UNIX)
#include "dconfsettings.h"
+#else
+#error Unsupported platform.
#endif
Settings::Settings(QObject *parent) : QObject(parent)
@@ -55,9 +59,11 @@ Settings::~Settings()
Settings* Settings::create(QObject *parent)
{
-#ifdef Q_OS_MAC
+#if defined(Q_OS_WIN)
+ return new Win32Settings(parent);
+#elif defined(Q_OS_MAC)
return new CocoaSettings(parent);
-#else
+#elif defined(Q_OS_UNIX)
return new DConfSettings(parent);
#endif
}