GUI: Renamed methods in ResultsView

This commit is contained in:
Daniel Marjamäki 2017-07-28 12:10:10 +02:00
parent 090062baaf
commit 73cbf617e2
3 changed files with 100 additions and 102 deletions

View File

@ -66,7 +66,7 @@ MainWindow::MainWindow(TranslationHandler* th, QSettings* settings) :
{ {
mUI.setupUi(this); mUI.setupUi(this);
mThread = new ThreadHandler(this); mThread = new ThreadHandler(this);
mUI.mResults->Initialize(mSettings, mApplications, mThread); mUI.mResults->initialize(mSettings, mApplications, mThread);
// Filter timer to delay filtering results slightly while typing // Filter timer to delay filtering results slightly while typing
mFilterTimer = new QTimer(this); mFilterTimer = new QTimer(this);
@ -256,7 +256,7 @@ void MainWindow::loadSettings()
mSettings->value(SETTINGS_WINDOW_HEIGHT, 600).toInt()); mSettings->value(SETTINGS_WINDOW_HEIGHT, 600).toInt());
} }
ShowTypes *types = mUI.mResults->GetShowTypes(); ShowTypes *types = mUI.mResults->getShowTypes();
mUI.mActionShowStyle->setChecked(types->isShown(ShowTypes::ShowStyle)); mUI.mActionShowStyle->setChecked(types->isShown(ShowTypes::ShowStyle));
mUI.mActionShowErrors->setChecked(types->isShown(ShowTypes::ShowErrors)); mUI.mActionShowErrors->setChecked(types->isShown(ShowTypes::ShowErrors));
mUI.mActionShowWarnings->setChecked(types->isShown(ShowTypes::ShowWarnings)); mUI.mActionShowWarnings->setChecked(types->isShown(ShowTypes::ShowWarnings));
@ -352,7 +352,7 @@ void MainWindow::saveSettings() const
mApplications->saveSettings(); mApplications->saveSettings();
mSettings->setValue(SETTINGS_LANGUAGE, mTranslation->GetCurrentLanguage()); mSettings->setValue(SETTINGS_LANGUAGE, mTranslation->GetCurrentLanguage());
mUI.mResults->SaveSettings(mSettings); mUI.mResults->saveSettings(mSettings);
} }
void MainWindow::doCheckProject(ImportProject p) void MainWindow::doCheckProject(ImportProject p)
@ -370,10 +370,10 @@ void MainWindow::doCheckProject(ImportProject p)
enableProjectActions(false); enableProjectActions(false);
} }
mUI.mResults->Clear(true); mUI.mResults->clear(true);
mThread->ClearFiles(); mThread->ClearFiles();
mUI.mResults->CheckingStarted(p.fileSettings.size()); mUI.mResults->checkingStarted(p.fileSettings.size());
QDir inf(mCurrentDirectory); QDir inf(mCurrentDirectory);
const QString checkPath = inf.canonicalPath(); const QString checkPath = inf.canonicalPath();
@ -381,7 +381,7 @@ void MainWindow::doCheckProject(ImportProject p)
checkLockDownUI(); // lock UI while checking checkLockDownUI(); // lock UI while checking
mUI.mResults->SetCheckDirectory(checkPath); mUI.mResults->setCheckDirectory(checkPath);
Settings checkSettings = getCppcheckSettings(); Settings checkSettings = getCppcheckSettings();
checkSettings.force = false; checkSettings.force = false;
@ -415,7 +415,7 @@ void MainWindow::doCheckFiles(const QStringList &files)
} }
QStringList fileNames = pathList.getFileList(); QStringList fileNames = pathList.getFileList();
mUI.mResults->Clear(true); mUI.mResults->clear(true);
mThread->ClearFiles(); mThread->ClearFiles();
if (fileNames.isEmpty()) { if (fileNames.isEmpty()) {
@ -428,7 +428,7 @@ void MainWindow::doCheckFiles(const QStringList &files)
return; return;
} }
mUI.mResults->CheckingStarted(fileNames.count()); mUI.mResults->checkingStarted(fileNames.count());
mThread->SetFiles(fileNames); mThread->SetFiles(fileNames);
QDir inf(mCurrentDirectory); QDir inf(mCurrentDirectory);
@ -437,7 +437,7 @@ void MainWindow::doCheckFiles(const QStringList &files)
checkLockDownUI(); // lock UI while checking checkLockDownUI(); // lock UI while checking
mUI.mResults->SetCheckDirectory(checkPath); mUI.mResults->setCheckDirectory(checkPath);
Settings checkSettings = getCppcheckSettings(); Settings checkSettings = getCppcheckSettings();
if (mProject) if (mProject)
@ -475,7 +475,7 @@ void MainWindow::checkCode(const QString& code, const QString& filename)
// Check // Check
checkLockDownUI(); checkLockDownUI();
clearResults(); clearResults();
mUI.mResults->CheckingStarted(1); mUI.mResults->checkingStarted(1);
cppcheck.check(filename.toStdString(), code.toStdString()); cppcheck.check(filename.toStdString(), code.toStdString());
checkDone(); checkDone();
} }
@ -833,7 +833,7 @@ void MainWindow::checkDone()
return; return;
} }
mUI.mResults->CheckingFinished(); mUI.mResults->checkingFinished();
enableCheckButtons(true); enableCheckButtons(true);
mUI.mActionSettings->setEnabled(true); mUI.mActionSettings->setEnabled(true);
mUI.mActionOpenXML->setEnabled(true); mUI.mActionOpenXML->setEnabled(true);
@ -852,7 +852,7 @@ void MainWindow::checkDone()
if (mScratchPad) if (mScratchPad)
mScratchPad->setEnabled(true); mScratchPad->setEnabled(true);
if (mUI.mResults->HasResults()) { if (mUI.mResults->hasResults()) {
mUI.mActionClearResults->setEnabled(true); mUI.mActionClearResults->setEnabled(true);
mUI.mActionSave->setEnabled(true); mUI.mActionSave->setEnabled(true);
mUI.mActionPrint->setEnabled(true); mUI.mActionPrint->setEnabled(true);
@ -896,7 +896,7 @@ void MainWindow::programSettings()
SettingsDialog dialog(mApplications, mTranslation, this); SettingsDialog dialog(mApplications, mTranslation, this);
if (dialog.exec() == QDialog::Accepted) { if (dialog.exec() == QDialog::Accepted) {
dialog.SaveSettingValues(); dialog.SaveSettingValues();
mUI.mResults->UpdateSettings(dialog.ShowFullPath(), mUI.mResults->updateSettings(dialog.ShowFullPath(),
dialog.SaveFullPath(), dialog.SaveFullPath(),
dialog.SaveAllErrors(), dialog.SaveAllErrors(),
dialog.ShowNoErrorsMessage(), dialog.ShowNoErrorsMessage(),
@ -925,18 +925,18 @@ void MainWindow::reCheckSelected(QStringList files, bool all)
return; return;
// Clear details, statistics and progress // Clear details, statistics and progress
mUI.mResults->Clear(false); mUI.mResults->clear(false);
for (int i = 0; i < files.size(); ++i) for (int i = 0; i < files.size(); ++i)
mUI.mResults->ClearRecheckFile(files[i]); mUI.mResults->clearRecheckFile(files[i]);
mCurrentDirectory = mUI.mResults->GetCheckDirectory(); mCurrentDirectory = mUI.mResults->getCheckDirectory();
FileList pathList; FileList pathList;
pathList.addPathList(files); pathList.addPathList(files);
if (mProject) if (mProject)
pathList.addExcludeList(mProject->getProjectFile()->getExcludedPaths()); pathList.addExcludeList(mProject->getProjectFile()->getExcludedPaths());
QStringList fileNames = pathList.getFileList(); QStringList fileNames = pathList.getFileList();
checkLockDownUI(); // lock UI while checking checkLockDownUI(); // lock UI while checking
mUI.mResults->CheckingStarted(fileNames.size()); mUI.mResults->checkingStarted(fileNames.size());
mThread->SetCheckFiles(fileNames); mThread->SetCheckFiles(fileNames);
// Saving last check start time, otherwise unchecked modified files will not be // Saving last check start time, otherwise unchecked modified files will not be
@ -954,14 +954,14 @@ void MainWindow::reCheck(bool all)
return; return;
// Clear details, statistics and progress // Clear details, statistics and progress
mUI.mResults->Clear(all); mUI.mResults->clear(all);
// Clear results for changed files // Clear results for changed files
for (int i = 0; i < files.size(); ++i) for (int i = 0; i < files.size(); ++i)
mUI.mResults->Clear(files[i]); mUI.mResults->clear(files[i]);
checkLockDownUI(); // lock UI while checking checkLockDownUI(); // lock UI while checking
mUI.mResults->CheckingStarted(files.size()); mUI.mResults->checkingStarted(files.size());
if (mProject) if (mProject)
qDebug() << "Rechecking project file" << mProject->getProjectFile()->getFilename(); qDebug() << "Rechecking project file" << mProject->getProjectFile()->getFilename();
@ -972,7 +972,7 @@ void MainWindow::reCheck(bool all)
void MainWindow::clearResults() void MainWindow::clearResults()
{ {
mUI.mResults->Clear(true); mUI.mResults->clear(true);
mUI.mActionClearResults->setEnabled(false); mUI.mActionClearResults->setEnabled(false);
mUI.mActionSave->setEnabled(false); mUI.mActionSave->setEnabled(false);
mUI.mActionPrint->setEnabled(false); mUI.mActionPrint->setEnabled(false);
@ -981,7 +981,7 @@ void MainWindow::clearResults()
void MainWindow::openResults() void MainWindow::openResults()
{ {
if (mUI.mResults->HasResults()) { if (mUI.mResults->hasResults()) {
QMessageBox msgBox(this); QMessageBox msgBox(this);
msgBox.setWindowTitle(tr("Cppcheck")); msgBox.setWindowTitle(tr("Cppcheck"));
const QString msg(tr("Current results will be cleared.\n\n" const QString msg(tr("Current results will be cleared.\n\n"
@ -1017,10 +1017,10 @@ void MainWindow::loadResults(const QString selectedFile)
if (mProject) if (mProject)
closeProjectFile(); closeProjectFile();
mIsLogfileLoaded = true; mIsLogfileLoaded = true;
mUI.mResults->Clear(true); mUI.mResults->clear(true);
mUI.mActionRecheckModified->setEnabled(false); mUI.mActionRecheckModified->setEnabled(false);
mUI.mActionRecheckAll->setEnabled(false); mUI.mActionRecheckAll->setEnabled(false);
mUI.mResults->ReadErrorsXml(selectedFile); mUI.mResults->readErrorsXml(selectedFile);
setPath(SETTINGS_LAST_RESULT_PATH, selectedFile); setPath(SETTINGS_LAST_RESULT_PATH, selectedFile);
} }
} }
@ -1028,7 +1028,7 @@ void MainWindow::loadResults(const QString selectedFile)
void MainWindow::loadResults(const QString selectedFile, const QString sourceDirectory) void MainWindow::loadResults(const QString selectedFile, const QString sourceDirectory)
{ {
loadResults(selectedFile); loadResults(selectedFile);
mUI.mResults->SetCheckDirectory(sourceDirectory); mUI.mResults->setCheckDirectory(sourceDirectory);
} }
void MainWindow::enableCheckButtons(bool enable) void MainWindow::enableCheckButtons(bool enable)
@ -1046,32 +1046,32 @@ void MainWindow::enableCheckButtons(bool enable)
void MainWindow::showStyle(bool checked) void MainWindow::showStyle(bool checked)
{ {
mUI.mResults->ShowResults(ShowTypes::ShowStyle, checked); mUI.mResults->showResults(ShowTypes::ShowStyle, checked);
} }
void MainWindow::showErrors(bool checked) void MainWindow::showErrors(bool checked)
{ {
mUI.mResults->ShowResults(ShowTypes::ShowErrors, checked); mUI.mResults->showResults(ShowTypes::ShowErrors, checked);
} }
void MainWindow::showWarnings(bool checked) void MainWindow::showWarnings(bool checked)
{ {
mUI.mResults->ShowResults(ShowTypes::ShowWarnings, checked); mUI.mResults->showResults(ShowTypes::ShowWarnings, checked);
} }
void MainWindow::showPortability(bool checked) void MainWindow::showPortability(bool checked)
{ {
mUI.mResults->ShowResults(ShowTypes::ShowPortability, checked); mUI.mResults->showResults(ShowTypes::ShowPortability, checked);
} }
void MainWindow::showPerformance(bool checked) void MainWindow::showPerformance(bool checked)
{ {
mUI.mResults->ShowResults(ShowTypes::ShowPerformance, checked); mUI.mResults->showResults(ShowTypes::ShowPerformance, checked);
} }
void MainWindow::showInformation(bool checked) void MainWindow::showInformation(bool checked)
{ {
mUI.mResults->ShowResults(ShowTypes::ShowInformation, checked); mUI.mResults->showResults(ShowTypes::ShowInformation, checked);
} }
void MainWindow::checkAll() void MainWindow::checkAll()
@ -1194,7 +1194,7 @@ void MainWindow::save()
type = Report::CSV; type = Report::CSV;
} }
mUI.mResults->Save(selectedFile, type); mUI.mResults->save(selectedFile, type);
setPath(SETTINGS_LAST_RESULT_PATH, selectedFile); setPath(SETTINGS_LAST_RESULT_PATH, selectedFile);
} }
} }
@ -1238,7 +1238,7 @@ void MainWindow::setLanguage(const QString &code)
if (mTranslation->SetLanguage(code)) { if (mTranslation->SetLanguage(code)) {
//Translate everything that is visible here //Translate everything that is visible here
mUI.retranslateUi(this); mUI.retranslateUi(this);
mUI.mResults->Translate(); mUI.mResults->translate();
delete mLogView; delete mLogView;
mLogView = 0; mLogView = 0;
} }
@ -1254,7 +1254,7 @@ void MainWindow::aboutToShowViewMenu()
void MainWindow::stopChecking() void MainWindow::stopChecking()
{ {
mThread->Stop(); mThread->Stop();
mUI.mResults->DisableProgressbar(); mUI.mResults->disableProgressbar();
} }
void MainWindow::openHelpContents() void MainWindow::openHelpContents()
@ -1434,7 +1434,7 @@ void MainWindow::showStatistics()
statsDialog.setPathSelected(mCurrentDirectory); statsDialog.setPathSelected(mCurrentDirectory);
statsDialog.setNumberOfFilesScanned(mThread->GetPreviousFilesCount()); statsDialog.setNumberOfFilesScanned(mThread->GetPreviousFilesCount());
statsDialog.setScanDuration(mThread->GetPreviousScanDuration() / 1000.0); statsDialog.setScanDuration(mThread->GetPreviousScanDuration() / 1000.0);
statsDialog.setStatistics(mUI.mResults->GetStatistics()); statsDialog.setStatistics(mUI.mResults->getStatistics());
statsDialog.exec(); statsDialog.exec();
} }
@ -1461,7 +1461,7 @@ void MainWindow::debugError(const ErrorItem &item)
void MainWindow::filterResults() void MainWindow::filterResults()
{ {
mUI.mResults->FilterResults(mLineEditFilter->text()); mUI.mResults->filterResults(mLineEditFilter->text());
} }
void MainWindow::enableProjectActions(bool enable) void MainWindow::enableProjectActions(bool enable)

View File

@ -53,7 +53,7 @@ ResultsView::ResultsView(QWidget * parent) :
connect(mUI.mTree, SIGNAL(selectionChanged(const QModelIndex &)), this, SLOT(UpdateDetails(const QModelIndex &))); connect(mUI.mTree, SIGNAL(selectionChanged(const QModelIndex &)), this, SLOT(UpdateDetails(const QModelIndex &)));
} }
void ResultsView::Initialize(QSettings *settings, ApplicationList *list, ThreadHandler *checkThreadHandler) void ResultsView::initialize(QSettings *settings, ApplicationList *list, ThreadHandler *checkThreadHandler)
{ {
mUI.mProgress->setMinimum(0); mUI.mProgress->setMinimum(0);
mUI.mProgress->setVisible(false); mUI.mProgress->setVisible(false);
@ -70,7 +70,7 @@ ResultsView::~ResultsView()
//dtor //dtor
} }
void ResultsView::Clear(bool results) void ResultsView::clear(bool results)
{ {
if (results) { if (results) {
mUI.mTree->clear(); mUI.mTree->clear();
@ -86,58 +86,58 @@ void ResultsView::Clear(bool results)
mUI.mProgress->setFormat("%p%"); mUI.mProgress->setFormat("%p%");
} }
void ResultsView::Clear(const QString &filename) void ResultsView::clear(const QString &filename)
{ {
mUI.mTree->clear(filename); mUI.mTree->clear(filename);
} }
void ResultsView::ClearRecheckFile(const QString &filename) void ResultsView::clearRecheckFile(const QString &filename)
{ {
mUI.mTree->clearRecheckFile(filename); mUI.mTree->clearRecheckFile(filename);
} }
void ResultsView::Progress(int value, const QString& description) void ResultsView::progress(int value, const QString& description)
{ {
mUI.mProgress->setValue(value); mUI.mProgress->setValue(value);
mUI.mProgress->setFormat(QString("%p% (%1)").arg(description)); mUI.mProgress->setFormat(QString("%p% (%1)").arg(description));
} }
void ResultsView::Error(const ErrorItem &item) void ResultsView::error(const ErrorItem &item)
{ {
if (mUI.mTree->addErrorItem(item)) { if (mUI.mTree->addErrorItem(item)) {
emit GotResults(); emit gotResults();
mStatistics->addItem(ShowTypes::SeverityToShowType(item.severity)); mStatistics->addItem(ShowTypes::SeverityToShowType(item.severity));
} }
} }
void ResultsView::ShowResults(ShowTypes::ShowType type, bool show) void ResultsView::showResults(ShowTypes::ShowType type, bool show)
{ {
mUI.mTree->showResults(type, show); mUI.mTree->showResults(type, show);
} }
void ResultsView::CollapseAllResults() void ResultsView::collapseAllResults()
{ {
mUI.mTree->collapseAll(); mUI.mTree->collapseAll();
} }
void ResultsView::ExpandAllResults() void ResultsView::expandAllResults()
{ {
mUI.mTree->expandAll(); mUI.mTree->expandAll();
} }
void ResultsView::ShowHiddenResults() void ResultsView::showHiddenResults()
{ {
mUI.mTree->showHiddenResults(); mUI.mTree->showHiddenResults();
} }
void ResultsView::FilterResults(const QString& filter) void ResultsView::filterResults(const QString& filter)
{ {
mUI.mTree->filterResults(filter); mUI.mTree->filterResults(filter);
} }
void ResultsView::Save(const QString &filename, Report::Type type) const void ResultsView::save(const QString &filename, Report::Type type) const
{ {
if (!HasResults()) { if (!hasResults()) {
QMessageBox msgBox; QMessageBox msgBox;
msgBox.setText(tr("No errors found, nothing to save.")); msgBox.setText(tr("No errors found, nothing to save."));
msgBox.setIcon(QMessageBox::Critical); msgBox.setIcon(QMessageBox::Critical);
@ -180,7 +180,7 @@ void ResultsView::Save(const QString &filename, Report::Type type) const
} }
} }
void ResultsView::Print() void ResultsView::print()
{ {
QPrinter printer; QPrinter printer;
QPrintDialog dialog(&printer, this); QPrintDialog dialog(&printer, this);
@ -188,10 +188,10 @@ void ResultsView::Print()
if (dialog.exec() != QDialog::Accepted) if (dialog.exec() != QDialog::Accepted)
return; return;
Print(&printer); print(&printer);
} }
void ResultsView::PrintPreview() void ResultsView::printPreview()
{ {
QPrinter printer; QPrinter printer;
QPrintPreviewDialog dialog(&printer, this); QPrintPreviewDialog dialog(&printer, this);
@ -199,9 +199,9 @@ void ResultsView::PrintPreview()
dialog.exec(); dialog.exec();
} }
void ResultsView::Print(QPrinter* printer) void ResultsView::print(QPrinter* printer)
{ {
if (!HasResults()) { if (!hasResults()) {
QMessageBox msgBox; QMessageBox msgBox;
msgBox.setText(tr("No errors found, nothing to print.")); msgBox.setText(tr("No errors found, nothing to print."));
msgBox.setIcon(QMessageBox::Critical); msgBox.setIcon(QMessageBox::Critical);
@ -215,7 +215,7 @@ void ResultsView::Print(QPrinter* printer)
doc.print(printer); doc.print(printer);
} }
void ResultsView::UpdateSettings(bool showFullPath, void ResultsView::updateSettings(bool showFullPath,
bool saveFullPath, bool saveFullPath,
bool saveAllErrors, bool saveAllErrors,
bool showNoErrorsMessage, bool showNoErrorsMessage,
@ -226,17 +226,17 @@ void ResultsView::UpdateSettings(bool showFullPath,
mShowNoErrorsMessage = showNoErrorsMessage; mShowNoErrorsMessage = showNoErrorsMessage;
} }
void ResultsView::SetCheckDirectory(const QString &dir) void ResultsView::setCheckDirectory(const QString &dir)
{ {
mUI.mTree->setCheckDirectory(dir); mUI.mTree->setCheckDirectory(dir);
} }
QString ResultsView::GetCheckDirectory(void) QString ResultsView::getCheckDirectory(void)
{ {
return mUI.mTree->getCheckDirectory(); return mUI.mTree->getCheckDirectory();
} }
void ResultsView::CheckingStarted(int count) void ResultsView::checkingStarted(int count)
{ {
mUI.mProgress->setVisible(true); mUI.mProgress->setVisible(true);
mUI.mProgress->setMaximum(PROGRESS_MAX); mUI.mProgress->setMaximum(PROGRESS_MAX);
@ -244,7 +244,7 @@ void ResultsView::CheckingStarted(int count)
mUI.mProgress->setFormat(tr("%p% (%1 of %2 files checked)").arg(0).arg(count)); mUI.mProgress->setFormat(tr("%p% (%1 of %2 files checked)").arg(0).arg(count));
} }
void ResultsView::CheckingFinished() void ResultsView::checkingFinished()
{ {
mUI.mProgress->setVisible(false); mUI.mProgress->setVisible(false);
mUI.mProgress->setFormat("%p%"); mUI.mProgress->setFormat("%p%");
@ -252,7 +252,7 @@ void ResultsView::CheckingFinished()
//Should we inform user of non visible/not found errors? //Should we inform user of non visible/not found errors?
if (mShowNoErrorsMessage) { if (mShowNoErrorsMessage) {
//Tell user that we found no errors //Tell user that we found no errors
if (!HasResults()) { if (!hasResults()) {
QMessageBox msg(QMessageBox::Information, QMessageBox msg(QMessageBox::Information,
tr("Cppcheck"), tr("Cppcheck"),
tr("No errors found."), tr("No errors found."),
@ -275,17 +275,17 @@ void ResultsView::CheckingFinished()
} }
} }
bool ResultsView::HasVisibleResults() const bool ResultsView::hasVisibleResults() const
{ {
return mUI.mTree->hasVisibleResults(); return mUI.mTree->hasVisibleResults();
} }
bool ResultsView::HasResults() const bool ResultsView::hasResults() const
{ {
return mUI.mTree->hasResults(); return mUI.mTree->hasResults();
} }
void ResultsView::SaveSettings(QSettings *settings) void ResultsView::saveSettings(QSettings *settings)
{ {
mUI.mTree->saveSettings(); mUI.mTree->saveSettings();
QByteArray state = mUI.mVerticalSplitter->saveState(); QByteArray state = mUI.mVerticalSplitter->saveState();
@ -293,17 +293,17 @@ void ResultsView::SaveSettings(QSettings *settings)
mUI.mVerticalSplitter->restoreState(state); mUI.mVerticalSplitter->restoreState(state);
} }
void ResultsView::Translate() void ResultsView::translate()
{ {
mUI.mTree->translate(); mUI.mTree->translate();
} }
void ResultsView::DisableProgressbar() void ResultsView::disableProgressbar()
{ {
mUI.mProgress->setEnabled(false); mUI.mProgress->setEnabled(false);
} }
void ResultsView::ReadErrorsXml(const QString &filename) void ResultsView::readErrorsXml(const QString &filename)
{ {
const int version = XmlReport::determineVersion(filename); const int version = XmlReport::determineVersion(filename);
if (version == 0) { if (version == 0) {
@ -346,7 +346,7 @@ void ResultsView::ReadErrorsXml(const QString &filename)
mUI.mTree->setCheckDirectory(""); mUI.mTree->setCheckDirectory("");
} }
void ResultsView::UpdateDetails(const QModelIndex &index) void ResultsView::updateDetails(const QModelIndex &index)
{ {
QStandardItemModel *model = qobject_cast<QStandardItemModel*>(mUI.mTree->model()); QStandardItemModel *model = qobject_cast<QStandardItemModel*>(mUI.mTree->model());
QStandardItem *item = model->itemFromIndex(index); QStandardItem *item = model->itemFromIndex(index);

View File

@ -45,7 +45,7 @@ class ResultsView : public QWidget {
public: public:
explicit ResultsView(QWidget * parent = 0); explicit ResultsView(QWidget * parent = 0);
void Initialize(QSettings *settings, ApplicationList *list, ThreadHandler *checkThreadHandler); void initialize(QSettings *settings, ApplicationList *list, ThreadHandler *checkThreadHandler);
virtual ~ResultsView(); virtual ~ResultsView();
/** /**
@ -55,23 +55,23 @@ public:
* @param type Type of error to show/hide * @param type Type of error to show/hide
* @param show Should specified errors be shown (true) or hidden (false) * @param show Should specified errors be shown (true) or hidden (false)
*/ */
void ShowResults(ShowTypes::ShowType type, bool show); void showResults(ShowTypes::ShowType type, bool show);
/** /**
* @brief Clear results and statistics and reset progressinfo. * @brief Clear results and statistics and reset progressinfo.
* @param results Remove all the results from view? * @param results Remove all the results from view?
*/ */
void Clear(bool results); void clear(bool results);
/** /**
* @brief Remove a file from the results. * @brief Remove a file from the results.
*/ */
void Clear(const QString &filename); void clear(const QString &filename);
/** /**
* @brief Remove a recheck file from the results. * @brief Remove a recheck file from the results.
*/ */
void ClearRecheckFile(const QString &filename); void clearRecheckFile(const QString &filename);
/** /**
* @brief Save results to a file * @brief Save results to a file
@ -79,7 +79,7 @@ public:
* @param filename Filename to save results to * @param filename Filename to save results to
* @param type Type of the report. * @param type Type of the report.
*/ */
void Save(const QString &filename, Report::Type type) const; void save(const QString &filename, Report::Type type) const;
/** /**
* @brief Update tree settings * @brief Update tree settings
@ -91,7 +91,7 @@ public:
* @param showErrorId Show error id? * @param showErrorId Show error id?
* @param showInconclusive Show inconclusive? * @param showInconclusive Show inconclusive?
*/ */
void UpdateSettings(bool showFullPath, void updateSettings(bool showFullPath,
bool saveFullPath, bool saveFullPath,
bool saveAllErrors, bool saveAllErrors,
bool showNoErrorsMessage, bool showNoErrorsMessage,
@ -104,7 +104,7 @@ public:
* This is used to split error file path to relative if necessary * This is used to split error file path to relative if necessary
* @param dir Directory we are checking * @param dir Directory we are checking
*/ */
void SetCheckDirectory(const QString &dir); void setCheckDirectory(const QString &dir);
/** /**
* @brief Get the directory we are checking * @brief Get the directory we are checking
@ -112,62 +112,62 @@ public:
* @return Directory containing source files * @return Directory containing source files
*/ */
QString GetCheckDirectory(void); QString getCheckDirectory(void);
/** /**
* @brief Inform the view that checking has started * @brief Inform the view that checking has started
* *
* @param count Count of files to be checked. * @param count Count of files to be checked.
*/ */
void CheckingStarted(int count); void checkingStarted(int count);
/** /**
* @brief Inform the view that checking finished. * @brief Inform the view that checking finished.
* *
*/ */
void CheckingFinished(); void checkingFinished();
/** /**
* @brief Do we have visible results to show? * @brief Do we have visible results to show?
* *
* @return true if there is at least one warning/error to show. * @return true if there is at least one warning/error to show.
*/ */
bool HasVisibleResults() const; bool hasVisibleResults() const;
/** /**
* @brief Do we have results from check? * @brief Do we have results from check?
* *
* @return true if there is at least one warning/error, hidden or visible. * @return true if there is at least one warning/error, hidden or visible.
*/ */
bool HasResults() const; bool hasResults() const;
/** /**
* @brief Save View's settings * @brief Save View's settings
* *
* @param settings program settings. * @param settings program settings.
*/ */
void SaveSettings(QSettings *settings); void saveSettings(QSettings *settings);
/** /**
* @brief Translate this view * @brief Translate this view
* *
*/ */
void Translate(); void translate();
void DisableProgressbar(); void disableProgressbar();
/** /**
* @brief Read errors from report XML file. * @brief Read errors from report XML file.
* @param filename Report file to read. * @param filename Report file to read.
* *
*/ */
void ReadErrorsXml(const QString &filename); void readErrorsXml(const QString &filename);
/** /**
* @brief Return checking statistics. * @brief Return checking statistics.
* @return Pointer to checking statistics. * @return Pointer to checking statistics.
*/ */
CheckStatistics *GetStatistics() const { CheckStatistics *getStatistics() const {
return mStatistics; return mStatistics;
} }
@ -175,7 +175,7 @@ public:
* @brief Return Showtypes. * @brief Return Showtypes.
* @return Pointer to Showtypes. * @return Pointer to Showtypes.
*/ */
ShowTypes * GetShowTypes() const { ShowTypes * getShowTypes() const {
return &mUI.mTree->mShowSeverities; return &mUI.mTree->mShowSeverities;
} }
@ -185,21 +185,21 @@ signals:
* @brief Signal to be emitted when we have results * @brief Signal to be emitted when we have results
* *
*/ */
void GotResults(); void gotResults();
/** /**
* @brief Signal that results have been hidden or shown * @brief Signal that results have been hidden or shown
* *
* @param hidden true if there are some hidden results, or false if there are not * @param hidden true if there are some hidden results, or false if there are not
*/ */
void ResultsHidden(bool hidden); void resultsHidden(bool hidden);
/** /**
* @brief Signal to perform recheck of selected files * @brief Signal to perform recheck of selected files
* *
* @param selectedFilesList list of selected files * @param selectedFilesList list of selected files
*/ */
void CheckSelected(QStringList selectedFilesList); void checkSelected(QStringList selectedFilesList);
public slots: public slots:
@ -209,57 +209,57 @@ public slots:
* @param value Current progress value * @param value Current progress value
* @param description Description to accompany the progress * @param description Description to accompany the progress
*/ */
void Progress(int value, const QString& description); void progress(int value, const QString& description);
/** /**
* @brief Slot for new error to be displayed * @brief Slot for new error to be displayed
* *
* @param item Error data * @param item Error data
*/ */
void Error(const ErrorItem &item); void error(const ErrorItem &item);
/** /**
* @brief Collapse all results in the result list. * @brief Collapse all results in the result list.
*/ */
void CollapseAllResults(); void collapseAllResults();
/** /**
* @brief Expand all results in the result list. * @brief Expand all results in the result list.
*/ */
void ExpandAllResults(); void expandAllResults();
/** /**
* @brief Filters the results in the result list. * @brief Filters the results in the result list.
*/ */
void FilterResults(const QString& filter); void filterResults(const QString& filter);
/** /**
* @brief Show hidden results in the result list. * @brief Show hidden results in the result list.
*/ */
void ShowHiddenResults(); void showHiddenResults();
/** /**
* @brief Update detailed message when selected item is changed. * @brief Update detailed message when selected item is changed.
* *
* @param index Position of new selected item. * @param index Position of new selected item.
*/ */
void UpdateDetails(const QModelIndex &index); void updateDetails(const QModelIndex &index);
/** /**
* @brief Slot opening a print dialog to print the current report * @brief Slot opening a print dialog to print the current report
*/ */
void Print(); void print();
/** /**
* @brief Slot printing the current report to the printer. * @brief Slot printing the current report to the printer.
* @param printer The printer used for printing the report. * @param printer The printer used for printing the report.
*/ */
void Print(QPrinter* printer); void print(QPrinter* printer);
/** /**
* @brief Slot opening a print preview dialog * @brief Slot opening a print preview dialog
*/ */
void PrintPreview(); void printPreview();
protected: protected:
/** /**
@ -270,8 +270,6 @@ protected:
Ui::ResultsView mUI; Ui::ResultsView mUI;
CheckStatistics *mStatistics; CheckStatistics *mStatistics;
private:
}; };
/// @} /// @}
#endif // RESULTSVIEW_H #endif // RESULTSVIEW_H