119
|
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 |
#include "activitytsentry.h"
|
|
19 |
|
|
20 |
#include <fbs.h>
|
|
21 |
|
|
22 |
#include <QDateTime>
|
|
23 |
#include <QUrl>
|
|
24 |
|
|
25 |
#include "afactivities_global.h"
|
|
26 |
#include "afstorageglobals.h"
|
|
27 |
|
|
28 |
ActivityTsEntry::ActivityTsEntry(const QVariantHash &activityData) : mBitmap(0)
|
|
29 |
{
|
|
30 |
mData.insert("TaskTimestamp", activityData.value(ActivityTimestamp));
|
|
31 |
mData.insert("TaskUpdateTimestamp", QDateTime::currentDateTime());
|
|
32 |
mData.insert("TaskIsRunning", false);
|
|
33 |
mData.insert("TaskCanBeClosed", false);
|
|
34 |
mData.insert("TaskIsMandatory", 0);
|
|
35 |
|
|
36 |
{
|
|
37 |
QUrl uri;
|
|
38 |
uri.setScheme(Af::KActivityScheme);
|
|
39 |
uri.setHost(QString("%1").arg(activityData.value(ActivityApplicationKeyword).toUInt(), 8, 16, QChar('0')));
|
|
40 |
|
|
41 |
if (activityData.contains(ActivityActivityKeyword))
|
|
42 |
uri.addQueryItem(Af::KActivityUriNameKey, activityData.value(ActivityActivityKeyword).toString());
|
|
43 |
mData.insert("Uri", uri);
|
|
44 |
mData.insert("TaskId", qHash(uri.toString()));
|
|
45 |
}
|
|
46 |
|
|
47 |
mData.insert("TaskName", activityData.value(ActivityApplicationName));
|
|
48 |
mData.insert("TaskScreenshot", -1);
|
125
|
49 |
|
|
50 |
mData.insert(ActivityApplicationKeyword, activityData.value(ActivityApplicationKeyword));
|
|
51 |
mData.insert(ActivityActivityKeyword, activityData.value(ActivityActivityKeyword));
|
119
|
52 |
}
|
|
53 |
|
|
54 |
ActivityTsEntry::~ActivityTsEntry()
|
|
55 |
{
|
|
56 |
delete mBitmap;
|
|
57 |
}
|
|
58 |
|
|
59 |
void ActivityTsEntry::setThumbnail(const CFbsBitmap *bitmap)
|
|
60 |
{
|
|
61 |
mBitmap = bitmap;
|
|
62 |
mData.insert("TaskScreenshot", mBitmap->Handle());
|
|
63 |
mData.insert("TaskUpdateTimestamp", QDateTime::currentDateTime());
|
|
64 |
}
|
|
65 |
|
|
66 |
QVariantHash ActivityTsEntry::data() const
|
|
67 |
{
|
|
68 |
return mData;
|
|
69 |
}
|