Changeset View
Changeset View
Standalone View
Standalone View
addons/project/kateprojectinfoviewcodeanalysis.cpp
Show First 20 Lines • Show All 68 Lines • ▼ Show 20 Line(s) | 40 | { | |||
---|---|---|---|---|---|
69 | hlayout->setSpacing(0); | 69 | hlayout->setSpacing(0); | ||
70 | hlayout->addStretch(); | 70 | hlayout->addStretch(); | ||
71 | hlayout->addWidget(m_startStopAnalysis); | 71 | hlayout->addWidget(m_startStopAnalysis); | ||
72 | setLayout(layout); | 72 | setLayout(layout); | ||
73 | 73 | | |||
74 | /** | 74 | /** | ||
75 | * connect needed signals | 75 | * connect needed signals | ||
76 | */ | 76 | */ | ||
77 | connect(m_startStopAnalysis, SIGNAL(clicked(bool)), this, SLOT(slotStartStopClicked())); | 77 | connect(m_startStopAnalysis, &QPushButton::clicked, this, &KateProjectInfoViewCodeAnalysis::slotStartStopClicked); | ||
78 | connect(m_treeView, SIGNAL(clicked(const QModelIndex &)), this, SLOT(slotClicked(const QModelIndex &))); | 78 | connect(m_treeView, &QTreeView::clicked, this, &KateProjectInfoViewCodeAnalysis::slotClicked); | ||
79 | } | 79 | } | ||
80 | 80 | | |||
81 | KateProjectInfoViewCodeAnalysis::~KateProjectInfoViewCodeAnalysis() | 81 | KateProjectInfoViewCodeAnalysis::~KateProjectInfoViewCodeAnalysis() | ||
82 | { | 82 | { | ||
83 | } | 83 | } | ||
84 | 84 | | |||
85 | void KateProjectInfoViewCodeAnalysis::slotStartStopClicked() | 85 | void KateProjectInfoViewCodeAnalysis::slotStartStopClicked() | ||
86 | { | 86 | { | ||
87 | /** | 87 | /** | ||
88 | * get files for cppcheck | 88 | * get files for cppcheck | ||
89 | */ | 89 | */ | ||
90 | QStringList files = m_project->files().filter(QRegExp(QStringLiteral("\\.(cpp|cxx|cc|c\\+\\+|c|tpp|txx)$"))); | 90 | QStringList files = m_project->files().filter(QRegExp(QStringLiteral("\\.(cpp|cxx|cc|c\\+\\+|c|tpp|txx)$"))); | ||
91 | 91 | | |||
92 | /** | 92 | /** | ||
93 | * clear existing entries | 93 | * clear existing entries | ||
94 | */ | 94 | */ | ||
95 | m_model->removeRows(0, m_model->rowCount(), QModelIndex()); | 95 | m_model->removeRows(0, m_model->rowCount(), QModelIndex()); | ||
96 | 96 | | |||
97 | /** | 97 | /** | ||
98 | * launch cppcheck | 98 | * launch cppcheck | ||
99 | */ | 99 | */ | ||
100 | m_analyzer = new QProcess(this); | 100 | m_analyzer = new QProcess(this); | ||
101 | m_analyzer->setProcessChannelMode(QProcess::MergedChannels); | 101 | m_analyzer->setProcessChannelMode(QProcess::MergedChannels); | ||
102 | 102 | | |||
103 | connect(m_analyzer, SIGNAL(readyRead()), this, SLOT(slotReadyRead())); | 103 | connect(m_analyzer, &QProcess::readyRead, this, &KateProjectInfoViewCodeAnalysis::slotReadyRead); | ||
104 | connect(m_analyzer, SIGNAL(finished(int, QProcess::ExitStatus)), | 104 | connect(m_analyzer, static_cast<void(QProcess::*)(int,QProcess::ExitStatus)>(&QProcess::finished), | ||
105 | this, SLOT(finished(int, QProcess::ExitStatus))); | 105 | this, &KateProjectInfoViewCodeAnalysis::finished); | ||
106 | 106 | | |||
107 | QStringList args; | 107 | QStringList args; | ||
108 | args << QStringLiteral("-q") << QStringLiteral("--inline-suppr") << QStringLiteral("--enable=all") << QStringLiteral("--template={file}////{line}////{severity}////{message}") << QStringLiteral("--file-list=-"); | 108 | args << QStringLiteral("-q") << QStringLiteral("--inline-suppr") << QStringLiteral("--enable=all") << QStringLiteral("--template={file}////{line}////{severity}////{message}") << QStringLiteral("--file-list=-"); | ||
109 | m_analyzer->start(QStringLiteral("cppcheck"), args); | 109 | m_analyzer->start(QStringLiteral("cppcheck"), args); | ||
110 | 110 | | |||
111 | if (m_messageWidget) { | 111 | if (m_messageWidget) { | ||
112 | delete m_messageWidget; | 112 | delete m_messageWidget; | ||
113 | m_messageWidget = nullptr; | 113 | m_messageWidget = nullptr; | ||
▲ Show 20 Lines • Show All 103 Lines • Show Last 20 Lines |