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:
@@ -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
|
||||
|
||||
@@ -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() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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() )
|
||||
|
||||
Reference in New Issue
Block a user