Diff of /src/hugin1/hugin/MainFrame.cpp [7ab4d0] .. [36766f]  Maximize  Restore

Switch to side-by-side view

--- a/src/hugin1/hugin/MainFrame.cpp
+++ b/src/hugin1/hugin/MainFrame.cpp
@@ -623,27 +623,23 @@
 {
     DEBUG_TRACE("");
     m_filename = filename;
+
     // remove old images from cache
     // hmm probably not a good idea, if the project is reloaded..
-    //ImageCache::getInstance().flush();
+    // ImageCache::getInstance().flush();
+
+    SetStatusText( _("Open project:   ") + filename);
 
     wxFileName fname(filename);
     wxString path = fname.GetPath(wxPATH_GET_VOLUME | wxPATH_GET_SEPARATOR);
-
-    SetStatusText( _("Open project:   ") + filename);
-
-    // get the global config object
-    wxConfigBase* config = wxConfigBase::Get();
-    std::ifstream file((const char *)filename.mb_str(HUGIN_CONV_FILENAME));
-    if (file.good()) {
+    if (fname.IsOk() && fname.FileExists()) {
         wxBusyCursor wait;
         GlobalCmdHist::getInstance().addCommand(
-            new wxLoadPTProjectCmd(pano,file, (const char *)path.mb_str(HUGIN_CONV_FILENAME))
-            );
+           new wxLoadPTProjectCmd(pano,(const char *)filename.mb_str(HUGIN_CONV_FILENAME), (const char *)path.mb_str(HUGIN_CONV_FILENAME))
+           );
         DEBUG_DEBUG("project contains " << pano.getNrOfImages() << " after load");
         opt_panel->setModeCustom();
         SetStatusText(_("Project opened"));
-        config->Write(wxT("/actualPath"), path);  // remember for later
         this->SetTitle(fname.GetName() + wxT(".") + fname.GetExt() + wxT(" - hugin"));
         if (! (fname.GetExt() == wxT("pto"))) {
             // do not remember filename if its not a hugin project
@@ -651,6 +647,9 @@
             // incompatible one
             m_filename = wxT("");
         }
+        // get the global config object
+        wxConfigBase* config = wxConfigBase::Get();
+        config->Write(wxT("/actualPath"), path);  // remember for later
     } else {
         SetStatusText( _("Error opening project:   ") + filename);
         DEBUG_ERROR("Could not open file " << filename);

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks