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

List:       kde-commits
Subject:    [kdesvn] src/svnfrontend: QList<SvnItem *> SvnItemList -> QVector<SvnItem *>
From:       Christian Ehrlicher <Ch.Ehrlicher () gmx ! de>
Date:       2015-12-31 15:36:36
Message-ID: E1aEfHI-000439-0c () scm ! kde ! org
[Download RAW message or body]

Git commit 03d62382cdc6af8481ebea7ebd5d5e09c7f1a22e by Christian Ehrlicher.
Committed on 31/12/2015 at 15:34.
Pushed by chehrlic into branch 'master'.

QList<SvnItem *> SvnItemList -> QVector<SvnItem *>

M  +3    -5    src/svnfrontend/frontendtypes.h
M  +3    -3    src/svnfrontend/maintreewidget.cpp
M  +7    -9    src/svnfrontend/svnactions.cpp
M  +2    -2    src/svnfrontend/svnitem.cpp

http://commits.kde.org/kdesvn/03d62382cdc6af8481ebea7ebd5d5e09c7f1a22e

diff --git a/src/svnfrontend/frontendtypes.h b/src/svnfrontend/frontendtypes.h
index 68347b7..a72b89e 100644
--- a/src/svnfrontend/frontendtypes.h
+++ b/src/svnfrontend/frontendtypes.h
@@ -20,17 +20,15 @@
 #ifndef FRONTEND_TYPES_H
 #define FRONTEND_TYPES_H
 
-#include "svnqt/shared_pointer.h"
-#include <QList>
+#include "svnqt/smart_pointer.h"
+#include <QVector>
 
 class ThreadContextListener;
 class SvnItem;
 
 typedef svn::smart_pointer<ThreadContextListener> ThreadContextListenerP;
 
-typedef QList<SvnItem *> SvnItemList;
-typedef QList<SvnItem *>::iterator SvnItemListIterator;
-typedef QList<SvnItem *>::const_iterator SvnItemListConstIterator;
+typedef QVector<SvnItem *> SvnItemList;
 
 #endif
 
diff --git a/src/svnfrontend/maintreewidget.cpp b/src/svnfrontend/maintreewidget.cpp
index c6d3ef1..27e5680 100644
--- a/src/svnfrontend/maintreewidget.cpp
+++ b/src/svnfrontend/maintreewidget.cpp
@@ -2286,9 +2286,9 @@ void MainTreeWidget::slotDirUpdate()
     if (which.isEmpty()) {
         what.append(baseUri());
     } else {
-        SvnItemListConstIterator liter = which.constBegin();
-        for (; liter != which.constEnd(); ++liter) {
-            what.append((*liter)->fullName());
+        what.reserve(which.size());
+        Q_FOREACH(const SvnItem *item, which) {
+            what.append(item->fullName());
         }
     }
     m_Data->m_Model->svnWrapper()->makeUpdate(what, svn::Revision::HEAD, \
                svn::DepthUnknown);
diff --git a/src/svnfrontend/svnactions.cpp b/src/svnfrontend/svnactions.cpp
index ea7fa55..5c2e367 100644
--- a/src/svnfrontend/svnactions.cpp
+++ b/src/svnfrontend/svnactions.cpp
@@ -52,6 +52,7 @@
 #include "src/svnqt/cache/LogCache.h"
 #include "src/svnqt/cache/ReposLog.h"
 #include "src/svnqt/cache/ReposConfig.h"
+#include "src/svnqt/shared_pointer.h"
 
 #include "fronthelpers/createdlg.h"
 #include "fronthelpers/watchedprocess.h"
@@ -1495,9 +1496,9 @@ void SvnActions::prepareUpdate(bool ask)
     if (k.isEmpty()) {
         what.append(m_Data->m_ParentList->baseUri());
     } else {
-        SvnItemListConstIterator liter = k.constBegin();
-        for (; liter != k.constEnd(); ++liter) {
-            what.append((*liter)->fullName());
+        what.reserve(k.size());
+        Q_FOREACH(const SvnItem *item, k) {
+            what.append(item->fullName());
         }
     }
     svn::Revision r(svn::Revision::HEAD);
@@ -1556,9 +1557,7 @@ void SvnActions::makeAdd(bool rec)
     }
     svn::Paths items;
     items.reserve(lst.size());
-    SvnItemListConstIterator liter = lst.constBegin();
-    for (; liter != lst.constEnd(); ++liter) {
-        const SvnItem *cur = (*liter);
+    Q_FOREACH(const SvnItem *cur, lst) {
         if (cur->isVersioned()) {
             KMessageBox::error(m_Data->m_ParentList->realWidget(), i18n("<center>The \
entry<br>%1<br>is versioned - break.</center>",  cur->fullName()));
@@ -1757,9 +1756,8 @@ void SvnActions::slotRevert()
     const SvnItemList lst = m_Data->m_ParentList->SelectionList();
     QStringList displist;
     if (!lst.isEmpty()) {
-        SvnItemListConstIterator liter = lst.constBegin();
-        for (; liter != lst.constEnd(); ++liter) {
-            const SvnItem *cur = (*liter);
+        displist.reserve(lst.size());
+        Q_FOREACH(const SvnItem *cur, lst) {
             if (!cur->isVersioned()) {
                 KMessageBox::error(m_Data->m_ParentList->realWidget(), \
i18n("<center>The entry<br>%1<br>is not versioned - break.</center>", \
cur->fullName()));  return;
diff --git a/src/svnfrontend/svnitem.cpp b/src/svnfrontend/svnitem.cpp
index 4b016f4..e2e61b2 100644
--- a/src/svnfrontend/svnitem.cpp
+++ b/src/svnfrontend/svnitem.cpp
@@ -23,7 +23,6 @@
 #include "kdesvn_part.h"
 #include "src/settings/kdesvnsettings.h"
 #include "src/svnqt/status.h"
-#include "src/svnqt/smart_pointer.h"
 #include "src/svnqt/url.h"
 #include "helpers/ktranslateurl.h"
 
@@ -559,7 +558,8 @@ const QString &SvnItem::getToolTipText()
                 /* local */
             }
             if (wrap) {
-                QList<SvnItem *> lst; lst.append(this);
+                SvnItemList lst;
+                lst.append(this);
                 text = wrap->getInfo(lst, rev, peg, false, false);
                 kDebug() << text << endl;
                 if (!p_Item->m_fitem.isNull()) {


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

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