1 /* SPDX-FileCopyrightText: 2003-2018 Jesper K. Pedersen <blackie@kde.org> 2 3 SPDX-License-Identifier: GPL-2.0-or-later 4 */ 5 6 #include "ImageCounter.h" 7 8 #include <KLocalizedString> 9 #include <QLabel> 10 ImageCounter(QWidget * parent)11MainWindow::ImageCounter::ImageCounter(QWidget *parent) 12 : QLabel(parent) 13 { 14 setText(QString::fromLatin1("---")); 15 setMargin(5); 16 } 17 setMatchCount(uint matches)18void MainWindow::ImageCounter::setMatchCount(uint matches) 19 { 20 setText(i18np("Showing 1 thumbnail", "Showing %1 thumbnails", matches)); 21 } 22 setSelectionCount(uint selected)23void MainWindow::ImageCounter::setSelectionCount(uint selected) 24 { 25 if (selected > 0) 26 setText(i18n("(%1 selected)", selected)); 27 else 28 setText(QString()); 29 } 30 setTotal(uint c)31void MainWindow::ImageCounter::setTotal(uint c) 32 { 33 setText(i18n("Total: %1", c)); 34 } 35 showBrowserMatches(uint matches)36void MainWindow::ImageCounter::showBrowserMatches(uint matches) 37 { 38 setText(i18np("1 match", "%1 matches", matches)); 39 } 40 41 // vi:expandtab:tabstop=4 shiftwidth=4: 42