GUI: Rename variables
This commit is contained in:
parent
72f5c11143
commit
3e2236ac73
|
@ -322,11 +322,11 @@ void ResultsTree::clear(const QString &filename)
|
||||||
const QString stripped = stripPath(filename, false);
|
const QString stripped = stripPath(filename, false);
|
||||||
|
|
||||||
for (int i = 0; i < mModel.rowCount(); ++i) {
|
for (int i = 0; i < mModel.rowCount(); ++i) {
|
||||||
const QStandardItem *item = mModel.item(i, 0);
|
const QStandardItem *fileItem = mModel.item(i, 0);
|
||||||
if (!item)
|
if (!fileItem)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
QVariantMap data = item->data().toMap();
|
QVariantMap data = fileItem->data().toMap();
|
||||||
if (stripped == data["file"].toString() ||
|
if (stripped == data["file"].toString() ||
|
||||||
filename == data["file0"].toString()) {
|
filename == data["file0"].toString()) {
|
||||||
mModel.removeRow(i);
|
mModel.removeRow(i);
|
||||||
|
@ -338,12 +338,12 @@ void ResultsTree::clear(const QString &filename)
|
||||||
void ResultsTree::clearRecheckFile(const QString &filename)
|
void ResultsTree::clearRecheckFile(const QString &filename)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < mModel.rowCount(); ++i) {
|
for (int i = 0; i < mModel.rowCount(); ++i) {
|
||||||
const QStandardItem *item = mModel.item(i, 0);
|
const QStandardItem *fileItem = mModel.item(i, 0);
|
||||||
if (!item)
|
if (!fileItem)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
QString actualfile((!mCheckPath.isEmpty() && filename.startsWith(mCheckPath)) ? filename.mid(mCheckPath.length() + 1) : filename);
|
QString actualfile((!mCheckPath.isEmpty() && filename.startsWith(mCheckPath)) ? filename.mid(mCheckPath.length() + 1) : filename);
|
||||||
QVariantMap data = item->data().toMap();
|
QVariantMap data = fileItem->data().toMap();
|
||||||
QString storedfile = data["file"].toString();
|
QString storedfile = data["file"].toString();
|
||||||
storedfile = ((!mCheckPath.isEmpty() && storedfile.startsWith(mCheckPath)) ? storedfile.mid(mCheckPath.length() + 1) : storedfile);
|
storedfile = ((!mCheckPath.isEmpty() && storedfile.startsWith(mCheckPath)) ? storedfile.mid(mCheckPath.length() + 1) : storedfile);
|
||||||
if (actualfile == storedfile) {
|
if (actualfile == storedfile) {
|
||||||
|
@ -396,17 +396,17 @@ void ResultsTree::showHiddenResults()
|
||||||
//Clear the "hide" flag for each item
|
//Clear the "hide" flag for each item
|
||||||
int filecount = mModel.rowCount();
|
int filecount = mModel.rowCount();
|
||||||
for (int i = 0; i < filecount; i++) {
|
for (int i = 0; i < filecount; i++) {
|
||||||
QStandardItem *file = mModel.item(i, 0);
|
QStandardItem *fileItem = mModel.item(i, 0);
|
||||||
if (!file)
|
if (!fileItem)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
QVariantMap data = file->data().toMap();
|
QVariantMap data = fileItem->data().toMap();
|
||||||
data["hide"] = false;
|
data["hide"] = false;
|
||||||
file->setData(QVariant(data));
|
fileItem->setData(QVariant(data));
|
||||||
|
|
||||||
int errorcount = file->rowCount();
|
int errorcount = fileItem->rowCount();
|
||||||
for (int j = 0; j < errorcount; j++) {
|
for (int j = 0; j < errorcount; j++) {
|
||||||
QStandardItem *child = file->child(j, 0);
|
QStandardItem *child = fileItem->child(j, 0);
|
||||||
if (child) {
|
if (child) {
|
||||||
data = child->data().toMap();
|
data = child->data().toMap();
|
||||||
data["hide"] = false;
|
data["hide"] = false;
|
||||||
|
@ -427,20 +427,20 @@ void ResultsTree::refreshTree()
|
||||||
|
|
||||||
for (int i = 0; i < filecount; i++) {
|
for (int i = 0; i < filecount; i++) {
|
||||||
//Get file i
|
//Get file i
|
||||||
QStandardItem *file = mModel.item(i, 0);
|
QStandardItem *fileItem = mModel.item(i, 0);
|
||||||
if (!file) {
|
if (!fileItem) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Get the amount of errors this file contains
|
//Get the amount of errors this file contains
|
||||||
int errorcount = file->rowCount();
|
int errorcount = fileItem->rowCount();
|
||||||
|
|
||||||
//By default it shouldn't be visible
|
//By default it shouldn't be visible
|
||||||
bool show = false;
|
bool show = false;
|
||||||
|
|
||||||
for (int j = 0; j < errorcount; j++) {
|
for (int j = 0; j < errorcount; j++) {
|
||||||
//Get the error itself
|
//Get the error itself
|
||||||
QStandardItem *child = file->child(j, 0);
|
QStandardItem *child = fileItem->child(j, 0);
|
||||||
if (!child) {
|
if (!child) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -468,7 +468,7 @@ void ResultsTree::refreshTree()
|
||||||
}
|
}
|
||||||
|
|
||||||
//Hide/show accordingly
|
//Hide/show accordingly
|
||||||
setRowHidden(j, file->index(), hide);
|
setRowHidden(j, fileItem->index(), hide);
|
||||||
|
|
||||||
//If it was shown then the file itself has to be shown as well
|
//If it was shown then the file itself has to be shown as well
|
||||||
if (!hide) {
|
if (!hide) {
|
||||||
|
@ -477,7 +477,7 @@ void ResultsTree::refreshTree()
|
||||||
}
|
}
|
||||||
|
|
||||||
//Hide the file if its "hide" attribute is set
|
//Hide the file if its "hide" attribute is set
|
||||||
if (file->data().toMap()["hide"].toBool()) {
|
if (fileItem->data().toMap()["hide"].toBool()) {
|
||||||
show = false;
|
show = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -979,20 +979,20 @@ void ResultsTree::saveResults(Report *report) const
|
||||||
report->writeFooter();
|
report->writeFooter();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ResultsTree::saveErrors(Report *report, QStandardItem *item) const
|
void ResultsTree::saveErrors(Report *report, QStandardItem *fileItem) const
|
||||||
{
|
{
|
||||||
if (!item) {
|
if (!fileItem) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < item->rowCount(); i++) {
|
for (int i = 0; i < fileItem->rowCount(); i++) {
|
||||||
const QStandardItem *error = item->child(i, 0);
|
const QStandardItem *error = fileItem->child(i, 0);
|
||||||
|
|
||||||
if (!error) {
|
if (!error) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isRowHidden(i, item->index()) && !mSaveAllErrors) {
|
if (isRowHidden(i, fileItem->index()) && !mSaveAllErrors) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -298,9 +298,9 @@ protected:
|
||||||
/**
|
/**
|
||||||
* @brief Save all errors under specified item
|
* @brief Save all errors under specified item
|
||||||
* @param report Report that errors are saved to
|
* @param report Report that errors are saved to
|
||||||
* @param item Item whose errors to save
|
* @param fileItem Item whose errors to save
|
||||||
*/
|
*/
|
||||||
void saveErrors(Report *report, QStandardItem *item) const;
|
void saveErrors(Report *report, QStandardItem *fileItem) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Convert a severity string to a icon filename
|
* @brief Convert a severity string to a icon filename
|
||||||
|
|
Loading…
Reference in New Issue