Move the special directory query helpers into the places browser.

This commit is contained in:
Adam Reichold
2015-12-25 23:28:10 +01:00
parent e78d29ef35
commit b62b78e2f8
12 changed files with 146 additions and 232 deletions

View File

@@ -286,20 +286,13 @@ void SaveAsDialog::setInitialFileName (Glib::ustring fname)
fchooser->set_current_name(fname);
}
void SaveAsDialog::setImagePath (Glib::ustring ipath)
void SaveAsDialog::setImagePath (const Glib::ustring& imagePath)
{
const auto dirName = Glib::path_get_dirname (imagePath);
Glib::ustring path = Glib::path_get_dirname(ipath);
//Add the image's path to the Shortcut list
#ifdef WIN32
// Dirty workaround, waiting for a clean solution by using exceptions!
if (!safe_is_shortcut_dir(path))
#endif
try {
fchooser->add_shortcut_folder(path);
} catch (Glib::Error &err) {}
try {
fchooser->add_shortcut_folder (dirName);
} catch (Glib::Error&) {}
}