aboutsummaryrefslogtreecommitdiff
path: root/lumina-fileinfo/dialog.cpp
diff options
context:
space:
mode:
authorKen Moore <moorekou@gmail.com>2015-08-25 14:05:33 -0400
committerKen Moore <moorekou@gmail.com>2015-08-25 14:05:33 -0400
commit6c91fd006a109b0124d762bdfe51a9900111d49f (patch)
tree79c008a413aaf44b67dd68cb0e26b90eec38bc93 /lumina-fileinfo/dialog.cpp
parentCopy the old MainUI class over as an emergency backup in preparation for tyin... (diff)
downloadlumina-6c91fd006a109b0124d762bdfe51a9900111d49f.tar.gz
lumina-6c91fd006a109b0124d762bdfe51a9900111d49f.tar.bz2
lumina-6c91fd006a109b0124d762bdfe51a9900111d49f.zip
Disable the "size" output of a directory in lumina-fm: this needs some better coding to recusively add up the sizes of all the files within it.
Diffstat (limited to 'lumina-fileinfo/dialog.cpp')
-rw-r--r--lumina-fileinfo/dialog.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/lumina-fileinfo/dialog.cpp b/lumina-fileinfo/dialog.cpp
index 6141b961..335d05aa 100644
--- a/lumina-fileinfo/dialog.cpp
+++ b/lumina-fileinfo/dialog.cpp
@@ -154,15 +154,12 @@ void Dialog::LoadDesktopFile(QString input)
else{ type = info.suffix().toUpper(); }
if(info.isHidden()){ type = QString(tr("Hidden %1")).arg(type); }
ui->label_file_type->setText(type);
- double bytes = info.size();
- QStringList lab; lab << "B" << "KB" << "MB" << "GB" << "TB" << "PB";
- int i=0;
- while(i<lab.length() && bytes>1024){
- bytes = bytes/1024;
- i++; //next label
+ //Calculate the size of the file/dir
+ QString sz;
+ if(!info.isDir()){
+ sz = LUtils::BytesToDisplaySize(info.size());
}
- //convert the size to two decimel places and add the label
- QString sz = QString::number( qRound(bytes*100)/100.0 )+lab[i];
+ // TO-DO calculate the total size of all files within this directory (in a background thread)
ui->label_file_size->setText( sz );
ui->label_file_owner->setText(info.owner());
ui->label_file_group->setText(info.group());
bgstack15