~ubuntu-branches/ubuntu/saucy/sflphone/saucy

« back to all changes in this revision

Viewing changes to sflphone-common/src/dbus/networkmanager.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Francois Marier
  • Date: 2010-12-24 16:33:55 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20101224163355-tkvvikqxbrbav6up
Tags: 0.9.11-1
* New upstream release
* Add new build dependencies on libwebkit-dev and libyaml-dev

* Bump Standards-Version up to 3.9.1
* Bump debhelper compatibility to 8
* Patch another typo in the upstream code (lintian notice)

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
 
41
41
const string NetworkManager::statesString[5] = {"unknown", "asleep", "connecting", "connected", "disconnected"};
42
42
 
43
 
string NetworkManager::stateAsString(const uint32_t& state)
44
 
{
45
 
        return statesString[state];
46
 
}
47
 
 
48
 
void NetworkManager::StateChanged(const uint32_t& state)
49
 
{
50
 
        _warn("Network state changed: %s", stateAsString(state).c_str());
51
 
}
52
 
 
53
 
void NetworkManager::PropertiesChanged(const std::map< std::string, ::DBus::Variant >& argin0)
54
 
{
55
 
        const map< string, ::DBus::Variant >::const_iterator iter = argin0.begin();
56
 
 
57
 
        string message = iter->first;
58
 
 
59
 
        _warn("Properties changed: %s", iter->first.c_str());
60
 
/*
61
 
        DBus::Variant variant = iter->second;
62
 
        DBus::MessageIter i = variant.reader();
63
 
        cout << i.type() << endl;// 97
64
 
        cout << (char )i.type() << endl;
65
 
        cout << (char)i.array_type() << endl;
66
 
 
67
 
        cout << i.is_array() << endl;// 1
68
 
        cout << i.is_dict() << endl;// 0
69
 
        cout << i.array_type() << endl;// 111
70
 
 
71
 
        int size;
72
 
        ::DBus::Path* value = new ::DBus::Path[10];
73
 
        size = i.get_array(value);
74
 
        cout << "length: " << size << endl;
75
 
 
76
 
        while (!i.at_end())
77
 
        {
78
 
                char **array = new char*[2];
79
 
                size_t length = i.get_array(&array);
80
 
                cout << "length: " << length << endl;
81
 
                i = i.recurse();
82
 
        }
83
 
*/
84
 
        Manager::instance().registerAccounts();
85
 
}
86
 
 
87
 
NetworkManager::NetworkManager(DBus::Connection& connection, const DBus::Path& path, const char* destination): DBus::ObjectProxy (connection, path, destination)
 
43
string NetworkManager::stateAsString (const uint32_t& state)
 
44
{
 
45
    return statesString[state];
 
46
}
 
47
 
 
48
void NetworkManager::StateChanged (const uint32_t& state)
 
49
{
 
50
    _warn ("Network state changed: %s", stateAsString (state).c_str());
 
51
}
 
52
 
 
53
void NetworkManager::PropertiesChanged (const std::map< std::string, ::DBus::Variant >& argin0)
 
54
{
 
55
    const map< string, ::DBus::Variant >::const_iterator iter = argin0.begin();
 
56
 
 
57
    string message = iter->first;
 
58
 
 
59
    _warn ("Properties changed: %s", iter->first.c_str());
 
60
    /*
 
61
        DBus::Variant variant = iter->second;
 
62
        DBus::MessageIter i = variant.reader();
 
63
        cout << i.type() << endl;// 97
 
64
        cout << (char )i.type() << endl;
 
65
        cout << (char)i.array_type() << endl;
 
66
 
 
67
        cout << i.is_array() << endl;// 1
 
68
        cout << i.is_dict() << endl;// 0
 
69
        cout << i.array_type() << endl;// 111
 
70
 
 
71
        int size;
 
72
        ::DBus::Path* value = new ::DBus::Path[10];
 
73
        size = i.get_array(value);
 
74
        cout << "length: " << size << endl;
 
75
 
 
76
        while (!i.at_end())
 
77
        {
 
78
                char **array = new char*[2];
 
79
                size_t length = i.get_array(&array);
 
80
                cout << "length: " << length << endl;
 
81
                i = i.recurse();
 
82
        }
 
83
    */
 
84
    Manager::instance().registerAccounts();
 
85
}
 
86
 
 
87
NetworkManager::NetworkManager (DBus::Connection& connection, const DBus::Path& path, const char* destination) : DBus::ObjectProxy (connection, path, destination)
88
88
{
89
89
}
90
90