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 795349 - Disable export button when the logs are empty.
Disable export button when the logs are empty.
Status: RESOLVED FIXED
Product: gnome-logs
Classification: Other
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: gnome-logs maintainer(s)
gnome-logs maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2018-04-18 09:00 UTC by Ankriti Sachan
Modified: 2018-04-21 02:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Disable export button when the logs are empty (5.60 KB, patch)
2018-04-18 09:22 UTC, Ankriti Sachan
none Details | Review
Disable export button when the logs are empty (6.26 KB, patch)
2018-04-18 18:01 UTC, Ankriti Sachan
none Details | Review
Disable 'export' action when the logs are empty (6.27 KB, patch)
2018-04-20 03:54 UTC, Ankriti Sachan
committed Details | Review

Description Ankriti Sachan 2018-04-18 09:00:38 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.
Comment 1 Ankriti Sachan 2018-04-18 09:22:46 UTC
Created attachment 371080 [details] [review]
Disable export button when the logs are empty
Comment 2 Jonathan Kang 2018-04-18 09:40:31 UTC
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.
Comment 3 Ankriti Sachan 2018-04-18 18:01:31 UTC
Created attachment 371110 [details] [review]
Disable export button when the logs are empty
Comment 4 Jonathan Kang 2018-04-19 09:59:34 UTC
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.
Comment 5 Ankriti Sachan 2018-04-20 03:54:55 UTC
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 6 Jonathan Kang 2018-04-21 02:21:28 UTC
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.