aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/exporter.cpp (renamed from src/service.cpp)24
-rw-r--r--src/main.cpp6
-rw-r--r--src/planner-eds.cpp2
3 files changed, 18 insertions, 14 deletions
diff --git a/src/service.cpp b/src/exporter.cpp
index 0671c61..aa021f3 100644
--- a/src/service.cpp
+++ b/src/exporter.cpp
@@ -17,8 +17,8 @@
* Charles Kerr <charles.kerr@canonical.com>
*/
-#include <datetime/service.h>
#include <datetime/dbus-shared.h>
+#include <datetime/exporter.h>
#include <glib/gi18n.h>
#include <gio/gio.h>
@@ -31,7 +31,7 @@ namespace datetime {
****
***/
-Service::~Service()
+Exporter::~Exporter()
{
if (m_dbus_connection != nullptr)
{
@@ -53,20 +53,23 @@ Service::~Service()
***/
void
-Service::on_bus_acquired(GDBusConnection* connection, const gchar* name, gpointer gthis)
+Exporter::on_bus_acquired(GDBusConnection* connection, const gchar* name, gpointer gthis)
{
g_debug("bus acquired: %s", name);
- static_cast<Service*>(gthis)->on_bus_acquired(connection, name);
+ static_cast<Exporter*>(gthis)->on_bus_acquired(connection, name);
}
void
-Service::on_bus_acquired(GDBusConnection* connection, const gchar* /*name*/)
+Exporter::on_bus_acquired(GDBusConnection* connection, const gchar* /*name*/)
{
m_dbus_connection = static_cast<GDBusConnection*>(g_object_ref(G_OBJECT(connection)));
// export the actions
GError * error = nullptr;
- const auto id = g_dbus_connection_export_action_group(m_dbus_connection, BUS_PATH, m_actions, &error);
+ const auto id = g_dbus_connection_export_action_group(m_dbus_connection,
+ BUS_PATH,
+ m_actions->action_group(),
+ &error);
if (id)
{
m_exported_actions_id = id;
@@ -99,14 +102,14 @@ Service::on_bus_acquired(GDBusConnection* connection, const gchar* /*name*/)
***/
void
-Service::on_name_lost(GDBusConnection* connection, const gchar* name, gpointer gthis)
+Exporter::on_name_lost(GDBusConnection* connection, const gchar* name, gpointer gthis)
{
g_debug("name lost: %s", name);
- static_cast<Service*>(gthis)->on_name_lost(connection, name);
+ static_cast<Exporter*>(gthis)->on_name_lost(connection, name);
}
void
-Service::on_name_lost(GDBusConnection* /*connection*/, const gchar* /*name*/)
+Exporter::on_name_lost(GDBusConnection* /*connection*/, const gchar* /*name*/)
{
name_lost();
}
@@ -116,7 +119,8 @@ Service::on_name_lost(GDBusConnection* /*connection*/, const gchar* /*name*/)
***/
void
-Service::publish(GActionGroup* actions, std::vector<std::shared_ptr<Menu>>& menus)
+Exporter::publish(std::shared_ptr<Actions>& actions,
+ std::vector<std::shared_ptr<Menu>>& menus)
{
m_actions = actions;
m_menus = menus;
diff --git a/src/main.cpp b/src/main.cpp
index 6a56163..50d5241 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -38,7 +38,7 @@ main(int /*argc*/, char** /*argv*/)
// It can be removed when https://bugzilla.gnome.org/show_bug.cgi?id=674885 is fixed.
g_type_ensure(G_TYPE_DBUS_CONNECTION);
- // init i18n
+ // boilerplate i18n
setlocale(LC_ALL, "");
bindtextdomain(GETTEXT_PACKAGE, GNOMELOCALEDIR);
textdomain(GETTEXT_PACKAGE);
@@ -47,7 +47,7 @@ main(int /*argc*/, char** /*argv*/)
if(!notify_init("indicator-datetime-service"))
g_critical("libnotify initialization failed");
- // build the state and menu factory
+ // build the state and actions for the MenuFactory to use
std::shared_ptr<State> state(new LiveState);
std::shared_ptr<Actions> actions(new LiveActions(state));
MenuFactory factory(actions, state);
@@ -56,7 +56,7 @@ main(int /*argc*/, char** /*argv*/)
std::vector<std::shared_ptr<Menu>> menus;
menus.push_back(factory.buildMenu(Menu::Desktop));
- // export them
+ // export them & run until we lose the busname
auto loop = g_main_loop_new(nullptr, false);
Exporter exporter;
exporter.name_lost.connect([loop](){
diff --git a/src/planner-eds.cpp b/src/planner-eds.cpp
index 275a29e..b3f751a 100644
--- a/src/planner-eds.cpp
+++ b/src/planner-eds.cpp
@@ -48,7 +48,7 @@ public:
e_source_registry_new(m_cancellable, on_source_registry_ready, this);
m_owner.time.changed().connect([this](const DateTime& dt) {
- g_message("planner's datetime property changed to %s; calling rebuildSoon()", g_date_time_format(dt.get(), "%F %T"));
+ g_message("planner's datetime property changed to %s; calling rebuildSoon()", dt.format("%F %T").c_str());
rebuildSoon();
});