diff -r e4c884866116 -r 6a40edd41841 logsui/logsapp/src/logsappsettings.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/logsui/logsapp/src/logsappsettings.cpp Mon Oct 04 00:17:41 2010 +0300 @@ -0,0 +1,95 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include "logsappsettings.h" +#include "logsdefs.h" +#include "logslogger.h" +#include "logsforegroundwatcher.h" +#include +#include +#include + +const int logsFakeExitDisabled = 0; + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +LogsAppSettings::LogsAppSettings(int &argc, char *argv[]) : + mFeaturePreloadedEnabled(isBootupStart(argc, argv)), + mFeatureFakeExitEnabledVal(-1) +{ + if ( mFeaturePreloadedEnabled ){ + LogsForegroundWatcher::ensureBackgroundStartup(); + } +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +LogsAppSettings::~LogsAppSettings() +{ +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +bool LogsAppSettings::logsFeaturePreloadingEnabled() +{ + return mFeaturePreloadedEnabled; +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +bool LogsAppSettings::logsFeatureFakeExitEnabled() +{ + if ( mFeatureFakeExitEnabledVal < 0 ){ + XQSettingsManager manager; + XQSettingsKey key(XQSettingsKey::TargetCentralRepository, + KCRUidLogs.iUid, + KLogsFakeExitEnabled); + QVariant value = manager.readItemValue( + key, XQSettingsManager::TypeInt); + if (!value.isNull()) { + mFeatureFakeExitEnabledVal = value.toInt(); + } + if ( mFeatureFakeExitEnabledVal < 0 ){ + mFeatureFakeExitEnabledVal = logsFakeExitDisabled; + } + } + return ( mFeatureFakeExitEnabledVal != logsFakeExitDisabled ); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +bool LogsAppSettings::isBootupStart(int &argc, char *argv[]) +{ + for (int i=0; i