From kde-commits Fri Apr 30 21:42:46 2004 From: Craig Drummond Date: Fri, 30 Apr 2004 21:42:46 +0000 To: kde-commits Subject: kdebase/kcontrol/kfontinst/kcmfontinst Message-Id: <20040430214246.28BCF927B () office ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=108336137032481 CVS commit by craig: Show file sizes M +13 -3 KFileFontView.cpp 1.10 --- kdebase/kcontrol/kfontinst/kcmfontinst/KFileFontView.cpp #1.9:1.10 @@ -55,4 +55,5 @@ #define COL_NAME 0 #define COL_FILE 1 +#define COL_SIZE 2 class CKFileFontView::CKFileFontViewPrivate @@ -77,4 +78,5 @@ CKFileFontView::CKFileFontView(QWidget * addColumn(i18n("Name")); addColumn(i18n("File")); + addColumn(i18n("Size")); setShowSortIndicator(true); setAllColumnsShowFocus(true); @@ -320,4 +322,7 @@ void CKFileFontView::slotSortingChanged( sortSpec = (sort & ~QDir::SortByMask);// | QDir::Unsorted; break; + case COL_SIZE: + sortSpec = (sort & ~QDir::SortByMask | QDir::Size); + break; default: break; @@ -357,4 +362,9 @@ void CKFileFontView::slotSortingChanged( void CKFileFontView::setSorting(QDir::SortSpec spec) { + if (spec & QDir::Size) + itsSortingCol=COL_SIZE; + else + itsSortingCol=COL_NAME; + // inversed, because slotSortingChanged will reverse it if (spec & QDir::Reversed) @@ -363,10 +373,9 @@ void CKFileFontView::setSorting(QDir::So spec = (QDir::SortSpec) (spec | QDir::Reversed); - itsSortingCol = COL_NAME; KFileView::setSorting((QDir::SortSpec) spec); // don't emit sortingChanged() when called via setSorting() itsBlockSortingSignal = true; // can't use blockSignals() - slotSortingChanged(COL_NAME); + slotSortingChanged(itsSortingCol); itsBlockSortingSignal = false; } @@ -618,4 +627,5 @@ void CFontListViewItem::init() setText(COL_NAME, itsInf->text()); setText(COL_FILE, itsInf->isDir() ? "" : itsInf->url().filename()); + setText(COL_SIZE, itsInf->isDir() ? "" : KGlobal::locale()->formatNumber(itsInf->size(), 0)); }