GUI: Refactoring, split out getAddonPath()
This commit is contained in:
parent
14efd2fdf5
commit
1be04346b3
|
@ -72,15 +72,7 @@ void CheckThread::run()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString addonPath;
|
QString addonPath = getAddonPath();
|
||||||
if (QFileInfo(mDataDir + "/threadsafety.py").exists())
|
|
||||||
addonPath = mDataDir;
|
|
||||||
else if (QDir(mDataDir + "/addons").exists())
|
|
||||||
addonPath = mDataDir + "/addons";
|
|
||||||
else if (mDataDir.endsWith("/cfg")) {
|
|
||||||
if (QDir(mDataDir.mid(0,mDataDir.size()-3) + "addons").exists())
|
|
||||||
addonPath = mDataDir.mid(0,mDataDir.size()-3) + "addons";
|
|
||||||
}
|
|
||||||
|
|
||||||
bool needDump = mAddons.contains("y2038") || mAddons.contains("threadsafety") || mAddons.contains("cert") || mAddons.contains("misra");
|
bool needDump = mAddons.contains("y2038") || mAddons.contains("threadsafety") || mAddons.contains("cert") || mAddons.contains("misra");
|
||||||
QString file = mResult.getNextFile();
|
QString file = mResult.getNextFile();
|
||||||
|
@ -182,6 +174,18 @@ void CheckThread::stop()
|
||||||
mCppcheck.terminate();
|
mCppcheck.terminate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString CheckThread::getAddonPath() const {
|
||||||
|
if (QFileInfo(mDataDir + "/threadsafety.py").exists())
|
||||||
|
return mDataDir;
|
||||||
|
else if (QDir(mDataDir + "/addons").exists())
|
||||||
|
return mDataDir + "/addons";
|
||||||
|
else if (mDataDir.endsWith("/cfg")) {
|
||||||
|
if (QDir(mDataDir.mid(0,mDataDir.size()-3) + "addons").exists())
|
||||||
|
return mDataDir.mid(0,mDataDir.size()-3) + "addons";
|
||||||
|
}
|
||||||
|
return QString();
|
||||||
|
}
|
||||||
|
|
||||||
void CheckThread::parseAddonErrors(QString err, QString tool)
|
void CheckThread::parseAddonErrors(QString err, QString tool)
|
||||||
{
|
{
|
||||||
QTextStream in(&err, QIODevice::ReadOnly);
|
QTextStream in(&err, QIODevice::ReadOnly);
|
||||||
|
|
|
@ -106,6 +106,8 @@ protected:
|
||||||
CppCheck mCppcheck;
|
CppCheck mCppcheck;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
QString getAddonPath() const;
|
||||||
|
|
||||||
void parseAddonErrors(QString err, QString tool);
|
void parseAddonErrors(QString err, QString tool);
|
||||||
void parseClangErrors(QString err);
|
void parseClangErrors(QString err);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue