From 015acded4a6be165c30d088747f740933fa79483 Mon Sep 17 00:00:00 2001
From: Jan Arve Saether <jan-arve.saether@digia.com>
Date: Fri, 10 May 2013 10:28:03 +0200
Subject: [PATCH] Remove unneeded checks for -1 (infinity) in SplitView

With commit 16558ac71509fe51a4cf18f238e4f61b37323fe4
Layout.maximumWidth and Layout.maximumHeight now returns
Number.POSITIVE_INFINITY instead of -1.
As described in that commit, comparisons against those properties
does not need any special handling for -1 anymore.

Change-Id: I8d4bba0fa87f9c67ac30dd40a8be8cb99abba283
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
---
 src/controls/SplitView.qml | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/controls/SplitView.qml b/src/controls/SplitView.qml
index 0c50bc3bb..fc43874ea 100644
--- a/src/controls/SplitView.qml
+++ b/src/controls/SplitView.qml
@@ -231,9 +231,9 @@ Item {
 
         function clampedMinMax(value, minimum, maximum)
         {
-            if (minimum !== -1 && value < minimum)
+            if (value < minimum)
                 value = minimum
-            if (maximum !== -1 && value > maximum)
+            if (value > maximum)
                 value = maximum
             return value
         }
@@ -286,8 +286,7 @@ Item {
                 var fillItem = __items[fillIndex]
                 var superfluous = root[d.size] - d.accumulatedSize(0, __items.length, false)
                 var s = Math.max(superfluous, fillItem.Layout[minimum])
-                if (fillItem.Layout[maximum] !== -1)
-                    s = Math.min(s, fillItem.Layout[maximum])
+                s = Math.min(s, fillItem.Layout[maximum])
                 fillItem[d.size] = s
             }
 
-- 
GitLab