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

List:       kde-commits
Subject:    =?utf-8?q?=5Bplasmate=5D_/=3A_=22More_Projects=22_option_is_not_?=
From:       Giorgos Tsiapaliwkas <terietor () gmail ! com>
Date:       2011-05-13 16:17:33
Message-ID: 20110513161733.24C75A60A4 () git ! kde ! org
[Download RAW message or body]

Git commit 81bc0313d715b15547f6d4afd93ad08d8ada057e by Giorgos Tsiapaliwkas.
Committed on 13/05/2011 at 17:56.
Pushed by tsiapaliwkas into branch 'master'.

"More Projects" option is not reacting differently according to the number of the \
projects

M  +10   -6    startpage.cpp     

http://commits.kde.org/plasmate/81bc0313d715b15547f6d4afd93ad08d8ada057e

diff --git a/startpage.cpp b/startpage.cpp
index c29f85f..8f62c54 100644
--- a/startpage.cpp
+++ b/startpage.cpp
@@ -244,7 +244,7 @@ void StartPage::refreshRecentProjectsList()
         m_ui.recentProjects->hide();
         return;
     }
-
+    int counter = 0;
     foreach (const QString file, recentProjects) {
         // Specify path + filename as well to avoid mistaking .gitignore
         // as being the metadata file.
@@ -272,7 +272,7 @@ void StartPage::refreshRecentProjectsList()
 
         kDebug() << "adding" << projectName << "to the list of recent projects...";
         QListWidgetItem *item = new QListWidgetItem(projectName); // show the \
                user-set plasmoid name in the UI
-
+	counter++;
         // the loading code uses this to find the project to load.
         // since folder name and plasmoid name can be different, this
         // should be set to the folder name, which the loading code expects.
@@ -317,11 +317,15 @@ void StartPage::refreshRecentProjectsList()
         }
     }
 
-    if (recentProjects.count() > 4) {
-        QListWidgetItem *more = new QListWidgetItem(i18n("More projects..."));
-        more->setIcon(KIcon("window-new"));
-        m_ui.recentProjects->addItem(more);
+    QListWidgetItem *more;
+    //if (recentProjects.count() >=0 && recentProjects.count() <=4) {
+    if (counter >=0 && counter <=4) {
+      more = new QListWidgetItem(i18n("More projects..."));
+    } else {
+	more = new QListWidgetItem(i18n("Manage and More Projects..."));
     }
+    more->setIcon(KIcon("window-new"));
+    m_ui.recentProjects->addItem(more);
 }
 
 void StartPage::createNewProject()


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

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