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:
Tobias Doerffel
2009-04-05 23:16:27 +02:00
parent 1b91b599ba
commit 0ae72462d9

View File

@@ -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() );
}
}