~pete-woods/indicator-network/wapi-lp1597681

« back to all changes in this revision

Viewing changes to src/indicator/connectivity-service/dbus-sim.cpp

New Connectivity Service Private API for managing mobile data and SIM cards. Tests. (LP: #1373463)

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
    m_sim(sim),
36
36
    m_connection(connection)
37
37
{
38
 
    m_path.setPath(DBusTypes::simPath(m_sim->imsi()));
 
38
    m_path.setPath(DBusTypes::simPath());
39
39
 
40
40
    new SimAdaptor(this);
41
41
 
44
44
    connect(sim.get(), &Sim::lockedChanged, this, &DBusSim::lockedChanged);
45
45
    connect(sim.get(), &Sim::presentChanged, this, &DBusSim::presentChanged);
46
46
    connect(sim.get(), &Sim::dataRoamingEnabledChanged, this, &DBusSim::dataRoamingEnabledChanged);
 
47
    connect(sim.get(), &Sim::imsiChanged, this, &DBusSim::imsiChanged);
 
48
    connect(sim.get(), &Sim::primaryPhoneNumberChanged, this, &DBusSim::primaryPhoneNumberChanged);
 
49
    connect(sim.get(), &Sim::mccChanged, this, &DBusSim::mccChanged);
 
50
    connect(sim.get(), &Sim::mncChanged, this, &DBusSim::mncChanged);
47
51
}
48
52
 
49
53
DBusSim::~DBusSim()
74
78
    );
75
79
}
76
80
 
 
81
QString DBusSim::iccid() const
 
82
{
 
83
    return m_sim->iccid();
 
84
}
 
85
 
77
86
QString DBusSim::imsi() const
78
87
{
79
88
    return m_sim->imsi();
139
148
    notifyProperties({"DataRoamingEnabled"});
140
149
}
141
150
 
 
151
void DBusSim::imsiChanged()
 
152
{
 
153
    notifyProperties({"Imsi"});
 
154
}
 
155
 
 
156
void DBusSim::primaryPhoneNumberChanged()
 
157
{
 
158
    notifyProperties({"PrimaryPhoneNumber"});
 
159
}
 
160
 
 
161
void DBusSim::mccChanged()
 
162
{
 
163
    notifyProperties({"Mcc"});
 
164
}
 
165
 
 
166
void DBusSim::mncChanged()
 
167
{
 
168
    notifyProperties({"Mnc"});
 
169
}
 
170
 
142
171
nmofono::wwan::Sim::Ptr DBusSim::sim() const
143
172
{
144
173
    return m_sim;