| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
The last part of loading appointments and events is performed by four
"scan" functions called from io_load_app(). Failure in this part of data
load does not use io_load_error().
The four "scan" functions are changed to return an error message on
failure and NULL otherwise (the previous return value was not used).
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
| |
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Overview of existing implementation
-----------------------------------
The APP panel displays the 'day_items' vector in the 'lb_apt' listbox. A
listbox consists of a scrollwin (structure) in which a number of items
is displayed. The listbox keeps track of:
- the number of items
- the selected item
- the type of each item in an array type[]
- the height of each item (ie. how many screen lines) in an array ch[]
- how to display an item (on the screen)
The latter three are handled by functions fn_type(), fn_height(),
fn_draw(). The first two are used to fill in the corresponding array
entry, type[] or ch[], for item number i, the third draws item number i.
The items are taken from the global variables
vector_t day_items
int day_items_nb
in day.c. Items include captions (DAY_HEADING, DAY_SEPARATOR).
Everything is sorted for display (DAY_HEADING, events, DAY_SEPARATOR,
appts). These are filled in ("stored") [by day_store_items() for the
selected day in the calendar], before being "loaded" into the listbox.
See do_storage() in calcurse.c and ui_day_item_add() in ui-day.c.
New APP panel design
--------------------
Several days are displayed in the APP panel by loading them with
day_store_items().
With several days come several headings and separators. DAY_SEPARATOR is
reinterpreted to separate days, and a new separator, EVNT_SEPARATOR,
separates events from appointments. To sort everything, an 'order'
member of type time_t is added to the day_item structure. It is set for
headings and separators as well as for appointments and events as
follows:
item order
---------------------
DAY_HEADING BGNOFDAY (= midnight)
EVNT_SEPARATOR BGNOFDAY
DAY_SEPARATOR ENDOFDAY
event start time (midnight)
appointment start time (first day)
BGNOFDAY (following days, if any)
The sort function day_cmp() (used by vector_sort) is extended to sort by
order first.
The order field always indicates the day to which an item belongs. This
comes in handy, because with several days in the APP panel it is
necessary to distinguish between the selected day in the calendar and
the selected day in the APP panel. This raises the question which day
should actions (commands) operate on: the one selected in the calendar
or the one selected in the APP panel? Unquestionably the one on the APP
panel which is the one tacitly implied. In most cases it is not a
problem, though, because actions work on the selected item and the
selected day does not come into play. But in some cases it does:
delete item When deleting an occurrence of a repeated item, the
selected day is the exception day to add.
view item day_popup_item() needs the day of the selected item
for display of correct start/end times.
cut/paste item Paste needs the selected day in which to paste.
add item The day of the new item is taken from the calendar.
Instead a dummy event is inserted in an empty day.
This makes the day selectable, which is otherwise
impossible with only the DAY_HEADING displayed. The
dummy event is selectable but cannot be edited or
deleted (but viewed or piped).
With more than one day in the day_items vecter, an appointment spanning
more than one day may occur more than once in the vector (with start/end
times suitably adjusted for display). A day_item is no longer (always)
identified by the aptev_ptr (item) value. Instead the combination
(order, item.<ptr>) is used; order is roughly the day.
Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
| |
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
New filter option: --filter-invert. When present it inverts (negates)
the other filter options combined. This is mostly useful with the -G
option (with -Q the output is limited by the query range (day range)).
The ouput from "calcurse -G <filter options>" is the (set) complement of
"calcurse -G <filter options> --filter-invert". Here <filter options>
may be any combination of filter options.
Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With the exception of filter.type_mask, a filter is only applied if set
explicitly on the command line with a filter option. Whether that is the
case, is determined by comparison with the initialization value. For
date related filters (start_from/to, end_from/to) that is -1, hence the
criterion is != -1, not >= 0.
In generel, a filter initialization value should be invalid (i.e. one
that cannot be set explicitly). As times before the epoch (1 January
1970 00:00:00 UTC) are negative, -1 is a valid Unix time. However, as it
cannot be set from the command line, it is probably no problem?
Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
| |
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
| |
Make that date membership is computed correctly, even if a day has less
than 86400 seconds (e.g. after changing clocks).
Reported-by: Hakan Jerning <jerning@home.se>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
| |
* Order by start time first.
* Order items with the same start time by priority.
* Order items with the same start and priority by description.
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
| |
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
|
|
| |
Implement a new --filter-hash option to filter by object identifiers.
Each object having an identifier that has the specified pattern as a
prefix is matched. Patterns starting with an exclamation mark (!) are
interpreted as negative patterns.
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
| |
Add new format specifiers to print the raw item representation or an
object's hash value.
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
| |
Add functions to serialize non-recurrent objects without immediately
writing them to stdout.
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
|
|
|
| |
A natural convention is to specify the end time of an event as 23:59:59
on the day it is scheduled.
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
|
|
| |
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
| |
This adds a new item filter option --filter-pattern and removes the
whole -S parameter logic, while making -S an alias for --filter-pattern.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds the following filter options that allow for restricting the
set of items that are read from the appointments file:
* --filter-type
* --filter-start-from
* --filter-start-to
* --filter-start-after
* --filter-start-before
* --filter-end-from
* --filter-end-to
* --filter-end-after
* --filter-end-before
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
|
|
|
| |
This completes our switch to the Linux kernel coding style. Note that we
still use deeply nested constructs at some places which need to be fixed
up later.
Converted using the `Lindent` script from the Linux kernel code base,
along with some manual fixes.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Bail out when reading dates such as "02/30/2013" from the appointments
file. These *could* be converted into valid dates but since we never
write invalid dates to that file, these indicate a user error.
Fixes following test cases:
* appointment-009.sh
* appointment-012.sh
* appointment-016.sh
* appointment-019.sh
* event-003.sh
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
| |
Add 2013 to the copyright range for all source and documentation files.
Reported-by: Frederic Culot <frederic@culot.org>
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|\
| |
| |
| |
| |
| | |
Conflicts:
src/day.c
src/recur.c
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Since the result of localtime() is stored in a statically allocated
structure, data was overwritten when a context switch occurred during
(or shortly after) the execution of localtime(), potentially resulting
in critical data corruption. BUG#7 and BUG#8 are likely related.
This patch converts all usages of localtime() with localtime_r(), which
is thread-safe.
Reported-by: Baptiste Jonglez <baptiste@jonglez.org>
Reported-by: Erik Saule <esaule@bmi.osu.edu>
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| |
| | |
This is no longer needed. Note removal, as well as exception handling,
have been moved to separate functions and the cut feature has been
merged into the deletion function.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Remove the note removal code from *_delete()/*_erase() and create a new
wrapper function called day_item_erase_note() that is be used to drop
the note being associated to an item.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| |
| | |
* Actually duplicate an item instead of copying data only.
* Properly clone an item without a note.
* Mark *_dup() public.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| | |
Note that this doesn't remove *_dup() since these might still be needed
later.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Instead of calling type-specific duplication handlers and inserting
clones of the original items when pasting, save the generic day item and
remove the actual item from the linked list, so that it can be inserted
anywhere else later.
The cut/paste buffer is moved to the interaction unit, item-specific cut
operations are changed to remove the item from the linked list only
instead of copying and freeing it. An item is only freed if another item
is cut before the current cut/paste buffer is pasted. All paste
operations are changed and reinsert the actual item instead of creating
a clone.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| | |
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Always pass an item instead of passing a date and a index. This makes
use of the NULL callback that was added with one of the previous
patches.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Change the data type of the "data" parameter from "long" to "void *" in
llist_find_*() signatures to allow for passing more complex objects.
Change all llist_find_*() invocations and callbacks accordingly.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|/
|
|
|
|
|
| |
Remove apoint_get(), event_get(), recur_get_apoint() and
recur_get_event(), since they are no longer used.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Convert our code base to adhere to Linux kernel coding style using
Lindent, with the following exceptions:
* Use spaces, instead of tabs, for indentation.
* Use 2-character indentations (instead of 8 characters).
Rationale: We currently have too much levels of indentation. Using
8-character tabs would make huge code parts unreadable. These need to be
cleaned up before we can switch to 8 characters.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
| |
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
| |
Add 2012 to the copyright range for all source and documentation files.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
| |
Ensure we don't read arbitrary data when fgets() returns a NULL string
(meaning that either the EOF is encountered or an error occurred). This
also fixes a couple of compiler warnings seen with "-Wunused-result".
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
No reason to use "return (x);" here. Refer to the GNU coding guidelines
for details. Created using following semantic patch:
@@
expression expr;
@@
- return (expr);
+ return expr;
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A small style fix that removes all remaining "(void)" casts. Using these
isn't encouraged in GNU coding guidelines and doesn't serve a certain
purpose, except for satisfying a few static code analysis tools. We
already nuked some of these in previous patches, but this semantic patch
should fix what's left:
@@
identifier func;
@@
- (void)func (
+ func (
...);
Long lines were re-formatted manually.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
| |
There is absolutely no reason to make events start on noon, 12:00.
Switching to 00:00 seems totally reasonable here, and makes event
handling a bit easier, also.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
| |
Nasty off-by-one error here. An event should be associated with a day if
it starts at 12:00 a.m. and shouldn't be associated if it enters the
next day.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
|
|
| |
Now that we use hash-based note file names, note files should never be
unlinked as a note file might be shared.
Also, remove the ERASE_FORCE_KEEP_NOTE flag that no longer makes any
sense.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
| |
Strip trailing whitespaces in all source files.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
|
| |
* Update copyright dates (use 2004-2011 as date range everywhere).
* Change copyright holder from "Frederic Culot" to "calcurse Development
Team".
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
| |
Use the new generic list implementation instead of those insane "next"
pointers in events. Includes some cleanups.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
| |
"bad_zero.cocci" spatch from http://coccinelle.lip6.fr/impact_linux.php.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
| |
Use spaces instead of tabs for source code indentation only, strip
trailing whitespaces from lines.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
| |
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
| |
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
| |
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
|
| |
|