equal
deleted
inserted
replaced
|
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 <hbstringutil.h> |
|
19 |
|
20 #include "HelpCommon.h" |
|
21 #include "HelpStandardItem.h" |
|
22 |
|
23 HelpStandardItem::HelpStandardItem(const QString& text) : QStandardItem(text) |
|
24 { |
|
25 } |
|
26 |
|
27 HelpStandardItem::~HelpStandardItem() |
|
28 { |
|
29 } |
|
30 |
|
31 bool HelpStandardItem::operator<(const QStandardItem & other) const |
|
32 { |
|
33 const int role = model() ? model()->sortRole() : Qt::DisplayRole; |
|
34 switch(role) |
|
35 { |
|
36 case Qt::DisplayRole: |
|
37 if(HbStringUtil::compareC(text(), other.text()) < 0) |
|
38 { |
|
39 return true; |
|
40 } |
|
41 break; |
|
42 case UidRole: |
|
43 case HrefRole: |
|
44 case KeywordRole: |
|
45 default: |
|
46 return QStandardItem::operator<(other); |
|
47 } |
|
48 return false; |
|
49 } |