summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorStephen Kelly <stephen.kelly@kdab.com>2012-11-01 12:21:11 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-11-01 16:10:32 +0100
commit3de5a8e78be307145340e0867de53dc607eae59c (patch)
tree66c307a612e3d13241a1c22ffaa10fdd70b0bad0 /src/gui
parent731ba8ed08f80644b403556638c7f6229e678ebe (diff)
Strip trailing whitespace in itemviews.
Using git ls-files -z | xargs -0 sed -i 's/ \+$//' in the relevant directories. Change-Id: I861ef9952fb32ed2db9ec8b67864ec7d0d61f0f2 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/itemmodels/qstandarditemmodel.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/gui/itemmodels/qstandarditemmodel.cpp b/src/gui/itemmodels/qstandarditemmodel.cpp
index 6e919eb0b2..fdd00fe980 100644
--- a/src/gui/itemmodels/qstandarditemmodel.cpp
+++ b/src/gui/itemmodels/qstandarditemmodel.cpp
@@ -2935,7 +2935,7 @@ QMimeData *QStandardItemModel::mimeData(const QModelIndexList &indexes) const
return data;
QByteArray encoded;
QDataStream stream(&encoded, QIODevice::WriteOnly);
-
+
QSet<QStandardItem*> itemsSet;
QStack<QStandardItem*> stack;
itemsSet.reserve(indexes.count());
@@ -2945,7 +2945,7 @@ QMimeData *QStandardItemModel::mimeData(const QModelIndexList &indexes) const
itemsSet << item;
stack.push(item);
}
-
+
//remove duplicates childrens
{
QSet<QStandardItem *> seen;
@@ -2954,7 +2954,7 @@ QMimeData *QStandardItemModel::mimeData(const QModelIndexList &indexes) const
if (seen.contains(itm))
continue;
seen.insert(itm);
-
+
const QVector<QStandardItem*> &childList = itm->d_func()->children;
for (int i = 0; i < childList.count(); ++i) {
QStandardItem *chi = childList.at(i);
@@ -2968,17 +2968,17 @@ QMimeData *QStandardItemModel::mimeData(const QModelIndexList &indexes) const
}
}
}
-
+
stack.reserve(itemsSet.count());
foreach (QStandardItem *item, itemsSet) {
stack.push(item);
}
-
+
//stream everything recursively
while (!stack.isEmpty()) {
QStandardItem *item = stack.pop();
if(itemsSet.contains(item)) { //if the item is selection 'top-level', strem its position
- stream << item->row() << item->column();
+ stream << item->row() << item->column();
}
if(item) {
stream << *item << item->columnCount() << item->d_ptr->children.count();
@@ -2996,7 +2996,7 @@ QMimeData *QStandardItemModel::mimeData(const QModelIndexList &indexes) const
/* \internal
Used by QStandardItemModel::dropMimeData
- stream out an item and his children
+ stream out an item and his children
*/
void QStandardItemModelPrivate::decodeDataRecursive(QDataStream &stream, QStandardItem *item)
{
@@ -3004,9 +3004,9 @@ void QStandardItemModelPrivate::decodeDataRecursive(QDataStream &stream, QStanda
stream >> *item;
stream >> colCount >> childCount;
item->setColumnCount(colCount);
-
+
int childPos = childCount;
-
+
while(childPos > 0) {
childPos--;
QStandardItem *child = createItem();