LocalResourcesProvider: do not include own name in path-property of

directory items and fixed usage of ResourcesItem::fullName() - makes
format of XML cache file more consistent and also speeds up string
comparisonswhen filtering
This commit is contained in:
Tobias Doerffel
2009-03-10 18:48:46 +01:00
parent 5976ab5ce2
commit 2d7b1f1211
3 changed files with 13 additions and 12 deletions

View File

@@ -111,11 +111,12 @@ public:
QString fullName( void ) const
{
if( m_type == TypeDirectory )
{
return fullPath();
}
return fullPath()+name();
return fullPath() + name();
}
QString fullRelativeName( void ) const
{
return path() + name();
}
const QString & hash( void ) const

View File

@@ -175,16 +175,16 @@ printf("read dir: %s\n", d.canonicalPath().toAscii().constData() );
d.dirName(),
ResourcesItem::TypeDirectory,
m_baseDir,
_parent->item() ?
_parent->item()->path() + d.dirName() +
QDir::separator() :
_parent->item() && _parent->parent() &&
_parent->parent()->item() ?
_parent->item()->fullRelativeName() :
QString::null );
parentItem->setLastMod( QFileInfo(
d.canonicalPath() ).lastModified() );
database()->addItem( parentItem );
curParent = new ResourcesTreeItem( _parent, parentItem );
curParent->setTemporaryMarker( true );
m_watcher.addPath( parentItem->fullPath() );
m_watcher.addPath( parentItem->fullName() );
}

View File

@@ -144,7 +144,7 @@ addItem( item );
ResourcesTreeItem * treeItem = new ResourcesTreeItem( _i, item );
if( item->type() == ResourcesItem::TypeDirectory )
{
emit directoryItemAdded( item->fullPath() );
emit directoryItemAdded( item->fullName() );
}
loadTreeItem( treeItem, e );
}
@@ -201,7 +201,7 @@ void ResourcesDB::addItem( ResourcesItem * newItem )
}
if( oldItem->type() == ResourcesItem::TypeDirectory )
{
emit directoryItemRemoved( oldItem->fullPath() );
emit directoryItemRemoved( oldItem->fullName() );
}
m_items.remove( hash );
delete oldItem;
@@ -229,7 +229,7 @@ void ResourcesDB::recursiveRemoveItems( ResourcesTreeItem * parent,
{
if( parent->item()->type() == ResourcesItem::TypeDirectory )
{
emit directoryItemRemoved( parent->item()->fullPath() );
emit directoryItemRemoved( parent->item()->fullName() );
}
const QString & hash = parent->item()->hash();
if( !hash.isEmpty() )