LocalResourcesProvider: fixed filesystem monitoring
The slot LocalResourcesProvider::reloadDirectory() contained various bugs so it did not record changes in filesystem properly. This also fixes lots of QFileSystemWatcher messages in console window when saving a new project inside LMMS.
This commit is contained in:
@@ -114,11 +114,16 @@ void LocalResourcesProvider::removeDirectory( const QString & _path )
|
||||
void LocalResourcesProvider::reloadDirectory( const QString & _path )
|
||||
{
|
||||
ResourcesTreeItem * dirTreeItem = NULL;
|
||||
QString p = _path;
|
||||
if( !p.endsWith( QDir::separator() ) )
|
||||
{
|
||||
p += QDir::separator();
|
||||
}
|
||||
|
||||
foreach( ResourcesItem * it, database()->items() )
|
||||
{
|
||||
if( it->type() == ResourcesItem::TypeDirectory &&
|
||||
it->fullPath() == _path )
|
||||
it->fullName() == p )
|
||||
{
|
||||
dirTreeItem = it->treeItem();
|
||||
}
|
||||
@@ -130,7 +135,8 @@ void LocalResourcesProvider::reloadDirectory( const QString & _path )
|
||||
if( dirItem )
|
||||
{
|
||||
m_scannedFolders.clear();
|
||||
readDir( dirItem->path(), dirTreeItem->parent() );
|
||||
readDir( dirItem->fullRelativeName(),
|
||||
dirTreeItem->parent() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user