mirror of
https://gitlab.com/kelteseth/ScreenPlay.git
synced 2024-09-15 06:52:34 +02:00
Fix calling to load installed content twice
This commit is contained in:
parent
bb5121264c
commit
08414a3d01
@ -293,7 +293,6 @@ Item {
|
||||
textFieldTags.getTags())
|
||||
savePopup.open()
|
||||
ScreenPlay.installedListModel.reset()
|
||||
ScreenPlay.installedListModel.loadInstalledContent()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -17,7 +17,16 @@ InstalledListModel::InstalledListModel(
|
||||
QObject::connect(this, &InstalledListModel::addInstalledItem,
|
||||
this, &InstalledListModel::append, Qt::QueuedConnection);
|
||||
}
|
||||
void InstalledListModel::init()
|
||||
{
|
||||
if (!m_fileSystemWatcher.addPath(m_globalVariables->localStoragePath().toLocalFile())) {
|
||||
qWarning() << "Could not setup file system watcher for changed files with path: " << m_globalVariables->localStoragePath().toLocalFile();
|
||||
}
|
||||
|
||||
loadInstalledContent();
|
||||
|
||||
QObject::connect(&m_fileSystemWatcher, &QFileSystemWatcher::directoryChanged, this, &InstalledListModel::reset);
|
||||
}
|
||||
int InstalledListModel::rowCount(const QModelIndex& parent) const
|
||||
{
|
||||
if (parent.isValid())
|
||||
@ -169,17 +178,4 @@ void InstalledListModel::reset()
|
||||
loadInstalledContent();
|
||||
}
|
||||
|
||||
void InstalledListModel::init()
|
||||
{
|
||||
if (!m_fileSystemWatcher.addPath(m_globalVariables->localStoragePath().toLocalFile())) {
|
||||
qWarning() << "Could not setup file system watcher for changed files with path: " << m_globalVariables->localStoragePath().toLocalFile();
|
||||
}
|
||||
|
||||
QObject::connect(&m_fileSystemWatcher, &QFileSystemWatcher::directoryChanged, this, [this](const QString& path) {
|
||||
qDebug() << path;
|
||||
reset();
|
||||
loadInstalledContent();
|
||||
});
|
||||
loadInstalledContent();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user