cleaned up includes based on include-what-you-use (#4007)

* cleaned up includes based on include-what-you-use

* updated translations
This commit is contained in:
Oliver Stöneberg 2022-04-13 12:24:00 +02:00 committed by GitHub
parent 5ac4afa5b8
commit 45158ec064
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
79 changed files with 2874 additions and 2746 deletions

View File

@ -18,6 +18,7 @@
#include "filelister.h"
#include "config.h"
#include "path.h"
#include "pathmatch.h"
#include "utils.h"

View File

@ -22,6 +22,7 @@
#include <QDialog>
#include <QString>
class QObject;
class QWidget;
namespace Ui {
class About;

View File

@ -22,6 +22,7 @@
#include <QDialog>
#include <QString>
class QObject;
class QWidget;
class Application;
namespace Ui {

View File

@ -18,11 +18,25 @@
#include "checkthread.h"
#include "analyzerinfo.h"
#include "common.h"
#include "cppcheck.h"
#include "erroritem.h"
#include "errorlogger.h"
#include "errortypes.h"
#include "settings.h"
#include "standards.h"
#include "threadresult.h"
#include <cstddef>
#include <functional>
#include <list>
#include <map>
#include <ostream>
#include <set>
#include <string>
#include <vector>
#include <QDebug>
#include <QDir>
#include <QFile>

View File

@ -25,6 +25,7 @@
#include <QThread>
class QObject;
class Settings;
class ThreadResult;

View File

@ -23,6 +23,8 @@
#include <QPainter>
#include <QShortcut>
class QTextDocument;
Highlighter::Highlighter(QTextDocument *parent,
CodeEditorStyle *widgetStyle) :

View File

@ -24,8 +24,11 @@
#include <QSyntaxHighlighter>
class CodeEditorStyle;
class QObject;
class QPaintEvent;
class QRect;
class QResizeEvent;
class QTextDocument;
class Highlighter : public QSyntaxHighlighter {
Q_OBJECT

View File

@ -20,6 +20,8 @@
#include <QColorDialog>
class QWidget;
SelectColorButton::SelectColorButton(QWidget* parent) :
QPushButton(parent),
mColor(QColor(255, 255, 255))

View File

@ -27,6 +27,9 @@
#include <QFont>
#include <QPushButton>
class QObject;
class QWidget;
class SelectColorButton : public QPushButton {
Q_OBJECT
public:

View File

@ -24,6 +24,8 @@
#include <QDialogButtonBox>
#include <QFormLayout>
class QWidget;
const QString StyleEditDialog::mSampleDocument(
"/*****\n"
"* Multiline Comment\n"

View File

@ -26,7 +26,10 @@
class CodeEditor;
class SelectColorButton;
class SelectFontWeightCombo;
class QObject;
class QPushButton;
class QStringList;
class QWidget;
class StyleEditDialog : public QDialog {
Q_OBJECT

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -24,6 +24,8 @@
#include <QString>
#include <QTextStream>
class ErrorItem;
/// @addtogroup GUI
/// @{

View File

@ -20,6 +20,8 @@
#include "common.h"
#include <list>
QErrorPathItem::QErrorPathItem(const ErrorMessage::FileLocation &loc)
: file(QString::fromStdString(loc.getfile(false)))
, line(loc.line)

View File

@ -20,6 +20,10 @@
#include "pathmatch.h"
#include <algorithm>
#include <string>
#include <vector>
#include <QDir>
QStringList FileList::getDefaultFilters()

View File

@ -22,6 +22,7 @@
#include <QDialog>
#include <QString>
class QObject;
class QWidget;
class QTextEdit;
namespace Ui {

View File

@ -28,6 +28,8 @@
#include <QHelpIndexWidget>
#include <QMessageBox>
class QWidget;
void HelpBrowser::setHelpEngine(QHelpEngine *helpEngine)
{
mHelpEngine = helpEngine;

View File

@ -22,12 +22,14 @@
#include <QDialog>
#include <QTextBrowser>
class QHelpEngine;
class QObject;
class QUrl;
class QWidget;
namespace Ui {
class HelpDialog;
}
class QHelpEngine;
class HelpBrowser : public QTextBrowser {
public:
HelpBrowser(QWidget* parent = nullptr) : QTextBrowser(parent), mHelpEngine(nullptr) {}

View File

@ -23,6 +23,8 @@
#include <QRegularExpression>
#include <QRegularExpressionValidator>
class QWidget;
LibraryAddFunctionDialog::LibraryAddFunctionDialog(QWidget *parent) :
QDialog(parent),
mUi(new Ui::LibraryAddFunctionDialog)

View File

@ -21,14 +21,16 @@
#include <QDialog>
#define SIMPLENAME "[_a-zA-Z][_a-zA-Z0-9]*" // just a name
#define SCOPENAME SIMPLENAME "(::" SIMPLENAME ")*" // names with optional scope
#define NAMES SCOPENAME "(," SCOPENAME ")*" // names can be separated by comma
class QObject;
class QWidget;
namespace Ui {
class LibraryAddFunctionDialog;
}
#define SIMPLENAME "[_a-zA-Z][_a-zA-Z0-9]*" // just a name
#define SCOPENAME SIMPLENAME "(::" SIMPLENAME ")*" // names with optional scope
#define NAMES SCOPENAME "(," SCOPENAME ")*" // names can be separated by comma
class LibraryAddFunctionDialog : public QDialog {
Q_OBJECT

View File

@ -25,12 +25,16 @@
#include "ui_librarydialog.h"
#include <string>
#include <QFile>
#include <QFileDialog>
#include <QMessageBox>
#include <QRegularExpression>
#include <QTextStream>
class QWidget;
// TODO: get/compare functions from header
class FunctionListItem : public QListWidgetItem {

View File

@ -24,7 +24,8 @@
#include <QDialog>
class QListWidgetItem;
class QObject;
class QWidget;
namespace Ui {
class LibraryDialog;
}

View File

@ -20,6 +20,8 @@
#include "ui_libraryeditargdialog.h"
class QWidget;
LibraryEditArgDialog::LibraryEditArgDialog(QWidget *parent, const CppcheckLibraryData::Function::Arg &arg) :
QDialog(parent),
mUi(new Ui::LibraryEditArgDialog),

View File

@ -23,6 +23,8 @@
#include <QDialog>
class QObject;
class QWidget;
namespace Ui {
class LibraryEditArgDialog;
}

View File

@ -29,6 +29,7 @@
#else
#include <iostream>
#endif
#include <string>
#include <QApplication>
#include <QCoreApplication>

View File

@ -20,25 +20,39 @@
#include "applicationlist.h"
#include "aboutdialog.h"
#include "analyzerinfo.h"
#include "common.h"
#include "cppcheck.h"
#include "errortypes.h"
#include "filelist.h"
#include "fileviewdialog.h"
#include "helpdialog.h"
#include "importproject.h"
#include "librarydialog.h"
#include "platform.h"
#include "projectfile.h"
#include "projectfiledialog.h"
#include "report.h"
#include "resultsview.h"
#include "scratchpad.h"
#include "showtypes.h"
#include "statsdialog.h"
#include "settingsdialog.h"
#include "standards.h"
#include "suppressions.h"
#include "threadhandler.h"
#include "threadresult.h"
#include "translationhandler.h"
#include "ui_mainwindow.h"
#include <algorithm>
#include <functional>
#include <list>
#include <set>
#include <string>
#include <vector>
#include <QApplication>
#include <QAction>
#include <QActionGroup>

View File

@ -19,6 +19,7 @@
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include "library.h"
#include "settings.h"
#include "platforms.h"
@ -36,6 +37,9 @@ class QActionGroup;
class QSettings;
class QTimer;
class QLineEdit;
class ImportProject;
class QCloseEvent;
class QObject;
namespace Ui {
class MainWindow;
}

View File

@ -25,6 +25,11 @@
#include "ui_newsuppressiondialog.h"
#include <functional>
#include <string>
class QWidget;
NewSuppressionDialog::NewSuppressionDialog(QWidget *parent) :
QDialog(parent),
mUI(new Ui::NewSuppressionDialog)

View File

@ -23,6 +23,8 @@
#include <QDialog>
class QObject;
class QWidget;
namespace Ui {
class NewSuppressionDialog;
}

View File

@ -21,6 +21,8 @@
#include "report.h"
class ErrorItem;
/// @addtogroup GUI
/// @{

View File

@ -19,9 +19,13 @@
#include "projectfile.h"
#include "common.h"
#include "config.h"
#include "importproject.h"
#include "settings.h"
#include <string>
#include <utility>
#include <QFile>
#include <QDir>
#include <QXmlStreamReader>

View File

@ -22,6 +22,7 @@
#include "settings.h"
#include "suppressions.h"
#include <cstddef>
#include <map>
#include <QObject>

View File

@ -23,11 +23,16 @@
#include "importproject.h"
#include "library.h"
#include "newsuppressiondialog.h"
#include "platform.h"
#include "platforms.h"
#include "projectfile.h"
#include "settings.h"
#include "ui_projectfile.h"
#include <list>
#include <string>
#include <QDir>
#include <QFileDialog>
#include <QFileInfo>
@ -35,6 +40,8 @@
#include <QRegularExpressionValidator>
#include <QSettings>
class QModelIndex;
/** Return paths from QListWidget */
static QStringList getPaths(const QListWidget *list)
{

View File

@ -25,6 +25,8 @@
#include <QString>
#include <QStringList>
class QModelIndex;
class QObject;
class QWidget;
namespace Ui {
class ProjectFile;

View File

@ -26,9 +26,13 @@
#include "projectfile.h"
#include "report.h"
#include "showtypes.h"
#include "suppressions.h"
#include "threadhandler.h"
#include "xmlreportv2.h"
#include <string>
#include <utility>
#include <QAction>
#include <QApplication>
#include <QClipboard>

View File

@ -35,6 +35,8 @@ class QWidget;
class QItemSelectionModel;
class ThreadHandler;
class QContextMenuEvent;
class QKeyEvent;
class QObject;
class QSettings;
/// @addtogroup GUI

View File

@ -19,12 +19,14 @@
#include "resultsview.h"
#include "checkstatistics.h"
#include "codeeditor.h"
#include "codeeditorstyle.h"
#include "common.h"
#include "csvreport.h"
#include "erroritem.h"
#include "path.h"
#include "printablereport.h"
#include "resultstree.h"
#include "txtreport.h"
#include "xmlreport.h"
#include "xmlreportv2.h"

View File

@ -34,7 +34,8 @@ class QModelIndex;
class QPrinter;
class QSettings;
class CheckStatistics;
class QListWidgetItem;
class QObject;
class QPoint;
namespace Ui {
class ResultsView;
}

View File

@ -18,6 +18,7 @@
#include "scratchpad.h"
#include "codeeditor.h"
#include "mainwindow.h"
#include "ui_scratchpad.h"

View File

@ -22,6 +22,7 @@
#include <QDialog>
class MainWindow;
class QObject;
namespace Ui {
class ScratchPad;
}

View File

@ -18,6 +18,7 @@
#include "settingsdialog.h"
#include "application.h"
#include "applicationdialog.h"
#include "applicationlist.h"
#include "codeeditorstyle.h"

View File

@ -28,6 +28,7 @@ class ApplicationList;
class TranslationHandler;
class CodeEditorStyle;
class QCheckBox;
class QObject;
namespace Ui {
class Settings;
}

View File

@ -21,6 +21,7 @@
#include "checkstatistics.h"
#include "common.h"
#include "projectfile.h"
#include "showtypes.h"
#include "ui_statsdialog.h"

View File

@ -23,6 +23,8 @@
class ProjectFile;
class CheckStatistics;
class QObject;
class QWidget;
namespace Ui {
class StatsDialog;
}

View File

@ -16,8 +16,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "color.h"
#include "errorlogger.h"
#include <string>
#include <QObject>
class BenchmarkSimple : public QObject, public ErrorLogger {

View File

@ -23,6 +23,10 @@
#include "resultsview.h"
#include "settings.h"
#include <list>
#include <string>
#include <utility>
#include <QDebug>
#include <QFileInfo>
#include <QSettings>

View File

@ -35,6 +35,7 @@ class CheckThread;
class QSettings;
class Settings;
class ImportProject;
class ErrorItem;
/// @addtogroup GUI
/// @{

View File

@ -21,6 +21,7 @@
#include "common.h"
#include "erroritem.h"
#include "errorlogger.h"
#include "errortypes.h"
#include <QFile>

View File

@ -24,6 +24,9 @@
#include "errorlogger.h"
#include "importproject.h"
#include <list>
#include <string>
#include <QMutex>
#include <QObject>
#include <QStringList>

View File

@ -24,6 +24,9 @@
#include <QString>
#include <QTextStream>
class ErrorItem;
class QObject;
/// @addtogroup GUI
/// @{

View File

@ -19,6 +19,7 @@
#ifndef XML_REPORTV2_H
#define XML_REPORTV2_H
#include "erroritem.h"
#include "xmlreport.h"
#include <QString>

View File

@ -32,11 +32,9 @@
#include "errortypes.h"
#include "symboldatabase.h"
class Function;
class Library;
class Settings;
class Token;
class Variable;
enum class ChildrenToVisit {
none,

View File

@ -30,7 +30,6 @@
#include "tokenize.h"
#include "valueflow.h"
#include <algorithm>
#include <list>
#include <unordered_set>
#include <utility>

View File

@ -36,10 +36,6 @@
class ErrorLogger;
class Settings;
class Token;
class Function;
class Scope;
class Type;
class Variable;
namespace CTU {
class FileInfo;

View File

@ -40,7 +40,6 @@
#include <memory>
#include <ostream>
#include <set>
#include <type_traits>
#include <utility>
#include <numeric>

View File

@ -33,7 +33,6 @@
#include <algorithm>
#include <list>
#include <memory>
#include <set>
#include <utility>
#include <vector>

View File

@ -34,6 +34,7 @@
#include <iosfwd>
#include <list>
#include <memory>
#include <stack>
#include <string>
#include <tinyxml2.h>

View File

@ -36,7 +36,6 @@
#include <vector>
class Token;
class TokenList;
class Settings;
namespace tinyxml2 {

View File

@ -36,7 +36,6 @@
#include <list>
#include <memory>
#include <string>
#include <type_traits>
#include <utility>
#include <vector>

View File

@ -26,6 +26,7 @@
#include <cstddef>
#include <functional>
#include <map>
#include <string>
#include <unordered_map>
class Token;

View File

@ -34,7 +34,6 @@
#include <atomic>
#include <cstdint>
#include <list>
#include <map>
#include <set>
#include <string>
#include <vector>

View File

@ -22,7 +22,9 @@
#include "mathlib.h"
#include "path.h"
#include "utils.h"
#include "token.h"
#include "tokenize.h"
#include "tokenlist.h"
#include <algorithm>
#include <cctype> // std::isdigit, std::isalnum, etc

View File

@ -33,6 +33,7 @@
#include <memory>
#include <set>
#include <string>
#include <type_traits>
#include <utility>
#include <vector>

View File

@ -33,7 +33,6 @@
#include <map>
#include <memory>
#include <stack>
#include <type_traits>
#include <utility>
static Token *skipRequires(Token *tok)

View File

@ -115,7 +115,6 @@
#include <map>
#include <memory>
#include <set>
#include <stack>
#include <string>
#include <type_traits>
#include <unordered_map>

View File

@ -26,6 +26,7 @@
#include "tokenize.h"
#include "tokenlist.h"
#include <algorithm>
#include <cstdint>
#include <cstring>
#include <limits>

View File

@ -21,11 +21,13 @@
#include "testutils.h"
#include "threadexecutor.h"
#include <algorithm>
#include <cstddef>
#include <map>
#include <ostream>
#include <string>
#include <utility>
#include <vector>
class TestThreadExecutor : public TestFixture {
public:

View File

@ -29,6 +29,7 @@
#include <cstdio>
#include <iosfwd>
#include <list>
#include <ostream>
#include <string>
class Token;