messagingapp/msgnotifications/msgnotifier/src/msgnotifier_p.cpp
author hgs
Tue, 05 Oct 2010 13:58:47 +0530
changeset 73 ecf6a73a9186
parent 62 fdbe8253b596
child 76 60a8a215b0ec
permissions -rw-r--r--
201039_03
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
23
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     1
/*
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     2
 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     3
 * All rights reserved.
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     4
 * This component and the accompanying materials are made available
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     5
 * under the terms of "Eclipse Public License v1.0"
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     6
 * which accompanies this distribution, and is available
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     7
 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     8
 *
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     9
 * Initial Contributors:
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    10
 * Nokia Corporation - initial contribution.
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    11
 *
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    12
 * Contributors:
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    13
 *
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    14
 * Description: Listen to conversation server events and parse the 
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    15
 * events. These parse infomation passed to notifications and indications.
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    16
 *
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    17
 */
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    18
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    19
// SYSTEM INCLUDES
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    20
#include <msvapi.h>
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    21
#include <ccsclientconversation.h>
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    22
#include <ccsrequesthandler.h>
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    23
#include <ccsconversationentry.h>
25
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
    24
#include <xqservicerequest.h>
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
    25
#include <QString>
37
hgs
parents: 25
diff changeset
    26
#include <w32std.h>
hgs
parents: 25
diff changeset
    27
#include <apgtask.h> 
hgs
parents: 25
diff changeset
    28
#include <XQSettingsManager>
51
3507212d340e 201031_02
hgs
parents: 48
diff changeset
    29
#include <xqaiwrequest.h>
3507212d340e 201031_02
hgs
parents: 48
diff changeset
    30
#include <xqappmgr.h>
37
hgs
parents: 25
diff changeset
    31
#include <xqpublishandsubscribeutils.h>
hgs
parents: 25
diff changeset
    32
#include <xqsystemtoneservice.h>
hgs
parents: 25
diff changeset
    33
#include <xqconversions.h>
51
3507212d340e 201031_02
hgs
parents: 48
diff changeset
    34
#include <QThreadPool>
62
fdbe8253b596 201035_03
hgs
parents: 51
diff changeset
    35
#include <ProfileEngineInternalCRKeys.h>
fdbe8253b596 201035_03
hgs
parents: 51
diff changeset
    36
#include <hwrmvibra.h>
23
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    37
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    38
//USER INCLUDES
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    39
#include "msgnotifier.h"
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    40
#include "msgnotifier_p.h"
25
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
    41
#include "msgstorehandler.h"
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
    42
#include "msginfodefs.h"
37
hgs
parents: 25
diff changeset
    43
#include "conversationidpsconsts.h"
hgs
parents: 25
diff changeset
    44
#include "debugtraces.h"
23
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    45
62
fdbe8253b596 201035_03
hgs
parents: 51
diff changeset
    46
const XQCentralRepositorySettingsKey silenceModeKey(KCRUidProfileEngine.iUid, KProEngSilenceMode);
fdbe8253b596 201035_03
hgs
parents: 51
diff changeset
    47
23
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    48
// ----------------------------------------------------------------------------
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    49
// MsgNotifierPrivate::MsgNotifierPrivate
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    50
// @see MsgNotifierPrivate.h
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    51
// ----------------------------------------------------------------------------
25
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
    52
MsgNotifierPrivate::MsgNotifierPrivate(MsgNotifier* MsgNotifier) :
37
hgs
parents: 25
diff changeset
    53
    q_ptr(MsgNotifier), mCvServer(NULL), iMsgStoreHandler(NULL),
hgs
parents: 25
diff changeset
    54
    mSettingsManager(NULL),mPSUtils(NULL)
