GNOME Bugzilla – Bug 795349
Disable export button when the logs are empty.
Last modified: 2018-04-21 02:22:04 UTC
Currently, we are able to export journal logs even when there are no entries shown, e.g. when there are no search results present for a query , resulting in creation of an empty file on export. To prevent it, it would be better to disable 'export' action when there are no logs to display.
Created attachment 371080 [details] [review] Disable export button when the logs are empty
Review of attachment 371080 [details] [review]: ::: src/gl-journal-model.c @@ +120,3 @@ + else + { + g_signal_emit (model, signals[ENABLE_EXPORT], 0); one concern about this: signals[ENABLE_EXPORT] is gonna be emitted many times as long as new log entries are fetched. But actually we only need to emit this signal once to enable exporting. ::: src/gl-window.c @@ +365,3 @@ +void +disable_export_button (GlWindow *window) disable/enable_export might be a better name for these two callbacks, as they disable/enable the export action.
Created attachment 371110 [details] [review] Disable export button when the logs are empty
Review of attachment 371110 [details] [review]: Looks good overall. Just a few coding style comments as below. * The commit message should follow a standard format: a short title of 50 chars length, followed by a longer explanation of 72 chars length each line. For more information, see https://wiki.gnome.org/Newcomers/SubmitContribution ::: src/gl-journal-model.c @@ +62,3 @@ + /* export variable is used to identify when total number of entries,to display, + * changes from 0 to any other number and only then emit 'ENABLE_EXPORT'signal + * once instead of emitting it repeatedly when new entries are continuously added */ Please try to limit each line within 80 characters.
Created attachment 371149 [details] [review] Disable 'export' action when the logs are empty Same as previous one, just a few minor changes in commit message and comment-style.
Comment on attachment 371149 [details] [review] Disable 'export' action when the logs are empty I made some minor changes and pushed it to master as commit 93bb0931b29942310df7edfb83ccd18d1a9b8a4b.