Default folder for new files must be the latest used folder (fix #1068)

To behave in this way, the open/save dialog must receive a document
filename with an empty path.
This commit is contained in:
David Capello 2016-04-20 10:22:01 -03:00
parent 9cc8d43f0a
commit 4be68ab5f0

View File

@ -64,7 +64,12 @@ std::string Document::name() const
void Document::setFilename(const std::string& filename)
{
m_filename = base::normalize_path(filename);
// Normalize the path (if the filename has a path)
if (!base::get_file_path(filename).empty())
m_filename = base::normalize_path(filename);
else
m_filename = filename;
notifyObservers(&DocumentObserver::onFileNameChanged, this);
}