refactor and shizz
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
#include <vector>
|
||||
|
||||
class TrayService {
|
||||
inline static TrayService *instance = nullptr;
|
||||
public:
|
||||
struct Item {
|
||||
std::string id;
|
||||
@@ -29,9 +30,6 @@ class TrayService {
|
||||
Glib::RefPtr<Gdk::Paintable> iconPaintable;
|
||||
};
|
||||
|
||||
TrayService();
|
||||
~TrayService();
|
||||
|
||||
void start();
|
||||
void stop();
|
||||
|
||||
@@ -44,7 +42,6 @@ class TrayService {
|
||||
|
||||
Glib::RefPtr<Gio::MenuModel> get_menu_model(const std::string &id);
|
||||
Glib::RefPtr<Gio::ActionGroup> get_menu_action_group(const std::string &id);
|
||||
void debug_dump_menu_layout(const std::string &id);
|
||||
struct MenuNode {
|
||||
int id = 0;
|
||||
std::string label;
|
||||
@@ -60,7 +57,18 @@ class TrayService {
|
||||
sigc::signal<void(const std::string &)> &signal_item_removed();
|
||||
sigc::signal<void(const Item &)> &signal_item_updated();
|
||||
|
||||
static TrayService *getInstance() {
|
||||
if (TrayService::instance == nullptr) {
|
||||
TrayService::instance = new TrayService();
|
||||
}
|
||||
|
||||
return TrayService::instance;
|
||||
}
|
||||
|
||||
private:
|
||||
TrayService();
|
||||
~TrayService();
|
||||
|
||||
struct TrackedItem {
|
||||
Item publicData;
|
||||
guint signalSubscriptionId = 0;
|
||||
|
||||
Reference in New Issue
Block a user