MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / setProject

Method setProject

gui/statsdialog.cpp:93–134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91}
92
93void StatsDialog::setProject(const ProjectFile* projectFile)
94{
95 if (projectFile) {
96 mUI->mProject->setText(projectFile->getRootPath());
97 mUI->mPaths->setText(projectFile->getCheckPaths().join(";"));
98 mUI->mIncludePaths->setText(projectFile->getIncludeDirs().join(";"));
99 mUI->mDefines->setText(projectFile->getDefines().join(";"));
100 mUI->mUndefines->setText(projectFile->getUndefines().join(";"));
101#ifndef QT_CHARTS_LIB
102 mUI->mTabHistory->setVisible(false);
103#else
104 QString statsFile;
105 if (!projectFile->getBuildDir().isEmpty()) {
106 const QString prjpath = QFileInfo(projectFile->getFilename()).absolutePath();
107 const QString buildDir = prjpath + '/' + projectFile->getBuildDir();
108 if (QDir(buildDir).exists()) {
109 statsFile = buildDir + "/statistics.txt";
110 }
111 }
112 mUI->mLblHistoryFile->setText(tr("File: ") + (statsFile.isEmpty() ? tr("No cppcheck build dir") : statsFile));
113 if (!statsFile.isEmpty()) {
114 QChartView *chartView = createChart(statsFile, "cppcheck");
115 mUI->mTabHistory->layout()->addWidget(chartView);
116 // cppcheck-suppress knownConditionTrueFalse - TODO in getClangAnalyzer()
117 if (projectFile->getClangAnalyzer()) {
118 chartView = createChart(statsFile, CLANG_ANALYZER);
119 mUI->mTabHistory->layout()->addWidget(chartView);
120 }
121 if (projectFile->getClangTidy()) {
122 chartView = createChart(statsFile, CLANG_TIDY);
123 mUI->mTabHistory->layout()->addWidget(chartView);
124 }
125 }
126#endif
127 } else {
128 mUI->mProject->setText(QString());
129 mUI->mPaths->setText(QString());
130 mUI->mIncludePaths->setText(QString());
131 mUI->mDefines->setText(QString());
132 mUI->mUndefines->setText(QString());
133 }
134}
135
136void StatsDialog::setPathSelected(const QString& path)
137{

Callers 2

doAnalyzeProjectMethod · 0.45
showStatisticsMethod · 0.45

Calls 13

createChartFunction · 0.85
getRootPathMethod · 0.80
getIncludeDirsMethod · 0.80
getDefinesMethod · 0.80
getUndefinesMethod · 0.80
isEmptyMethod · 0.80
getBuildDirMethod · 0.80
getClangAnalyzerMethod · 0.80
getClangTidyMethod · 0.80
QStringClass · 0.70
joinMethod · 0.45
getCheckPathsMethod · 0.45

Tested by

no test coverage detected