aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp42
1 files changed, 8 insertions, 34 deletions
diff --git a/src/main.cpp b/src/main.cpp
index f145504..a422610 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1,5 +1,6 @@
/*
* Copyright 2014 Canonical Ltd.
+ * Copyright 2022-2023 Robert Tari
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 3, as published
@@ -15,21 +16,23 @@
*
* Authors:
* Charles Kerr <charles.kerr@canonical.com>
+ * Robert Tari <robert@tari.in>
*/
#include <src/exporter.h>
-#include <src/rotation-lock.h>
+#include <src/service.h>
+#ifdef LOMIRI_FEATURES_ENABLED
#include <src/greeter.h>
#include <src/usb-manager.h>
#include <src/usb-monitor.h>
+#include <sys/stat.h>
+#include <errno.h>
+#endif
#include <glib/gi18n.h> // bindtextdomain()
#include <gio/gio.h>
-
#include <locale.h>
-#include <sys/stat.h>
-#include <errno.h>
extern "C"
{
@@ -54,44 +57,15 @@ main(int /*argc*/, char** /*argv*/)
g_main_loop_quit(loop);
};
- // build all our indicators.
- // Right now we've only got one -- rotation lock -- but hey, we can dream.
std::vector<std::shared_ptr<Indicator>> indicators;
std::vector<std::shared_ptr<Exporter>> exporters;
- indicators.push_back(std::make_shared<RotationLockIndicator>());
+ indicators.push_back(std::make_shared<DisplayIndicator>());
for (auto& indicator : indicators) {
auto exporter = std::make_shared<Exporter>(indicator);
exporter->name_lost().connect(on_name_lost);
exporters.push_back(exporter);
}
- gboolean bHasSocket = FALSE;
-
- if (ayatana_common_utils_is_lomiri())
- {
- struct stat cStat;
-
- if (stat("/dev/socket/adbd", &cStat) == 0)
- {
- if (S_ISSOCK(cStat.st_mode))
- {
- // We need the ADBD handler running,
- // 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"};
- auto usb_monitor = std::make_shared<GUDevUsbMonitor>();
- auto greeter = std::make_shared<Greeter>();
- UsbManager usb_manager {ADB_SOCKET_PATH, PUBLIC_KEYS_FILENAME, usb_monitor, greeter};
- bHasSocket = TRUE;
- }
- }
- }
-
- if (bHasSocket == FALSE)
- {
- g_message("No /dev/socket/adbd socket found, skipping UsbManager");
- }
-
// let's go!
g_main_loop_run(loop);