Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 0 additions & 24 deletions gui/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1863,30 +1863,6 @@ void MainWindow::analyzeProject(const ProjectFile *projectFile, const QStringLis
QFileInfo inf(projectFile->getFilename());
const QString& rootpath = projectFile->getRootPath();

if (isCppcheckPremium() && !projectFile->getLicenseFile().isEmpty()) {
if (rootpath.isEmpty() || rootpath == ".")
QDir::setCurrent(inf.absolutePath());
else if (QDir(rootpath).isAbsolute())
QDir::setCurrent(rootpath);
else
QDir::setCurrent(inf.absolutePath() + "/" + rootpath);

QString licenseFile = projectFile->getLicenseFile();
if (!QFileInfo(licenseFile).isAbsolute() && !rootpath.isEmpty())
licenseFile = inf.absolutePath() + "/" + licenseFile;

#ifdef Q_OS_WIN
const QString premiumaddon = QCoreApplication::applicationDirPath() + "/premiumaddon.exe";
#else
const QString premiumaddon = QCoreApplication::applicationDirPath() + "/premiumaddon";
#endif
const std::vector<std::string> args{"--check-loc-license", licenseFile.toStdString()};
std::string output;
CheckThread::executeCommand(premiumaddon.toStdString(), args, "", output);
std::ofstream fout(inf.absolutePath().toStdString() + "/cppcheck-premium-loc");
fout << output;
}

QDir::setCurrent(inf.absolutePath());

mThread->setAddonsAndTools(projectFile->getAddonsAndTools());
Expand Down
9 changes: 0 additions & 9 deletions gui/projectfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ void ProjectFile::clear()
mBughunting = false;
mCertIntPrecision = 0;
mCodingStandards.clear();
mPremiumLicenseFile.clear();
}

bool ProjectFile::read(const QString &filename)
Expand Down Expand Up @@ -233,8 +232,6 @@ bool ProjectFile::read(const QString &filename)
readStringList(mCodingStandards, xmlReader, CppcheckXml::CodingStandardElementName);
if (xmlReader.name() == QString(CppcheckXml::CertIntPrecisionElementName))
mCertIntPrecision = readInt(xmlReader, 0);
if (xmlReader.name() == QString(CppcheckXml::LicenseFileElementName))
mPremiumLicenseFile = readString(xmlReader);
if (xmlReader.name() == QString(CppcheckXml::ProjectNameElementName))
mProjectName = readString(xmlReader);

Expand Down Expand Up @@ -1053,12 +1050,6 @@ bool ProjectFile::write(const QString &filename)
xmlWriter.writeEndElement();
}

if (!mPremiumLicenseFile.isEmpty()) {
xmlWriter.writeStartElement(CppcheckXml::LicenseFileElementName);
xmlWriter.writeCharacters(mPremiumLicenseFile);
xmlWriter.writeEndElement();
}

xmlWriter.writeEndDocument();
file.close();
return true;
Expand Down
11 changes: 0 additions & 11 deletions gui/projectfile.h
Original file line number Diff line number Diff line change
Expand Up @@ -404,14 +404,6 @@ class ProjectFile : public QObject {
return mCertIntPrecision;
}

/** Cppcheck Premium: License file */
void setLicenseFile(const QString& licenseFile) {
mPremiumLicenseFile = licenseFile;
}
const QString& getLicenseFile() const {
return mPremiumLicenseFile;
}

/**
* @brief Write project file (to disk).
* @param filename Filename to use.
Expand Down Expand Up @@ -653,9 +645,6 @@ class ProjectFile : public QObject {
*/
QStringList mCodingStandards;

/** @brief Cppcheck Premium: license file */
QString mPremiumLicenseFile;

/** @brief Project name, used when generating compliance report */
QString mProjectName;

Expand Down
19 changes: 0 additions & 19 deletions gui/projectfile.ui
Original file line number Diff line number Diff line change
Expand Up @@ -629,25 +629,6 @@
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="premiumLicense">
<property name="title">
<string>Premium License</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_12">
<item>
<widget class="QLineEdit" name="mEditLicenseFile"/>
</item>
<item>
<widget class="QPushButton" name="mBtnBrowseLicense">
<property name="text">
<string>Browse...</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="mTabWarningOptions">
Expand Down
4 changes: 0 additions & 4 deletions gui/projectfiledialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,6 @@ ProjectFileDialog::ProjectFileDialog(ProjectFile *projectFile, bool premium, QWi
setWindowTitle(title);
loadSettings();

mUI->premiumLicense->setVisible(false);

QStringList libs;
// Search the std.cfg first since other libraries could depend on it
QString stdLibraryFilename;
Expand Down Expand Up @@ -464,7 +462,6 @@ void ProjectFileDialog::loadFromProjectFile(const ProjectFile *projectFile)
mUI->mToolClangTidy->setEnabled(false);
}
mUI->mEditTags->setText(projectFile->getTags().join(';'));
mUI->mEditLicenseFile->setText(projectFile->getLicenseFile());
updatePathsAndDefines();
}

Expand Down Expand Up @@ -552,7 +549,6 @@ void ProjectFileDialog::saveToProjectFile(ProjectFile *projectFile) const
projectFile->setBughunting(mUI->mBughunting->isChecked());
projectFile->setClangAnalyzer(mUI->mToolClangAnalyzer->isChecked());
projectFile->setClangTidy(mUI->mToolClangTidy->isChecked());
projectFile->setLicenseFile(mUI->mEditLicenseFile->text());
projectFile->setTags(mUI->mEditTags->text().split(";", Qt::SkipEmptyParts));
}

Expand Down
1 change: 0 additions & 1 deletion lib/importproject.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ namespace CppcheckXml {
static constexpr char CodingStandardsElementName[] = "coding-standards";
static constexpr char CodingStandardElementName[] = "coding-standard";
static constexpr char CertIntPrecisionElementName[] = "cert-c-int-precision";
static constexpr char LicenseFileElementName[] = "license-file";
static constexpr char ProjectNameElementName[] = "project-name";
}

Expand Down
Loading