aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2016-03-21 13:40:11 -0500
committerCharles Kerr <charles.kerr@canonical.com>2016-03-21 13:40:11 -0500
commit7a25132c125f6e5e413ad26ea950ae22bee982f5 (patch)
tree1870caed0aec4960053bd9e5125574dbcb48b08c /src/main.cpp
parent45709c48f34e0909c1309dccac1dd3e047f518fb (diff)
downloadayatana-indicator-display-7a25132c125f6e5e413ad26ea950ae22bee982f5.tar.gz
ayatana-indicator-display-7a25132c125f6e5e413ad26ea950ae22bee982f5.tar.bz2
ayatana-indicator-display-7a25132c125f6e5e413ad26ea950ae22bee982f5.zip
if our USB device is disconnected while prompting the user for ADBD, cancel the prompt.
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 7d6eb5f..27e6bcc 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -20,6 +20,7 @@
#include <src/exporter.h>
#include <src/rotation-lock.h>
#include <src/usb-manager.h>
+#include <src/usb-monitor.h>
#include <glib/gi18n.h> // bindtextdomain()
#include <gio/gio.h>
@@ -59,7 +60,8 @@ main(int /*argc*/, char** /*argv*/)
// even though it doesn't have an indicator component yet
static constexpr char const * ADB_SOCKET_PATH {"/dev/socket/adbd"};
static constexpr char const * PUBLIC_KEYS_FILENAME {"/data/misc/adb/adb_keys"};
- UsbManager usb_manager {ADB_SOCKET_PATH, PUBLIC_KEYS_FILENAME};
+ auto usb_monitor = std::make_shared<GUDevUsbMonitor>();
+ UsbManager usb_manager {ADB_SOCKET_PATH, PUBLIC_KEYS_FILENAME, usb_monitor};
// let's go!
g_main_loop_run(loop);