From b838d13963a977a65e252e1a62854ca96de96b47 Mon Sep 17 00:00:00 2001
From: Alexander Mueller <alexander.mueller@hs.uni-hamburg.de>
Date: Thu, 15 Sep 2005 08:16:40 +0000
Subject: [PATCH] BugID: 136 Made the g_navigatorID dependent on the manager ID
 of the Navigator UI manager. Not deleted instances are reused on starting a
 Navigator UI manager with the same number. (And changed the file type).

---
 .../nav_fw/gcfnav-configuration-functions.ctl | 26 +++++--------------
 1 file changed, 7 insertions(+), 19 deletions(-)

diff --git a/MAC/Navigator/scripts/libs/nav_fw/gcfnav-configuration-functions.ctl b/MAC/Navigator/scripts/libs/nav_fw/gcfnav-configuration-functions.ctl
index 63dac2bd992..11cfe84931e 100644
--- a/MAC/Navigator/scripts/libs/nav_fw/gcfnav-configuration-functions.ctl
+++ b/MAC/Navigator/scripts/libs/nav_fw/gcfnav-configuration-functions.ctl
@@ -149,7 +149,7 @@ int navConfigGetNavigatorID()
 void navConfigSetNavigatorID(int newID)
 {
   bool createConfiguration = false;
-  if(newID != 0)
+  if(newID > 256)
   {
     g_navigatorID = newID;
     if(!dpAccessable(DPNAME_NAVIGATOR + g_navigatorID))
@@ -159,30 +159,18 @@ void navConfigSetNavigatorID(int newID)
   }
   else
   {
-    int id=1;
-    while(id<20 && !createConfiguration) // if no free config found, use config #20
+  	g_navigatorID = myManNum();
+    if(!dpAccessable(DPNAME_NAVIGATOR + g_navigatorID))
     {
-      if(!dpAccessable(DPNAME_NAVIGATOR + id))
-      {
-        g_navigatorID = id;
-        createConfiguration=true;
-      }
-      else
-      {
-        id++;
-      }
+      createConfiguration = true;
     }
   }
-  if(createConfiguration)
-  {
-    dpCreate(DPNAME_NAVIGATOR + g_navigatorID, DPTYPENAME_NAVIGATOR_INSTANCE);
-  }
-  else if(!createConfiguration) // if no free config found, use config #20
+  if (createConfiguration)
   {
-    g_navigatorID = 20;
     dpCreate(DPNAME_NAVIGATOR + g_navigatorID, DPTYPENAME_NAVIGATOR_INSTANCE);
   }
-  LOG_DEBUG("Using Navigator ID:",g_navigatorID);
+  dpSet(DPNAME_NAVIGATOR + g_navigatorID + "." + ELNAME_USECOUNT, 0);
+  LOG_DEBUG("Using Navigator ID:", g_navigatorID);
 }
   
 ///////////////////////////////////////////////////////////////////////////
-- 
GitLab