Bug 242503 - Build plug-in should report outcome of compilation more precisely
Summary: Build plug-in should report outcome of compilation more precisely
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Platform: Debian testing Linux
: NOR wishlist (vote)
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-22 18:04 UTC by Oliver Sander
Modified: 2010-10-31 16:45 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Patch for the kate build plugin that improves the content of some message boxes, as requested in 242503 (3.38 KB, patch)
2010-10-23 16:09 UTC, Oliver Sander
Details
Revised patch for wishlist item 242503 (3.03 KB, patch)
2010-10-24 23:12 UTC, Oliver Sander
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Oliver Sander 2010-06-22 18:04:47 UTC
Version:           unspecified (using KDE 4.4.4) 
OS:                Linux

I am building a C++ program with the Kate build plug-in. If compilation of a program was successful, but there were compiler warnings, termination of the build process is reported by a little window saying 'Make results: Warnings/Errors found'.  If the compiler output is large, it is not obvious to see whether compilation aborted or whether there were only a few warnings.  It would be nice if the message could be more specific and say only 'Make results: Warnings found' if there were no errors.

As an aside, it would be nice if the outcome of the last compilation run could be quickly visible (say, by some symbol), even after the notification window has disappeared.


Reproducible: Didn't try
Comment 1 Oliver Sander 2010-10-23 16:09:44 UTC
Created attachment 52802 [details]
Patch for the kate build plugin that improves the content of some message boxes, as requested in 242503
Comment 2 Oliver Sander 2010-10-23 16:10:05 UTC
I wrote a patch that implements the requested behavior.  The build plugin now counts the number of errors and warnings.  The message window mentions errors and warnings only if there have actually been errors and warnings, respectively. If there have been, reasonably precise numbers are given.

Please review the patch and apply it if it meets your standards.  Thanks.
Comment 3 Milian Wolff 2010-10-24 01:00:26 UTC
Hey Oliver,

I'd personally just use "if (m_num_errors_found)" instead of checking for > 0 all the time.

Also camel cased variable names are preferred: m_numErrors and m_numWarnings is imo better.

And the part with the passive popup is not looking good to me. It should always use i18np. And it would be simpler if you do it like this:

if (m_numErrors || m_numWarnings) {
  QStringList msgs;
  if (m_numErrors) {
    msgs << i18np("Found one error.", "Found %1 errors.", m_numErrors);
  }
  if (m_numWarnings) {
    msg << i18np("Found one warning.", "Found %1 warnings.", m_numErrors);
  }
  KPassivePopup::message(i18n("Make Results"), msgs.join("\n"), m_toolView);
}

Otherwise good job :) If you fix the above stuff I'll happilly merge the patch.

Bye
Comment 4 Oliver Sander 2010-10-24 23:10:55 UTC
Hi Milian!
Thanks for the review.  I attach a revised patch, which includes all of your suggestions.
--
Oliver
Comment 5 Oliver Sander 2010-10-24 23:12:09 UTC
Created attachment 52838 [details]
Revised patch for wishlist item 242503
Comment 6 Milian Wolff 2010-10-25 10:59:36 UTC
committed to git, thanks
Comment 7 Christoph Cullmann 2010-10-31 16:45:20 UTC
SVN commit 1191596 by cullmann:

mwolff:
    Show amount of compile errors and warnings in popup of build plugin.
    
    Thanks for the patch to Oliver Sander.
    
BUG: 242503


 M  +21 -13    plugin_katebuild.cpp  
 M  +2 -1      plugin_katebuild.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1191596