contentstorage/caclient/stub/src/caobjectadapter.cpp
changeset 85 7feec50967db
child 86 e492551a0d54
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/caclient/stub/src/caobjectadapter.cpp	Tue Mar 23 23:17:02 2010 +0200
@@ -0,0 +1,62 @@
+    /*
+ * Copyright (c)2008 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  ?Description
+ *
+ */
+
+#include <cadefs.h>
+
+#include "caobjectadapter.h"
+#include "caentry.h"
+#include "caicondescription.h"
+
+
+//----------------------------------------------------------------------------
+//
+//----------------------------------------------------------------------------
+QPixmap CaObjectAdapter::makeIcon(const CaEntry &entry, const QSize &size)
+{
+    QPixmap icon;
+    if (!entry.iconDescription().filename().isEmpty()) {
+        icon = QPixmap(entry.iconDescription().filename()).scaled(size);
+    }
+    if (icon.isNull()) {
+        if (entry.role() == GroupEntryRole) {
+            icon = QPixmap("./resource/folder.png").scaled(size);
+        }
+        else {
+            icon = QPixmap("./resource/application.png").scaled(size);
+        }
+    }
+    return icon;
+}
+
+//----------------------------------------------------------------------------
+//
+//----------------------------------------------------------------------------
+void CaObjectAdapter::setId(CaEntry &entry,
+    int id)
+{
+    entry.setId(id);
+}
+
+//----------------------------------------------------------------------------
+//
+//----------------------------------------------------------------------------
+void CaObjectAdapter::setId(CaIconDescription &iconDescription,
+    int id)
+{
+    iconDescription.setId(id);
+}
+