@@ -4402,8 +4402,6 @@ MainWindow::replyFinished(
44024402 // Set the total number of lines for the original file
44034403 lstFileData.at (0 )->iEndingLine = tmpData.count (" \n " )+2 ;
44044404
4405- qDebug () << tmpData;
4406-
44074405 // Append the data to the POST request
44084406 baPostData.append (tmpData);
44094407 baPostData.append (" \r\n -----------------------------17192614014659--\r\n " );
@@ -4523,37 +4521,24 @@ qDebug() << tmpData;
45234521 if (iLineNumber >= 1 && iLineNumber < 200000 )
45244522 {
45254523 // Line number seems valid, search for the file
4526- /* qint16 ia = lstFileData.length()-1;
4527- while (ia >= 0)
4528- {
4529- //Free up each element and delete it
4530- FileSStruct *tempFileS = lstFileData.at(ia);
4531- qDebug() << tempFileS->strFilename << ": " << tempFileS->iStartingLine << ", " << tempFileS->iEndingLine;
4532- --ia;
4533- }*/
4534- qDebug () << " Error is on #" << iLineNumber;
45354524 qint16 iCFile = lstFileData.length ()-1 ;
4536- qint16 tst = 0 ;
4525+ qint16 iCLine = 0 ;
45374526 while (iCFile >= 0 )
45384527 {
45394528 // Search for the file with the error
45404529 FileSStruct *tempFileS = lstFileData.at (iCFile);
4541- qDebug () << " check: " << tempFileS->strFilename << " : " << tempFileS->iStartingLine << " , " << tempFileS->iEndingLine << " , " << tempFileS->iLineSpaces ;
4542- // if (tempFileS->iStartingLine >= iLineNumber && tempFileS->iEndingLine <= iLineNumber)
45434530 if (tempFileS->iStartingLine <= iLineNumber && tempFileS->iEndingLine >= iLineNumber)
45444531 {
45454532 // Found the file
45464533 qint16 iFPos = strMessage.indexOf (" File : " );
45474534 strMessage.remove (strMessage.indexOf (" File : " )-1 , strMessage.indexOf (" \n " , strMessage.indexOf (" Line : " ))-strMessage.indexOf (" File : " )+2 );
4548- strMessage.insert (iFPos-1 , QString (" File : " ).append (tempFileS->strFilename ).append (" \n " ).append (" Line : " ).append (QString::number (iLineNumber - tempFileS->iStartingLine + 1
4549- -(tst > 0 && iCFile == 0 ? tst+1 : 0 )
4550- )).append (" \n " ));
4535+ strMessage.insert (iFPos-1 , QString (" File : " ).append (tempFileS->strFilename ).append (" \n " ).append (" Line : " ).append (QString::number (iLineNumber - tempFileS->iStartingLine + 1 - (iCLine > 0 && iCFile == 0 ? iCLine+1 : 0 ))).append (" \n " ));
45514536 break ;
45524537 }
45534538 else if (tempFileS->iStartingLine <= iLineNumber)
45544539 {
4555- //
4556- tst += tempFileS->iEndingLine -tempFileS->iStartingLine - tempFileS->iLineSpaces ;
4540+ // Not this file
4541+ iCLine += tempFileS->iEndingLine -tempFileS->iStartingLine - tempFileS->iLineSpaces ;
45574542 }
45584543 --iCFile;
45594544 }
0 commit comments