Skip to content

Commit

Permalink
Kobo/WifiDialog: move EnsureConnected() to class WPASupplicant
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxKellermann committed Jan 26, 2022
1 parent 3232d60 commit 49f087c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/Kobo/WPASupplicant.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ class WPASupplicant {
*/
void Connect(const char *path);

void EnsureConnected(const char *path) {
if (!IsConnected())
Connect(path);
}

void Close() noexcept;

void SendCommand(const char *cmd);
Expand Down
3 changes: 1 addition & 2 deletions src/Kobo/WifiDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,7 @@ WifiListWidget::Connect()
void
WifiListWidget::EnsureConnected()
{
if (!wpa_supplicant.IsConnected())
wpa_supplicant.Connect("/var/run/wpa_supplicant/eth0");
wpa_supplicant.EnsureConnected("/var/run/wpa_supplicant/eth0");
}

inline WifiListWidget::NetworkInfo *
Expand Down

0 comments on commit 49f087c

Please sign in to comment.