aboutsummaryrefslogtreecommitdiff
path: root/src/usb-manager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/usb-manager.cpp')
-rw-r--r--src/usb-manager.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/usb-manager.cpp b/src/usb-manager.cpp
index 6b40cea..f089a22 100644
--- a/src/usb-manager.cpp
+++ b/src/usb-manager.cpp
@@ -41,12 +41,11 @@ public:
{
m_adbd_client->on_pk_request().connect([this](const AdbdClient::PKRequest& req){
auto snap = new UsbSnap(req.fingerprint);
- snap->on_user_response().connect([this,req,snap](AdbdClient::PKResponse response, bool /*FIXME: remember_choice*/){
+ snap->on_user_response().connect([this,req,snap](AdbdClient::PKResponse response, bool remember_choice){
req.respond(response);
- if (response == AdbdClient::PKResponse::ALLOW)
+ if (remember_choice)
write_public_key(req.public_key);
-
- // delete later
+ // delete_later
g_idle_add([](gpointer gsnap){delete static_cast<UsbSnap*>(gsnap); return G_SOURCE_REMOVE;}, snap);
});
});