[easytag] Tighten invariants when navigating the file list
- From: David King <davidk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [easytag] Tighten invariants when navigating the file list
- Date: Sat, 21 Feb 2015 11:17:32 +0000 (UTC)
commit dc2d03daa4924aaa02ab7065ebc46b4fec9ae716
Author: David King <amigadave amigadave com>
Date: Sat Feb 21 11:05:54 2015 +0000
Tighten invariants when navigating the file list
src/application_window.c | 15 +++++++--------
1 files changed, 7 insertions(+), 8 deletions(-)
---
diff --git a/src/application_window.c b/src/application_window.c
index c35d495..163491c 100644
--- a/src/application_window.c
+++ b/src/application_window.c
@@ -1283,8 +1283,7 @@ on_go_first (GSimpleAction *action,
self = ET_APPLICATION_WINDOW (user_data);
priv = et_application_window_get_instance_private (self);
- if (!ETCore->ETFileDisplayedList)
- return;
+ g_return_if_fail (ETCore->ETFileDisplayedList);
et_application_window_update_et_file_from_ui (self);
@@ -1323,8 +1322,8 @@ on_go_previous (GSimpleAction *action,
self = ET_APPLICATION_WINDOW (user_data);
priv = et_application_window_get_instance_private (self);
- if (!ETCore->ETFileDisplayedList || !ETCore->ETFileDisplayedList->prev)
- return;
+ g_return_if_fail (ETCore->ETFileDisplayedList
+ && ETCore->ETFileDisplayedList->prev);
et_application_window_update_et_file_from_ui (self);
@@ -1362,8 +1361,8 @@ on_go_next (GSimpleAction *action,
self = ET_APPLICATION_WINDOW (user_data);
priv = et_application_window_get_instance_private (self);
- if (!ETCore->ETFileDisplayedList || !ETCore->ETFileDisplayedList->next)
- return;
+ g_return_if_fail (ETCore->ETFileDisplayedList
+ && ETCore->ETFileDisplayedList->next);
et_application_window_update_et_file_from_ui (self);
@@ -1401,8 +1400,8 @@ on_go_last (GSimpleAction *action,
self = ET_APPLICATION_WINDOW (user_data);
priv = et_application_window_get_instance_private (self);
- if (!ETCore->ETFileDisplayedList || !ETCore->ETFileDisplayedList->next)
- return;
+ g_return_if_fail (ETCore->ETFileDisplayedList
+ && ETCore->ETFileDisplayedList->next);
et_application_window_update_et_file_from_ui (self);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]