summaryrefslogtreecommitdiff
path: root/src/todo.c
AgeCommit message (Collapse)Author
2011-12-09src/todo.c: Remove several unneeded variablesLukas Fleischer
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-11-14Use a global configuration variableLukas Fleischer
This is one of the few valid use cases for a global variable. No need to make it pseudo-local and pass it from one function to another. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-11-02Remove parentheses from return statementsLukas Fleischer
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>
2011-11-02Do not cast unused return values to voidLukas Fleischer
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>
2011-11-02Avoid use of printf()/fprintf()Lukas Fleischer
Use one of the following functions where appropriate: * puts() (whenever we print hard coded strings to stdout) * fputs() (whenever we print hard coded strings to a stream) * putchar() (whenever we print a single character to stdout) * fputc() (whenever we print a single character to a stream) * strncpy() (whenever we copy hard coded strings to a buffer) This removes the overhead introduced by the format string parser and reduces the number of false positive C-format strings spotted by xgettext(1)'s heuristics. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-10-06Add count parameter to *_{in,de}crease()Lukas Fleischer
This allows for moving more than one item up/down. This currently isn't used anywhere but will be bound to a key with one of the following patches. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-10-06Remove temporary highlight pointersLukas Fleischer
Add an additional check to apoint_update_panel() and todo_update_panel() and only highlight currently selected items if the corresponding panel is active. This allows us to remove all the highlight pointer juggling that we used whenever the panel selection changed. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-10-05Do not unlink() note files on note removalLukas Fleischer
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>
2011-10-05Accept variable length note namesLukas Fleischer
Read up to the first blank in note_read() instead of assuming a fixed-width note file name. Accept everything up to 40 characters (which is the length of a SHA1 hash in hexadecimal representation). Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-21Refactor out note functionsLukas Fleischer
* Add new note_edit() and note_view() helper functions. Use these instead of copy-pasted code in *_note_edit(). * Move all note-related functions (note_edit(), note_view(), note_erase()) to a new source file "note.c". Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-05Add todo_pipe_item() functionLukas Fleischer
Pipe a serialized todo item to an external process, similar to what day_pipe_item() does (cf. c3f532d814e555abf67efb136491956428f19965). Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-02Refactor out todo item serializationLukas Fleischer
Add a todo_write() function that allows one to serialize todo items and write serialized data to an output stream in a fashion similar to apoint_write() and event_write(). Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-02Use constant for maximum UTF-8 character sizeLukas Fleischer
Introduce a UTF8_MAXLEN constant instead of using the literal value "6" at various places. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-02Make display_todo_item() UTF-8 compatibleLukas Fleischer
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-22Update copyright notices in source files, documentation and "COPYING".Lukas Fleischer
* 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>
2011-04-22Return -1 in io_file_is_empty() if file cannot be accessed.Lukas Fleischer
Ensure files don't appear as empty if fopen() fails (e.g. on temporary EACCES failures). Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-19Use generic lists for todo items.Lukas Fleischer
Use the new generic list implementation instead of "next" pointers in todo items. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-12Drop empty notes after editing.Lukas Fleischer
Keeping empty notes doesn't make sense here. Also, there doesn't seem to be a simple way to erase notes yet. This will make calcurse delete any notes that are empty (meaning that they are either 0-byte files or contain nothing but a newline character) when returning from the editor. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-05Compare pointers to "NULL" instead of "0".Lukas Fleischer
"bad_zero.cocci" spatch from http://coccinelle.lip6.fr/impact_linux.php. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-03Remove dead assignments spotted by clang-analyzer.Lukas Fleischer
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-03-14Overall indentation fixes.Lukas Fleischer
Use spaces instead of tabs for source code indentation only, strip trailing whitespaces from lines. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-03-04Update website links to match the new URL.Lukas Fleischer
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-03-04Update mail addresses to match the new mailing lists.Lukas Fleischer
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-03-03Remove CVS "$Id" headers.Lukas Fleischer
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-03-03Fixed file permissions.Lukas Fleischer
2010-03-20All headers gathered into a single one. Typedefs suppressed.Frederic Culot
2009-07-19Make use of erase_note() whenever possible.Frederic Culot
2009-07-12stdbool header removed, unsigned type used insteadFrederic Culot
2009-07-05Switch to BSD license.Frederic Culot
2009-06-26Ability to flag todo items as completed.Frederic Culot
2009-01-03more code cleanupFrederic Culot
2009-01-02various bugfixesFrederic Culot
2008-12-28Added wrappers around libc's memory management functions, to easily debug ↵Frederic Culot
memory usage
2008-12-15small bugfixes and a major one (freeze when deleting an appointment's note, ↵Frederic Culot
thanks Jan for reporting it)
2008-12-12code cleanupFrederic Culot
2008-12-08color configuration menu adapted to handle user-defined key bindingsFrederic Culot
2008-12-07Checks added while loading key bindings configuration.Frederic Culot
2008-11-16More work on implementing user-definable keybindingsFrederic Culot
2008-11-09Loading of user-configurable keys implementedFrederic Culot
2008-04-19some memory leaks fixed using valgrind and some minor code cleanupFrederic Culot
2008-04-12Yet another style for source code. GNU style now used (I am fed up with tabs...)Frederic Culot
2008-04-04no more segfault when changing item priority (fixes Debian Bug #469297)Frederic Culot
2008-01-20Code parts related to item update rewrittenFrederic Culot
2008-01-13Ability to attach notes to appointments and events addedFrederic Culot
2007-12-31Notes attached to todos can now be suppressedFrederic Culot
2007-12-30Ability to attach notes to todo items addedFrederic Culot
2007-10-21routines updated to handle new window_t and window_e typesFrederic Culot
2007-08-15hilt_tod moved to static variable hiltFrederic Culot
todo_hilt(), todo_hilt_set(), todo_hilt_decrease(), todo_hilt_increase(), todo_saved_mesg(), todo_nb(), todo_set_nb(), todo_set_first(), todo_first_increase(), todo_first_decrease(), todo_hilt_pos() added
2007-07-28unuseful headers removed and some functions became staticFrederic Culot
2007-07-21todo_update_panel() and todo_delete() addedFrederic Culot