Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
VideoLAN
VLMC
Commits
a66442cf
Commit
a66442cf
authored
Feb 18, 2010
by
Hugo Beauzee-Luyssen
Browse files
Preferences: Create a SettingValue if the variable doesn't exist already.
This fixes issue #142
parent
edce3c85
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/Configuration/SettingsManager.cpp
View file @
a66442cf
...
@@ -81,9 +81,17 @@ SettingsManager::value( const QString &key,
...
@@ -81,9 +81,17 @@ SettingsManager::value( const QString &key,
{
{
QReadLocker
rl
(
&
m_rwLock
);
QReadLocker
rl
(
&
m_rwLock
);
if
(
(
type
==
XML
||
type
==
All
)
&&
m_xmlSettings
.
contains
(
key
)
)
if
(
(
type
==
XML
||
type
==
All
)
)
return
m_xmlSettings
.
value
(
key
)
->
get
();
{
else
if
(
(
type
==
QSett
||
type
==
All
)
)
if
(
m_xmlSettings
.
contains
(
key
)
)
return
m_xmlSettings
.
value
(
key
)
->
get
();
else
{
m_xmlSettings
.
insert
(
key
,
new
SettingValue
(
defaultValue
)
);
return
defaultValue
;
}
}
else
if
(
type
==
QSett
)
{
{
if
(
m_classicSettings
.
contains
(
key
)
)
if
(
m_classicSettings
.
contains
(
key
)
)
return
m_classicSettings
.
value
(
key
)
->
get
();
return
m_classicSettings
.
value
(
key
)
->
get
();
...
@@ -97,8 +105,6 @@ SettingsManager::value( const QString &key,
...
@@ -97,8 +105,6 @@ SettingsManager::value( const QString &key,
return
val
;
return
val
;
}
}
}
}
return
defaultValue
;
}
}
QHash
<
QString
,
QVariant
>
QHash
<
QString
,
QVariant
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment