aboutsummaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
authorMike Skec <skec@protonmail.ch>2021-01-09 14:27:44 +1100
committerFelix Queißner <felix@ib-queissner.de>2021-01-10 13:40:46 +0100
commitdd3e8716b276f9f1646338f8801ca9a2f688fc46 (patch)
treec2f4651e5aa539e72e3ecf9ae1a005c2b8e9e106 /src/mainwindow.cpp
parent601887655e7f128c1c938a24fc38d002a8aecb64 (diff)
downloadkristall-dd3e8716b276f9f1646338f8801ca9a2f688fc46.tar.gz
status bar: New file cache indicator
Mime label was also simplified so that only type/subtype are shown.
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 4a09811..26f49ec 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -24,6 +24,7 @@ MainWindow::MainWindow(QApplication * app, QWidget *parent) :
ui(new Ui::MainWindow),
url_status(new ElideLabel(this)),
file_size(new QLabel(this)),
+ file_cached(new QLabel(this)),
file_mime(new QLabel(this)),
load_time(new QLabel(this))
{
@@ -32,6 +33,7 @@ MainWindow::MainWindow(QApplication * app, QWidget *parent) :
this->url_status->setElideMode(Qt::ElideMiddle);
this->statusBar()->addWidget(this->url_status);
+ this->statusBar()->addPermanentWidget(this->file_cached);
this->statusBar()->addPermanentWidget(this->file_mime);
this->statusBar()->addPermanentWidget(this->file_size);
this->statusBar()->addPermanentWidget(this->load_time);
@@ -419,10 +421,12 @@ void MainWindow::setFileStatus(const DocumentStats &stats)
{
if(stats.isValid()) {
this->file_size->setText(IoUtil::size_human(stats.file_size));
- this->file_mime->setText(stats.mime_type.toString());
+ this->file_cached->setText(stats.loaded_from_cache ? "(cached)" : "");
+ this->file_mime->setText(stats.mime_type.toString(false));
this->load_time->setText(QString("%1 ms").arg(stats.loading_time));
} else {
this->file_size->setText("");
+ this->file_cached->setText("");
this->file_mime->setText("");
this->load_time->setText("");
}