diff --git a/include/resources_item.h b/include/resources_item.h index 1914ce111..23bf46718 100644 --- a/include/resources_item.h +++ b/include/resources_item.h @@ -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 diff --git a/src/core/local_resources_provider.cpp b/src/core/local_resources_provider.cpp index 676ee30b2..fe3a6d525 100644 --- a/src/core/local_resources_provider.cpp +++ b/src/core/local_resources_provider.cpp @@ -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() ); } diff --git a/src/core/resources_db.cpp b/src/core/resources_db.cpp index 8ce8bbfc8..0d592005a 100644 --- a/src/core/resources_db.cpp +++ b/src/core/resources_db.cpp @@ -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() )