23
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    55
{
25
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
    56
    QDEBUG_WRITE("MsgNotifierPrivate::MsgNotifierPrivate : Enter")
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
    57
48
4f501b74aeb1 201029_02
hgs
parents: 37
diff changeset
    58
    initL();
25
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
    59
    QDEBUG_WRITE("MsgNotifierPrivate::MsgNotifierPrivate : Exit")
23
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    60
}
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    61
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    62
// ----------------------------------------------------------------------------
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    63
// MsgNotifierPrivate::~MsgNotifierPrivate
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    64
// @see MsgNotifierPrivate.h
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    65
// ----------------------------------------------------------------------------
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    66
MsgNotifierPrivate::~MsgNotifierPrivate()
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    67
{
25
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
    68
    QDEBUG_WRITE("MsgNotifierPrivate::~MsgNotifierPrivate : Enter")
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
    69
    if (mCvServer) {
48
4f501b74aeb1 201029_02
hgs
parents: 37
diff changeset
    70
        TRAP_IGNORE(mCvServer->RemoveConversationListChangeEventL(this));
25
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
    71
        delete mCvServer;
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
    72
        mCvServer = NULL;
23
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    73
    }
25
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
    74
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
    75
    if (iMsgStoreHandler) {
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
    76
        delete iMsgStoreHandler;
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
    77
        iMsgStoreHandler = NULL;
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
    78
    }
37
hgs
parents: 25
diff changeset
    79
    
hgs
parents: 25
diff changeset
    80
    if(mPSUtils)
hgs
parents: 25
diff changeset
    81
        {
hgs
parents: 25
diff changeset
    82
        delete mPSUtils;
hgs
parents: 25
diff changeset
    83
        }
hgs
parents: 25
diff changeset
    84
    
hgs
parents: 25
diff changeset
    85
    if(mSettingsManager)
hgs
parents: 25
diff changeset
    86
        {
hgs
parents: 25
diff changeset
    87
        delete mSettingsManager;
hgs
parents: 25
diff changeset
    88
        }
hgs
parents: 25
diff changeset
    89
    
hgs
parents: 25
diff changeset
    90
    if(mSts)
hgs
parents: 25
diff changeset
    91
        {
hgs
parents: 25
diff changeset
    92
        delete mSts;
hgs
parents: 25
diff changeset
    93
        mSts = NULL;
hgs
parents: 25
diff changeset
    94
        }
hgs
parents: 25
diff changeset
    95
    
62
fdbe8253b596 201035_03
hgs
parents: 51
diff changeset
    96
    if(mVibra)
fdbe8253b596 201035_03
hgs
parents: 51
diff changeset
    97
        {
fdbe8253b596 201035_03
hgs
parents: 51
diff changeset
    98
        delete mVibra;
fdbe8253b596 201035_03
hgs
parents: 51
diff changeset
    99
        mVibra = NULL;
fdbe8253b596 201035_03
hgs
parents: 51
diff changeset
   100
        }
25
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   101
    QDEBUG_WRITE("MsgNotifierPrivate::~MsgNotifierPrivate : Exit")
23
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   102
}
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   103
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   104
// ----------------------------------------------------------------------------
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   105
// MsgNotifierPrivate::initL
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   106
// @see MsgNotifierPrivate.h
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   107
// ----------------------------------------------------------------------------
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   108
void MsgNotifierPrivate::initL()
25
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   109
{
23
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   110
    QDEBUG_WRITE("MsgNotifierPrivate::initL : Enter")
25
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   111
23
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   112
    mCvServer = CCSRequestHandler::NewL();
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   113
    mCvServer->RequestConversationListChangeEventL(this);
25
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   114
    iMsgStoreHandler = new MsgStoreHandler(this, mCvServer);
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   115
    updateUnreadIndications(true); 
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   116
    updateOutboxIndications();
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   117
48
4f501b74aeb1 201029_02
hgs
parents: 37
diff changeset
   118
    QT_TRYCATCH_LEAVING(mSettingsManager = new XQSettingsManager());
37
hgs
parents: 25
diff changeset
   119
    
hgs
parents: 25
diff changeset
   120
    // define property
48
4f501b74aeb1 201029_02
hgs
parents: 37
diff changeset
   121
    QT_TRYCATCH_LEAVING(mPSUtils = new XQPublishAndSubscribeUtils(*mSettingsManager));
4f501b74aeb1 201029_02
hgs
parents: 37
diff changeset
   122
    
37
hgs
parents: 25
diff changeset
   123
    XQPublishAndSubscribeSettingsKey convIdKey(
hgs
parents: 25
diff changeset
   124
            KMsgCVIdProperty, KMsgCVIdKey);
hgs
parents: 25
diff changeset
   125
    bool success = mPSUtils->defineProperty(convIdKey, 
hgs
parents: 25
diff changeset
   126
                            XQSettingsManager::TypeInt);
hgs
parents: 25
diff changeset
   127
    
hgs
parents: 25
diff changeset
   128
    QDEBUG_WRITE_FORMAT("MsgNotifierPrivate::initL "
hgs
parents: 25
diff changeset
   129
                        "property creation ret value",success)
hgs
parents: 25
diff changeset
   130
    
hgs
parents: 25
diff changeset
   131
    // write -1 initially 
hgs
parents: 25
diff changeset
   132
    success = mSettingsManager->writeItemValue(convIdKey,-1);
hgs
parents: 25
diff changeset
   133
    
hgs
parents: 25
diff changeset
   134
    QDEBUG_WRITE_FORMAT("MsgNotifierPrivate::initL "
hgs
parents: 25
diff changeset
   135
                           "writing ret value",success)
hgs
parents: 25
diff changeset
   136
    
48
4f501b74aeb1 201029_02
hgs
parents: 37
diff changeset
   137
    QT_TRYCATCH_LEAVING(mSts = new XQSystemToneService());
37
hgs
parents: 25
diff changeset
   138
    
62
fdbe8253b596 201035_03
hgs
parents: 51
diff changeset
   139
    mVibra = CHWRMVibra::NewL();
fdbe8253b596 201035_03
hgs
parents: 51
diff changeset
   140
    
23
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   141
    QDEBUG_WRITE("MsgNotifierPrivate::initL : Exit")
25
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   142
}
23
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   143
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   144
// ----------------------------------------------------------------------------
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   145
// MsgNotifierPrivate::AddConversationList
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   146
// @see MsgNotifierPrivate.h
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   147
// ----------------------------------------------------------------------------
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   148
void MsgNotifierPrivate::AddConversationList(
25
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   149
                  const CCsClientConversation& aClientConversation)
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   150
{
51
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   151
    QCRITICAL_WRITE("MsgNotifierPrivate::AddConversationList : Enter")
25
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   152
23
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   153
    processListEntry(aClientConversation);
25
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   154
    updateUnreadIndications();
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   155
51
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   156
    QCRITICAL_WRITE("MsgNotifierPrivate::AddConversationList : Exit")
25
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   157
}
23
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   158
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   159
// ----------------------------------------------------------------------------
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   160
// MsgNotifierPrivate::DeleteConversationList
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   161
// @see MsgNotifierPrivate.h
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   162
// ----------------------------------------------------------------------------
25
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   163
void MsgNotifierPrivate::DeleteConversationList( 
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   164
	                const CCsClientConversation& /*aClientConversation*/)
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   165
{
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   166
    QDEBUG_WRITE("MsgNotifierPrivate::DeleteConversationList : Enter")
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   167
    updateUnreadIndications();
23
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   168
    QDEBUG_WRITE("MsgNotifierPrivate::DeleteConversationList : Exit")
25
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   169
}
23
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   170
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   171
// ----------------------------------------------------------------------------
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   172
// MsgNotifierPrivate::ModifyConversationList
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   173
// @see MsgNotifierPrivate.h
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   174
// ----------------------------------------------------------------------------
25
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   175
void MsgNotifierPrivate::ModifyConversationList(const CCsClientConversation& aClientConversation)
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   176
{
51
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   177
    QCRITICAL_WRITE("MsgNotifierPrivate::ModifyConversationList : Enter")
25
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   178
23
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   179
    processListEntry(aClientConversation);
25
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   180
    updateUnreadIndications();
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   181
51
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   182
    QCRITICAL_WRITE("MsgNotifierPrivate::ModifyConversationList : Exit")
25
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   183
}
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   184
23
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   185
// ----------------------------------------------------------------------------
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   186
// MsgNotifierPrivate::RefreshConversationList
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   187
// @see MsgNotifierPrivate.h
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   188
// ----------------------------------------------------------------------------
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   189
void MsgNotifierPrivate::RefreshConversationList()
25
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   190
{
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   191
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   192
}
23
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   193
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   194
// ----------------------------------------------------------------------------
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   195
// MsgNotifierPrivate::processListEntry
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   196
// @see MsgNotifierPrivate.h
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   197
// ----------------------------------------------------------------------------
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   198
void MsgNotifierPrivate::processListEntry(
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   199
        const CCsClientConversation& aClientConversation)
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   200
    {
51
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   201
    QCRITICAL_WRITE("MsgNotifierPrivate::processListEntry : Enter")
23
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   202
    
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   203
    CCsConversationEntry* convEntry = 
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   204
                                 aClientConversation.GetConversationEntry();
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   205
    
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   206
    QDEBUG_WRITE_FORMAT("MsgNotifierPrivate::processListEntry Direction",
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   207
                                                convEntry->ConversationDir())
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   208
    QDEBUG_WRITE_FORMAT("MsgNotifierPrivate::processListEntry New Entry Attribute",
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   209
                                                convEntry->IsAttributeSet(ECsAttributeNewEntryAdded))
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   210
    QDEBUG_WRITE_FORMAT("MsgNotifierPrivate::processListEntry Unread Attribute",
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   211
                                                convEntry->IsAttributeSet(ECsAttributeUnread))
25
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   212
   
23
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   213
    if((convEntry->ConversationDir() == ECsDirectionIncoming)
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   214
            && convEntry->IsAttributeSet(ECsAttributeNewEntryAdded) 
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   215
            && convEntry->IsAttributeSet(ECsAttributeUnread))
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   216
        {
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   217
        QDEBUG_WRITE("processListEntry : Processing data for Notification")
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   218
        
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   219
        NotificationData notifData;
25
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   220
        notifData.msvEntryId = convEntry->EntryId(); 
23
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   221
        notifData.mConversationId = aClientConversation.GetConversationEntryId();
25
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   222
        notifData.mMsgType = static_cast<int>(convEntry->GetType());
23
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   223
        
25
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   224
        HBufC* displayName = aClientConversation.GetDisplayName();
23
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   225
        HBufC* number =  convEntry->Contact();
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   226
        HBufC* descrp =  convEntry->Description();
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   227
        
25
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   228
        if(displayName)
23
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   229
            {
25
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   230
            notifData.mDisplayName = 
37
hgs
parents: 25
diff changeset
   231
                                XQConversions::s60DescToQString(*displayName);
25
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   232
            }        
23
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   233
        if(number)
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   234
            {
37
hgs
parents: 25
diff changeset
   235
            notifData.mContactNum =  XQConversions::s60DescToQString(*number);
23
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   236
            }
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   237
        if(descrp)
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   238
            {
37
hgs
parents: 25
diff changeset
   239
            notifData.mDescription = XQConversions::s60DescToQString(*descrp);
23
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   240
            }
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   241
        
62
fdbe8253b596 201035_03
hgs
parents: 51
diff changeset
   242
        QVariant silenceMode = mSettingsManager->readItemValue(silenceModeKey, XQSettingsManager::TypeInt);
fdbe8253b596 201035_03
hgs
parents: 51
diff changeset
   243
        int silent = silenceMode.toInt();
fdbe8253b596 201035_03
hgs
parents: 51
diff changeset
   244
        if(silent < 1)
fdbe8253b596 201035_03
hgs
parents: 51
diff changeset
   245
            {
fdbe8253b596 201035_03
hgs
parents: 51
diff changeset
   246
            //Play new message alert tone.
fdbe8253b596 201035_03
hgs
parents: 51
diff changeset
   247
            mSts->playTone(XQSystemToneService::SmsAlertTone);
fdbe8253b596 201035_03
hgs
parents: 51
diff changeset
   248
            }
fdbe8253b596 201035_03
hgs
parents: 51
diff changeset
   249
        // Execute the vibra effect.
fdbe8253b596 201035_03
hgs
parents: 51
diff changeset
   250
        if (mVibra) 
fdbe8253b596 201035_03
hgs
parents: 51
diff changeset
   251
            {
fdbe8253b596 201035_03
hgs
parents: 51
diff changeset
   252
            TInt err = KErrNone;
fdbe8253b596 201035_03
hgs
parents: 51
diff changeset
   253
            TRAP(err,mVibra->StartVibraL(1000));
fdbe8253b596 201035_03
hgs
parents: 51
diff changeset
   254
            }
23
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   255
        
37
hgs
parents: 25
diff changeset
   256
        // check whether opened cv id and received 
hgs
parents: 25
diff changeset
   257
        // cv id are same and show notification
hgs
parents: 25
diff changeset
   258
        if( showNotification(notifData.mConversationId ))
hgs
parents: 25
diff changeset
   259
            {
hgs
parents: 25
diff changeset
   260
             q_ptr->displayNewMessageNotification(notifData);
hgs
parents: 25
diff changeset
   261
             QDEBUG_WRITE("processListEntry : Notification display called")
hgs
parents: 25
diff changeset
   262
            }
hgs
parents: 25
diff changeset
   263
       
23
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   264
        }
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   265
    
51
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   266
    QCRITICAL_WRITE("MsgNotifierPrivate::processListEntry : Exit")
23
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   267
    }
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   268
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   269
// ----------------------------------------------------------------------------
25
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   270
// MsgNotifierPrivate::updateUnreadIndications
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   271
// @see MsgNotifierPrivate.h
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   272
// ----------------------------------------------------------------------------
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   273
void MsgNotifierPrivate::updateUnreadIndications(bool bootup)
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   274
{
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   275
    QDEBUG_WRITE("MsgNotifierPrivate::updateIndicationsL : Enter")
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   276
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   277
    int unreadCount(0);
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   278
   if(bootup)
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   279
   {
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   280
       TRAP_IGNORE(unreadCount = iMsgStoreHandler->GetUnreadMessageCountL());
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   281
   }
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   282
   else
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   283
   {
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   284
       TRAP_IGNORE(unreadCount = mCvServer->GetTotalUnreadCountL());
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   285
   }
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   286
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   287
    QDEBUG_WRITE_FORMAT("MsgNotifierPrivate::"
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   288
        "updateIndications unreadCount = ",unreadCount );
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   289
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   290
    //activate or deactivate indications based on unread count
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   291
    q_ptr->updateUnreadIndications(unreadCount);
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   292
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   293
    QDEBUG_WRITE("MsgNotifierPrivate::updateIndicationsL : Exit")
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   294
}
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   295
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   296
// ----------------------------------------------------------------------------
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   297
// MsgNotifierPrivate::updateOutboxIndications
23
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   298
// @see MsgNotifierPrivate.h
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   299
// ----------------------------------------------------------------------------
25
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   300
void MsgNotifierPrivate::updateOutboxIndications()
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   301
{
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   302
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   303
    MsgInfo failedIndicatorData;
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   304
    MsgInfo pendingIndicatorData;
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   305
    TInt err = KErrNone;
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   306
    
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   307
    TRAP(err, iMsgStoreHandler->GetOutboxEntriesL(failedIndicatorData,pendingIndicatorData));
23
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   308
25
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   309
    q_ptr->updateOutboxIndications(failedIndicatorData);
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   310
    q_ptr->updateOutboxIndications(pendingIndicatorData);
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   311
}
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   312
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   313
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   314
// ----------------------------------------------------------------------------
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   315
// MsgNotifierPrivate::displayOutboxIndications
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   316
// @see MsgNotifierPrivate.h
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   317
// ----------------------------------------------------------------------------
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   318
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   319
void MsgNotifierPrivate::displayOutboxIndications(MsgInfo data)
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   320
	{
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   321
		q_ptr->updateOutboxIndications(data);
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   322
	}
