Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
d3bb0daf
Commit
d3bb0daf
authored
12 years ago
by
Tristan Matthews
Browse files
Options
Downloads
Patches
Plain Diff
* #9911: simplify network manager state reporting
parent
497f205c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
daemon/src/dbus/networkmanager.cpp
+10
-7
10 additions, 7 deletions
daemon/src/dbus/networkmanager.cpp
daemon/src/dbus/networkmanager.h
+0
-3
0 additions, 3 deletions
daemon/src/dbus/networkmanager.h
with
10 additions
and
10 deletions
daemon/src/dbus/networkmanager.cpp
+
10
−
7
View file @
d3bb0daf
...
...
@@ -30,20 +30,23 @@
#include
"networkmanager.h"
#include
"../manager.h"
#include
"array_size.h"
#include
"logger.h"
const
std
::
string
NetworkManager
::
statesString
[]
=
{
"unknown"
,
"asleep"
,
"connecting"
,
"connected"
,
"disconnected"
,
"unknown"
,};
namespace
{
const
char
*
stateAsString
(
uint32_t
state
)
{
static
const
char
*
STATES
[]
=
{
"unknown"
,
"asleep"
,
"connecting"
,
"connected"
,
"disconnected"
};
std
::
string
NetworkManager
::
stateAsString
(
const
uint32_t
&
state
)
{
return
statesString
[
state
<
6
?
state
:
5
];
const
size_t
idx
=
state
<
ARRAYSIZE
(
STATES
)
?
state
:
0
;
return
STATES
[
idx
];
}
}
void
NetworkManager
::
StateChanged
(
const
uint32_t
&
state
)
{
WARN
(
"Network state changed: %s"
,
stateAsString
(
state
)
.
c_str
()
);
WARN
(
"Network state changed: %s"
,
stateAsString
(
state
));
}
void
NetworkManager
::
PropertiesChanged
(
const
std
::
map
<
std
::
string
,
::
DBus
::
Variant
>
&
argin0
)
...
...
This diff is collapsed.
Click to expand it.
daemon/src/dbus/networkmanager.h
+
0
−
3
View file @
d3bb0daf
...
...
@@ -45,7 +45,6 @@ class NetworkManager : public org::freedesktop::NetworkManager_proxy,
NetworkManager
(
DBus
::
Connection
&
,
const
DBus
::
Path
&
,
const
char
*
);
void
StateChanged
(
const
uint32_t
&
state
);
void
PropertiesChanged
(
const
std
::
map
<
std
::
string
,
::
DBus
::
Variant
>
&
argin0
);
std
::
string
stateAsString
(
const
uint32_t
&
state
);
private:
enum
NMState
{
...
...
@@ -55,8 +54,6 @@ class NetworkManager : public org::freedesktop::NetworkManager_proxy,
NM_STATE_CONNECTED
,
NM_STATE_DISCONNECTED
};
static
const
std
::
string
statesString
[];
};
#endif
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment