[Xfce4-commits] [apps/xfdashboard] 01/01: Remove ununsed enumeration XFDASHBOARD_SELECTION_TARGET_NONE

noreply at xfce.org noreply at xfce.org
Sun Mar 20 15:18:19 CET 2016


This is an automated email from the git hooks/post-receive script.

nomad pushed a commit to branch master
in repository apps/xfdashboard.

commit 02cf5d2ec4b740ccb2aae487549c4fe0c83df9c5
Author: Stephan Haller <nomad at froevel.de>
Date:   Sun Mar 20 15:17:12 2016 +0100

    Remove ununsed enumeration XFDASHBOARD_SELECTION_TARGET_NONE
    
    It was only used internally to check if given function parameter is in range. This was replacable by checking if value is greater or equal to zero.
---
 libxfdashboard/action-button.c           |  3 +--
 libxfdashboard/applications-view.c       |  3 +--
 libxfdashboard/focusable.c               |  3 +--
 libxfdashboard/quicklaunch.c             |  3 +--
 libxfdashboard/search-result-container.c |  3 +--
 libxfdashboard/search-view.c             | 15 +++++----------
 libxfdashboard/types.h                   |  5 +----
 libxfdashboard/windows-view.c            |  3 +--
 8 files changed, 12 insertions(+), 26 deletions(-)

diff --git a/libxfdashboard/action-button.c b/libxfdashboard/action-button.c
index 1599327..805d518 100644
--- a/libxfdashboard/action-button.c
+++ b/libxfdashboard/action-button.c
@@ -272,8 +272,7 @@ static ClutterActor* _xfdashboard_action_button_focusable_find_selection(Xfdashb
 	g_return_val_if_fail(XFDASHBOARD_IS_FOCUSABLE(inFocusable), NULL);
 	g_return_val_if_fail(XFDASHBOARD_IS_ACTION_BUTTON(inFocusable), NULL);
 	g_return_val_if_fail(!inSelection || CLUTTER_IS_ACTOR(inSelection), NULL);
-	g_return_val_if_fail(inDirection>XFDASHBOARD_SELECTION_TARGET_NONE, NULL);
-	g_return_val_if_fail(inDirection<=XFDASHBOARD_SELECTION_TARGET_NEXT, NULL);
+	g_return_val_if_fail(inDirection>=0 && inDirection<=XFDASHBOARD_SELECTION_TARGET_NEXT, NULL);
 
 	self=XFDASHBOARD_ACTION_BUTTON(inFocusable);
 
diff --git a/libxfdashboard/applications-view.c b/libxfdashboard/applications-view.c
index 8ddb76f..7d41d76 100644
--- a/libxfdashboard/applications-view.c
+++ b/libxfdashboard/applications-view.c
@@ -1036,8 +1036,7 @@ static ClutterActor* _xfdashboard_applications_view_focusable_find_selection(Xfd
 	g_return_val_if_fail(XFDASHBOARD_IS_FOCUSABLE(inFocusable), NULL);
 	g_return_val_if_fail(XFDASHBOARD_IS_APPLICATIONS_VIEW(inFocusable), NULL);
 	g_return_val_if_fail(!inSelection || CLUTTER_IS_ACTOR(inSelection), NULL);
-	g_return_val_if_fail(inDirection>XFDASHBOARD_SELECTION_TARGET_NONE, NULL);
-	g_return_val_if_fail(inDirection<=XFDASHBOARD_SELECTION_TARGET_NEXT, NULL);
+	g_return_val_if_fail(inDirection>=0 && inDirection<=XFDASHBOARD_SELECTION_TARGET_NEXT, NULL);
 
 	self=XFDASHBOARD_APPLICATIONS_VIEW(inFocusable);
 	priv=self->priv;
diff --git a/libxfdashboard/focusable.c b/libxfdashboard/focusable.c
index f33f020..d869226 100644
--- a/libxfdashboard/focusable.c
+++ b/libxfdashboard/focusable.c
@@ -860,8 +860,7 @@ ClutterActor* xfdashboard_focusable_find_selection(XfdashboardFocusable *self, C
 
 	g_return_val_if_fail(XFDASHBOARD_IS_FOCUSABLE(self), NULL);
 	g_return_val_if_fail(!inSelection || CLUTTER_IS_ACTOR(inSelection), NULL);
-	g_return_val_if_fail(inDirection>XFDASHBOARD_SELECTION_TARGET_NONE, NULL);
-	g_return_val_if_fail(inDirection<=XFDASHBOARD_SELECTION_TARGET_NEXT, NULL);
+	g_return_val_if_fail(inDirection>=0 && inDirection<=XFDASHBOARD_SELECTION_TARGET_NEXT, NULL);
 
 	iface=XFDASHBOARD_FOCUSABLE_GET_IFACE(self);
 
diff --git a/libxfdashboard/quicklaunch.c b/libxfdashboard/quicklaunch.c
index cb550e6..023c2d0 100644
--- a/libxfdashboard/quicklaunch.c
+++ b/libxfdashboard/quicklaunch.c
@@ -2364,8 +2364,7 @@ static ClutterActor* _xfdashboard_quicklaunch_focusable_find_selection(Xfdashboa
 	g_return_val_if_fail(XFDASHBOARD_IS_FOCUSABLE(inFocusable), FALSE);
 	g_return_val_if_fail(XFDASHBOARD_IS_QUICKLAUNCH(inFocusable), FALSE);
 	g_return_val_if_fail(!inSelection || CLUTTER_IS_ACTOR(inSelection), NULL);
-	g_return_val_if_fail(inDirection>XFDASHBOARD_SELECTION_TARGET_NONE, NULL);
-	g_return_val_if_fail(inDirection<=XFDASHBOARD_SELECTION_TARGET_NEXT, NULL);
+	g_return_val_if_fail(inDirection>=0 && inDirection<=XFDASHBOARD_SELECTION_TARGET_NEXT, NULL);
 
 	self=XFDASHBOARD_QUICKLAUNCH(inFocusable);
 	priv=self->priv;
diff --git a/libxfdashboard/search-result-container.c b/libxfdashboard/search-result-container.c
index 89a13e8..c272fcd 100644
--- a/libxfdashboard/search-result-container.c
+++ b/libxfdashboard/search-result-container.c
@@ -1781,8 +1781,7 @@ ClutterActor* xfdashboard_search_result_container_find_selection(XfdashboardSear
 
 	g_return_val_if_fail(XFDASHBOARD_IS_SEARCH_RESULT_CONTAINER(self), NULL);
 	g_return_val_if_fail(!inSelection || CLUTTER_IS_ACTOR(inSelection), NULL);
-	g_return_val_if_fail(inDirection>XFDASHBOARD_SELECTION_TARGET_NONE, NULL);
-	g_return_val_if_fail(inDirection<=XFDASHBOARD_SELECTION_TARGET_NEXT, NULL);
+	g_return_val_if_fail(inDirection>=0 && inDirection<=XFDASHBOARD_SELECTION_TARGET_NEXT, NULL);
 
 	priv=self->priv;
 	selection=NULL;
diff --git a/libxfdashboard/search-view.c b/libxfdashboard/search-view.c
index 56cb5ae..0c2e5b9 100644
--- a/libxfdashboard/search-view.c
+++ b/libxfdashboard/search-view.c
@@ -1038,11 +1038,9 @@ static ClutterActor* _xfdashboard_search_view_focusable_find_selection_internal_
 	g_return_val_if_fail(XFDASHBOARD_IS_SEARCH_VIEW(self), NULL);
 	g_return_val_if_fail(XFDASHBOARD_IS_SEARCH_RESULT_CONTAINER(inContainer), NULL);
 	g_return_val_if_fail(CLUTTER_IS_ACTOR(inSelection), NULL);
-	g_return_val_if_fail(inDirection>XFDASHBOARD_SELECTION_TARGET_NONE, NULL);
-	g_return_val_if_fail(inDirection<=XFDASHBOARD_SELECTION_TARGET_NEXT, NULL);
+	g_return_val_if_fail(inDirection>=0 && inDirection<=XFDASHBOARD_SELECTION_TARGET_NEXT, NULL);
 	g_return_val_if_fail(inCurrentProviderIter, NULL);
-	g_return_val_if_fail(inNextContainerDirection>XFDASHBOARD_SELECTION_TARGET_NONE, NULL);
-	g_return_val_if_fail(inNextContainerDirection<=XFDASHBOARD_SELECTION_TARGET_NEXT, NULL);
+	g_return_val_if_fail(inNextContainerDirection>=0 && inNextContainerDirection<=XFDASHBOARD_SELECTION_TARGET_NEXT, NULL);
 
 	/* Ask current provider to find selection for requested direction */
 	newSelection=xfdashboard_search_result_container_find_selection(inContainer,
@@ -1125,11 +1123,9 @@ static ClutterActor* _xfdashboard_search_view_focusable_find_selection_internal_
 	g_return_val_if_fail(XFDASHBOARD_IS_SEARCH_VIEW(self), NULL);
 	g_return_val_if_fail(XFDASHBOARD_IS_SEARCH_RESULT_CONTAINER(inContainer), NULL);
 	g_return_val_if_fail(CLUTTER_IS_ACTOR(inSelection), NULL);
-	g_return_val_if_fail(inDirection>XFDASHBOARD_SELECTION_TARGET_NONE, NULL);
-	g_return_val_if_fail(inDirection<=XFDASHBOARD_SELECTION_TARGET_NEXT, NULL);
+	g_return_val_if_fail(inDirection>=0 && inDirection<=XFDASHBOARD_SELECTION_TARGET_NEXT, NULL);
 	g_return_val_if_fail(inCurrentProviderIter, NULL);
-	g_return_val_if_fail(inNextContainerDirection>XFDASHBOARD_SELECTION_TARGET_NONE, NULL);
-	g_return_val_if_fail(inNextContainerDirection<=XFDASHBOARD_SELECTION_TARGET_NEXT, NULL);
+	g_return_val_if_fail(inNextContainerDirection>=0 && inNextContainerDirection<=XFDASHBOARD_SELECTION_TARGET_NEXT, NULL);
 
 	/* Ask current provider to find selection for requested direction */
 	newSelection=xfdashboard_search_result_container_find_selection(inContainer,
@@ -1213,8 +1209,7 @@ static ClutterActor* _xfdashboard_search_view_focusable_find_selection(Xfdashboa
 	g_return_val_if_fail(XFDASHBOARD_IS_FOCUSABLE(inFocusable), NULL);
 	g_return_val_if_fail(XFDASHBOARD_IS_SEARCH_VIEW(inFocusable), NULL);
 	g_return_val_if_fail(!inSelection || CLUTTER_IS_ACTOR(inSelection), NULL);
-	g_return_val_if_fail(inDirection>XFDASHBOARD_SELECTION_TARGET_NONE, NULL);
-	g_return_val_if_fail(inDirection<=XFDASHBOARD_SELECTION_TARGET_NEXT, NULL);
+	g_return_val_if_fail(inDirection>=0 && inDirection<=XFDASHBOARD_SELECTION_TARGET_NEXT, NULL);
 
 	self=XFDASHBOARD_SEARCH_VIEW(inFocusable);
 	priv=self->priv;
diff --git a/libxfdashboard/types.h b/libxfdashboard/types.h
index 5b0bc3c..777c104 100644
--- a/libxfdashboard/types.h
+++ b/libxfdashboard/types.h
@@ -156,7 +156,6 @@ typedef enum /*< prefix=XFDASHBOARD_STAGE_BACKGROUND_IMAGE_TYPE >*/
 
 /**
  * XfdashboardSelectionTarget:
- * @XFDASHBOARD_SELECTION_TARGET_NONE: *used internally*
  * @XFDASHBOARD_SELECTION_TARGET_LEFT: Move to next selectable actor at left side.
  * @XFDASHBOARD_SELECTION_TARGET_RIGHT: Move to next selectable actor at right side.
  * @XFDASHBOARD_SELECTION_TARGET_UP: Move to next selectable actor at top side.
@@ -173,9 +172,7 @@ typedef enum /*< prefix=XFDASHBOARD_STAGE_BACKGROUND_IMAGE_TYPE >*/
  */
 typedef enum /*< prefix=XFDASHBOARD_SELECTION_TARGET >*/
 {
-	XFDASHBOARD_SELECTION_TARGET_NONE=0, /* Used internally */
-
-	XFDASHBOARD_SELECTION_TARGET_LEFT,
+	XFDASHBOARD_SELECTION_TARGET_LEFT=0,
 	XFDASHBOARD_SELECTION_TARGET_RIGHT,
 	XFDASHBOARD_SELECTION_TARGET_UP,
 	XFDASHBOARD_SELECTION_TARGET_DOWN,
diff --git a/libxfdashboard/windows-view.c b/libxfdashboard/windows-view.c
index 6deae0c..8447e3f 100644
--- a/libxfdashboard/windows-view.c
+++ b/libxfdashboard/windows-view.c
@@ -1432,8 +1432,7 @@ static ClutterActor* _xfdashboard_windows_view_focusable_find_selection(Xfdashbo
 	g_return_val_if_fail(XFDASHBOARD_IS_FOCUSABLE(inFocusable), NULL);
 	g_return_val_if_fail(XFDASHBOARD_IS_WINDOWS_VIEW(inFocusable), NULL);
 	g_return_val_if_fail(!inSelection || CLUTTER_IS_ACTOR(inSelection), NULL);
-	g_return_val_if_fail(inDirection>XFDASHBOARD_SELECTION_TARGET_NONE, NULL);
-	g_return_val_if_fail(inDirection<=XFDASHBOARD_SELECTION_TARGET_NEXT, NULL);
+	g_return_val_if_fail(inDirection>=0 && inDirection<=XFDASHBOARD_SELECTION_TARGET_NEXT, NULL);
 
 	self=XFDASHBOARD_WINDOWS_VIEW(inFocusable);
 	priv=self->priv;

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list