Skip to content

Commit 71e566f

Browse files
committed
util: add accesspoint variables named better.
1 parent 27dcefa commit 71e566f

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

src/util/network/manager.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -573,16 +573,16 @@ void NetworkManager::activate_connection(std::string p1, std::string p2, std::st
573573
{}
574574
}
575575

576-
void NetworkManager::request_password(std::string p2, std::string p3)
576+
void NetworkManager::request_password(std::string device_path, std::string ap_path)
577577
{
578-
if (p2.find("/Devices/") != std::string::npos)
578+
if (device_path.find("/Devices/") != std::string::npos)
579579
{
580-
auto device = std::dynamic_pointer_cast<WifiNetwork>(all_devices[p2]);
580+
auto device = std::dynamic_pointer_cast<WifiNetwork>(all_devices[device_path]);
581581
if (device)
582582
{
583-
popup_cache_p2 = p2;
584-
popup_cache_p3 = p3;
585-
auto ap = device->get_access_points()[p3];
583+
popup_cache_device = device_path;
584+
popup_cache_ap = ap_path;
585+
auto ap = device->get_access_points()[ap_path];
586586
popup_label.set_label("Preshared Key required for Access Point '" + ap->get_ssid() + "'");
587587
popup_window.present();
588588
popup_window.get_focus();
@@ -716,13 +716,13 @@ void NetworkManager::submit_password()
716716
}
717717

718718
popup_entry.set_text("");
719-
auto wifi = std::dynamic_pointer_cast<WifiNetwork>(all_devices[popup_cache_p2]);
719+
auto wifi = std::dynamic_pointer_cast<WifiNetwork>(all_devices[popup_cache_device]);
720720
if (!wifi)
721721
{
722722
return;
723723
}
724724

725-
auto ap = wifi->get_access_points()[popup_cache_p3];
725+
auto ap = wifi->get_access_points()[popup_cache_ap];
726726
if (!ap)
727727
{
728728
return;
@@ -788,7 +788,7 @@ void NetworkManager::submit_password()
788788
// Object paths (o)
789789
// ------------------------
790790
auto device_path =
791-
Glib::Variant<Glib::DBusObjectPathString>::create(popup_cache_p2);
791+
Glib::Variant<Glib::DBusObjectPathString>::create(popup_cache_device);
792792
// Access point path is "/" → NM autoselects AP matching SSID
793793
auto ap_path = Glib::Variant<Glib::DBusObjectPathString>::create("/");
794794
// ------------------------

src/util/network/manager.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class NetworkManager
6161
Gtk::Label popup_label;
6262
Gtk::Entry popup_entry;
6363

64-
std::string popup_cache_p2 = "", popup_cache_p3 = "";
64+
std::string popup_cache_device = "", popup_cache_ap = "";
6565
inline static std::weak_ptr<NetworkManager> instance;
6666

6767
public:
@@ -178,7 +178,7 @@ class NetworkManager
178178
void mobile_global_set(bool value);
179179
void networking_global_set(bool value);
180180
void submit_password();
181-
void request_password(std::string p2, std::string p3);
181+
void request_password(std::string device_path, std::string ap_path);
182182

183183
std::shared_ptr<NetworkSettings> get_setting_for_ssid(std::string ssid);
184184
};

0 commit comments

Comments
 (0)