mirror of
https://github.com/parchlinux/calamares.git
synced 2025-05-29 10:44:28 -04:00
[libcalamares] Introduce convenience for reading Locale map
This commit is contained in:
parent
4420120b55
commit
d80661211c
2 changed files with 19 additions and 0 deletions
|
@ -73,6 +73,19 @@ clearGS( Calamares::GlobalStorage& gs )
|
||||||
gs.remove( gsKey );
|
gs.remove( gsKey );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString
|
||||||
|
readGS( Calamares::GlobalStorage& gs, const QString& key )
|
||||||
|
{
|
||||||
|
if ( gs.contains( gsKey ) )
|
||||||
|
{
|
||||||
|
QVariantMap localeConf = gs.value( gsKey ).toMap();
|
||||||
|
if ( localeConf.contains( key ) )
|
||||||
|
{
|
||||||
|
return localeConf.value( key ).toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return QString();
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Locale
|
} // namespace Locale
|
||||||
} // namespace CalamaresUtils
|
} // namespace CalamaresUtils
|
||||||
|
|
|
@ -74,6 +74,12 @@ DLLEXPORT void removeGS( Calamares::GlobalStorage& gs, const QString& key );
|
||||||
*/
|
*/
|
||||||
DLLEXPORT void clearGS( Calamares::GlobalStorage& gs );
|
DLLEXPORT void clearGS( Calamares::GlobalStorage& gs );
|
||||||
|
|
||||||
|
/** @brief Gets a value from the *localeConf* map in @p gs
|
||||||
|
*
|
||||||
|
* If the key is not set (or doesn't exist), returns QString().
|
||||||
|
*/
|
||||||
|
DLLEXPORT QString readGS( Calamares::GlobalStorage& gs, const QString& key );
|
||||||
|
|
||||||
} // namespace Locale
|
} // namespace Locale
|
||||||
} // namespace CalamaresUtils
|
} // namespace CalamaresUtils
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue