226 self.resultList.setUpdatesEnabled(False) |
226 self.resultList.setUpdatesEnabled(False) |
227 self.resultList.setSortingEnabled(False) |
227 self.resultList.setSortingEnabled(False) |
228 |
228 |
229 self.checkProgress.setMaximum(len(self.files)) |
229 self.checkProgress.setMaximum(len(self.files)) |
230 self.checkProgress.setVisible(len(self.files) > 1) |
230 self.checkProgress.setVisible(len(self.files) > 1) |
231 self.checkProgressLabel.setVisible(len(self.files) > 1) |
|
232 QApplication.processEvents() |
231 QApplication.processEvents() |
233 |
232 |
234 # now go through all the files |
233 # now go through all the files |
235 self.progress = 0 |
234 self.progress = 0 |
236 if len(self.files) == 1: |
235 if len(self.files) == 1: |
248 |
247 |
249 @param codestring optional sourcestring |
248 @param codestring optional sourcestring |
250 @type str |
249 @type str |
251 """ |
250 """ |
252 if not self.files: |
251 if not self.files: |
253 self.checkProgressLabel.setPath("") |
|
254 self.checkProgress.setMaximum(1) |
252 self.checkProgress.setMaximum(1) |
255 self.checkProgress.setValue(1) |
253 self.checkProgress.setValue(1) |
256 self.__finish() |
254 self.__finish() |
257 return |
255 return |
258 |
256 |
259 self.filename = self.files.pop(0) |
257 self.filename = self.files.pop(0) |
260 self.checkProgress.setValue(self.progress) |
258 self.checkProgress.setValue(self.progress) |
261 self.checkProgressLabel.setPath(self.filename) |
|
262 QApplication.processEvents() |
259 QApplication.processEvents() |
263 |
260 |
264 if self.cancelled: |
261 if self.cancelled: |
265 return |
262 return |
266 |
263 |
284 |
281 |
285 The results are reported to the __processResult slot. |
282 The results are reported to the __processResult slot. |
286 """ |
283 """ |
287 self.__lastFileItem = None |
284 self.__lastFileItem = None |
288 |
285 |
289 self.checkProgressLabel.setPath(self.tr("Preparing files...")) |
|
290 |
|
291 argumentsList = [] |
286 argumentsList = [] |
292 for progress, filename in enumerate(self.files, start=1): |
287 for progress, filename in enumerate(self.files, start=1): |
293 self.checkProgress.setValue(progress) |
288 self.checkProgress.setValue(progress) |
294 QApplication.processEvents() |
289 QApplication.processEvents() |
295 |
290 |
315 |
310 |
316 @param type_ type of the calculated metrics |
311 @param type_ type of the calculated metrics |
317 @type str, one of ["raw", "mi", "cc"] |
312 @type str, one of ["raw", "mi", "cc"] |
318 """ |
313 """ |
319 if type_ == "raw": |
314 if type_ == "raw": |
320 self.checkProgressLabel.setPath("") |
|
321 self.checkProgress.setMaximum(1) |
315 self.checkProgress.setMaximum(1) |
322 self.checkProgress.setValue(1) |
316 self.checkProgress.setValue(1) |
323 self.__finish() |
317 self.__finish() |
324 |
318 |
325 def __processError(self, type_, fn, msg): |
319 def __processError(self, type_, fn, msg): |
352 # Check if it's the requested file, otherwise ignore signal if not |
346 # Check if it's the requested file, otherwise ignore signal if not |
353 # in batch mode |
347 # in batch mode |
354 if not self.__batch and fn != self.filename: |
348 if not self.__batch and fn != self.filename: |
355 return |
349 return |
356 |
350 |
357 self.checkProgressLabel.setPath(self.__project.getRelativePath(fn)) |
|
358 QApplication.processEvents() |
351 QApplication.processEvents() |
359 |
352 |
360 if "error" in result: |
353 if "error" in result: |
361 self.__createErrorItem(fn, result["error"]) |
354 self.__createErrorItem(fn, result["error"]) |
362 else: |
355 else: |
418 self.resultList.header().setStretchLastSection(True) |
411 self.resultList.header().setStretchLastSection(True) |
419 self.resultList.header().setSectionResizeMode( |
412 self.resultList.header().setSectionResizeMode( |
420 QHeaderView.ResizeMode.Interactive) |
413 QHeaderView.ResizeMode.Interactive) |
421 |
414 |
422 self.checkProgress.setVisible(False) |
415 self.checkProgress.setVisible(False) |
423 self.checkProgressLabel.setVisible(False) |
|
424 |
416 |
425 def __createSummary(self): |
417 def __createSummary(self): |
426 """ |
418 """ |
427 Private method to create the code metrics summary. |
419 Private method to create the code metrics summary. |
428 """ |
420 """ |