[devhelp/wip/swilmet/misc-improvements: 4/18] book-manager: avoid double negation
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [devhelp/wip/swilmet/misc-improvements: 4/18] book-manager: avoid double negation
- Date: Sun, 24 May 2015 15:34:53 +0000 (UTC)
commit 4b0e5829e9edbb1ea7f91015b96fc881ea93ee73
Author: Sébastien Wilmet <swilmet gnome org>
Date: Sun May 24 13:23:12 2015 +0200
book-manager: avoid double negation
"book_enabled" is clearer than "!book_disabled".
https://bugzilla.gnome.org/show_bug.cgi?id=749797
src/dh-book-manager.c | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/src/dh-book-manager.c b/src/dh-book-manager.c
index ccfb2c8..bef259e 100644
--- a/src/dh-book-manager.c
+++ b/src/dh-book-manager.c
@@ -657,7 +657,7 @@ book_manager_add_from_filepath (DhBookManager *book_manager,
{
DhBookManagerPrivate *priv;
DhBook *book;
- gboolean book_disabled;
+ gboolean book_enabled;
g_return_if_fail (book_manager);
g_return_if_fail (book_path);
@@ -692,12 +692,11 @@ book_manager_add_from_filepath (DhBookManager *book_manager,
(GCompareFunc)dh_book_cmp_by_title);
/* Set the proper enabled/disabled state, depending on conf */
- book_disabled = book_manager_is_book_disabled_in_conf (book_manager,
- book);
- dh_book_set_enabled (book, !book_disabled);
+ book_enabled = !book_manager_is_book_disabled_in_conf (book_manager, book);
+ dh_book_set_enabled (book, book_enabled);
/* Store language if enabled */
- if (!book_disabled) {
+ if (book_enabled) {
book_manager_inc_language (book_manager,
dh_book_get_language (book));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]