Summary: | summaries in catalogmanager next to the folders | ||
---|---|---|---|
Product: | kbabel | Reporter: | Erik Kj <erik> |
Component: | CatalogManager | Assignee: | Stanislav Visnovsky <visnovsky> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | greendeath |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: |
Description
Erik Kj
2003-11-14 17:20:16 UTC
Subject: kdesdk/kbabel/catalogmanager CVS commit by nanulo: Fixed #68221 - KBabel catalog manager does not show file counts for directories. It does now, but without coloring - too late for that. Reviewed by llunak CCMAIL: 68221-done@bugs.kde.org M +37 -6 catmanlistitem.cpp 1.23 --- kdesdk/kbabel/catalogmanager/catmanlistitem.cpp #1.22:1.23 @@ -305,4 +305,24 @@ void CatManListItem::update(bool showPoI QDir dir=_primary.dir(); setText(COL_NAME,dir.dirName()); + + // count the childen numbers + int fuzzy = 0; + int untrans = 0; + int total = 0; + + CatManListItem* ch = static_cast<CatManListItem*>(firstChild ()); + + while (ch) + { + fuzzy += ch->fuzzy (); + untrans += ch->untranslated (); + total += ch->total (); + ch = static_cast<CatManListItem*>(ch->nextSibling()); + } + + setText(COL_FUZZY,QString::number(fuzzy)); + setText(COL_UNTRANS,QString::number(untrans)); + setText(COL_TOTAL,QString::number(total)); + //setSelectable(false); _type=Dir; @@ -353,5 +373,4 @@ void CatManListItem::update(bool showPoI if(PoInfo::info(_primary.absFilePath(),poInfo,_wordList,updateWordList)==OK) { - kdDebug(KBABEL_CATMAN) << "For " << poFile() << " we found " << _wordList.size() << " words" << endl; if( _view->isStopped() ) return; if( updateWordList) _wordListUpdated = true; @@ -393,12 +412,8 @@ void CatManListItem::update(bool showPoI setPixmap(COL_NAME,icon); - // if the status changed, update the parent item - if(needWork != neededWork) - { updateParent=true; } } } - } // only the template exists else if(_template.exists()) @@ -411,4 +426,18 @@ void CatManListItem::update(bool showPoI _type=Dir; + // count the childen numbers + int total = 0; + + CatManListItem* ch = static_cast<CatManListItem*>(firstChild ()); + + while (ch) + { + total += ch->total (); + ch = static_cast<CatManListItem*>(ch->nextSibling()); + } + + setText(COL_TOTAL,QString::number(total)); + + QPixmap icon; if(!isOpen()) @@ -453,4 +482,6 @@ void CatManListItem::update(bool showPoI } setPixmap(COL_NAME,ICON_MISSING); + + updateParent = true; } } |