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

List:       kde-commits
Subject:    [koffice] showcase/part: Make foreach in CustomSlideShow efficient.
From:       "Dr. Robert Marmorstein" <robert () narnia ! homeunix ! com>
Date:       2011-08-02 9:16:39
Message-ID: 20110802091639.9A6A3A60E1 () git ! kde ! org
[Download RAW message or body]

Git commit d519bcf703cd4ccfc93b2fadcda0e05623744fd4 by Dr. Robert Marmorstein.
Committed on 02/08/2011 at 11:15.
Pushed by robertm into branch 'master'.

Make foreach in CustomSlideShow efficient.

Another krazy fix....

M  +5    -3    showcase/part/SCCustomSlideShows.cpp

http://commits.kde.org/koffice/d519bcf703cd4ccfc93b2fadcda0e05623744fd4

diff --git a/showcase/part/SCCustomSlideShows.cpp b/showcase/part/SCCustomSlideShows.cpp
index d549095..4ccabd8 100644
--- a/showcase/part/SCCustomSlideShows.cpp
+++ b/showcase/part/SCCustomSlideShows.cpp
@@ -123,10 +123,12 @@ void SCCustomSlideShows::removeSlidesFromAll(const QList<KoPAPageBase*> &slideSh
 
 void SCCustomSlideShows::saveOdf(KoPASavingContext &context)
 {
-    foreach (const QString &name, m_customSlideShows.keys()) {
-        QList<KoPAPageBase*> slideList = m_customSlideShows.value(name);
+    QMap <QString, QList<KoPAPageBase*> >::const_iterator end = m_customSlideShows.constEnd();
+    for (QMap <QString, QList<KoPAPageBase*> >::const_iterator iter = m_customSlideShows.constBegin(); 
+            iter != end; ++iter) {
+        QList<KoPAPageBase*> slideList = iter.value();
         context.xmlWriter().startElement("presentation:show");
-        context.xmlWriter().addAttribute("presentation:name", name);
+        context.xmlWriter().addAttribute("presentation:name", iter.key());
         QString pages;
         foreach (KoPAPageBase *page, slideList) {
             KoPAPage *p = dynamic_cast<KoPAPage *>(page);

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

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