forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -1309,7 +1309,7 @@ QtMessageLogItem *QmlEngine::constructLogItemTree(
|
|||||||
QtMessageLogItem *child = constructLogItemTree(item,
|
QtMessageLogItem *child = constructLogItemTree(item,
|
||||||
i.value(), i.key());
|
i.value(), i.key());
|
||||||
if (child)
|
if (child)
|
||||||
item->insertChildSorted(child);
|
item->insertChild(child);
|
||||||
}
|
}
|
||||||
} else if (result.type() == QVariant::List) {
|
} else if (result.type() == QVariant::List) {
|
||||||
if (key.isEmpty())
|
if (key.isEmpty())
|
||||||
@@ -1321,7 +1321,7 @@ QtMessageLogItem *QmlEngine::constructLogItemTree(
|
|||||||
QtMessageLogItem *child = constructLogItemTree(item, resultList.at(i),
|
QtMessageLogItem *child = constructLogItemTree(item, resultList.at(i),
|
||||||
QString::number(i));
|
QString::number(i));
|
||||||
if (child)
|
if (child)
|
||||||
item->insertChildSorted(child);
|
item->insertChild(child);
|
||||||
}
|
}
|
||||||
} else if (result.canConvert(QVariant::String)) {
|
} else if (result.canConvert(QVariant::String)) {
|
||||||
item->text = result.toString();
|
item->text = result.toString();
|
||||||
|
@@ -995,7 +995,7 @@ QtMessageLogItem *QmlV8DebuggerClientPrivate::constructLogItemTree(
|
|||||||
QtMessageLogItem *child = constructLogItemTree(
|
QtMessageLogItem *child = constructLogItemTree(
|
||||||
item, extractData(property, refsVal), refsVal);
|
item, extractData(property, refsVal), refsVal);
|
||||||
if (child)
|
if (child)
|
||||||
item->insertChildSorted(child);
|
item->insertChild(child);
|
||||||
}
|
}
|
||||||
|
|
||||||
return item;
|
return item;
|
||||||
|
@@ -31,6 +31,8 @@
|
|||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
#include "qtmessageloghandler.h"
|
#include "qtmessageloghandler.h"
|
||||||
|
#include "debuggercore.h"
|
||||||
|
#include "debuggeractions.h"
|
||||||
|
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
@@ -94,8 +96,13 @@ bool QtMessageLogItem::insertChildren(int position, int count)
|
|||||||
return true;
|
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;
|
int i = 0;
|
||||||
for (; i < m_childItems.count(); i++) {
|
for (; i < m_childItems.count(); i++) {
|
||||||
if (item->text < m_childItems[i]->text) {
|
if (item->text < m_childItems[i]->text) {
|
||||||
|
@@ -126,7 +126,7 @@ public:
|
|||||||
QtMessageLogItem *child(int number);
|
QtMessageLogItem *child(int number);
|
||||||
int childCount() const;
|
int childCount() const;
|
||||||
bool insertChildren(int position, int count);
|
bool insertChildren(int position, int count);
|
||||||
void insertChildSorted(QtMessageLogItem *item);
|
void insertChild(QtMessageLogItem *item);
|
||||||
bool insertChild(int position, QtMessageLogItem *item);
|
bool insertChild(int position, QtMessageLogItem *item);
|
||||||
QtMessageLogItem *parent();
|
QtMessageLogItem *parent();
|
||||||
bool removeChildren(int position, int count);
|
bool removeChildren(int position, int count);
|
||||||
|
Reference in New Issue
Block a user