87
|
1 |
/*
|
85
|
2 |
* Copyright (c)2008 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: ?Description
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
86
|
18 |
#include <QDir>
|
|
19 |
#include <HbIcon>
|
|
20 |
|
85
|
21 |
|
|
22 |
#include "caobjectadapter.h"
|
|
23 |
#include "caentry.h"
|
|
24 |
#include "caicondescription.h"
|
86
|
25 |
#include <cadefs.h>
|
85
|
26 |
|
|
27 |
//----------------------------------------------------------------------------
|
|
28 |
//
|
|
29 |
//----------------------------------------------------------------------------
|
86
|
30 |
HbIcon CaObjectAdapter::makeIcon(const CaEntry &entry, const QSize &size)
|
85
|
31 |
{
|
86
|
32 |
HbIcon icon;
|
|
33 |
QString filename(entry.iconDescription().filename());
|
87
|
34 |
if (!filename.isEmpty()) {
|
86
|
35 |
icon = HbIcon(filename);
|
92
|
36 |
//icon.addBadge( Qt::AlignTop | Qt::AlignRight, HbIcon("qtg_small_hs_widget"));
|
85
|
37 |
}
|
86
|
38 |
if (icon.isNull() || !(icon.size().isValid())) {
|
92
|
39 |
icon = HbIcon("qtg_large_application");
|
85
|
40 |
}
|
|
41 |
return icon;
|
|
42 |
}
|
|
43 |
|
86
|
44 |
|
85
|
45 |
//----------------------------------------------------------------------------
|
|
46 |
//
|
|
47 |
//----------------------------------------------------------------------------
|
|
48 |
void CaObjectAdapter::setId(CaEntry &entry,
|
87
|
49 |
int id)
|
85
|
50 |
{
|
|
51 |
entry.setId(id);
|
|
52 |
}
|
|
53 |
|
|
54 |
//----------------------------------------------------------------------------
|
|
55 |
//
|
|
56 |
//----------------------------------------------------------------------------
|
|
57 |
void CaObjectAdapter::setId(CaIconDescription &iconDescription,
|
87
|
58 |
int id)
|
85
|
59 |
{
|
|
60 |
iconDescription.setId(id);
|
|
61 |
}
|
|
62 |
|
96
|
63 |
//----------------------------------------------------------------------------
|
|
64 |
//
|
|
65 |
//----------------------------------------------------------------------------
|
|
66 |
ErrorCode CaObjectAdapter::convertErrorCode(int internalErrorCode)
|
|
67 |
{
|
|
68 |
ErrorCode error(NoErrorCode);
|
|
69 |
switch (internalErrorCode) {
|
|
70 |
case 0:
|
|
71 |
error = NoErrorCode;
|
|
72 |
break;
|
|
73 |
default:
|
|
74 |
error = UnknownErrorCode;
|
|
75 |
break;
|
|
76 |
}
|
|
77 |
return error;
|
|
78 |
}
|
|
79 |
|