From bfcb2cd0e0168e1f740678a626a5d5077cf6e677 Mon Sep 17 00:00:00 2001 From: Arno Date: Sat, 24 Jul 2010 18:11:28 +0200 Subject: Fix selected items in statusbar for archive Show number of selected items of FilesTreeView in statusbar when selecting files. --- shemov.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'shemov.cpp') diff --git a/shemov.cpp b/shemov.cpp index 8b3e82b..03b9271 100644 --- a/shemov.cpp +++ b/shemov.cpp @@ -58,6 +58,8 @@ SheMov::SheMov(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(parent, fla connect(mATree->filesWidget(), SIGNAL(statusMessage(QString)), this, SLOT(statusbarMessage(QString))); connect(mATree->filesWidget(), SIGNAL(sizeChanged(qint64)), this, SLOT(setSize(qint64))); connect(mATree, SIGNAL(needWindowTitleChange(QString)), this, SLOT(setWindowTitle(QString))); + connect(mATree->filesWidget()->filesTree()->selectionModel(), SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)), this, SLOT(updateSelectionCount(const QItemSelection &, const QItemSelection &))); + connect(mATree->seriesWidget()->seriesTree()->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(updateSelectionCount(QItemSelection,QItemSelection))); QVBoxLayout *mainLayout = new QVBoxLayout; mainLayout->addWidget(mTab); @@ -113,6 +115,10 @@ void SheMov::updateSelectionCount(const QItemSelection & /* sel */, const QItemS mSelectedSize->setText(QString(tr("%1")).arg(l.toString((selSize)))); break; } + case 1: { + int selCount = mATree->filesWidget()->filesTree()->selectionModel()->selectedRows().count(); + mSelectedItems->setText(QString::number(selCount)); + } } } -- cgit v1.2.3-70-g09d2