90
|
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: Mock implementation for system info for testing
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#include <QVariant>
|
|
20 |
|
|
21 |
#include "mocksysteminfo.h"
|
|
22 |
|
|
23 |
|
|
24 |
QSystemNetworkInfo::QSystemNetworkInfo(QObject *parent) : QObject(parent)
|
|
25 |
{
|
|
26 |
}
|
97
|
27 |
|
90
|
28 |
QSystemNetworkInfo::~QSystemNetworkInfo()
|
|
29 |
{
|
|
30 |
}
|
|
31 |
|
|
32 |
QSystemNetworkInfo::NetworkStatus QSystemNetworkInfo::networkStatus(QSystemNetworkInfo::NetworkMode mode)
|
|
33 |
{
|
|
34 |
// property 'testNetworkMode' -> GsmMode / WcdmaMode, others return NoNetworkAvailable
|
|
35 |
// property 'testNetworkStatus' -> NoNetworkAvailable / Connected / HomeNetwork, others return NoNetworkAvailable
|
|
36 |
QSystemNetworkInfo::NetworkStatus networkStatus = NoNetworkAvailable;
|
|
37 |
int modeProperty = property("testNetworkMode").toInt();
|
|
38 |
int statusProperty = property("testNetworkStatus").toInt();
|
|
39 |
if ( modeProperty == mode ) {
|
|
40 |
networkStatus = (QSystemNetworkInfo::NetworkStatus) statusProperty;
|
|
41 |
}
|
|
42 |
return networkStatus;
|
|
43 |
}
|
|
44 |
|
|
45 |
int QSystemNetworkInfo::networkSignalStrength(QSystemNetworkInfo::NetworkMode mode)
|
|
46 |
{
|
|
47 |
Q_UNUSED(mode);
|
|
48 |
return -1;
|
|
49 |
}
|
|
50 |
|
|
51 |
QString QSystemNetworkInfo::networkName(QSystemNetworkInfo::NetworkMode mode)
|
|
52 |
{
|
|
53 |
Q_UNUSED(mode);
|
|
54 |
return QString("Testing");
|
|
55 |
}
|
|
56 |
|
|
57 |
|
|
58 |
QSystemDeviceInfo::QSystemDeviceInfo(QObject *parent) : QObject(parent)
|
|
59 |
{
|
|
60 |
}
|
97
|
61 |
|
90
|
62 |
QSystemDeviceInfo::~QSystemDeviceInfo()
|
|
63 |
{
|
|
64 |
}
|
|
65 |
|
|
66 |
QSystemDeviceInfo::SimStatus QSystemDeviceInfo::simStatus()
|
|
67 |
{
|
|
68 |
if (property("simAvailable").toBool()) {
|
|
69 |
return SingleSimAvailable;
|
|
70 |
}
|
|
71 |
return SimNotAvailable;
|
|
72 |
}
|
|
73 |
|
|
74 |
QSystemDeviceInfo::Profile QSystemDeviceInfo::currentProfile()
|
|
75 |
{
|
|
76 |
if (property("offlineMode").toBool()) {
|
|
77 |
return OfflineProfile;
|
|
78 |
}
|
|
79 |
return NormalProfile;
|
|
80 |
}
|
|
81 |
|
|
82 |
// End of file
|
|
83 |
|