summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAurindam Jana <aurindam.jana@nokia.com>2012-03-22 12:00:47 +0100
committerhjk <qthjk@ovi.com>2012-03-22 12:04:48 +0100
commitb9dfbd8ec309dc0417c23ad8e118fd835d74c7ec (patch)
treee88929ea585a4b4adeadaee6ae344ca53cd76e69
parente9e804888eb3330dae4144afb4026447895834a2 (diff)
downloadqt-creator-b9dfbd8ec309dc0417c23ad8e118fd835d74c7ec.tar.gz
QtMessageLogHandler: Sorting child items
Insert child items in sorted order if the "Sort Members and Classes Alphabetically" is set in Locals And Expressions. Change-Id: Ib21803326ec3f35c9541c08d876c4a38c0202a9f Reviewed-by: hjk <qthjk@ovi.com>
-rw-r--r--src/plugins/debugger/qml/qmlengine.cpp4
-rw-r--r--src/plugins/debugger/qml/qmlv8debuggerclient.cpp2
-rw-r--r--src/plugins/debugger/qtmessageloghandler.cpp9
-rw-r--r--src/plugins/debugger/qtmessageloghandler.h2
4 files changed, 12 insertions, 5 deletions
diff --git a/src/plugins/debugger/qml/qmlengine.cpp b/src/plugins/debugger/qml/qmlengine.cpp
index e9d5c42a90..abc050cf4c 100644
--- a/src/plugins/debugger/qml/qmlengine.cpp
+++ b/src/plugins/debugger/qml/qmlengine.cpp
@@ -1309,7 +1309,7 @@ QtMessageLogItem *QmlEngine::constructLogItemTree(
QtMessageLogItem *child = constructLogItemTree(item,
i.value(), i.key());
if (child)
- item->insertChildSorted(child);
+ item->insertChild(child);
}
} else if (result.type() == QVariant::List) {
if (key.isEmpty())
@@ -1321,7 +1321,7 @@ QtMessageLogItem *QmlEngine::constructLogItemTree(
QtMessageLogItem *child = constructLogItemTree(item, resultList.at(i),
QString::number(i));
if (child)
- item->insertChildSorted(child);
+ item->insertChild(child);
}
} else if (result.canConvert(QVariant::String)) {
item->text = result.toString();
diff --git a/src/plugins/debugger/qml/qmlv8debuggerclient.cpp b/src/plugins/debugger/qml/qmlv8debuggerclient.cpp
index 58121ddc07..01910e1bd5 100644
--- a/src/plugins/debugger/qml/qmlv8debuggerclient.cpp
+++ b/src/plugins/debugger/qml/qmlv8debuggerclient.cpp
@@ -995,7 +995,7 @@ QtMessageLogItem *QmlV8DebuggerClientPrivate::constructLogItemTree(
QtMessageLogItem *child = constructLogItemTree(
item, extractData(property, refsVal), refsVal);
if (child)
- item->insertChildSorted(child);
+ item->insertChild(child);
}
return item;
diff --git a/src/plugins/debugger/qtmessageloghandler.cpp b/src/plugins/debugger/qtmessageloghandler.cpp
index 5080d8efc9..3ca2d33bfa 100644
--- a/src/plugins/debugger/qtmessageloghandler.cpp
+++ b/src/plugins/debugger/qtmessageloghandler.cpp
@@ -31,6 +31,8 @@
**************************************************************************/
#include "qtmessageloghandler.h"
+#include "debuggercore.h"
+#include "debuggeractions.h"
#include <utils/qtcassert.h>
@@ -94,8 +96,13 @@ bool QtMessageLogItem::insertChildren(int position, int count)
return true;
}
-void QtMessageLogItem::insertChildSorted(QtMessageLogItem *item)
+void QtMessageLogItem::insertChild(QtMessageLogItem *item)
{
+ if (!debuggerCore()->boolSetting(SortStructMembers)) {
+ m_childItems.insert(m_childItems.count(), item);
+ return;
+ }
+
int i = 0;
for (; i < m_childItems.count(); i++) {
if (item->text < m_childItems[i]->text) {
diff --git a/src/plugins/debugger/qtmessageloghandler.h b/src/plugins/debugger/qtmessageloghandler.h
index b76d85d043..6e84f67a18 100644
--- a/src/plugins/debugger/qtmessageloghandler.h
+++ b/src/plugins/debugger/qtmessageloghandler.h
@@ -126,7 +126,7 @@ public:
QtMessageLogItem *child(int number);
int childCount() const;
bool insertChildren(int position, int count);
- void insertChildSorted(QtMessageLogItem *item);
+ void insertChild(QtMessageLogItem *item);
bool insertChild(int position, QtMessageLogItem *item);
QtMessageLogItem *parent();
bool removeChildren(int position, int count);