diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2016-03-08 22:04:56 -0600 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2016-03-08 22:04:56 -0600 |
commit | 68b671ce04b8b5d6b37025ad093c73a3e14d4d64 (patch) | |
tree | 1b9d1dca5587219915115c8ccd702cfa6f5fd045 /src/main.cpp | |
parent | 40f48471fe531ba5b9f1e1c4371f252fca4c2d52 (diff) | |
download | ayatana-indicator-display-68b671ce04b8b5d6b37025ad093c73a3e14d4d64.tar.gz ayatana-indicator-display-68b671ce04b8b5d6b37025ad093c73a3e14d4d64.tar.bz2 ayatana-indicator-display-68b671ce04b8b5d6b37025ad093c73a3e14d4d64.zip |
add fingerprint snap decisions; test with notification dbusmock
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/main.cpp b/src/main.cpp index 0c56bd6..62eca62 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -20,6 +20,7 @@ #include <src/adbd-client.h> #include <src/exporter.h> #include <src/rotation-lock.h> +#include <src/usb-snap.h> #include <glib/gi18n.h> // bindtextdomain() #include <gio/gio.h> @@ -60,9 +61,11 @@ main(int /*argc*/, char** /*argv*/) static constexpr char const * ADB_SOCKET_PATH {"/dev/socket/adb"}; GAdbdClient adbd_client{ADB_SOCKET_PATH}; adbd_client.on_pk_request().connect([](const AdbdClient::PKRequest& req){ - g_debug("%s got pk_request [%s]", G_STRLOC, req.public_key.c_str()); - // FIXME: actually decide what response to send back - req.respond(AdbdClient::PKResponse::ALLOW); + auto snap = new UsbSnap(req.public_key); + snap->on_user_response().connect([req,snap](AdbdClient::PKResponse response, bool /*FIXME: remember_choice*/){ + req.respond(response); + g_idle_add([](gpointer gsnap){delete static_cast<UsbSnap*>(gsnap); return G_SOURCE_REMOVE;}, snap); // delete-later + }); }); g_main_loop_run(loop); |