23
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   323
25
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   324
// ----------------------------------------------------------------------------
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   325
// MsgNotifierPrivate::displayFailedNote
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   326
// @see MsgNotifierPrivate.h
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   327
// ----------------------------------------------------------------------------
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   328
void MsgNotifierPrivate::displayFailedNote(MsgInfo info)
37
hgs
parents: 25
diff changeset
   329
    {
hgs
parents: 25
diff changeset
   330
    QDEBUG_WRITE("MsgNotifierPrivate::displayFailedNote start.")
hgs
parents: 25
diff changeset
   331
            
hgs
parents: 25
diff changeset
   332
    // check whether opened cv id and received 
hgs
parents: 25
diff changeset
   333
    // cv id are same then dont show failed note
hgs
parents: 25
diff changeset
   334
    if (!showNotification(info.mConversationId))
hgs
parents: 25
diff changeset
   335
        {
hgs
parents: 25
diff changeset
   336
        return;
hgs
parents: 25
diff changeset
   337
        }
23
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   338
37
hgs
parents: 25
diff changeset
   339
    //Even if name string is empty we shall add name into args
hgs
parents: 25
diff changeset
   340
    QString nameString;
hgs
parents: 25
diff changeset
   341
25
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   342
    info.mDisplayName.removeDuplicates();
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   343
    info.mDisplayName.sort();
37
hgs
parents: 25
diff changeset
   344
25
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   345
    nameString.append(info.mDisplayName.at(0));
37
hgs
parents: 25
diff changeset
   346
    for (int i = 1; i < info.mDisplayName.count(); ++i)
hgs
parents: 25
diff changeset
   347
        {
25
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   348
        nameString.append(", ");
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   349
        nameString.append(info.mDisplayName.at(i));
37
hgs
parents: 25
diff changeset
   350
        }
23
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   351
37
hgs
parents: 25
diff changeset
   352
    // create request arguments
hgs
parents: 25
diff changeset
   353
    QVariantList args;
hgs
parents: 25
diff changeset
   354
    args << QVariant(nameString);
25
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   355
    args << info.mConversationId;
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   356
    args << info.mMessageType;
37
hgs
parents: 25
diff changeset
   357
hgs
parents: 25
diff changeset
   358
    // TODO: use XQAiwRequest
hgs
parents: 25
diff changeset
   359
    XQServiceRequest snd("messaging.com.nokia.symbian.MsgErrorNotifier",
hgs
parents: 25
diff changeset
   360
            "displayErrorNote(QVariantList)", false);
hgs
parents: 25
diff changeset
   361
25
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   362
    snd << args;
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   363
    snd.send();
37
hgs
parents: 25
diff changeset
   364
    
hgs
parents: 25
diff changeset
   365
    QDEBUG_WRITE("MsgNotifierPrivate::displayFailedNote end.")
hgs
parents: 25
diff changeset
   366
    }
