[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdeutils/kgpg
From:       Rolf Eike Beer <kde () opensource ! sf-tec ! de>
Date:       2011-02-14 6:52:52
Message-ID: 20110214065252.4D348AC8C5 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1220543 by dakon:

get the width of the key count status field right

This also removes a string.

 M  +2 -2      keysmanager.cpp  
 M  +6 -0      model/kgpgitemmodel.cpp  
 M  +1 -0      model/kgpgitemmodel.h  


--- trunk/KDE/kdeutils/kgpg/keysmanager.cpp #1220542:1220543
@@ -485,8 +485,8 @@
 	iproxy->setOnlySecret(KGpgSettings::showSecret());
 
 	KStatusBar *statusbar = statusBar();
-	statusbar->insertPermanentFixedItem(i18n("00000 Keys, 000 Groups"), 0);
-	statusbar->changeItem(QLatin1String( "" ), 0);
+	statusbar->insertPermanentFixedItem(KGpgItemModel::statusCountMessageString(9999, 999), 0);
+	statusbar->changeItem(QString(), 0);
 
 	cg = KConfigGroup(KGlobal::config().data(), "MainWindow");
 	setAutoSaveSettings(cg, true);
--- trunk/KDE/kdeutils/kgpg/model/kgpgitemmodel.cpp #1220542:1220543
@@ -197,6 +197,12 @@
 	const int groups = m_root->groupChildren();
 	const int keys = m_root->getChildCount() - groups;
 
+	return statusCountMessageString(keys, groups);
+}
+
+QString
+KGpgItemModel::statusCountMessageString(const unsigned int keys, const unsigned int groups)
+{
 	// Most people will not have groups. Handle this case
 	// special so the string isn't displayed in this case at all
 	if (groups == 0) {
--- trunk/KDE/kdeutils/kgpg/model/kgpgitemmodel.h #1220542:1220543
@@ -71,6 +71,7 @@
 
 	KGpgRootNode *getRootNode() const;
 	QString statusCountMessage() const;
+	static QString statusCountMessageString(const unsigned int keys, const unsigned int groups);
 
 public Q_SLOTS:
 	KGpgGroupNode *addGroup(const QString &name, const KGpgKeyNode::List &keys);
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic