After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 778583 - todo.txt: Error when opening Todo.txt
todo.txt: Error when opening Todo.txt
Status: RESOLVED FIXED
Product: gnome-todo
Classification: Other
Component: General
3.22.x
Other Linux
: Normal normal
: ---
Assigned To: GNOME To Do maintainer(s)
GNOME To Do maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2017-02-14 03:40 UTC by Mohammed Sadiq
Modified: 2017-02-22 12:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gtd-plugin-todo-txt: set default source when todo.txt source is not set (1.29 KB, patch)
2017-02-17 11:05 UTC, Rohit Kaushik
none Details | Review
gtd-plugin-todo-txt: set default source when todo.txt source is not set (1.62 KB, patch)
2017-02-17 16:40 UTC, Rohit Kaushik
committed Details | Review
todo.txt plugin: move to GFile API (8.68 KB, patch)
2017-02-17 16:50 UTC, Rohit Kaushik
committed Details | Review

Description Mohammed Sadiq 2017-02-14 03:40:34 UTC
I can't enable todo.txt plugin.

I get the following error logged into terminal:
 gtd_provider_todo_txt_load_source: Error while opening Todo.txt: Operation not supported

May be because Todo.txt file isn't present already, and todo.txt plugin doesn't creates it.

Thanks
Comment 1 Rohit Kaushik 2017-02-17 11:05:11 UTC
Created attachment 346053 [details] [review]
gtd-plugin-todo-txt: set default source when todo.txt source is not set

Earlier default source was set when the self->source was NULL.
but this aprroach is wrong as self->source is set to
g_settings_get_string (self->settings, "file") during initialization,
as g_settings_get_string return a empty string if the source is never set.
So now set default source is called when the self->source is empty and not
NULL.
Due to this the source is never set on first start and hence the plugin
does not loads.
Comment 2 Rohit Kaushik 2017-02-17 16:40:17 UTC
Created attachment 346087 [details] [review]
gtd-plugin-todo-txt: set default source when todo.txt source is not set

Earlier default source was set when the self->source was NULL.
but this aprroach is wrong as self->source is set to
g_settings_get_string (self->settings, "file") during initialization,
as g_settings_get_string return a empty string if the source is never set.
So now set default source is called when the self->source is empty and not
NULL.
Due to this the source is never set on first start and hence the plugin
does not loads.
Comment 3 Rohit Kaushik 2017-02-17 16:50:27 UTC
Created attachment 346090 [details] [review]
todo.txt plugin: move to GFile API

Currently gtd-plugin-todo-txt has a source element in the struct
which stores the todo.txt path. This is not needed and the code
should make use of GFile API only.
so the source variable has been removed from the structure in both
provider and plugin and now we only use source_file.
Comment 4 Georges Basile Stavracas Neto 2017-02-22 12:14:23 UTC
Review of attachment 346087 [details] [review]:

LGTM
Comment 5 Georges Basile Stavracas Neto 2017-02-22 12:15:43 UTC
Review of attachment 346090 [details] [review]:

LGTM
Comment 6 Georges Basile Stavracas Neto 2017-02-22 12:19:30 UTC
Thank you so much for these patches. It's working much, much better now! :)

Attachment 346087 [details] pushed as 46225b6 - todo-txt: set default source when todo.txt source is not set
Attachment 346090 [details] pushed as 388c8e4 - todo.txt plugin: move to GFile API