summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--network/wifinetworkmodel.cpp1
-rw-r--r--telephony/telephony.cpp5
-rw-r--r--telephony/telephony.h10
-rw-r--r--telephony/telephonymessage.h2
4 files changed, 17 insertions, 1 deletions
diff --git a/network/wifinetworkmodel.cpp b/network/wifinetworkmodel.cpp
index 3cfd7dd..3837278 100644
--- a/network/wifinetworkmodel.cpp
+++ b/network/wifinetworkmodel.cpp
@@ -82,6 +82,7 @@ void WifiNetworkModel::removeAllNetworks()
{
beginRemoveRows(QModelIndex(), 0, m_networks.count() - 1);
qDeleteAll(m_networks.begin(), m_networks.end());
+ m_networks.clear();
endRemoveRows();
}
diff --git a/telephony/telephony.cpp b/telephony/telephony.cpp
index 08b80b1..716ded7 100644
--- a/telephony/telephony.cpp
+++ b/telephony/telephony.cpp
@@ -66,7 +66,8 @@ void Telephony::onConnected()
"callStateChanged",
"dialingCall",
"incomingCall",
- "terminatedCall"};
+ "terminatedCall",
+ "online"};
QStringListIterator eventIterator(events);
TelephonyMessage *tmsg;
@@ -103,6 +104,8 @@ void Telephony::onMessageReceived(MessageType type, Message *message)
setCallState("disconnected");
m_colp = "";
m_clip = "";
+ } else if (tmsg->isOnline()) {
+ setOnlineState(tmsg->connected());
}
}
}
diff --git a/telephony/telephony.h b/telephony/telephony.h
index 7cff598..04f55a7 100644
--- a/telephony/telephony.h
+++ b/telephony/telephony.h
@@ -27,6 +27,7 @@ class Telephony : public QObject
Q_OBJECT
Q_PROPERTY(bool connected READ connected WRITE setConnected NOTIFY connectedChanged)
Q_PROPERTY(QString callState READ callState WRITE setCallState NOTIFY callStateChanged)
+ Q_PROPERTY(bool online READ online NOTIFY onlineChanged)
Q_PROPERTY(QString callClip READ callClip)
Q_PROPERTY(QString callColp READ callColp)
@@ -49,7 +50,14 @@ class Telephony : public QObject
emit callStateChanged(m_call_state);
}
+ void setOnlineState(bool state)
+ {
+ m_online = state;
+ emit onlineChanged(state);
+ }
+
bool connected() { return m_connected; }
+ bool online() { return m_online; }
QString callState() { return m_call_state; }
QString callClip() { return m_clip; }
QString callColp() { return m_colp; }
@@ -57,9 +65,11 @@ class Telephony : public QObject
signals:
void connectedChanged(bool);
void callStateChanged(QString);
+ void onlineChanged(bool connected);
private:
bool m_connected;
+ bool m_online;
MessageEngine *m_mloop;
QString m_call_state;
QString m_clip;
diff --git a/telephony/telephonymessage.h b/telephony/telephonymessage.h
index 87d06a6..0225b64 100644
--- a/telephony/telephonymessage.h
+++ b/telephony/telephonymessage.h
@@ -27,9 +27,11 @@ class TelephonyMessage : public Message
bool isDialingCall() { return m_event ? (this->eventName() == "dialingCall") : false; };
bool isIncomingCall() { return m_event ? (this->eventName() == "incomingCall") : false; };
bool isTerminatedCall() { return (this->eventName() == "terminatedCall"); };
+ bool isOnline() { return (this->eventName() == "online"); };
QString clip() { return m_event_data.find("clip").value().toString(); };
QString colp() { return m_event_data.find("colp").value().toString(); };
QString state() { return m_event_data.find("state").value().toString(); };
+ bool connected() { return m_event_data.find("connected").value().toBool(); };
bool createRequest(QString verb, QString value = "None");
};