Revision: 41611
          http://brlcad.svn.sourceforge.net/brlcad/?rev=41611&view=rev
Author:   davidloman
Date:     2010-12-15 13:41:10 +0000 (Wed, 15 Dec 2010)

Log Message:
-----------
Cleaned up logging a bit in the Config::loadFile() method.  Also added 
dedicated check for file existance.

Modified Paths:
--------------
    rt^3/trunk/src/utility/Config.cxx

Modified: rt^3/trunk/src/utility/Config.cxx
===================================================================
--- rt^3/trunk/src/utility/Config.cxx   2010-12-15 13:18:24 UTC (rev 41610)
+++ rt^3/trunk/src/utility/Config.cxx   2010-12-15 13:41:10 UTC (rev 41611)
@@ -45,7 +45,7 @@
 Config* Config::getInstance()
 {
     if (!Config::pInstance) {
-       pInstance = new Config();
+       pInstance = new Config();
     }
     return Config::pInstance;
 }
@@ -53,15 +53,22 @@
 bool Config::loadFile(QString pathAndFileName, bool verbose)
 {
     QString msg;
-    msg = "Attemping to load config from: " + pathAndFileName + ".";
+    msg = "Attemping to load config from: '" + pathAndFileName + "'.";
     this->log->logINFO("Config", msg);
 
     //init file object
     QFile f(pathAndFileName);
 
+    if (f.exists() == false) {
+               msg = "Could not find file: '" + pathAndFileName + "'.";
+               this->log->logFATAL("Config", msg);
+               return false;
+    }
+
+
     //verify & open
     if (!f.open(QIODevice::ReadOnly | QIODevice::Text)) {
-               msg = "Loading config from: " + pathAndFileName + " FAILED.";
+               msg = "Loading config from: '" + pathAndFileName + "' FAILED.";
                this->log->logFATAL("Config", msg);
                return false;
     }


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to