|
From: <pst...@us...> - 2008-04-02 00:31:46
|
Revision: 382
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=382&view=rev
Author: pstieber
Date: 2008-04-01 17:31:44 -0700 (Tue, 01 Apr 2008)
Log Message:
-----------
Changed the way file existence is checked, moved debug output, and removed and extra can't finc conf file message box.
Modified Paths:
--------------
trunk/jazz/src/Project.cpp
Modified: trunk/jazz/src/Project.cpp
===================================================================
--- trunk/jazz/src/Project.cpp 2008-04-01 21:21:06 UTC (rev 381)
+++ trunk/jazz/src/Project.cpp 2008-04-02 00:31:44 UTC (rev 382)
@@ -23,6 +23,7 @@
#include "WxWidgets.h"
#include <wx/config.h>
#include <wx/filename.h>
+#include <wx/file.h>
#include "Project.h"
#include "RecordingInfo.h"
@@ -360,39 +361,28 @@
wxString ConfFileNameAndPath = ConfFilePath + mConfFileName;
// Test for the existence of the Jazz++ configuration file.
- ifstream Is;
- Is.open(ConfFileNameAndPath.c_str());
- if (!Is)
+ if (!::wxFileExists(ConfFileNameAndPath))
{
- // Close and clear the stream.
- Is.close();
- Is.clear();
-
// Return a valid path to the data.
FindAndRegisterConfFilePath(ConfFilePath);
ConfFileNameAndPath = ConfFilePath + mConfFileName;
// Try one more time.
- Is.open(ConfFileNameAndPath.c_str());
- if (!Is)
+ if (!::wxFileExists(ConfFileNameAndPath))
{
- wxMessageBox(
- "Could not find configuration file.",
- "Warning",
- wxOK);
+ ConfFileNameAndPath.clear();
}
- Is.close();
- Is.clear();
}
- cout
- << "JZProject::ReadConfiguration() ConfFileNameAndPath:" << '\n'
- << " \"" << ConfFileNameAndPath << '"'
- << endl;
-
if (!ConfFileNameAndPath.IsEmpty())
{
+ cout
+ << "JZProject::ReadConfiguration() ConfFileNameAndPath:" << '\n'
+ << " \"" << ConfFileNameAndPath << '"'
+ << endl;
+
mpConfig->LoadConfig(ConfFileNameAndPath);
+
DEBUG(
if (BankTable != (tDoubleCommand *) NULL)
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|