@@ -171,7 +171,7 @@ bool ResultsTree::AddErrorItem(const ErrorItem &item)
171171 data[" line" ] = item.lines [0 ];
172172 data[" id" ] = item.errorId ;
173173 data[" inconclusive" ] = item.inconclusive ;
174- data[" file0" ] = item.file0 ;
174+ data[" file0" ] = StripPath ( item.file0 , true ) ;
175175 stditem->setData (QVariant (data));
176176
177177 // Add backtrace files as children
@@ -347,8 +347,11 @@ void ResultsTree::ClearRecheckFile(const QString &filename)
347347 if (!item)
348348 continue ;
349349
350+ QString actualfile ((!mCheckPath .isEmpty () && filename.startsWith (mCheckPath )) ? filename.mid (mCheckPath .length () + 1 ) : filename);
350351 QVariantMap data = item->data ().toMap ();
351- if (filename == data[" file" ].toString ()) {
352+ QString storedfile = data[" file" ].toString ();
353+ storedfile = ((!mCheckPath .isEmpty () && storedfile.startsWith (mCheckPath )) ? storedfile.mid (mCheckPath .length () + 1 ) : storedfile);
354+ if (actualfile == storedfile) {
352355 mModel .removeRow (i);
353356 break ;
354357 }
@@ -833,12 +836,27 @@ void ResultsTree::RecheckSelectedFiles()
833836 item = item->parent ();
834837 QVariantMap data = item->data ().toMap ();
835838 QString currentFile = data[" file" ].toString ();
836- if (Path::isHeader (currentFile.toStdString ())) {
837- if (!selectedItems.contains (data[" file0" ].toString ()))
838- selectedItems<<data[" file0" ].toString ();
839+ if (!currentFile.isEmpty ()) {
840+ QString fileNameWithCheckPath;
841+ QFileInfo curfileInfo (currentFile);
842+ if (!curfileInfo.exists () && !mCheckPath .isEmpty () && currentFile.indexOf (mCheckPath ) != 0 )
843+ fileNameWithCheckPath = mCheckPath + " /" + currentFile;
844+ else
845+ fileNameWithCheckPath = currentFile;
846+ const QFileInfo fileInfo (fileNameWithCheckPath);
847+ if (!fileInfo.exists ()) {
848+ AskFileDir (currentFile);
849+ return ;
850+ }
851+ if (Path::isHeader (currentFile.toStdString ())) {
852+ if (!data[" file0" ].toString ().isEmpty () && !selectedItems.contains (data[" file0" ].toString ())) {
853+ selectedItems<<((!mCheckPath .isEmpty () && (data[" file0" ].toString ().indexOf (mCheckPath ) != 0 )) ? (mCheckPath + " /" + data[" file0" ].toString ()) : data[" file0" ].toString ());
854+ if (!selectedItems.contains (fileNameWithCheckPath))
855+ selectedItems<<fileNameWithCheckPath;
856+ }
857+ } else if (!selectedItems.contains (fileNameWithCheckPath))
858+ selectedItems<<fileNameWithCheckPath;
839859 }
840- if (!selectedItems.contains (currentFile))
841- selectedItems<<currentFile;
842860 }
843861 emit CheckSelected (selectedItems);
844862}
@@ -1043,6 +1061,12 @@ void ResultsTree::SetCheckDirectory(const QString &dir)
10431061 mCheckPath = dir;
10441062}
10451063
1064+
1065+ QString ResultsTree::GetCheckDirectory (void )
1066+ {
1067+ return mCheckPath ;
1068+ }
1069+
10461070QString ResultsTree::StripPath (const QString &path, bool saving) const
10471071{
10481072 if ((!saving && mShowFullPath ) || (saving && mSaveFullPath )) {
0 commit comments