|
1 /* |
|
2 * Copyright (c) 2010 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 #include "dialerwidgetengine.h" |
|
19 |
|
20 #include <logsdomaincrkeys.h> |
|
21 |
|
22 DialerWidgetEngine::DialerWidgetEngine(): |
|
23 m_missedCalls(-1) |
|
24 { |
|
25 } |
|
26 |
|
27 DialerWidgetEngine::~DialerWidgetEngine() |
|
28 { |
|
29 delete m_settingsManager; |
|
30 m_settingsManager = NULL; |
|
31 } |
|
32 |
|
33 bool DialerWidgetEngine::initialize() |
|
34 { |
|
35 #ifdef Q_OS_SYMBIAN |
|
36 m_settingsManager = new XQSettingsManager(this); |
|
37 if ( !m_settingsManager ){ |
|
38 return false; |
|
39 } |
|
40 XQSettingsKey settingsKey( XQSettingsKey::TargetCentralRepository, |
|
41 KCRUidLogs.iUid, KLogsNewMissedCalls ); |
|
42 |
|
43 if ( !connect( m_settingsManager, |
|
44 SIGNAL( valueChanged(const XQSettingsKey & ,const QVariant &)), |
|
45 this, SLOT(valueChanged(XQSettingsKey, |
|
46 QVariant)))){ |
|
47 return false; |
|
48 } |
|
49 |
|
50 if(!m_settingsManager->startMonitoring( settingsKey )){ |
|
51 return false; |
|
52 } |
|
53 |
|
54 #endif |
|
55 return true; |
|
56 } |
|
57 |
|
58 void DialerWidgetEngine::valueChanged( |
|
59 const XQSettingsKey &key, |
|
60 const QVariant &value ) |
|
61 { |
|
62 if ( key.key() == (quint32)KLogsNewMissedCalls ){ |
|
63 m_missedCalls = value.toInt(); |
|
64 emit missedCallsCountChanged( m_missedCalls ); |
|
65 } |
|
66 } |
|
67 |
|
68 int DialerWidgetEngine::missedCallsCount() |
|
69 { |
|
70 return m_missedCalls; |
|
71 } |