From: <bru...@us...> - 2010-02-24 17:15:50
|
Revision: 5025 http://hugin.svn.sourceforge.net/hugin/?rev=5025&view=rev Author: brunopostle Date: 2010-02-24 17:15:43 +0000 (Wed, 24 Feb 2010) Log Message: ----------- merge trunk -r 5024 Make `hugin *.jpg` work (Alexandre Duret-Lutz) Modified Paths: -------------- hugin/releases/2010.0/src/hugin1/hugin/huginApp.cpp Modified: hugin/releases/2010.0/src/hugin1/hugin/huginApp.cpp =================================================================== --- hugin/releases/2010.0/src/hugin1/hugin/huginApp.cpp 2010-02-24 17:12:21 UTC (rev 5024) +++ hugin/releases/2010.0/src/hugin1/hugin/huginApp.cpp 2010-02-24 17:15:43 UTC (rev 5025) @@ -335,10 +335,14 @@ filename.Prepend(wxFileName::GetPathSeparator()); filename.Prepend(cwd); } + // Loading the project file with set actualPath to its + // parent directory. (actualPath is used as starting + // directory by many subsequent file selection dialogs.) frame->LoadProjectFile(filename); } else { std::vector<std::string> filesv; for (int i=1; i< argc; i++) { + bool actualPathSet = false; wxFileName file(argv[i]); if (file.GetExt().CmpNoCase(wxT("jpg")) == 0 || file.GetExt().CmpNoCase(wxT("jpeg")) == 0 || @@ -352,7 +356,21 @@ file.GetExt().CmpNoCase(wxT("hdr")) == 0 || file.GetExt().CmpNoCase(wxT("viff")) == 0 ) { - filesv.push_back((const char *)(file.GetFullPath().mb_str(HUGIN_CONV_FILENAME))); + wxString filename(argv[i]); + // Make sure the filename is absolute. + if (! wxIsAbsolutePath(filename)) { + filename.Prepend(wxFileName::GetPathSeparator()); + filename.Prepend(cwd); + } + + filesv.push_back((const char *)(filename.mb_str(HUGIN_CONV_FILENAME))); + + // Use the first filename to set actualPath. + if (! actualPathSet) { + file = filename; + config->Write(wxT("/actualPath"), file.GetPath()); + actualPathSet = true; + } } } GlobalCmdHist::getInstance().addCommand( This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |