summaryrefslogtreecommitdiffstats
path: root/src/corelib/io
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@nokia.com>2010-09-10 12:06:59 (GMT)
committerLiang Qi <liang.qi@nokia.com>2010-09-10 12:06:59 (GMT)
commit7e05bf257d589e97e54b36cb112f96ae17cbd6f2 (patch)
treeb99804c8b6bf2b3176138e43371bceefa17bdc04 /src/corelib/io
parent60bfb40e3c398163fe17834c26cdf97579946cc2 (diff)
downloadQt-7e05bf257d589e97e54b36cb112f96ae17cbd6f2.zip
Qt-7e05bf257d589e97e54b36cb112f96ae17cbd6f2.tar.gz
Qt-7e05bf257d589e97e54b36cb112f96ae17cbd6f2.tar.bz2
Fix the bug for QSettings on Windows, to store qint32/quint32, qint64/quint64 in Windows registry.
Reviewed-by: Prasanth Ullattil Reviewed-by: Joerg Bornemann Task: QTBUT-13249 AutoTest: Included
Diffstat (limited to 'src/corelib/io')
-rw-r--r--src/corelib/io/qsettings_win.cpp24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/corelib/io/qsettings_win.cpp b/src/corelib/io/qsettings_win.cpp
index de96e06..b3fe734 100644
--- a/src/corelib/io/qsettings_win.cpp
+++ b/src/corelib/io/qsettings_win.cpp
@@ -535,6 +535,15 @@ bool QWinSettingsPrivate::readKey(HKEY parentHandle, const QString &rSubKey, QVa
break;
}
+ case REG_QWORD: {
+ Q_ASSERT(data.size() == sizeof(qint64));
+ qint64 i;
+ memcpy((char*)&i, data.constData(), sizeof(qint64));
+ if (value != 0)
+ *value = i;
+ break;
+ }
+
default:
qWarning("QSettings: Unknown data %d type in Windows registry", static_cast<int>(dataType));
if (value != 0)
@@ -683,10 +692,19 @@ void QWinSettingsPrivate::set(const QString &uKey, const QVariant &value)
break;
}
- case QVariant::Int: {
+ case QVariant::Int:
+ case QVariant::UInt: {
type = REG_DWORD;
- int i = value.toInt();
- regValueBuff = QByteArray((const char*)&i, sizeof(int));
+ qint32 i = value.toInt();
+ regValueBuff = QByteArray((const char*)&i, sizeof(qint32));
+ break;
+ }
+
+ case QVariant::LongLong:
+ case QVariant::ULongLong: {
+ type = REG_QWORD;
+ qint64 i = value.toLongLong();
+ regValueBuff = QByteArray((const char*)&i, sizeof(qint64));
break;
}