Commit Graph
27 Commits
Author SHA1 Message Date
Georges Basile Stavracas Neto 7b68931973 search/engine: Increase range to a whole year
This is still not the ideal solution, but now that we have widgetry
that can handle hundreds of thousands of events, no limitations to
the maximum number of events, and no crashes related on the search
engine, we can increase the search range to a broader value and
show more results.

Helps: https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/624
2023-04-22 10:22:57 +00:00
Georges Basile Stavracas Neto d7b2a7d88c search/hit-event: Fix compare function
The current compare function puts events closer to today at the end
of the list, instead of the beginning. Revert that.
2023-04-22 10:22:57 +00:00
Georges Basile Stavracas Neto 8170ee0455 search: Remove artificial limits
Now that we use a widget that appropriately handles infinite items,
we don't need to limit anything anymore.

Related: https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/624
2023-04-22 10:22:57 +00:00
Georges Basile Stavracas Neto badb7b3d9c search/model: Shuffle some code around 2023-04-22 10:22:57 +00:00
Georges Basile Stavracas Neto afdec9e811 search/hit: Fix double unref
When I originally wrote the code, I expected to create a new icon
every time that function was called. That expectation changed, but
the code wasn't fully updated.

Use g_value_set_object() instead of g_value_take_object().
2023-04-22 10:22:57 +00:00
Georges Basile Stavracas Neto 6b57c459a3 search/hit-event: Compare calendars too
This allows not mixing up similar events from different calendars.
2023-03-16 09:28:30 -03:00
Georges Basile Stavracas Neto 5dd98ea01c search/model: Don't ignore results past limits
Instead, monitor where items are added relative to each other, and
proxy the 'items-changed' call to match the inner list.

Helps https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/989
2023-03-16 09:28:30 -03:00
Georges Basile Stavracas Neto a216706026 search/model: Use boolean result to find equal hits
It's a bit better than using -1 with an unsigned int :)
2023-03-16 09:28:30 -03:00
Georges Basile Stavracas Neto daec07c9f6 search: Rework threading
Search uses GcalTimeline, an object that is meant to be single
threaded, in multple threads. That mostly worked okay because
GcalTimeline mostly relies on GcalCalendarMonitor, which is
heavily threaded. But, sometimes it failed.

Rework that to be single-threaded, and asynchronous.

Closes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/981
Closes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/987
Closes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/988
2023-03-16 12:27:47 +00:00
Abdullahi Usman be0a2312d9 search-model: check for duplicate events in search bar 2022-06-21 12:28:54 +00:00
Georges Basile Stavracas Neto 74c410bd85 Port search subsystem to GTK4 2022-02-11 09:18:38 -03:00
Georges Basile Stavracas Neto 2139f40e67 project: Adjust color rendering to use GdkPaintable 2022-02-11 09:18:38 -03:00
Georges Basile Stavracas Neto e67ebcfc50 project: Move all UI-related files to src/gui/
So we can have a nice separation.
2020-10-30 14:44:33 -03:00
Georges Basile Stavracas Neto eb954505e4 project: Split meson files in subdirs
It allows us to better control what each subdir does, etc. This is
only the first step; we want to also split GResources, etc.
2020-10-30 13:45:50 -03:00
Georges Basile Stavracas Neto 12fd607d56 utils: Make date comparison follow time comparison semantics
Right now, comparing dates with gcal_date_time_compare_date() gives
the exact opposite result of when comparing using g_date_time_compare().

As shown by this patch, this was a source of *many* bugs.
2020-04-14 19:08:06 +00:00
Georges Basile Stavracas Neto c0016b266b search: Port to GcalTimeline 2020-04-01 21:06:51 -03:00
Georges Basile Stavracas Neto 047078d67d build: Move foward typedefs to gcal-types.h
Standard practice; gcal-types.h is meant to only be
used by header files.
2020-04-01 21:06:50 -03:00
Georges Basile Stavracas Neto a0403b0b3e search-model: Wait for results before returning
Dazzle is very sensitive to returning empty search results,
and ends up flickering when we pass a search model that is
not yet populated.

Wait for a few results, or for 150ms, before returning the
model.

https://gitlab.gnome.org/GNOME/gnome-calendar/issues/468
2019-10-04 01:55:08 -03:00
Michael Catanzaro 8e6a3b9f3f Fix crashes when e_cal_util_get_system_timezone() returns NULL
The return value is nullable, but gnome-calendar fails to check it.

Because the nullable return value is inconvenient for us, we can instead
add and use gcal_context_get_icaltimezone() to supplement the existing
gcal_context_get_timezone().

We'll also need a function to convert from GTimeZone to ICalTimezone,
gcal_timezone_to_icaltimezone().

Fixes #419
2019-09-19 16:01:44 -05:00
Georges Basile Stavracas Neto 78680d9b5b search-engine: Fix wrong debug message 2019-06-24 21:32:59 -03:00
Georges Basile Stavracas Neto ea60c95a44 manager: Rework signals to use GcalCalendar 2019-05-04 12:05:39 -03:00
Georges Basile Stavracas Neto 1118c74881 event: Receive and operate on GcalCalendar
Instead of receiving an ESource, receive a GcalCalendar
and operate on it. Many places needed to be adjusted for
that.

Tests need to be rethinked.
2019-05-04 12:05:39 -03:00
Georges Basile Stavracas Neto d6c5bf032d search: Open event from search results
And this finally hooks up the last missing bit from the
search engine: opening events from search results.

All the necessary plumbing is there for extending search
with other commands or results, such as go to date, etc.
2019-04-29 17:08:54 -03:00
Georges Basile Stavracas Neto 74af4af540 search-button: Remove useless debug message 2019-04-29 17:08:53 -03:00
Georges Basile Stavracas Neto 6994723d79 search: Introduce a search engine
This is architectured in such a way that it will
allow us to introduce other searcheable terms in
the future.

All the functionality that in the past was in
GcalManager is now spread across GcalSearchModel,
GcalSearchHitEvent and GcalSearchEngine.
2019-04-29 17:08:53 -03:00
Georges Basile Stavracas Neto dfbd7fca26 search-button: Add a context property
We will use it later when GcalContext has a search
engine.
2019-04-29 17:08:52 -03:00
Georges Basile Stavracas Neto 36f4809c1c window: Turn search button into a DzlSuggestionButton
Gives us a nice, smooth and sweet animation.
2019-04-29 17:08:51 -03:00