hgs
parents: 25
diff changeset
   367
hgs
parents: 25
diff changeset
   368
// ----------------------------------------------------------------------------
hgs
parents: 25
diff changeset
   369
// MsgNotifierPrivate::showNotification
hgs
parents: 25
diff changeset
   370
// @see MsgNotifierPrivate.h
hgs
parents: 25
diff changeset
   371
// ----------------------------------------------------------------------------
hgs
parents: 25
diff changeset
   372
bool MsgNotifierPrivate::showNotification(int receivedMsgConvId)
hgs
parents: 25
diff changeset
   373
{
73
ecf6a73a9186 201039_03
hgs
parents: 62
diff changeset
   374
    bool showNotification = false;
37
hgs
parents: 25
diff changeset
   375
    
hgs
parents: 25
diff changeset
   376
    RWsSession wsSession ;
73
ecf6a73a9186 201039_03
hgs
parents: 62
diff changeset
   377
    int err = wsSession.Connect();
37
hgs
parents: 25
diff changeset
   378
73
ecf6a73a9186 201039_03
hgs
parents: 62
diff changeset
   379
    if ( KErrNone == err )
37
hgs
parents: 25
diff changeset
   380
        {
73
ecf6a73a9186 201039_03
hgs
parents: 62
diff changeset
   381
        showNotification = true;
ecf6a73a9186 201039_03
hgs
parents: 62
diff changeset
   382
        TApaTaskList taskList(wsSession);
ecf6a73a9186 201039_03
hgs
parents: 62
diff changeset
   383
        TApaTask task = taskList.FindApp(KMsgAppUid); // find msgapp is running
ecf6a73a9186 201039_03
hgs
parents: 62
diff changeset
   384
ecf6a73a9186 201039_03
hgs
parents: 62
diff changeset
   385
        if (task.Exists())
37
hgs
parents: 25
diff changeset
   386
            {
73
ecf6a73a9186 201039_03
hgs
parents: 62
diff changeset
   387
            TApaTask foregndtask = taskList.FindByPos(0); // foreground app
ecf6a73a9186 201039_03
hgs
parents: 62
diff changeset
   388
            // compare  window group id  
ecf6a73a9186 201039_03
hgs
parents: 62
diff changeset
   389
            // if application is in foregorund, then check the currently
ecf6a73a9186 201039_03
hgs
parents: 62
diff changeset
   390
            // opened conversation is same as received one.
ecf6a73a9186 201039_03
hgs
parents: 62
diff changeset
   391
            if (task.WgId() == foregndtask.WgId())
ecf6a73a9186 201039_03
hgs
parents: 62
diff changeset
   392
                {
ecf6a73a9186 201039_03
hgs
parents: 62
diff changeset
   393
                // get the current conversation ID
ecf6a73a9186 201039_03
hgs
parents: 62
diff changeset
   394
                XQPublishAndSubscribeSettingsKey convIdKey(KMsgCVIdProperty,
ecf6a73a9186 201039_03
hgs
parents: 62
diff changeset
   395
                        KMsgCVIdKey);
ecf6a73a9186 201039_03
hgs
parents: 62
diff changeset
   396
                QVariant value = mSettingsManager->readItemValue(convIdKey,
ecf6a73a9186 201039_03
hgs
parents: 62
diff changeset
   397
                        XQSettingsManager::TypeInt);
37
hgs
parents: 25
diff changeset
   398
73
ecf6a73a9186 201039_03
hgs
parents: 62
diff changeset
   399
                int openedConvId = value.toInt();
ecf6a73a9186 201039_03
hgs
parents: 62
diff changeset
   400
                if (openedConvId == receivedMsgConvId)
ecf6a73a9186 201039_03
hgs
parents: 62
diff changeset
   401
                    {
ecf6a73a9186 201039_03
hgs
parents: 62
diff changeset
   402
                    showNotification = false;
ecf6a73a9186 201039_03
hgs
parents: 62
diff changeset
   403
                    QDEBUG_WRITE("processListEntry : Notification not shown")
ecf6a73a9186 201039_03
hgs
parents: 62
diff changeset
   404
                    }
37
hgs
parents: 25
diff changeset
   405
                }
hgs
parents: 25
diff changeset
   406
            }
73
ecf6a73a9186 201039_03
hgs
parents: 62
diff changeset
   407
ecf6a73a9186 201039_03
hgs
parents: 62
diff changeset
   408
        wsSession.Close();
37
hgs
parents: 25
diff changeset
   409
        }
hgs
parents: 25
diff changeset
   410
    return showNotification;
25
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   411
}
37
hgs
parents: 25
diff changeset
   412
// ----------------------------------------------------------------------------
hgs
parents: 25
diff changeset
   413
// MsgNotifierPrivate::PartialDeleteConversationList
hgs
parents: 25
diff changeset
   414
// @see mcsconversationclientchangeobserver.h
hgs
parents: 25
diff changeset
   415
// ----------------------------------------------------------------------------
hgs
parents: 25
diff changeset
   416
void MsgNotifierPrivate::PartialDeleteConversationList(
51
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   417
        const CCsClientConversation& /*aClientConversation*/){/*empty implementation*/}
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   418
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   419
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   420
// ----------------------------------------------------------------------------
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   421
// MsgNotifierPrivate::ShowClass0Message
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   422
// @see msgnotifier_p.h
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   423
// ----------------------------------------------------------------------------
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   424
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   425
void MsgNotifierPrivate::ShowClass0Message(Class0Info& class0Info)
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   426
{
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   427
    QCRITICAL_WRITE("flashmsgnotifier BEGIN");
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   428
    QThreadPool::globalInstance()->start(new Class0SmsServiceTask(class0Info));
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   429
    QCRITICAL_WRITE("flashmsgnotifier END");
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   430
}
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   431
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   432
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   433
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   434
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   435
// ----------------------------------------------------------------------------
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   436
// Class0SmsServiceTask::Class0SmsServiceTask
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   437
// @see msgnotifier_p.h
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   438
// ----------------------------------------------------------------------------  
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   439
Class0SmsServiceTask::Class0SmsServiceTask(Class0Info& class0Info):
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   440
mClass0info(class0Info)
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   441
     {     
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   442
     }
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   443
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   444
// ----------------------------------------------------------------------------
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   445
// Class0SmsServiceTask::~Class0SmsServiceTask
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   446
// @see msgnotifier_p.h
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   447
// ----------------------------------------------------------------------------   
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   448
Class0SmsServiceTask::~Class0SmsServiceTask()
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   449
     {     
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   450
     }
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   451
     
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   452
// ----------------------------------------------------------------------------
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   453
// Class0SmsServiceTask::run
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   454
// @see msgnotifier_p.h
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   455
// ----------------------------------------------------------------------------   
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   456
void Class0SmsServiceTask::run()
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   457
     {
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   458
   	  QList<QVariant> args;
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   459
      QString serviceName("flashmsgnotifier");
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   460
      QString interfaceName("com.nokia.symbian.IFlashMsgNotifier");
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   461
      QString operation("displayFlashMsg(QByteArray)");
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   462
      XQAiwRequest* request;
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   463
      XQApplicationManager appManager;
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   464
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   465
      request = appManager.create(interfaceName, operation, false); //non-embedded
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   466
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   467
      if ( request == NULL )
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   468
      {
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   469
          QCRITICAL_WRITE("flashmsgnotifier request == NULL");
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   470
          return; 
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   471
      }
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   472
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   473
      QByteArray ba; 
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   474
      QDataStream stream(&ba, QIODevice::ReadWrite);
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   475
      stream << mClass0info.body;
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   476
      stream << mClass0info.address;
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   477
      stream << mClass0info.alias;
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   478
      stream << mClass0info.time;     
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   479
      stream << mClass0info.messageId;
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   480
       
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   481
      args << ba;
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   482
      request->setArguments(args);    
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   483
       
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   484
      if(!request->send())
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   485
      {
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   486
         QString lastErr;
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   487
          lastErr = request->lastErrorMessage();
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   488
          QDEBUG_WRITE_FORMAT("flashmsgnotifier launch failed", lastErr);
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   489
      }
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   490
       
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   491
      QCRITICAL_WRITE("flashmsgnotifier END");
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   492
      delete request;  
3507212d340e 201031_02
hgs
parents: 48
diff changeset
   493
     }
25
84d9eb65b26f Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   494
23
238255e8b033 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   495
//EOF