Skip to content

Commit 175b20e

Browse files
committed
Fix #14737 (GUI: Remove handling of Cppcheck Premium LOC license)
1 parent 0045a09 commit 175b20e

6 files changed

Lines changed: 0 additions & 68 deletions

File tree

gui/mainwindow.cpp

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1863,30 +1863,6 @@ void MainWindow::analyzeProject(const ProjectFile *projectFile, const QStringLis
18631863
QFileInfo inf(projectFile->getFilename());
18641864
const QString& rootpath = projectFile->getRootPath();
18651865

1866-
if (isCppcheckPremium() && !projectFile->getLicenseFile().isEmpty()) {
1867-
if (rootpath.isEmpty() || rootpath == ".")
1868-
QDir::setCurrent(inf.absolutePath());
1869-
else if (QDir(rootpath).isAbsolute())
1870-
QDir::setCurrent(rootpath);
1871-
else
1872-
QDir::setCurrent(inf.absolutePath() + "/" + rootpath);
1873-
1874-
QString licenseFile = projectFile->getLicenseFile();
1875-
if (!QFileInfo(licenseFile).isAbsolute() && !rootpath.isEmpty())
1876-
licenseFile = inf.absolutePath() + "/" + licenseFile;
1877-
1878-
#ifdef Q_OS_WIN
1879-
const QString premiumaddon = QCoreApplication::applicationDirPath() + "/premiumaddon.exe";
1880-
#else
1881-
const QString premiumaddon = QCoreApplication::applicationDirPath() + "/premiumaddon";
1882-
#endif
1883-
const std::vector<std::string> args{"--check-loc-license", licenseFile.toStdString()};
1884-
std::string output;
1885-
CheckThread::executeCommand(premiumaddon.toStdString(), args, "", output);
1886-
std::ofstream fout(inf.absolutePath().toStdString() + "/cppcheck-premium-loc");
1887-
fout << output;
1888-
}
1889-
18901866
QDir::setCurrent(inf.absolutePath());
18911867

18921868
mThread->setAddonsAndTools(projectFile->getAddonsAndTools());

gui/projectfile.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ void ProjectFile::clear()
8888
mBughunting = false;
8989
mCertIntPrecision = 0;
9090
mCodingStandards.clear();
91-
mPremiumLicenseFile.clear();
9291
}
9392

9493
bool ProjectFile::read(const QString &filename)
@@ -233,8 +232,6 @@ bool ProjectFile::read(const QString &filename)
233232
readStringList(mCodingStandards, xmlReader, CppcheckXml::CodingStandardElementName);
234233
if (xmlReader.name() == QString(CppcheckXml::CertIntPrecisionElementName))
235234
mCertIntPrecision = readInt(xmlReader, 0);
236-
if (xmlReader.name() == QString(CppcheckXml::LicenseFileElementName))
237-
mPremiumLicenseFile = readString(xmlReader);
238235
if (xmlReader.name() == QString(CppcheckXml::ProjectNameElementName))
239236
mProjectName = readString(xmlReader);
240237

@@ -1053,12 +1050,6 @@ bool ProjectFile::write(const QString &filename)
10531050
xmlWriter.writeEndElement();
10541051
}
10551052

1056-
if (!mPremiumLicenseFile.isEmpty()) {
1057-
xmlWriter.writeStartElement(CppcheckXml::LicenseFileElementName);
1058-
xmlWriter.writeCharacters(mPremiumLicenseFile);
1059-
xmlWriter.writeEndElement();
1060-
}
1061-
10621053
xmlWriter.writeEndDocument();
10631054
file.close();
10641055
return true;

gui/projectfile.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -404,14 +404,6 @@ class ProjectFile : public QObject {
404404
return mCertIntPrecision;
405405
}
406406

407-
/** Cppcheck Premium: License file */
408-
void setLicenseFile(const QString& licenseFile) {
409-
mPremiumLicenseFile = licenseFile;
410-
}
411-
const QString& getLicenseFile() const {
412-
return mPremiumLicenseFile;
413-
}
414-
415407
/**
416408
* @brief Write project file (to disk).
417409
* @param filename Filename to use.
@@ -653,9 +645,6 @@ class ProjectFile : public QObject {
653645
*/
654646
QStringList mCodingStandards;
655647

656-
/** @brief Cppcheck Premium: license file */
657-
QString mPremiumLicenseFile;
658-
659648
/** @brief Project name, used when generating compliance report */
660649
QString mProjectName;
661650

gui/projectfile.ui

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -629,25 +629,6 @@
629629
</layout>
630630
</widget>
631631
</item>
632-
<item>
633-
<widget class="QGroupBox" name="premiumLicense">
634-
<property name="title">
635-
<string>Premium License</string>
636-
</property>
637-
<layout class="QHBoxLayout" name="horizontalLayout_12">
638-
<item>
639-
<widget class="QLineEdit" name="mEditLicenseFile"/>
640-
</item>
641-
<item>
642-
<widget class="QPushButton" name="mBtnBrowseLicense">
643-
<property name="text">
644-
<string>Browse...</string>
645-
</property>
646-
</widget>
647-
</item>
648-
</layout>
649-
</widget>
650-
</item>
651632
</layout>
652633
</widget>
653634
<widget class="QWidget" name="mTabWarningOptions">

gui/projectfiledialog.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,6 @@ ProjectFileDialog::ProjectFileDialog(ProjectFile *projectFile, bool premium, QWi
139139
setWindowTitle(title);
140140
loadSettings();
141141

142-
mUI->premiumLicense->setVisible(false);
143-
144142
QStringList libs;
145143
// Search the std.cfg first since other libraries could depend on it
146144
QString stdLibraryFilename;
@@ -464,7 +462,6 @@ void ProjectFileDialog::loadFromProjectFile(const ProjectFile *projectFile)
464462
mUI->mToolClangTidy->setEnabled(false);
465463
}
466464
mUI->mEditTags->setText(projectFile->getTags().join(';'));
467-
mUI->mEditLicenseFile->setText(projectFile->getLicenseFile());
468465
updatePathsAndDefines();
469466
}
470467

@@ -552,7 +549,6 @@ void ProjectFileDialog::saveToProjectFile(ProjectFile *projectFile) const
552549
projectFile->setBughunting(mUI->mBughunting->isChecked());
553550
projectFile->setClangAnalyzer(mUI->mToolClangAnalyzer->isChecked());
554551
projectFile->setClangTidy(mUI->mToolClangTidy->isChecked());
555-
projectFile->setLicenseFile(mUI->mEditLicenseFile->text());
556552
projectFile->setTags(mUI->mEditTags->text().split(";", Qt::SkipEmptyParts));
557553
}
558554

lib/importproject.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,6 @@ namespace CppcheckXml {
198198
static constexpr char CodingStandardsElementName[] = "coding-standards";
199199
static constexpr char CodingStandardElementName[] = "coding-standard";
200200
static constexpr char CertIntPrecisionElementName[] = "cert-c-int-precision";
201-
static constexpr char LicenseFileElementName[] = "license-file";
202201
static constexpr char ProjectNameElementName[] = "project-name";
203202
}
204203

0 commit comments

Comments
 (0)