From b36bca71cac789c258b78767e6d9d66d746d91b9 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Tue, 10 Jun 2008 16:57:09 +0000 Subject: [PATCH] always ensure we have a valid view id. BUG:163053 svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=819127 --- view.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/view.cpp b/view.cpp index fb43a13c9..b24fd8dc6 100644 --- a/view.cpp +++ b/view.cpp @@ -39,15 +39,19 @@ public: trackChanges(true), desktop(-1), containment(0), - q(view) - + q(view), + viewId(0) { - if (uniqueId == 0) { - viewId = ++s_maxViewId; - } else if (uniqueId > s_maxViewId) { + if (uniqueId > s_maxViewId) { s_maxViewId = uniqueId; viewId = uniqueId; } + + if (viewId == 0) { + // we didn't get a sane value assigned to us, so lets + // grab the next available id + viewId = ++s_maxViewId; + } } ~Private()