From 51257c29633432c4ecc418fd07726b798508c613 Mon Sep 17 00:00:00 2001 From: am Date: Wed, 16 Sep 2009 17:49:38 +0000 Subject: -Removed some qDebug() statements -Removed filtering of extractor output (not tested) -Changed SelectionMode of filemanager to ExtendedSelection -Fixed bug in SheMov::setFreeFS -Size of selected files is now shown in filemanager git-svn-id: file:///var/svn/repos2/shemov/trunk@407 f440f766-f032-0410-8965-dc7d17de2ca0 --- shemov.cpp | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'shemov.cpp') diff --git a/shemov.cpp b/shemov.cpp index 449846c..5b86fef 100644 --- a/shemov.cpp +++ b/shemov.cpp @@ -39,6 +39,7 @@ #include "editarchiveitemdialog.h" #include "coverarchiveeditor.h" #include "statisticsdialog.h" +#include "filesystemfileproxy.h" SheMov::SheMov(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(parent, flags) { qApp->setWindowIcon(QIcon(":/shemov.png")); @@ -109,10 +110,20 @@ SheMov::SheMov(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(parent, fla void SheMov::updateSelectionCount(const QItemSelection & /* sel */, const QItemSelection & /* prev */){ QLocale l; switch (mTab->currentIndex()) { - case 0: - mSelectedItems->setText(QString::number(mFSWidget->fileView()->selectionModel()->selectedRows().count())); - mSelectedSize->setText("n/a"); + case 0: { + int selCount = mFSWidget->fileView()->selectionModel()->selectedRows().count(); + mSelectedItems->setText(QString::number(selCount)); + qint64 selSize(0); + foreach(QModelIndex idx, mFSWidget->fileView()->selectionModel()->selectedRows()){ + QModelIndex real = mFSWidget->fileProxy()->mapToSource(idx); + if(real.isValid()){ + QFileInfo fi = mFSWidget->dirModel()->fileInfo(real); + selSize += fi.size(); + } + } + mSelectedSize->setText(QString(tr("%1")).arg(l.toString((selSize)))); break; + } case 1: mSelectedItems->setText(QString::number(mAVWidget->fileView()->selectionModel()->selectedRows().count())); qint64 s = mAVWidget->currentSize(); @@ -160,7 +171,7 @@ void SheMov::tabChanged(int newTab){ void SheMov::setFsFree(){ struct statfs buf; QSettings s; - QString dir = s.value("paths/archive").toString(); + QString dir = s.value("paths/archivedir").toString(); int success = statfs(qPrintable(dir), &buf); if(success == -1){ mFsFree->setText(tr("Error")); @@ -191,7 +202,6 @@ void SheMov::setFsFree(){ QSize stringSize = fm.size(Qt::TextSingleLine, freeString); int startx = (100 - stringSize.width()) / 2; int starty = (height - stringSize.height()) / 2 + fm.ascent(); - qDebug() << startx << starty; p.drawText(QPoint(startx, starty), freeString); mFsFree->setPixmap(QPixmap::fromImage(img)); } -- cgit v1.2.3-70-g09d2