When a mont point is removed, clear the music list.

This commit is contained in:
craig.p.drummond
2012-10-09 19:10:34 +00:00
committed by craig.p.drummond
parent 5baf752026
commit 7bf04bf2f4
3 changed files with 17 additions and 1 deletions

View File

@@ -397,3 +397,12 @@ void Device::songCount(int c)
{
setStatusMessage(i18n("Updating (%1)...").arg(c));
}
void Device::clear() const
{
if (childCount()) {
Device *that=(Device *)this;
that->update=new MusicLibraryItemRoot();
that->applyUpdate();
}
}

View File

@@ -161,6 +161,7 @@ public:
virtual bool isStdFs() const {
return false;
}
void clear() const;
public Q_SLOTS:
void setStatusMessage(const QString &message);

View File

@@ -338,11 +338,16 @@ void RemoteFsDevice::procFinished(int exitCode)
bool RemoteFsDevice::isConnected() const
{
if (details.isLocalFile()) {
return QDir(details.path).exists();
if (QDir(details.path).exists()) {
return true;
}
clear();
return false;
}
QString mp=mountPoint(details, false);
if (mp.isEmpty()) {
clear();
return false;
}
@@ -371,6 +376,7 @@ bool RemoteFsDevice::isConnected() const
}
}
#endif
clear();
return false;
}