Skip to content
Permalink
Browse files

implemented to show file size in FileAttributeDIalog.(refs #69)

  • Loading branch information...
haraki committed Jun 23, 2019
1 parent 637873d commit 555ec1bcc078ce60b82fbadb1d63e74168bb017a
Showing with 45 additions and 5 deletions.
  1. +8 −0 fileattributesdialog.cpp
  2. +37 −5 fileattributesdialog.ui
@@ -25,6 +25,14 @@ FileAttributesDialog::FileAttributesDialog(const QFileInfo& fileInfo,

ui->informationFullPathLabel->setText(fileInfo.absoluteFilePath());
ui->informationMimeLabel->setText(QMimeDatabase().mimeTypeForFile(fileInfo).name());
if(fileInfo.isDir())
{
ui->informationFileSizeLabel->setText("- ");
}
else
{
ui->informationFileSizeLabel->setText(QString("%L1 ").arg(fileInfo.size()) + tr("Bytes"));
}

ui->ownershipUserLabel->setText(fileInfo.owner());
ui->ownershipGroupLabel->setText(fileInfo.group());
@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>320</width>
<height>407</height>
<height>505</height>
</rect>
</property>
<property name="sizePolicy">
@@ -44,6 +44,9 @@
<property name="text">
<string>Full path :</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="1">
@@ -53,17 +56,37 @@
</property>
</widget>
</item>
<item row="1" column="0">
<item row="3" column="1">
<widget class="QLabel" name="informationMimeLabel">
<property name="text">
<string>MIME</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="informationMimeHeadLabel">
<property name="text">
<string>MIME :</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="informationMimeLabel">
<item row="4" column="0">
<widget class="QLabel" name="informationFileSizeHeadLabel">
<property name="text">
<string>MIME</string>
<string>File size :</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLabel" name="informationFileSizeLabel">
<property name="text">
<string>File size</string>
</property>
</widget>
</item>
@@ -88,13 +111,19 @@
<property name="text">
<string>Group :</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="ownershipUserHeadLabel">
<property name="text">
<string>User :</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="1">
@@ -211,6 +240,9 @@
<property name="text">
<string>Created : </string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="0">

0 comments on commit 555ec1b

Please sign in to comment.
You can’t perform that action at this time.