Better thread termination

This commit is contained in:
craig.p.drummond
2013-01-30 19:16:03 +00:00
committed by craig.p.drummond
parent a281e0da9b
commit ac3345c65c
16 changed files with 80 additions and 30 deletions

View File

@@ -340,17 +340,26 @@ void DevicesModel::setEnabled(bool e)
loadRemote();
#endif
} else {
disconnect(Solid::DeviceNotifier::instance(), SIGNAL(deviceAdded(const QString &)), this, SLOT(deviceAdded(const QString &)));
disconnect(Solid::DeviceNotifier::instance(), SIGNAL(deviceRemoved(const QString &)), this, SLOT(deviceRemoved(const QString &)));
// disconnect(Covers::self(), SIGNAL(cover(const Song &, const QImage &, const QString &)),
// this, SLOT(setCover(const Song &, const QImage &, const QString &)));
disconnect(MountPoints::self(), SIGNAL(updated()), this, SLOT(mountsChanged()));
stop();
clear();
}
inhibitMenuUpdate=false;
updateItemMenu();
}
void DevicesModel::stop()
{
foreach (Device *dev, devices) {
dev->stop();
}
disconnect(Solid::DeviceNotifier::instance(), SIGNAL(deviceAdded(const QString &)), this, SLOT(deviceAdded(const QString &)));
disconnect(Solid::DeviceNotifier::instance(), SIGNAL(deviceRemoved(const QString &)), this, SLOT(deviceRemoved(const QString &)));
// disconnect(Covers::self(), SIGNAL(cover(const Song &, const QImage &, const QString &)),
// this, SLOT(setCover(const Song &, const QImage &, const QString &)));
disconnect(MountPoints::self(), SIGNAL(updated()), this, SLOT(mountsChanged()));
}
Device * DevicesModel::device(const QString &udi)
{
int idx=indexOf(udi);