Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
ximper-shell-notification-center
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ximper Linux
ximper-shell-notification-center
Commits
171fe2e9
Verified
Commit
171fe2e9
authored
Apr 18, 2026
by
Kirill Unitsaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quick-settings: cache D-Bus proxies in network tiles
parent
c5372594
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
21 deletions
+52
-21
vpnTile.vala
src/controlCenter/widgets/quickSettings/tiles/vpnTile.vala
+26
-11
wifiTile.vala
src/controlCenter/widgets/quickSettings/tiles/wifiTile.vala
+26
-10
No files found.
src/controlCenter/widgets/quickSettings/tiles/vpnTile.vala
View file @
171fe2e9
...
...
@@ -15,6 +15,10 @@ namespace XimperShellNotificationCenter.Widgets {
private
Gtk
.
Box
?
current_submenu
=
null
;
private
bool
updating_submenu
=
false
;
private
bool
connecting
=
false
;
private
Gee
.
HashMap
<
string
,
NMActiveConnDBus
>
active_proxy_cache
=
new
Gee
.
HashMap
<
string
,
NMActiveConnDBus
>
();
private
Gee
.
HashMap
<
string
,
NMSettingsConnDBus
>
conn_proxy_cache
=
new
Gee
.
HashMap
<
string
,
NMSettingsConnDBus
>
();
~
VpnTile
()
{
if
(
sync_timeout
!=
0
)
{
...
...
@@ -104,11 +108,17 @@ namespace XimperShellNotificationCenter.Widgets {
foreach
(
var
ac_path
in
nm
.
active_connections
)
{
try
{
var
ac
=
yield
Bus
.
get_proxy
<
NMActiveConnDBus
>
(
BusType
.
SYSTEM
,
"org.freedesktop.NetworkManager"
,
ac_path
);
string
key
=
(
string
)
ac_path
;
NMActiveConnDBus
?
ac
=
active_proxy_cache
.
get
(
key
);
if
(
ac
==
null
)
{
ac
=
yield
Bus
.
get_proxy
<
NMActiveConnDBus
>
(
BusType
.
SYSTEM
,
"org.freedesktop.NetworkManager"
,
ac_path
);
active_proxy_cache
.
set
(
key
,
ac
);
}
if
(
ac
.
vpn
&&
ac
.
state
==
2
)
{
active_vpns
.
set
(
(
string
)
ac
.
connection
,
...
...
@@ -132,11 +142,17 @@ namespace XimperShellNotificationCenter.Widgets {
foreach
(
var
conn_path
in
settings
.
list_connections
())
{
try
{
var
conn
=
yield
Bus
.
get_proxy
<
NMSettingsConnDBus
>
(
BusType
.
SYSTEM
,
"org.freedesktop.NetworkManager"
,
conn_path
);
string
key
=
(
string
)
conn_path
;
NMSettingsConnDBus
?
conn
=
conn_proxy_cache
.
get
(
key
);
if
(
conn
==
null
)
{
conn
=
yield
Bus
.
get_proxy
<
NMSettingsConnDBus
>
(
BusType
.
SYSTEM
,
"org.freedesktop.NetworkManager"
,
conn_path
);
conn_proxy_cache
.
set
(
key
,
conn
);
}
var
s
=
conn
.
get_settings
();
var
conn_s
=
s
.
lookup
(
"connection"
);
if
(
conn_s
==
null
)
continue
;
...
...
@@ -149,7 +165,6 @@ namespace XimperShellNotificationCenter.Widgets {
string
name
=
id_var
!=
null
?
id_var
.
get_string
()
:
"VPN"
;
string
key
=
(
string
)
conn_path
;
if
(
seen
.
contains
(
key
))
continue
;
seen
.
add
(
key
);
...
...
src/controlCenter/widgets/quickSettings/tiles/wifiTile.vala
View file @
171fe2e9
...
...
@@ -22,6 +22,10 @@ namespace XimperShellNotificationCenter.Widgets {
private
bool
connecting
=
false
;
private
bool
updating_submenu
=
false
;
private
Gtk
.
Revealer
?
open_password_revealer
=
null
;
private
Gee
.
HashMap
<
string
,
NMAccessPointDBus
>
ap_proxy_cache
=
new
Gee
.
HashMap
<
string
,
NMAccessPointDBus
>
();
private
Gee
.
HashMap
<
string
,
NMSettingsConnDBus
>
saved_proxy_cache
=
new
Gee
.
HashMap
<
string
,
NMSettingsConnDBus
>
();
~
WifiTile
()
{
if
(
sync_timeout
!=
0
)
{
...
...
@@ -200,11 +204,17 @@ namespace XimperShellNotificationCenter.Widgets {
foreach
(
var
ap_path
in
ap_paths
)
{
try
{
var
ap
=
yield
Bus
.
get_proxy
<
NMAccessPointDBus
>
(
BusType
.
SYSTEM
,
"org.freedesktop.NetworkManager"
,
ap_path
);
string
key
=
(
string
)
ap_path
;
NMAccessPointDBus
?
ap
=
ap_proxy_cache
.
get
(
key
);
if
(
ap
==
null
)
{
ap
=
yield
Bus
.
get_proxy
<
NMAccessPointDBus
>
(
BusType
.
SYSTEM
,
"org.freedesktop.NetworkManager"
,
ap_path
);
ap_proxy_cache
.
set
(
key
,
ap
);
}
string
ssid
=
NetworkManagerProxy
.
ssid_to_string
(
ap
.
ssid
);
...
...
@@ -281,11 +291,17 @@ namespace XimperShellNotificationCenter.Widgets {
foreach
(
var
conn_path
in
settings
.
list_connections
())
{
try
{
var
conn
=
yield
Bus
.
get_proxy
<
NMSettingsConnDBus
>
(
BusType
.
SYSTEM
,
"org.freedesktop.NetworkManager"
,
conn_path
);
string
key
=
(
string
)
conn_path
;
NMSettingsConnDBus
?
conn
=
saved_proxy_cache
.
get
(
key
);
if
(
conn
==
null
)
{
conn
=
yield
Bus
.
get_proxy
<
NMSettingsConnDBus
>
(
BusType
.
SYSTEM
,
"org.freedesktop.NetworkManager"
,
conn_path
);
saved_proxy_cache
.
set
(
key
,
conn
);
}
var
s
=
conn
.
get_settings
();
var
wifi_s
=
s
.
lookup
(
"802-11-wireless"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment