Index: runtime/solid-device-automounter/kcm/DeviceModel.cpp =================================================================== --- runtime/solid-device-automounter/kcm/DeviceModel.cpp (révision 1107758) +++ runtime/solid-device-automounter/kcm/DeviceModel.cpp (révision 1107759) @@ -13,9 +13,7 @@ DeviceModel::DeviceModel(QObject *parent) : QAbstractItemModel(parent) { - foreach(const QString &dev, AutomounterSettings::knownDevices()) { - addNewDevice(dev); - } + reload(); connect(Solid::DeviceNotifier::instance(), SIGNAL(deviceAdded(const QString)), this, SLOT(deviceAttached(const QString))); connect(Solid::DeviceNotifier::instance(), SIGNAL(deviceRemoved(const QString)), this, SLOT(deviceRemoved(const QString))); @@ -113,10 +111,19 @@ void DeviceModel::reload() { + beginResetModel(); + m_loginForced.clear(); + m_attachedForced.clear(); + m_attached.clear(); + m_disconnected.clear(); + foreach(const QString &dev, AutomounterSettings::knownDevices()) { + addNewDevice(dev); + } foreach(const QString &udi, m_loginForced.keys()) { m_loginForced[udi] = AutomounterSettings::deviceAutomountIsForced(udi, AutomounterSettings::Login); m_attachedForced[udi] = AutomounterSettings::deviceAutomountIsForced(udi, AutomounterSettings::Attach); } + endResetModel(); } QModelIndex