Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embedded daemon in one unified binary #702

Merged
merged 11 commits into from
Sep 13, 2021
4 changes: 2 additions & 2 deletions core/Services/Calendar/EventStore.vala
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public class Calendar.EventStore : Object {
}
}

protected EventStore () {
public EventStore () {
this.week_starts_on = get_week_start ();
this.month_start = Calendar.Util.datetime_get_start_of_month (get_page ());
compute_ranges ();
Expand Down Expand Up @@ -368,7 +368,7 @@ public class Calendar.EventStore : Object {
int wso = (int) week_starts_on;
int offset = 0;

// offset corresponds number of days from the start of the week to
// offset corresponds number of days from the start of the week to
// month_start, as seen on a displayed calendar.
if (wso < dow) {
offset = dow - wso;
Expand Down
217 changes: 0 additions & 217 deletions daemon/Daemon.vala

This file was deleted.

18 changes: 0 additions & 18 deletions daemon/meson.build

This file was deleted.

2 changes: 1 addition & 1 deletion data/io.elementary.calendar-daemon.desktop.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Name=Calendar Daemon
Comment=View Event Reminders
Icon=io.elementary.calendar
Exec=@EXEC_PATH@
Exec=@EXEC_PATH@ --background
Terminal=false
Type=Application
Categories=System;
Expand Down
1 change: 0 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ gresource_calendar = gnome.compile_resources(

subdir('data')
subdir('core')
subdir('daemon')
subdir('src')
subdir('plugins')
subdir('po')
Expand Down
9 changes: 9 additions & 0 deletions src/Application.vala
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ namespace Maya {
public MainWindow window;
public static GLib.Settings? saved_state = null;
public static GLib.Settings? wingpanel_settings = null;
public static bool run_in_background = false;

static construct {
if (SettingsSchemaSource.get_default ().lookup ("io.elementary.calendar.savedstate", true) != null) {
Expand Down Expand Up @@ -58,10 +59,18 @@ namespace Maya {
public const OptionEntry[] APP_OPTIONS = {
{ "add-event", 'a', 0, OptionArg.NONE, out Option.add_event, N_("Create an event"), null },
{ "show-day", 's', 0, OptionArg.STRING, out Option.show_day, N_("Focus the given day"), N_("date") },
{ "background", 'b', 0, OptionArg.NONE, out run_in_background, "Run the Application in background", null},
{ null }
};

protected override void activate () {
if (run_in_background) {
run_in_background = false;
new Calendar.TodayEventMonitor ();
hold ();
return;
}

if (get_windows () != null) {
get_windows ().data.present (); // present window if app is already running
return;
Expand Down
Loading