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

@@ -392,28 +392,21 @@ void FlatField::flatFieldAutoSelectChanged()
}
void FlatField::setShortcutPath(Glib::ustring path)
void FlatField::setShortcutPath(const Glib::ustring& path)
{
if (path == "") {
if (path.empty ()) {
return;
}
#ifdef WIN32
try {
// Dirty workaround, waiting for a clean solution by using exceptions!
if (!safe_is_shortcut_dir(path))
#endif
{
if (lastShortcutPath != "") {
try {
flatFieldFile->remove_shortcut_folder(lastShortcutPath);
} catch (Glib::Error &err) {}
if (!lastShortcutPath.empty ()) {
flatFieldFile->remove_shortcut_folder (lastShortcutPath);
}
flatFieldFile->add_shortcut_folder (path);
lastShortcutPath = path;
try {
flatFieldFile->add_shortcut_folder(path);
} catch (Glib::Error &err) {}
}
} catch (Glib::Error&) {}
}