@@ -150,7 +150,8 @@ OSDocument::OSDocument(const openstudio::model::Model& library, const openstudio
150150 if (!m_savePath.isEmpty ()) {
151151 auto p = toPath (m_savePath);
152152 modelTempDirPath = model::initializeModel (*model, p);
153- m_mainWindow->setWindowTitle (toQString (p.filename ()) + " [*]" );
153+ m_mainWindow->setWindowFilePath (m_savePath);
154+ m_mainWindow->setWindowTitle (m_savePath + " [*]" );
154155 } else {
155156 modelTempDirPath = model::initializeModel (*model);
156157 m_mainWindow->setWindowTitle (" Untitled[*]" );
@@ -930,12 +931,13 @@ bool OSDocument::fixWeatherFileInTemp(bool opening) {
930931 epwPathAbsolute = true ;
931932
932933 epwInUserPath = *weatherFilePath;
933- if (boost::filesystem::exists (epwInUserPath)) {
934+ boost::system::error_code ec;
935+ if (boost::filesystem::exists (epwInUserPath, ec)) {
934936 epwInUserPathChecksum = checksum (epwInUserPath);
935937 }
936938
937939 epwInTempPath = tempFilesDir / epwInUserPath.filename ();
938- if (boost::filesystem::exists (epwInTempPath)) {
940+ if (boost::filesystem::exists (epwInTempPath, ec )) {
939941 epwInTempPathChecksum = checksum (epwInTempPath);
940942 }
941943
@@ -946,11 +948,12 @@ bool OSDocument::fixWeatherFileInTemp(bool opening) {
946948
947949 // Look in temp model "resources" and "resources/files"
948950 epwInTempPath = tempResourcesDir / *weatherFilePath;
949- if (boost::filesystem::exists (epwInTempPath)) {
951+ boost::system::error_code ec;
952+ if (boost::filesystem::exists (epwInTempPath, ec)) {
950953 epwInTempPathChecksum = checksum (epwInTempPath);
951954 } else {
952955 epwInTempPath = tempFilesDir / *weatherFilePath;
953- if (boost::filesystem::exists (epwInTempPath)) {
956+ if (boost::filesystem::exists (epwInTempPath, ec )) {
954957 epwInTempPathChecksum = checksum (epwInTempPath);
955958 }
956959 }
@@ -966,12 +969,12 @@ bool OSDocument::fixWeatherFileInTemp(bool opening) {
966969
967970 // Expected location is companion_folder/files
968971 epwInUserPath = searchFilesDir / *weatherFilePath;
969- if (boost::filesystem::exists (epwInUserPath)) {
972+ if (boost::filesystem::exists (epwInUserPath, ec )) {
970973 epwInUserPathChecksum = checksum (epwInUserPath);
971974 } else {
972975 // Just in case, we look in the companion_folder
973976 epwInUserPath = searchCompanionDir / *weatherFilePath;
974- if (boost::filesystem::exists (epwInUserPath)) {
977+ if (boost::filesystem::exists (epwInUserPath, ec )) {
975978 epwInUserPathChecksum = checksum (epwInUserPath);
976979 }
977980 }
@@ -1098,7 +1101,8 @@ bool OSDocument::fixWeatherFileInTemp(bool opening) {
10981101
10991102 if (doCopy) {
11001103 LOG (Debug, " Removing weather file at " << copyDest);
1101- boost::filesystem::remove_all (copyDest);
1104+ boost::system::error_code ec;
1105+ boost::filesystem::remove_all (copyDest, ec);
11021106 LOG (Debug, " Removing weather file complete" );
11031107 }
11041108
@@ -1510,9 +1514,10 @@ bool OSDocument::saveAs() {
15101514 // remove old model
15111515 if (!m_savePath.isEmpty ()) {
15121516 openstudio::path oldModelPath = toPath (m_modelTempDir) / toPath (m_savePath).filename ();
1513- if (boost::filesystem::exists (oldModelPath)) {
1517+ boost::system::error_code ec;
1518+ if (boost::filesystem::exists (oldModelPath, ec)) {
15141519 LOG (Debug, " Removing " << oldModelPath << " starting" );
1515- boost::filesystem::remove (oldModelPath);
1520+ boost::filesystem::remove (oldModelPath, ec );
15161521 LOG (Debug, " Removing " << oldModelPath << " complete" );
15171522 }
15181523 }
@@ -1631,8 +1636,8 @@ boost::optional<model::Component> OSDocument::getComponent(const OSItemId& itemI
16311636 }
16321637
16331638#endif
1634-
1635- // OS_ASSERT(openstudio::filesystem::exists(oscPath));
1639+ // std::error_code ec;
1640+ // OS_ASSERT(openstudio::filesystem::exists(oscPath, ec ));
16361641
16371642 osversion::VersionTranslator translator;
16381643 // translator.setAllowNewerVersions(false); // DLM: allow to open newer versions?
@@ -1734,9 +1739,7 @@ void OSDocument::updateWindowFilePath() {
17341739 } else {
17351740 // m_mainWindow->setWindowTitle();
17361741 m_mainWindow->setWindowFilePath (m_savePath);
1737- QFileInfo fi (m_savePath);
1738- QString fileName = fi.fileName ();
1739- m_mainWindow->setWindowTitle (fileName + " [*]" );
1742+ m_mainWindow->setWindowTitle (m_savePath + " [*]" );
17401743 }
17411744}
17421745
0 commit comments