Summary: | wrong import session size | ||
---|---|---|---|
Product: | [Applications] k3b | Reporter: | John Floyd <jfloyd> |
Component: | general | Assignee: | Sebastian Trueg <trueg> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | daniel |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | openSUSE | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Attachments: | Fixes gui project sizes - fixes double dipping and fixes existing session sizes reports to console problem in debug output. |
Description
John Floyd
2007-04-05 13:44:22 UTC
I have noticed this too. I believe these lines are causing it (from K3bDataDoc::size() ): if( m_isoOptions.doNotCacheInodes() ) return root()->blocks().mode1Bytes() + m_oldSessionSize; else Unchecking the "Do not cache inodes" option makes k3b report the correct session size. Created attachment 20229 [details]
Fixes gui project sizes - fixes double dipping and fixes existing session sizes reports to console problem in debug output.
First patch appears to fix the double dipping in calculating the size of the
files in the project window. It tests for existing imported files before
adding in its size.
The second patch fixes the incorrect size reporting shown in my original post.
Not sure if this is actually used anywhere though. The problem here is to
differentiate between single and double layer discs.
Thanks a lot for your patch. I will apply the first one. The second one, however, seems not important since the output is only used for debugging anyway. SVN commit 652574 by trueg: Do not count the size of items from the old session. BUG: 143874 M +23 -21 k3bdiritem.cpp --- trunk/extragear/multimedia/k3b/libk3b/projects/datacd/k3bdiritem.cpp #652573:652574 @@ -1,4 +1,4 @@ -/* +/* * * $Id$ * Copyright (C) 2003 Sebastian Trueg <trueg@k3b.org> @@ -35,7 +35,7 @@ m_dirs(0) { m_k3bName = name; - + // add automagically like a qlistviewitem if( parent() ) parent()->addDataItem( this ); @@ -59,7 +59,7 @@ K3bDirItem::~K3bDirItem() { // delete all children - // doing this by hand is much saver than using the + // doing this by hand is much saver than using the // auto-delete feature since some of the items' destructors // may change the list K3bDataItem* i = m_children.first(); @@ -69,7 +69,7 @@ takeDataItem(i); delete i; i = m_children.first(); - } + } // this has to be done after deleting the children // because the directory itself has a size of 0 in K3b @@ -156,11 +156,11 @@ updateFiles( -1, 0 ); item->m_parentDir = 0; - + // inform the doc if( doc() ) doc()->itemRemovedFromDir( this, item ); - + if( item->isFile() ) { // restore the item imported from an old session if( static_cast<K3bFileItem*>(item)->replaceItemFromOldSession() ) @@ -234,7 +234,7 @@ bool K3bDirItem::mkdir( const QString& dirPath ) { - // + // // An absolut path always starts at the root item // if( dirPath[0] == '/' ) { @@ -334,21 +334,23 @@ void K3bDirItem::updateSize( K3bDataItem* item, bool removed ) { - if( removed ) { - m_followSymlinksSize -= item->itemSize( true ); - m_size -= item->itemSize( false ); - m_followSymlinksBlocks -= item->itemBlocks( true ).lba(); - m_blocks -= item->itemBlocks( false ).lba(); - } - else { - m_followSymlinksSize += item->itemSize( true ); - m_size += item->itemSize( false ); - m_followSymlinksBlocks += item->itemBlocks( true ).lba(); - m_blocks += item->itemBlocks( false ).lba(); - } + if ( !item->isFromOldSession() ) { + if( removed ) { + m_followSymlinksSize -= item->itemSize( true ); + m_size -= item->itemSize( false ); + m_followSymlinksBlocks -= item->itemBlocks( true ).lba(); + m_blocks -= item->itemBlocks( false ).lba(); + } + else { + m_followSymlinksSize += item->itemSize( true ); + m_size += item->itemSize( false ); + m_followSymlinksBlocks += item->itemBlocks( true ).lba(); + m_blocks += item->itemBlocks( false ).lba(); + } + } - if( parent() ) - parent()->updateSize( item, removed ); + if( parent() ) + parent()->updateSize( item, removed ); } void K3bDirItem::updateFiles( long files, long dirs ) |