diff options
author | Daniel Teske <[email protected]> | 2011-10-06 13:12:22 +0200 |
---|---|---|
committer | Daniel Teske <[email protected]> | 2011-10-07 13:56:06 +0200 |
commit | d8ac419ef5a814f85cc8f5251d1522faaa54212e (patch) | |
tree | e2e5a1b9ec8c597364ba52ff867d3b87d44ef399 /src/plugins/vcsbase/vcsbaseclientsettings.cpp | |
parent | 368726d6f22520abe0162a3d50cee71bbe474f75 (diff) |
VcsBaseClientSetting, check the type before returning from the union
Change-Id: Ic40b88e1cf9b731509edc6636c1e0bdb5f053529
Reviewed-on: http://codereview.qt-project.org/6234
Reviewed-by: Daniel Teske <[email protected]>
Diffstat (limited to 'src/plugins/vcsbase/vcsbaseclientsettings.cpp')
-rw-r--r-- | src/plugins/vcsbase/vcsbaseclientsettings.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/vcsbase/vcsbaseclientsettings.cpp b/src/plugins/vcsbase/vcsbaseclientsettings.cpp index 42c810c76f2..0db56b8a4f4 100644 --- a/src/plugins/vcsbase/vcsbaseclientsettings.cpp +++ b/src/plugins/vcsbase/vcsbaseclientsettings.cpp @@ -282,21 +282,21 @@ bool *VCSBaseClientSettings::boolPointer(const QString &key) QString *VCSBaseClientSettings::stringPointer(const QString &key) { - if (hasKey(key)) + if (hasKey(key) && valueType(key) == QVariant::String) return d->m_valueHash[key].m_comp.strPtr; return 0; } int VCSBaseClientSettings::intValue(const QString &key, int defaultValue) const { - if (hasKey(key)) + if (hasKey(key) && valueType(key) == QVariant::Int) return d->m_valueHash[key].m_comp.intValue; return defaultValue; } bool VCSBaseClientSettings::boolValue(const QString &key, bool defaultValue) const { - if (hasKey(key)) + if (hasKey(key) && valueType(key) == QVariant::Bool) return d->m_valueHash[key].m_comp.boolValue; return defaultValue; } |