equal
deleted
inserted
replaced
1 /* |
|
2 * Copyright (c) 2010 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 |
|
19 #include "btabstractdelegate.h" |
|
20 #include "btqtconstants.h" |
|
21 |
|
22 #include <btsettingmodel.h> |
|
23 #include <btdevicemodel.h> |
|
24 |
|
25 /*! |
|
26 Constructor. |
|
27 */ |
|
28 BtAbstractDelegate::BtAbstractDelegate( BtSettingModel *settingModel, |
|
29 BtDeviceModel *deviceModel, QObject *parent ) |
|
30 : QObject( parent ), mSettingModel(settingModel),mDeviceModel(deviceModel) |
|
31 { |
|
32 } |
|
33 |
|
34 /*! |
|
35 Destructor. |
|
36 */ |
|
37 BtAbstractDelegate::~BtAbstractDelegate() |
|
38 { |
|
39 } |
|
40 |
|
41 BtSettingModel *BtAbstractDelegate::getSettingModel() |
|
42 { |
|
43 return mSettingModel; |
|
44 } |
|
45 |
|
46 BtDeviceModel *BtAbstractDelegate::getDeviceModel() |
|
47 { |
|
48 return mDeviceModel; |
|
49 } |
|
50 |
|
51 void BtAbstractDelegate::cancel() |
|
52 { |
|
53 |
|
54 } |
|
55 |
|
56 bool BtAbstractDelegate::isBtPowerOn() |
|
57 { |
|
58 QModelIndex powerIndex = getSettingModel()->index(BtSettingModel::PowerStateRow, 0); |
|
59 PowerStateQtValue powerState = (PowerStateQtValue)getSettingModel()->data(powerIndex, BtSettingModel::SettingValueRole).toInt(); |
|
60 |
|
61 return (BtPowerOn == powerState); |
|
62 } |
|
63 |
|
64 |
|
65 |
|