mirror of
https://github.com/clangen/musikcube.git
synced 2025-02-28 16:11:45 +00:00
Fixed a crazy old bug in SettingsLayout when trying to add/remove an empty
directory in the settings screen.
This commit is contained in:
parent
07bc12d283
commit
a44c7c76a3
@ -356,18 +356,24 @@ void SettingsLayout::LoadPreferences() {
|
||||
|
||||
void SettingsLayout::AddSelectedDirectory() {
|
||||
size_t index = this->browseList->GetSelectedIndex();
|
||||
std::string path = this->browseAdapter->GetFullPathAt(index);
|
||||
|
||||
if (path.size()) {
|
||||
this->indexer->AddPath(path);
|
||||
if (index != (size_t) -1) {
|
||||
std::string path = this->browseAdapter->GetFullPathAt(index);
|
||||
|
||||
if (path.size()) {
|
||||
this->indexer->AddPath(path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SettingsLayout::RemoveSelectedDirectory() {
|
||||
std::vector<std::string> paths;
|
||||
this->indexer->GetPaths(paths);
|
||||
|
||||
size_t index = this->addedPathsList->GetSelectedIndex();
|
||||
this->indexer->RemovePath(paths.at(index));
|
||||
if (index > (size_t) -1) {
|
||||
this->indexer->RemovePath(paths.at(index));
|
||||
}
|
||||
}
|
||||
|
||||
void SettingsLayout::DrillIntoSelectedDirectory() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user