20 #ifndef THREADHANDLER_H
21 #define THREADHANDLER_H
29 #include <QElapsedTimer>
33 #include <QStringList>
104 void setFiles(
const QStringList &files);
190 void log(
const QString &msg);
270 bool needsReCheck(
const QString &filename, std::set<QString> &modified, std::set<QString> &unmodified)
const;
A class containing error data for one error.
Importing project settings.
Widget to show cppcheck progressbar and result.
This is just a container for general settings so that we don't need to pass individual values to func...
This class handles creating threadresult and starting threads.
bool hasPreviousFiles() const
Have we checked files already?
void done()
Signal that all threads are done.
void check(const Settings &settings)
Start the threads to check the files.
QStringList mClangIncludePaths
bool needsReCheck(const QString &filename, std::set< QString > &modified, std::set< QString > &unmodified) const
Check if a file needs to be rechecked.
int mScanDuration
The previous scan duration in milliseconds.
QStringList mLastFiles
List of files checked last time (used when rechecking)
void removeThreads()
Function to delete all threads.
bool mAnalyseWholeProgram
void threadDone()
Slot that a single thread is done.
QDateTime getCheckStartTime() const
Get start time of last check.
QList< SuppressionList::Suppression > mSuppressions
QStringList mAddonsAndTools
void saveSettings(QSettings &settings) const
Save settings.
QDateTime mCheckStartTime
date and time when current checking started
ThreadResult mResults
Thread results are stored here.
void setThreadCount(const int count)
Set the number of threads to use.
ThreadHandler(QObject *parent=nullptr)
void setAddonsAndTools(const QStringList &addonsAndTools)
QDateTime mLastCheckTime
when was the files checked the last time (used when rechecking)
QStringList getReCheckFiles(bool all) const
Get files that should be rechecked because they have been changed.
~ThreadHandler() override
void stop()
Slot to stop all threads.
void setClangIncludePaths(const QStringList &s)
void debugError(const ErrorItem &item)
int mRunningThreadCount
The amount of threads currently running.
bool isChecking() const
Is checking running?
void log(const QString &msg)
QElapsedTimer mTimer
Timer used for measuring scan duration.
void setProject(const ImportProject &prj)
Set project to check.
int getPreviousFilesCount() const
Return count of files we checked last time.
void setCheckStartTime(QDateTime checkStartTime)
Set start time of check.
void clearFiles()
Clear all files from cppcheck.
int getPreviousScanDuration() const
Return the time elapsed while scanning the previous time.
void setCheckFiles(bool all)
Set files to check.
void initialize(const ResultsView *view)
Initialize the threads (connect all signals to resultsview's slots)
void setFiles(const QStringList &files)
Set files to check.
QList< CheckThread * > mThreads
List of threads currently in use.
void setSuppressions(const QList< SuppressionList::Suppression > &s)
void loadSettings(const QSettings &settings)
Load settings.
Threads use this class to obtain new files to process and to publish results.