summaryrefslogtreecommitdiffstats
path: root/src/libs/installer/qsettingswrapper.cpp
diff options
context:
space:
mode:
authorkh1 <karsten.heimrich@digia.com>2014-06-06 12:59:45 +0200
committerKarsten Heimrich <karsten.heimrich@digia.com>2014-06-06 14:01:39 +0200
commit598901e70bc5bbba60055a2b867994a94494c759 (patch)
treeaf58fed4a08c31cb8446609826e9c856e7d5af8e /src/libs/installer/qsettingswrapper.cpp
parentb4cdc6c9e3ecdc4acbe1882ddd4a3888bb8f2d7c (diff)
Fix endless loop.
Caused by the fact that the settings wrapper did not support anything different then native format, we had to trick the wrapper into using its default QSettings object which in turn uses a QFile (which roundtrips to the admin server) to write the settings out (behind the scenes). The blocking appeared only on Linux cause there we try a native call fcntl(handle, F_SETLKW, &fl) to lock the file during sync, which blocks endless caused of the missing rights. The fix is to use the settings wrapper also for ini format, as both are supported (Ini and Native). Change-Id: I73131c4adf85ba175ba6af1e18acccc29451b14f Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Diffstat (limited to 'src/libs/installer/qsettingswrapper.cpp')
-rw-r--r--src/libs/installer/qsettingswrapper.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/libs/installer/qsettingswrapper.cpp b/src/libs/installer/qsettingswrapper.cpp
index b67ed931a..5ad34bbd3 100644
--- a/src/libs/installer/qsettingswrapper.cpp
+++ b/src/libs/installer/qsettingswrapper.cpp
@@ -53,8 +53,7 @@ class QSettingsWrapper::Private
{
public:
Private(const QString &organization, const QString &application)
- : m_native(true)
- , m_application(application)
+ : m_application(application)
, m_organization(organization)
, m_scope(QSettings::UserScope)
, m_format(QSettings::NativeFormat)
@@ -63,8 +62,7 @@ public:
}
Private(QSettings::Scope scope, const QString &organization, const QString &application)
- : m_native(true)
- , m_application(application)
+ : m_application(application)
, m_organization(organization)
, m_scope(scope)
, m_format(QSettings::NativeFormat)
@@ -74,8 +72,7 @@ public:
Private(QSettings::Format format, QSettings::Scope scope, const QString &organization,
const QString &application)
- : m_native(format == QSettings::NativeFormat)
- , m_application(application)
+ : m_application(application)
, m_organization(organization)
, m_scope(scope)
, m_format(format)
@@ -84,8 +81,7 @@ public:
}
Private(const QString &fileName, QSettings::Format format)
- : m_native(format == QSettings::NativeFormat)
- , m_filename(fileName)
+ : m_filename(fileName)
, settings(fileName, format)
{
m_format = format;
@@ -94,7 +90,6 @@ public:
m_organization = settings.organizationName();
}
- bool m_native;
QString m_filename;
QString m_application;
QString m_organization;
@@ -329,8 +324,10 @@ QVariant QSettingsWrapper::value(const QString &param1, const QVariant &param2)
bool QSettingsWrapper::createSocket() const
{
- if (!d->m_native)
- return false;
+ if ((d->m_format != QSettings::NativeFormat) && (d->m_format != QSettings::IniFormat)) {
+ Q_ASSERT_X(false, Q_FUNC_INFO, "Settings wrapper does not support any different format "
+ "then QSettingsWrapper::NativeFormat and QSettingsWrapper::IniFormat.");
+ }
return (const_cast<QSettingsWrapper *>(this))->connectToServer(QVariantList()
<< d->m_application << d->m_organization << d->m_scope << d->m_format << d->m_filename);
}