Skip to content

Commit

Permalink
GUI: Enable sorting in results view.
Browse files Browse the repository at this point in the history
  • Loading branch information
kimmov committed Jun 4, 2009
1 parent 0fe601a commit 9b5350e
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions gui/resultstree.cpp
Expand Up @@ -35,27 +35,24 @@ 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()
{
SaveSettings();
}



QStandardItem *ResultsTree::CreateItem(const QString &name)
{
QStandardItem *item = new QStandardItem(name);
item->setEditable(false);
return item;
}


void ResultsTree::AddErrorItem(const QString &file,
const QString &severity,
const QString &message,
Expand All @@ -65,7 +62,6 @@ void ResultsTree::AddErrorItem(const QString &file,
{
Q_UNUSED(file);


if (files.isEmpty())
{
return;
Expand Down Expand Up @@ -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++)
{
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -532,7 +525,6 @@ void ResultsTree::SaveErrors(QTextStream &out, QStandardItem *item, bool xml)
}

out << line << endl;

}
}

Expand Down Expand Up @@ -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);

Expand All @@ -620,7 +611,6 @@ void ResultsTree::RefreshFilePaths(QStandardItem *item)
continue;
}


//Get error's user data
QVariant userdata = error->data();
//Convert it to QVariantMap
Expand All @@ -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)
{
Expand Down Expand Up @@ -666,7 +655,6 @@ void ResultsTree::RefreshFilePaths(QStandardItem *item)
}
}


void ResultsTree::RefreshFilePaths()
{
qDebug("Refreshing file paths");
Expand All @@ -676,6 +664,4 @@ void ResultsTree::RefreshFilePaths()
{
RefreshFilePaths(mModel.item(i, 0));
}

}

0 comments on commit 9b5350e

Please sign in to comment.