changeset 3:734915479959

[fix] Request ID 1553601: If no uigui ini file is found at call of indenter constructor the application quitted with an exception. Now does not access ini file list if count is <= 0. git-svn-id: svn://svn.code.sf.net/p/universalindent/code/trunk@160 59b1889a-e5ac-428c-b0c7-476e01d41282
author thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
date Wed, 06 Sep 2006 19:03:49 +0000
parents fc5a79632b09
children 351111bf95f4
files src/indenthandler.cpp
diffstat 1 files changed, 11 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/indenthandler.cpp	Wed Sep 06 07:10:50 2006 +0000
+++ b/src/indenthandler.cpp	Wed Sep 06 19:03:49 2006 +0000
@@ -54,18 +54,19 @@
 	QDir dataDirctory = QDir(dataDirPathStr);
 
 	indenterIniFileList = dataDirctory.entryList( QStringList("uigui_*.ini") );
-    noIndenterExecExistDialogAlreadyShown = false;
+    if ( indenterIniFileList.count() > 0 ) {
+        // Take care if the selected indenterID is smaller or greater than the number of existing indenters
+        if ( indenterID < 0 ) {
+            indenterID = 0;
+        }
+        if ( indenterID >= indenterIniFileList.count() ) {
+            indenterID = indenterIniFileList.count() - 1;
+        }
 
-    // Take care if the selected indenterID is smaller or greater than the number of existing indenters
-    if ( indenterID < 0 ) {
-        indenterID = 0;
+        // reads and parses first found indent ini file and creates toolbox entries
+        readIndentIniFile( dataDirctoryStr + indenterIniFileList.at(indenterID) );
     }
-    if ( indenterID >= indenterIniFileList.count() ) {
-        indenterID = indenterIniFileList.count() - 1;
-    }
-
-	// reads and parses first found indent ini file and creates toolbox entries
-	readIndentIniFile( dataDirctoryStr + indenterIniFileList.at(indenterID) );
+    noIndenterExecExistDialogAlreadyShown = false;
 }