atoms modules tests fixed
[scilab.git] / scilab / modules / atoms / macros / atoms_internals / atomsGetHomeListboxElts.sci
index 6cfcfbe..c671a96 100644 (file)
 // http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
 
 function elements = atomsGetHomeListboxElts()
-    items_str  = [];
-    items_mat  = [];
+    items_str  = "";
+    items_mat  = "";
 
     installed  = atomsGetInstalled();
     tmp = atomsAutoloadList("all")
     autoloaded = tmp(:,1)
-    allModules = get("atomsFigure", "UserData");
+    if ~isempty(get("atomsFigure")) then
+        allModules = get("atomsFigure", "UserData");
 
-    items_str  = atomsSetInstalledList(installed)
-    items_mat = installed(:,1)
-    items_mat = [emptystr(items_mat)+"module" items_mat ]
+        items_str  = atomsSetInstalledList(installed)
+        items_mat = installed(:,1)
+        if isempty(items_str)
+            items_str = "";
+            items_mat = "";
+        end
+        items_mat = [emptystr(items_mat)+"module" items_mat ]
 
-    if items_str==[] then
-        elements("items_str") = "";
-    else
         elements("items_str") = items_str;
+        elements("items_mat") = items_mat;
+    else
+        elements = [];
     end
-
-    elements("items_mat") = items_mat;
-
 endfunction