When a mont point is removed, clear the music list.
This commit is contained in:
committed by
craig.p.drummond
parent
5baf752026
commit
7bf04bf2f4
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -161,6 +161,7 @@ public:
|
||||
virtual bool isStdFs() const {
|
||||
return false;
|
||||
}
|
||||
void clear() const;
|
||||
|
||||
public Q_SLOTS:
|
||||
void setStatusMessage(const QString &message);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user