X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=connection.cpp;h=07882b0889773311f1e061e8970e76feb2f37c19;hb=76c4d7987cc699a60491a786dd66d81c2b0ce31e;hp=9e990c3473deb6bc6c65a27b3ec8b4019cf3e9ff;hpb=39d019b3778ff4027f41e356fb6956e1a13bdca1;p=yandex-traffic diff --git a/connection.cpp b/connection.cpp index 9e990c3..07882b0 100644 --- a/connection.cpp +++ b/connection.cpp @@ -81,3 +81,21 @@ void ConnectionChecker::updateState (bool new_state, const QString& net_type) type_changed (_net_type); } } + + +bool ConnectionChecker::checkConnection (bool allow_gsm, bool allow_wifi) +{ + if (!_connected) + return false; + + switch (_net_type) { + case Net_None: + return true; + case Net_WLAN: + return allow_wifi; + case Net_GSM: + return allow_gsm; + default: + return true; + } +}