@@ -151,25 +151,27 @@ void CheckThread::run()
151
151
return ;
152
152
}
153
153
154
- QString file = mResult .getNextFile ();
155
- while (!file.isEmpty () && mState == Running) {
156
- qDebug () << " Checking file" << file;
157
- cppcheck.check (FileWithDetails (file.toStdString (), Path::identify (file.toStdString (), mSettings .cppHeaderProbe ), 0 ));
158
- runAddonsAndTools (mSettings , nullptr , file);
159
- emit fileChecked (file);
154
+ const FileWithDetails* file = nullptr ;
155
+ mResult .getNextFile (file);
156
+ while (file && mState == Running) {
157
+ const std::string& fname = file->spath ();
158
+ qDebug () << " Checking file" << QString::fromStdString (fname);
159
+ cppcheck.check (*file);
160
+ runAddonsAndTools (mSettings , nullptr , QString::fromStdString (fname));
161
+ emit fileChecked (QString::fromStdString (fname));
160
162
161
163
if (mState == Running)
162
- file = mResult .getNextFile ();
164
+ mResult .getNextFile (file );
163
165
}
164
166
165
167
const FileSettings* fileSettings = nullptr ;
166
168
mResult .getNextFileSettings (fileSettings);
167
169
while (fileSettings && mState == Running) {
168
- file = QString::fromStdString ( fileSettings->filename () );
169
- qDebug () << " Checking file" << file ;
170
+ const std::string& fname = fileSettings->filename ();
171
+ qDebug () << " Checking file" << QString::fromStdString (fname) ;
170
172
cppcheck.check (*fileSettings);
171
- runAddonsAndTools (mSettings , fileSettings, QString::fromStdString (fileSettings-> filename () ));
172
- emit fileChecked (file );
173
+ runAddonsAndTools (mSettings , fileSettings, QString::fromStdString (fname ));
174
+ emit fileChecked (QString::fromStdString (fname) );
173
175
174
176
if (mState == Running)
175
177
mResult .getNextFileSettings (fileSettings);
0 commit comments