diff options
author | am <am@f440f766-f032-0410-8965-dc7d17de2ca0> | 2009-09-16 17:49:38 +0000 |
---|---|---|
committer | am <am@f440f766-f032-0410-8965-dc7d17de2ca0> | 2009-09-16 17:49:38 +0000 |
commit | 51257c29633432c4ecc418fd07726b798508c613 (patch) | |
tree | 07796fafba1b3a19a9b14e159a49569d3f798525 /shemov.cpp | |
parent | 5e86b6d1cff1d9baacad8c34b062267a382b1990 (diff) | |
download | SheMov-51257c29633432c4ecc418fd07726b798508c613.tar.gz SheMov-51257c29633432c4ecc418fd07726b798508c613.tar.bz2 SheMov-51257c29633432c4ecc418fd07726b798508c613.zip |
-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
Diffstat (limited to 'shemov.cpp')
-rw-r--r-- | shemov.cpp | 20 |
1 files changed, 15 insertions, 5 deletions
@@ -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("<span style=\"color:#000000\">n/a</span>"); + 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("<span style=\"color:#000000\">%1</span>")).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)); } |