Skip to content

Commit c025188

Browse files
MaxMansfieldricardomv
authored andcommitted
Remove nonexistent directories from places sidebar model.
Changes: 1. Added logic to placesmodel.cpp which checks for the existence of a directory
1 parent 69e2185 commit c025188

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/plugin/placesmodel/placesmodel.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,12 @@ PlacesModel::PlacesModel(QObject *parent) :
5757
m_locations = m_settings->value("storedLocations").toStringList();
5858
}
5959

60-
foreach (const QString &location, m_locations) {
61-
qDebug() << "Location: " << location;
60+
// Make sure the directories exist
61+
foreach(const auto& location, m_locations) {
62+
if(!location.isEmpty() && QDir(location).exists())
63+
qDebug() << "Location: " << location;
64+
else
65+
m_locations.removeOne(location);
6266
}
6367

6468
initNewUserMountsWatcher();

0 commit comments

Comments
 (0)