Compare commits
3 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
24a5dcdfbb |
||
|
|
e6aa3fb279 |
||
|
|
365a9f5316 |
4 changed files with 11 additions and 230 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -1,2 +1,3 @@
|
|||
/wingpanel-indicator-datetime-2.0.1.tar.xz
|
||||
/wingpanel-indicator-datetime-2.0.2.tar.gz
|
||||
/wingpanel-indicator-datetime-2.1.0.tar.gz
|
||||
|
|
|
|||
|
|
@ -1,221 +0,0 @@
|
|||
diff --git a/src/Widgets/calendar/CalendarModel.vala b/src/Widgets/calendar/CalendarModel.vala
|
||||
index 9dc0438..9ff1755 100644
|
||||
--- a/src/Widgets/calendar/CalendarModel.vala
|
||||
+++ b/src/Widgets/calendar/CalendarModel.vala
|
||||
@@ -61,7 +61,7 @@ namespace DateTime.Widgets {
|
||||
return summary;
|
||||
} else if (alarm) {
|
||||
return "%s - %s".printf (start_time.format (Util.TimeFormat ()), summary);
|
||||
- } else if (range.days > 0 && date.compare (range.first) != 0) {
|
||||
+ } else if (range.days > 0 && date.compare (range.first_dt) != 0) {
|
||||
return summary;
|
||||
}
|
||||
return "%s - %s".printf (summary, start_time.format (Util.TimeFormat ()));
|
||||
@@ -365,8 +365,8 @@ namespace DateTime.Widgets {
|
||||
(Gee.EqualDataFunc<E.CalComponent>? )Util.calcomponent_equal_func);
|
||||
source_events.set (source, events);
|
||||
/* query client view */
|
||||
- var iso_first = E.Util.isodate_from_time_t ((time_t)data_range.first.to_unix ());
|
||||
- var iso_last = E.Util.isodate_from_time_t ((time_t)data_range.last.add_days (1).to_unix ());
|
||||
+ var iso_first = E.Util.isodate_from_time_t ((time_t)data_range.first_dt.to_unix ());
|
||||
+ var iso_last = E.Util.isodate_from_time_t ((time_t)data_range.last_dt.add_days (1).to_unix ());
|
||||
var query = @"(occur-in-time-range? (make-time \"$iso_first\") (make-time \"$iso_last\"))";
|
||||
|
||||
E.CalClient client;
|
||||
@@ -488,4 +488,4 @@ namespace DateTime.Widgets {
|
||||
events_removed (source, removed_events.read_only_view);
|
||||
}
|
||||
}
|
||||
-}
|
||||
\ No newline at end of file
|
||||
+}
|
||||
diff --git a/src/Widgets/calendar/CalendarView.vala b/src/Widgets/calendar/CalendarView.vala
|
||||
index 4615782..4ede210 100644
|
||||
--- a/src/Widgets/calendar/CalendarView.vala
|
||||
+++ b/src/Widgets/calendar/CalendarView.vala
|
||||
@@ -102,7 +102,7 @@ public class DateTime.Widgets.CalendarView : Gtk.Grid {
|
||||
|
||||
void on_show_weeks_changed () {
|
||||
var model = CalendarModel.get_default ();
|
||||
- weeks.update (model.data_range.first, model.num_weeks);
|
||||
+ weeks.update (model.data_range.first_dt, model.num_weeks);
|
||||
}
|
||||
|
||||
/* Indicates the month has changed */
|
||||
@@ -122,18 +122,18 @@ public class DateTime.Widgets.CalendarView : Gtk.Grid {
|
||||
/* Sets the calendar widgets to the date range of the model */
|
||||
void sync_with_model () {
|
||||
var model = CalendarModel.get_default ();
|
||||
- if (grid.grid_range != null && (model.data_range.equals (grid.grid_range) || grid.grid_range.first.compare (model.data_range.first) == 0))
|
||||
+ if (grid.grid_range != null && (model.data_range.equals (grid.grid_range) || grid.grid_range.first_dt.compare (model.data_range.first_dt) == 0))
|
||||
return; // nothing to do
|
||||
|
||||
GLib.DateTime previous_first = null;
|
||||
if (grid.grid_range != null)
|
||||
- previous_first = grid.grid_range.first;
|
||||
+ previous_first = grid.grid_range.first_dt;
|
||||
var previous_big_grid = big_grid;
|
||||
big_grid = create_big_grid ();
|
||||
stack.add (big_grid);
|
||||
|
||||
header.update_columns (model.week_starts_on);
|
||||
- weeks.update (model.data_range.first, model.num_weeks);
|
||||
+ weeks.update (model.data_range.first_dt, model.num_weeks);
|
||||
grid.set_range (model.data_range, model.month_start);
|
||||
|
||||
// keep focus date on the same day of the month
|
||||
@@ -151,7 +151,7 @@ public class DateTime.Widgets.CalendarView : Gtk.Grid {
|
||||
}
|
||||
|
||||
if (previous_first != null) {
|
||||
- if (previous_first.compare (grid.grid_range.first) == -1) {
|
||||
+ if (previous_first.compare (grid.grid_range.first_dt) == -1) {
|
||||
stack.transition_type = Gtk.StackTransitionType.SLIDE_LEFT;
|
||||
} else {
|
||||
stack.transition_type = Gtk.StackTransitionType.SLIDE_RIGHT;
|
||||
diff --git a/src/Widgets/calendar/Util.vala b/src/Widgets/calendar/Util.vala
|
||||
index f0ffa08..e3fcb69 100644
|
||||
--- a/src/Widgets/calendar/Util.vala
|
||||
+++ b/src/Widgets/calendar/Util.vala
|
||||
@@ -22,8 +22,8 @@
|
||||
namespace Util {
|
||||
/* Represents date range from 'first' to 'last' inclusive */
|
||||
public class DateRange : Object, Gee.Traversable<GLib.DateTime>, Gee.Iterable<GLib.DateTime> {
|
||||
- public GLib.DateTime first { get; private set; }
|
||||
- public GLib.DateTime last { get; private set; }
|
||||
+ public GLib.DateTime first_dt { get; private set; }
|
||||
+ public GLib.DateTime last_dt { get; private set; }
|
||||
public bool @foreach (Gee.ForallFunc<GLib.DateTime> f) {
|
||||
foreach (var date in this) {
|
||||
if (f (date) == false) {
|
||||
@@ -36,22 +36,22 @@ namespace Util {
|
||||
|
||||
public int64 days {
|
||||
get {
|
||||
- return last.difference (first) / GLib.TimeSpan.DAY;
|
||||
+ return last_dt.difference (first_dt) / GLib.TimeSpan.DAY;
|
||||
}
|
||||
}
|
||||
|
||||
public DateRange (GLib.DateTime first, GLib.DateTime last) {
|
||||
assert (first.compare (last) <= 0);
|
||||
- this.first = first;
|
||||
- this.last = last;
|
||||
+ first_dt = first;
|
||||
+ last_dt = last;
|
||||
}
|
||||
|
||||
public DateRange.copy (DateRange date_range) {
|
||||
- this(date_range.first, date_range.last);
|
||||
+ this(date_range.first_dt, date_range.last_dt);
|
||||
}
|
||||
|
||||
public bool equals (DateRange other) {
|
||||
- return (first == other.first && last == other.last);
|
||||
+ return (first_dt == other.first_dt && last_dt == other.last_dt);
|
||||
}
|
||||
|
||||
public Type element_type {
|
||||
@@ -65,7 +65,7 @@ namespace Util {
|
||||
}
|
||||
|
||||
public bool contains (GLib.DateTime time) {
|
||||
- return (first.compare (time) < 1) && (last.compare (time) > -1);
|
||||
+ return (first_dt.compare (time) < 1) && (last_dt.compare (time) > -1);
|
||||
}
|
||||
|
||||
public Gee.SortedSet<GLib.DateTime> to_set () {
|
||||
@@ -107,13 +107,13 @@ namespace Util {
|
||||
|
||||
public DateIterator (DateRange range) {
|
||||
this.range = range;
|
||||
- this.current = range.first.add_days (-1);
|
||||
+ this.current = range.first_dt.add_days (-1);
|
||||
}
|
||||
|
||||
public bool @foreach (Gee.ForallFunc<GLib.DateTime> f) {
|
||||
- var element = range.first;
|
||||
+ var element = range.first_dt;
|
||||
|
||||
- while (element.compare (range.last) < 0) {
|
||||
+ while (element.compare (range.last_dt) < 0) {
|
||||
if (f (element) == false) {
|
||||
return false;
|
||||
}
|
||||
@@ -135,11 +135,11 @@ namespace Util {
|
||||
}
|
||||
|
||||
public bool has_next () {
|
||||
- return current.compare (range.last) < 0;
|
||||
+ return current.compare (range.last_dt) < 0;
|
||||
}
|
||||
|
||||
public bool first () {
|
||||
- current = range.first;
|
||||
+ current = range.first_dt;
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -384,8 +384,8 @@ namespace Util {
|
||||
var exdate = property.get_exdate ();
|
||||
var date = ical_to_date_time (exdate);
|
||||
dateranges.@foreach ((daterange) => {
|
||||
- var first = daterange.first;
|
||||
- var last = daterange.last;
|
||||
+ var first = daterange.first_dt;
|
||||
+ var last = daterange.last_dt;
|
||||
|
||||
if (first.get_year () <= date.get_year () && last.get_year () >= date.get_year ()) {
|
||||
if (first.get_day_of_year () <= date.get_day_of_year () && last.get_day_of_year () >= date.get_day_of_year ()) {
|
||||
@@ -426,7 +426,7 @@ namespace Util {
|
||||
int i = 1;
|
||||
int n = i * rrule.interval;
|
||||
|
||||
- while (view_range.last.compare (start.add_days (n)) > 0) {
|
||||
+ while (view_range.last_dt.compare (start.add_days (n)) > 0) {
|
||||
dateranges.add (new Util.DateRange (start.add_days (n), end.add_days (n)));
|
||||
i++;
|
||||
n = i * rrule.interval;
|
||||
@@ -456,7 +456,7 @@ namespace Util {
|
||||
bool is_null_time = rrule.until.is_null_time () == 1;
|
||||
var temp_start = start.add_years (n);
|
||||
|
||||
- while (view_range.last.compare (temp_start) > 0) {
|
||||
+ while (view_range.last_dt.compare (temp_start) > 0) {
|
||||
if (is_null_time == false) {
|
||||
if (temp_start.get_year () > rrule.until.year) {
|
||||
break;
|
||||
@@ -494,7 +494,7 @@ namespace Util {
|
||||
var start_ical_day = get_date_from_ical_day (start.add_months (n), rrule.by_day[k]);
|
||||
int week_of_month = (int)GLib.Math.ceil ((double)start.get_day_of_month () / 7);
|
||||
|
||||
- while (view_range.last.compare (start_ical_day) > 0) {
|
||||
+ while (view_range.last_dt.compare (start_ical_day) > 0) {
|
||||
if (is_null_time == false) {
|
||||
if (start_ical_day.get_year () > rrule.until.year) {
|
||||
break;
|
||||
@@ -541,7 +541,7 @@ namespace Util {
|
||||
bool is_null_time = rrule.until.is_null_time () == 1;
|
||||
var temp_start = start.add_months (n);
|
||||
|
||||
- while (view_range.last.compare (temp_start) > 0) {
|
||||
+ while (view_range.last_dt.compare (temp_start) > 0) {
|
||||
if (is_null_time == false) {
|
||||
if (temp_start.get_year () > rrule.until.year) {
|
||||
break;
|
||||
@@ -618,7 +618,7 @@ namespace Util {
|
||||
bool is_null_time = rrule.until.is_null_time () == 1;
|
||||
var temp_start = start.add_days (n);
|
||||
|
||||
- while (view_range.last.compare (temp_start) > 0) {
|
||||
+ while (view_range.last_dt.compare (temp_start) > 0) {
|
||||
if (is_null_time == false) {
|
||||
if (temp_start.get_year () > rrule.until.year) {
|
||||
break;
|
||||
@@ -810,4 +810,4 @@ namespace Util {
|
||||
return false;
|
||||
});
|
||||
}
|
||||
-}
|
||||
\ No newline at end of file
|
||||
+}
|
||||
2
sources
2
sources
|
|
@ -1 +1 @@
|
|||
SHA512 (wingpanel-indicator-datetime-2.0.2.tar.gz) = d9723ccc6dc8d346ff7caad7defb01a9b7dae2d4958fd1576a23a25813431c47ee8edb3aa636f88a81ce099c2bc0107b11c2cb94e83eb665adf90694a8f8aecb
|
||||
SHA512 (wingpanel-indicator-datetime-2.1.0.tar.gz) = cfa20e16148fcdd2d63a52c79ec9344fd30e33a015d4d7377f2304c0bac7749d807fb681c092f8ae26779d7636f5b9c7d780822af916c640e657cbde99ea6a60
|
||||
|
|
|
|||
|
|
@ -1,25 +1,22 @@
|
|||
%global __provides_exclude_from ^%{_libdir}/wingpanel/.*\\.so$
|
||||
|
||||
%global appname io.elementary.desktop.wingpanel.datetime
|
||||
|
||||
Name: wingpanel-indicator-datetime
|
||||
Summary: Datetime Indicator for wingpanel
|
||||
Version: 2.0.2
|
||||
Release: 7%{?dist}
|
||||
Version: 2.1.0
|
||||
Release: 1%{?dist}
|
||||
License: GPLv3+
|
||||
|
||||
URL: https://github.com/elementary/%{name}
|
||||
Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz
|
||||
|
||||
# Upstream patch to fix compilation with vala 0.36+
|
||||
# https://github.com/elementary/wingpanel-indicator-datetime/commit/834f0ff2c6aacc6f6453e22986a4d1e7e058d75e
|
||||
Patch0: 00-fix-vala-0.36.patch
|
||||
|
||||
# Patch to fix undefined symbols
|
||||
Patch1: 01-fix-linker-flags.patch
|
||||
|
||||
BuildRequires: cmake
|
||||
BuildRequires: gettext
|
||||
BuildRequires: vala >= 0.22.0
|
||||
BuildRequires: vala-tools
|
||||
|
||||
BuildRequires: pkgconfig(glib-2.0) >= 2.32
|
||||
BuildRequires: pkgconfig(granite)
|
||||
|
|
@ -30,6 +27,7 @@ BuildRequires: pkgconfig(libical)
|
|||
BuildRequires: pkgconfig(libsoup-2.4)
|
||||
BuildRequires: pkgconfig(wingpanel-2.0)
|
||||
|
||||
Requires: wingpanel%{?_isa}
|
||||
Supplements: wingpanel%{?_isa}
|
||||
|
||||
|
||||
|
|
@ -62,10 +60,13 @@ popd
|
|||
|
||||
%{_libdir}/wingpanel/libdatetime.so
|
||||
|
||||
%{_datadir}/glib-2.0/schemas/org.pantheon.desktop.wingpanel.indicators.datetime.gschema.xml
|
||||
%{_datadir}/glib-2.0/schemas/%{appname}.gschema.xml
|
||||
|
||||
|
||||
%changelog
|
||||
* Wed Jul 04 2018 Fabio Valentini <decathorpe@gmail.com> - 2.1.0-1
|
||||
- Update to version 2.1.0.
|
||||
|
||||
* Wed Feb 07 2018 Kalev Lember <klember@redhat.com> - 2.0.2-7
|
||||
- Rebuilt for evolution-data-server soname bump
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue