summaryrefslogtreecommitdiffstats
path: root/shemov.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'shemov.cpp')
-rw-r--r--shemov.cpp20
1 files changed, 15 insertions, 5 deletions
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("<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));
}