Make utl::ConfigManager::get* use direct C++ config access internally
But some of those functions' names may be more telling than their configuration property counterparts, so there may be merit in keeping those trivial wrapper functions around. Change-Id: Ibbf4965fcefd58649920fad964b4a8d2108deaca Reviewed-on: https://gerrit.libreoffice.org/72836 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
@@ -27,6 +27,7 @@
|
|||||||
#include <com/sun/star/uno/Reference.hxx>
|
#include <com/sun/star/uno/Reference.hxx>
|
||||||
#include <com/sun/star/uno/Sequence.hxx>
|
#include <com/sun/star/uno/Sequence.hxx>
|
||||||
#include <i18nlangtag/languagetag.hxx>
|
#include <i18nlangtag/languagetag.hxx>
|
||||||
|
#include <officecfg/Setup.hxx>
|
||||||
#include <rtl/instance.hxx>
|
#include <rtl/instance.hxx>
|
||||||
#include <rtl/ustring.hxx>
|
#include <rtl/ustring.hxx>
|
||||||
#include <sal/log.hxx>
|
#include <sal/log.hxx>
|
||||||
@@ -66,21 +67,6 @@ getConfigurationProvider() {
|
|||||||
return css::configuration::theDefaultProvider::get( comphelper::getProcessComponentContext() );
|
return css::configuration::theDefaultProvider::get( comphelper::getProcessComponentContext() );
|
||||||
}
|
}
|
||||||
|
|
||||||
OUString getConfigurationString(OUString const & module, OUString const & path)
|
|
||||||
{
|
|
||||||
css::uno::Sequence< css::uno::Any > args(1);
|
|
||||||
args[0] <<= css::beans::NamedValue(
|
|
||||||
"nodepath",
|
|
||||||
css::uno::makeAny(module));
|
|
||||||
return
|
|
||||||
css::uno::Reference< css::container::XHierarchicalNameAccess >(
|
|
||||||
getConfigurationProvider()->createInstanceWithArguments(
|
|
||||||
"com.sun.star.configuration.ConfigurationAccess",
|
|
||||||
args),
|
|
||||||
css::uno::UNO_QUERY_THROW)->
|
|
||||||
getByHierarchicalName(path).get< OUString >();
|
|
||||||
}
|
|
||||||
|
|
||||||
struct theConfigManager:
|
struct theConfigManager:
|
||||||
public rtl::Static< utl::ConfigManager, theConfigManager >
|
public rtl::Static< utl::ConfigManager, theConfigManager >
|
||||||
{};
|
{};
|
||||||
@@ -88,57 +74,39 @@ struct theConfigManager:
|
|||||||
}
|
}
|
||||||
|
|
||||||
OUString utl::ConfigManager::getAboutBoxProductVersion() {
|
OUString utl::ConfigManager::getAboutBoxProductVersion() {
|
||||||
return getConfigurationString(
|
return officecfg::Setup::Product::ooSetupVersionAboutBox::get();
|
||||||
"/org.openoffice.Setup",
|
|
||||||
"Product/ooSetupVersionAboutBox");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
OUString utl::ConfigManager::getAboutBoxProductVersionSuffix() {
|
OUString utl::ConfigManager::getAboutBoxProductVersionSuffix() {
|
||||||
return getConfigurationString(
|
return officecfg::Setup::Product::ooSetupVersionAboutBoxSuffix::get();
|
||||||
"/org.openoffice.Setup",
|
|
||||||
"Product/ooSetupVersionAboutBoxSuffix");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
OUString utl::ConfigManager::getDefaultCurrency() {
|
OUString utl::ConfigManager::getDefaultCurrency() {
|
||||||
return getConfigurationString(
|
return officecfg::Setup::L10N::ooSetupCurrency::get();
|
||||||
"/org.openoffice.Setup",
|
|
||||||
"L10N/ooSetupCurrency");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
OUString utl::ConfigManager::getUILocale() {
|
OUString utl::ConfigManager::getUILocale() {
|
||||||
return getConfigurationString(
|
return officecfg::Setup::L10N::ooLocale::get();
|
||||||
"/org.openoffice.Setup",
|
|
||||||
"L10N/ooLocale");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
OUString utl::ConfigManager::getWorkLocale() {
|
OUString utl::ConfigManager::getWorkLocale() {
|
||||||
return getConfigurationString(
|
return officecfg::Setup::L10N::ooSetupSystemLocale::get();
|
||||||
"/org.openoffice.Setup",
|
|
||||||
"L10N/ooSetupSystemLocale");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
OUString utl::ConfigManager::getProductExtension() {
|
OUString utl::ConfigManager::getProductExtension() {
|
||||||
return getConfigurationString(
|
return officecfg::Setup::Product::ooSetupExtension::get();
|
||||||
"/org.openoffice.Setup",
|
|
||||||
"Product/ooSetupExtension");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
OUString utl::ConfigManager::getProductName() {
|
OUString utl::ConfigManager::getProductName() {
|
||||||
return getConfigurationString(
|
return officecfg::Setup::Product::ooName::get();
|
||||||
"/org.openoffice.Setup",
|
|
||||||
"Product/ooName");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
OUString utl::ConfigManager::getProductVersion() {
|
OUString utl::ConfigManager::getProductVersion() {
|
||||||
return getConfigurationString(
|
return officecfg::Setup::Product::ooSetupVersion::get();
|
||||||
"/org.openoffice.Setup",
|
|
||||||
"Product/ooSetupVersion");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
OUString utl::ConfigManager::getVendor() {
|
OUString utl::ConfigManager::getVendor() {
|
||||||
return getConfigurationString(
|
return officecfg::Setup::Product::ooVendor::get();
|
||||||
"/org.openoffice.Setup",
|
|
||||||
"Product/ooVendor");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void utl::ConfigManager::storeConfigItems() {
|
void utl::ConfigManager::storeConfigItems() {
|
||||||
|
Reference in New Issue
Block a user