85
|
1 |
/*
|
|
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());
|
|
34 |
if(!filename.isEmpty()) {
|
|
35 |
icon = HbIcon(filename);
|
85
|
36 |
}
|
86
|
37 |
if (icon.isNull() || !(icon.size().isValid())) {
|
|
38 |
icon = HbIcon(QDir(".").absoluteFilePath("resource/application.png"));
|
85
|
39 |
}
|
|
40 |
return icon;
|
|
41 |
}
|
|
42 |
|
86
|
43 |
|
85
|
44 |
//----------------------------------------------------------------------------
|
|
45 |
//
|
|
46 |
//----------------------------------------------------------------------------
|
|
47 |
void CaObjectAdapter::setId(CaEntry &entry,
|
|
48 |
int id)
|
|
49 |
{
|
|
50 |
entry.setId(id);
|
|
51 |
}
|
|
52 |
|
|
53 |
//----------------------------------------------------------------------------
|
|
54 |
//
|
|
55 |
//----------------------------------------------------------------------------
|
|
56 |
void CaObjectAdapter::setId(CaIconDescription &iconDescription,
|
|
57 |
int id)
|
|
58 |
{
|
|
59 |
iconDescription.setId(id);
|
|
60 |
}
|
|
61 |
|