GUI: Enable sorting in results view.

This commit is contained in:
Kimmo Varis 2009-06-04 17:46:19 +03:00
parent 0fe601a1c9
commit 9b5350e369
1 changed files with 1 additions and 15 deletions

View File

@ -35,10 +35,10 @@ ResultsTree::ResultsTree(QSettings &settings, ApplicationList &list) :
labels << tr("File") << tr("Severity") << tr("Line") << tr("Message");
mModel.setHorizontalHeaderLabels(labels);
setExpandsOnDoubleClick(false);
setSortingEnabled(true);
LoadSettings();
connect(this, SIGNAL(doubleClicked(const QModelIndex &)),
this, SLOT(QuickStartApplication(const QModelIndex &)));
}
ResultsTree::~ResultsTree()
@ -46,8 +46,6 @@ ResultsTree::~ResultsTree()
SaveSettings();
}
QStandardItem *ResultsTree::CreateItem(const QString &name)
{
QStandardItem *item = new QStandardItem(name);
@ -55,7 +53,6 @@ QStandardItem *ResultsTree::CreateItem(const QString &name)
return item;
}
void ResultsTree::AddErrorItem(const QString &file,
const QString &severity,
const QString &message,
@ -65,7 +62,6 @@ void ResultsTree::AddErrorItem(const QString &file,
{
Q_UNUSED(file);
if (files.isEmpty())
{
return;
@ -99,7 +95,6 @@ void ResultsTree::AddErrorItem(const QString &file,
data["id"] = id;
item->setData(QVariant(data));
//Add backtrace files as children
for (int i = 1;i < files.size() && i < lines.size();i++)
{
@ -140,14 +135,12 @@ QStandardItem *ResultsTree::AddBacktraceFiles(QStandardItem *parent,
list << CreateItem(QString("%1").arg(line));
list << CreateItem(message);
QModelIndex index = QModelIndex();
parent->appendRow(list);
setRowHidden(parent->rowCount() - 1, parent->index(), hide);
if (!icon.isEmpty())
{
list[0]->setIcon(QIcon(icon));
@ -532,7 +525,6 @@ void ResultsTree::SaveErrors(QTextStream &out, QStandardItem *item, bool xml)
}
out << line << endl;
}
}
@ -611,7 +603,6 @@ void ResultsTree::RefreshFilePaths(QStandardItem *item)
//Loop through all errors within this file
for (int i = 0;i < item->rowCount();i++)
{
//Get error i
QStandardItem *error = item->child(i, 0);
@ -620,7 +611,6 @@ void ResultsTree::RefreshFilePaths(QStandardItem *item)
continue;
}
//Get error's user data
QVariant userdata = error->data();
//Convert it to QVariantMap
@ -638,7 +628,6 @@ void ResultsTree::RefreshFilePaths(QStandardItem *item)
//Update this error's text
error->setText(StripPath(files[0], false));
//If this error has backtraces make sure the files list has enough filenames
if (error->rowCount() <= files.size() - 1)
{
@ -666,7 +655,6 @@ void ResultsTree::RefreshFilePaths(QStandardItem *item)
}
}
void ResultsTree::RefreshFilePaths()
{
qDebug("Refreshing file paths");
@ -676,6 +664,4 @@ void ResultsTree::RefreshFilePaths()
{
RefreshFilePaths(mModel.item(i, 0));
}
}