summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--collectionfoldersview.cpp6
-rw-r--r--collectionwidget.h3
-rw-r--r--playerwidget.cpp1
3 files changed, 10 insertions, 0 deletions
diff --git a/collectionfoldersview.cpp b/collectionfoldersview.cpp
index e1a96b2..483f42c 100644
--- a/collectionfoldersview.cpp
+++ b/collectionfoldersview.cpp
@@ -21,6 +21,12 @@ void CollectionFoldersView::populate(){
model()->setHorizontalHeaderLabels(headers());
QStandardItem *root = model()->invisibleRootItem();
QDir d(mCurrentFolder);
+ if(!d.exists()){
+ QString msg = QString("%1 vanished from under us!").arg(mCurrentFolder);
+ emit message(msg);
+ readSettings();
+ d.setPath(mCurrentFolder);
+ }
QMimeDatabase db;
QIcon songIcon(":/song.png");
QIcon otherIcon(":/belly_right_and_clear.png");
diff --git a/collectionwidget.h b/collectionwidget.h
index fe4a086..e910e57 100644
--- a/collectionwidget.h
+++ b/collectionwidget.h
@@ -24,6 +24,9 @@ class CollectionWidget : public QWidget {
void enableSorting(int column = 0, Qt::SortOrder sortOrder = Qt::AscendingOrder);
QActionGroup *customActions() { return mCustomActions; }
+ signals:
+ void message(const QString &msg);
+
public slots:
virtual void populate() { return; }
virtual void expandFirst(QSortFilterProxyModel *proxy);
diff --git a/playerwidget.cpp b/playerwidget.cpp
index c9e8214..54a1f50 100644
--- a/playerwidget.cpp
+++ b/playerwidget.cpp
@@ -161,6 +161,7 @@ void PlayerWidget::setupGui(QSplashScreen *splash){
}
for(int i = 0; i < mCollectionStack->count(); ++i){
CollectionWidget *curW = qobject_cast<CollectionWidget*>(mCollectionStack->widget(i));
+ connect(curW, &CollectionWidget::message, this, &PlayerWidget::message);
const QString name = curW->objectName();
// special case webradio
if(name == "webradio"){