1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <sssettingswrapper.h> |
|
20 #include <rsssettings.h> |
|
21 #include "sssettingswrapper_p.h" |
|
22 #include "logging.h" |
|
23 |
|
24 /*! |
|
25 SsSettingsWrapper::SsSettingsWrapper |
|
26 */ |
|
27 SsSettingsWrapper::SsSettingsWrapper(QObject *parent): |
|
28 QObject(parent), m_Priv(new SsSettingsWrapperPrivate(*this)) |
|
29 { |
|
30 DPRINT << ": IN"; |
|
31 |
|
32 // Initialize RSSSettings |
|
33 m_ssSettings = new RSSSettings; |
|
34 int err = m_ssSettings->Open(); |
|
35 DPRINT << "err: " << err; |
|
36 // Register for notifications |
|
37 m_ssSettings->RegisterAll( *m_Priv ); |
|
38 |
|
39 DPRINT << ": OUT"; |
|
40 } |
|
41 |
|
42 /*! |
|
43 SsSettingsWrapper::~SsSettingsWrapper |
|
44 */ |
|
45 SsSettingsWrapper::~SsSettingsWrapper() |
|
46 { |
|
47 DPRINT << ": IN"; |
|
48 |
|
49 if(m_ssSettings){ |
|
50 m_ssSettings->Close(); |
|
51 } |
|
52 delete m_ssSettings; |
|
53 delete m_Priv; |
|
54 |
|
55 DPRINT << ": OUT"; |
|
56 } |
|
57 |
|
58 /*! |
|
59 SsSettingsWrapper::get |
|
60 */ |
|
61 int SsSettingsWrapper::get(SsSettingsWrapperSettings setting, int &value) |
|
62 { |
|
63 DPRINT << ": IN"; |
|
64 |
|
65 int err = m_ssSettings->Get(static_cast<TSSSettingsSetting>(setting), value); |
|
66 |
|
67 DPRINT << ": err: " << err; |
|
68 DPRINT << ": setting: " << setting; |
|
69 DPRINT << ": value: " << value; |
|
70 DPRINT << ": OUT" ; |
|
71 return err; |
|
72 } |
|
73 |
|
74 /*! |
|
75 SsSettingsWrapper::set |
|
76 */ |
|
77 int SsSettingsWrapper::set(SsSettingsWrapperSettings setting, int value) |
|
78 { |
|
79 DPRINT << ": IN"; |
|
80 |
|
81 int err = m_ssSettings->Set( static_cast<TSSSettingsSetting>(setting), value ); |
|
82 |
|
83 DPRINT << ": err: " << err; |
|
84 DPRINT << ": setting: " << setting; |
|
85 DPRINT << ": value: " << value; |
|
86 DPRINT << ": OUT" ; |
|
87 return err; |
|
88 } |
|
89 |
|
90 // End of File. |
|