@@ -151,25 +151,27 @@ void CheckThread::run()
151151 return ;
152152 }
153153
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));
160162
161163 if (mState == Running)
162- file = mResult .getNextFile ();
164+ mResult .getNextFile (file );
163165 }
164166
165167 const FileSettings* fileSettings = nullptr ;
166168 mResult .getNextFileSettings (fileSettings);
167169 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) ;
170172 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) );
173175
174176 if (mState == Running)
175177 mResult .getNextFileSettings (fileSettings);
0 commit comments