Merge branch 'master' into projfile-gui

Conflicts:
	gui/cppcheck_de.ts
	gui/cppcheck_en.ts
	gui/cppcheck_fi.ts
	gui/cppcheck_nl.ts
	gui/cppcheck_pl.ts
	gui/cppcheck_ru.ts
	gui/cppcheck_se.ts
	gui/gui.pro
	gui/main.ui
This commit is contained in:
Kimmo Varis 2010-07-11 19:43:31 +03:00
commit 1504747030
55 changed files with 3046 additions and 875 deletions

1317
Changelog

File diff suppressed because it is too large Load Diff

View File

@ -52,6 +52,7 @@ TESTOBJ = test/testautovariables.o \
test/testpreprocessor.o \
test/testredundantif.o \
test/testrunner.o \
test/testsettings.o \
test/testsimplifytokens.o \
test/teststl.o \
test/testsuite.o \
@ -213,6 +214,9 @@ test/testredundantif.o: test/testredundantif.cpp lib/tokenize.h lib/classinfo.h
test/testrunner.o: test/testrunner.cpp test/testsuite.h lib/errorlogger.h lib/settings.h
$(CXX) $(CXXFLAGS) -Ilib -Icli -c -o test/testrunner.o test/testrunner.cpp
test/testsettings.o: test/testsettings.cpp lib/settings.h test/testsuite.h lib/errorlogger.h
$(CXX) $(CXXFLAGS) -Ilib -Icli -c -o test/testsettings.o test/testsettings.cpp
test/testsimplifytokens.o: test/testsimplifytokens.cpp test/testsuite.h lib/errorlogger.h lib/settings.h lib/tokenize.h lib/classinfo.h lib/token.h
$(CXX) $(CXXFLAGS) -Ilib -Icli -c -o test/testsimplifytokens.o test/testsimplifytokens.cpp

View File

@ -56,8 +56,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,43,0,0
PRODUCTVERSION 1,43,0,0
FILEVERSION 1,44,0,0
PRODUCTVERSION 1,44,0,0
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -73,12 +73,12 @@ BEGIN
BLOCK "040904b0"
BEGIN
VALUE "FileDescription", "cppcheck Application"
VALUE "FileVersion", "1.43"
VALUE "FileVersion", "1.44"
VALUE "InternalName", "cppcheck"
VALUE "LegalCopyright", "Copyright (C) 2007-2010 Daniel Marjamäki and Cppcheck team."
VALUE "OriginalFilename", "cppcheck.exe"
VALUE "ProductName", "cppcheck Application"
VALUE "ProductVersion", "1.43"
VALUE "ProductVersion", "1.44"
END
END
BLOCK "VarFileInfo"

View File

@ -20,7 +20,7 @@
/**
*
* @mainpage Cppcheck
* @version 1.43
* @version 1.44
*
* @section overview_sec Overview
* Cppcheck is a simple tool for static analysis of C/C++ code.

View File

@ -27,6 +27,7 @@
#include <cstdlib>
#include <cstring>
#include <cstdio>
#include <errno.h>
#endif
ThreadExecutor::ThreadExecutor(const std::vector<std::string> &filenames, const Settings &settings, ErrorLogger &errorLogger)
@ -51,12 +52,15 @@ void ThreadExecutor::addFileContent(const std::string &path, const std::string &
#if (defined(__GNUC__) || defined(__sun)) && !defined(__MINGW32__)
bool ThreadExecutor::handleRead(unsigned int &result)
int ThreadExecutor::handleRead(unsigned int &result)
{
char type = 0;
if (read(_pipe[0], &type, 1) <= 0)
{
return false;
if( errno == EAGAIN )
return 0;
return -1;
}
if (type != '1' && type != '2' && type != '3')
@ -104,10 +108,12 @@ bool ThreadExecutor::handleRead(unsigned int &result)
iss >> fileResult;
result += fileResult;
_errorLogger.reportStatus(_fileCount, _filenames.size());
delete [] buf;
return -1;
}
delete [] buf;
return true;
return 1;
}
unsigned int ThreadExecutor::check()
@ -134,21 +140,12 @@ unsigned int ThreadExecutor::check()
}
unsigned int childCount = 0;
for (unsigned int i = 0; i < _filenames.size(); i++)
unsigned int i = 0;
while( true )
{
// Keep only wanted amount of child processes running at a time.
if (childCount >= _settings._jobs)
// Start a new child
if( i < _filenames.size() && childCount < _settings._jobs )
{
while (handleRead(result))
{
}
int stat = 0;
waitpid(0, &stat, 0);
--childCount;
}
pid_t pid = fork();
if (pid < 0)
{
@ -180,19 +177,31 @@ unsigned int ThreadExecutor::check()
}
++childCount;
++i;
}
else if (childCount > 0)
{
// Wait for child to quit before stating new processes
while(true)
{
int readRes = handleRead(result);
if( readRes == -1 )
break;
else if( readRes == 0 )
usleep(5000); // 5 ms
}
while (childCount > 0)
{
int stat = 0;
waitpid(0, &stat, 0);
--childCount;
}
while (handleRead(result))
else if(childCount == 0)
{
// All done
break;
}
}
return result;
}

View File

@ -58,7 +58,13 @@ private:
#if (defined(__GNUC__) || defined(__sun)) && !defined(__MINGW32__)
private:
bool handleRead(unsigned int &result);
/**
* Read from the pipe, parse and handle what ever is in there.
*@return -1 in case of error
* 0 if there is nothing in the pipe to be read
* 1 if we did read something
*/
int handleRead(unsigned int &result);
void writeToPipe(char type, const std::string &data);
int _pipe[2];
std::list<std::string> _errorList;

View File

@ -128,15 +128,15 @@ kate -l(line) (file)</oldsource>
<name>MainWindow</name>
<message>
<location filename="main.ui" line="26"/>
<location filename="mainwindow.cpp" line="220"/>
<location filename="mainwindow.cpp" line="483"/>
<location filename="mainwindow.cpp" line="585"/>
<location filename="mainwindow.cpp" line="603"/>
<location filename="mainwindow.cpp" line="221"/>
<location filename="mainwindow.cpp" line="500"/>
<location filename="mainwindow.cpp" line="602"/>
<location filename="mainwindow.cpp" line="620"/>
<source>Cppcheck</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="143"/>
<location filename="main.ui" line="144"/>
<source>Standard</source>
<translation type="unfinished"></translation>
</message>
@ -146,264 +146,275 @@ kate -l(line) (file)</oldsource>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="83"/>
<location filename="main.ui" line="84"/>
<source>&amp;View</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="87"/>
<location filename="main.ui" line="88"/>
<source>&amp;Toolbars</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="120"/>
<location filename="main.ui" line="121"/>
<source>&amp;Check</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="129"/>
<location filename="main.ui" line="130"/>
<source>&amp;Edit</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="174"/>
<location filename="main.ui" line="175"/>
<source>&amp;License...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="179"/>
<location filename="main.ui" line="180"/>
<source>A&amp;uthors...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="188"/>
<location filename="main.ui" line="189"/>
<source>&amp;About...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="193"/>
<location filename="main.ui" line="194"/>
<source>&amp;Files...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="196"/>
<location filename="main.ui" line="197"/>
<source>Ctrl+F</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="205"/>
<location filename="main.ui" line="206"/>
<source>&amp;Directory...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="208"/>
<location filename="main.ui" line="209"/>
<source>Ctrl+D</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="217"/>
<location filename="main.ui" line="218"/>
<source>&amp;Recheck files</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="220"/>
<location filename="main.ui" line="221"/>
<source>Ctrl+R</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="229"/>
<location filename="main.ui" line="230"/>
<source>&amp;Stop</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="232"/>
<location filename="main.ui" line="233"/>
<source>Esc</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="241"/>
<location filename="main.ui" line="242"/>
<source>&amp;Save results to file...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="244"/>
<location filename="main.ui" line="245"/>
<source>Ctrl+S</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="249"/>
<location filename="main.ui" line="250"/>
<source>&amp;Quit</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="258"/>
<location filename="main.ui" line="259"/>
<source>&amp;Clear results</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="267"/>
<location filename="main.ui" line="268"/>
<source>&amp;Preferences</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="279"/>
<location filename="main.ui" line="280"/>
<source>Show style errors</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="291"/>
<location filename="main.ui" line="292"/>
<source>Show common errors</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="296"/>
<location filename="main.ui" line="297"/>
<source>&amp;Check all</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="301"/>
<location filename="main.ui" line="302"/>
<source>&amp;Uncheck all</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="306"/>
<location filename="main.ui" line="307"/>
<source>Collapse &amp;all</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="311"/>
<location filename="main.ui" line="312"/>
<source>&amp;Expand all</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="319"/>
<location filename="main.ui" line="320"/>
<source>&amp;Standard</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="322"/>
<location filename="main.ui" line="323"/>
<source>Standard items</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="338"/>
<location filename="main.ui" line="339"/>
<source>Toolbar</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="346"/>
<location filename="main.ui" line="347"/>
<source>&amp;Categories</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="349"/>
<location filename="main.ui" line="350"/>
<source>Error categories</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="354"/>
<location filename="main.ui" line="355"/>
<source>&amp;Open XML...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="360"/>
<source>Open P&amp;roject File...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="359"/>
<location filename="main.ui" line="365"/>
<source>&amp;New Project File...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="327"/>
<location filename="main.ui" line="328"/>
<source>&amp;Contents</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="161"/>
<location filename="main.ui" line="162"/>
<source>Categories</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="330"/>
<location filename="main.ui" line="331"/>
<source>Open the help contents</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="333"/>
<location filename="main.ui" line="334"/>
<source>F1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="105"/>
<location filename="main.ui" line="106"/>
<source>&amp;Language</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="110"/>
<location filename="main.ui" line="111"/>
<source>&amp;Help</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="253"/>
<location filename="mainwindow.cpp" line="254"/>
<source>Select files to check</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="267"/>
<location filename="mainwindow.cpp" line="268"/>
<source>Select directory to check</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="221"/>
<location filename="mainwindow.cpp" line="222"/>
<source>No suitable files found to check!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="479"/>
<location filename="mainwindow.cpp" line="496"/>
<source>Cannot exit while checking.
Stop the checking before exiting.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="510"/>
<location filename="mainwindow.cpp" line="527"/>
<source>License</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="517"/>
<location filename="mainwindow.cpp" line="534"/>
<source>Authors</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="525"/>
<location filename="mainwindow.cpp" line="542"/>
<source>XML files (*.xml);;Text files (*.txt);;CSV files (*.csv)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="527"/>
<location filename="mainwindow.cpp" line="544"/>
<source>Save the report file</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="535"/>
<location filename="mainwindow.cpp" line="442"/>
<location filename="mainwindow.cpp" line="552"/>
<source>XML files (*.xml)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="541"/>
<location filename="mainwindow.cpp" line="444"/>
<source>Open the report file</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="558"/>
<source>Text files (*.txt)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="547"/>
<location filename="mainwindow.cpp" line="564"/>
<source>CSV files (*.csv)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="587"/>
<location filename="mainwindow.cpp" line="604"/>
<source>Cppcheck - %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="604"/>
<location filename="mainwindow.cpp" line="621"/>
<source>Failed to change the language:
%1
@ -415,12 +426,12 @@ Stop the checking before exiting.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="671"/>
<location filename="mainwindow.cpp" line="688"/>
<source>Project files (*.cppcheck);;All files(*.*)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="673"/>
<location filename="mainwindow.cpp" line="690"/>
<source>Select Project File</source>
<translation type="unfinished"></translation>
</message>
@ -530,74 +541,91 @@ Stop the checking before exiting.</source>
<context>
<name>ResultsTree</name>
<message>
<location filename="resultstree.cpp" line="42"/>
<location filename="resultstree.cpp" line="796"/>
<location filename="resultstree.cpp" line="43"/>
<location filename="resultstree.cpp" line="828"/>
<source>File</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="42"/>
<location filename="resultstree.cpp" line="796"/>
<location filename="resultstree.cpp" line="43"/>
<location filename="resultstree.cpp" line="828"/>
<source>Severity</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="42"/>
<location filename="resultstree.cpp" line="796"/>
<location filename="resultstree.cpp" line="43"/>
<location filename="resultstree.cpp" line="828"/>
<source>Line</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="42"/>
<location filename="resultstree.cpp" line="796"/>
<location filename="resultstree.cpp" line="43"/>
<location filename="resultstree.cpp" line="828"/>
<source>Message</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="88"/>
<location filename="resultstree.cpp" line="82"/>
<source>Undefined file</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="419"/>
<location filename="resultstree.cpp" line="411"/>
<source>Copy filename</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="420"/>
<location filename="resultstree.cpp" line="412"/>
<source>Copy full path</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="421"/>
<location filename="resultstree.cpp" line="413"/>
<source>Copy message</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="459"/>
<location filename="resultstree.cpp" line="451"/>
<source>Cppcheck</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="460"/>
<location filename="resultstree.cpp" line="452"/>
<source>Configure the text file viewer program in Cppcheck preferences/Applications.</source>
<oldsource>You can open this error by specifying applications in program&apos;s settings.</oldsource>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="497"/>
<location filename="resultstree.cpp" line="479"/>
<source>Could not find the file!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="517"/>
<source>Could not start %1
Please check the application path and parameters are correct.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="661"/>
<location filename="resultstree.cpp" line="531"/>
<source>Could not find file:
%1
Please select the directory where file is located.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="538"/>
<source>Select Directory</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="693"/>
<source>style</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="665"/>
<location filename="resultstree.cpp" line="697"/>
<source>error</source>
<translation type="unfinished"></translation>
</message>
@ -605,30 +633,36 @@ Please check the application path and parameters are correct.</source>
<context>
<name>ResultsView</name>
<message>
<location filename="resultsview.cpp" line="174"/>
<location filename="resultsview.cpp" line="186"/>
<location filename="resultsview.cpp" line="182"/>
<location filename="resultsview.cpp" line="194"/>
<source>Cppcheck</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultsview.cpp" line="175"/>
<location filename="resultsview.cpp" line="183"/>
<source>No errors found.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultsview.cpp" line="183"/>
<location filename="resultsview.cpp" line="191"/>
<source>Errors were found, but they are configured to be hidden.
To toggle what kind of errors are shown, open view menu.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultsview.cpp" line="101"/>
<location filename="resultsview.cpp" line="240"/>
<location filename="resultsview.cpp" line="250"/>
<source>Failed to read the report.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultsview.cpp" line="109"/>
<source>No errors found, nothing to save.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultsview.cpp" line="128"/>
<location filename="resultsview.cpp" line="138"/>
<location filename="resultsview.cpp" line="136"/>
<location filename="resultsview.cpp" line="146"/>
<source>Failed to save the report.</source>
<translation type="unfinished"></translation>
</message>

View File

@ -141,15 +141,15 @@ kate -l(line) (file)</translation>
<name>MainWindow</name>
<message>
<location filename="main.ui" line="26"/>
<location filename="mainwindow.cpp" line="220"/>
<location filename="mainwindow.cpp" line="483"/>
<location filename="mainwindow.cpp" line="585"/>
<location filename="mainwindow.cpp" line="603"/>
<location filename="mainwindow.cpp" line="221"/>
<location filename="mainwindow.cpp" line="500"/>
<location filename="mainwindow.cpp" line="602"/>
<location filename="mainwindow.cpp" line="620"/>
<source>Cppcheck</source>
<translation>Cppcheck</translation>
</message>
<message>
<location filename="main.ui" line="143"/>
<location filename="main.ui" line="144"/>
<source>Standard</source>
<translation>Standard</translation>
</message>
@ -159,217 +159,222 @@ kate -l(line) (file)</translation>
<translation>&amp;File</translation>
</message>
<message>
<location filename="main.ui" line="83"/>
<location filename="main.ui" line="84"/>
<source>&amp;View</source>
<translation>&amp;View</translation>
</message>
<message>
<location filename="main.ui" line="87"/>
<location filename="main.ui" line="88"/>
<source>&amp;Toolbars</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="120"/>
<location filename="main.ui" line="121"/>
<source>&amp;Check</source>
<translation>&amp;Check</translation>
</message>
<message>
<location filename="main.ui" line="129"/>
<location filename="main.ui" line="130"/>
<source>&amp;Edit</source>
<translation>&amp;Edit</translation>
</message>
<message>
<location filename="main.ui" line="174"/>
<location filename="main.ui" line="175"/>
<source>&amp;License...</source>
<translation>&amp;License...</translation>
</message>
<message>
<location filename="main.ui" line="179"/>
<location filename="main.ui" line="180"/>
<source>A&amp;uthors...</source>
<translation>A&amp;uthors...</translation>
</message>
<message>
<location filename="main.ui" line="188"/>
<location filename="main.ui" line="189"/>
<source>&amp;About...</source>
<translation>&amp;About...</translation>
</message>
<message>
<location filename="main.ui" line="193"/>
<location filename="main.ui" line="194"/>
<source>&amp;Files...</source>
<translation>&amp;Files...</translation>
</message>
<message>
<location filename="main.ui" line="196"/>
<location filename="main.ui" line="197"/>
<source>Ctrl+F</source>
<translation>Ctrl+F</translation>
</message>
<message>
<location filename="main.ui" line="205"/>
<location filename="main.ui" line="206"/>
<source>&amp;Directory...</source>
<translation>&amp;Directory...</translation>
</message>
<message>
<location filename="main.ui" line="208"/>
<location filename="main.ui" line="209"/>
<source>Ctrl+D</source>
<translation>Ctrl+D</translation>
</message>
<message>
<location filename="main.ui" line="217"/>
<location filename="main.ui" line="218"/>
<source>&amp;Recheck files</source>
<translation>&amp;Recheck files</translation>
</message>
<message>
<location filename="main.ui" line="220"/>
<location filename="main.ui" line="221"/>
<source>Ctrl+R</source>
<translation>Ctrl+R</translation>
</message>
<message>
<location filename="main.ui" line="229"/>
<location filename="main.ui" line="230"/>
<source>&amp;Stop</source>
<translation>&amp;Stop</translation>
</message>
<message>
<location filename="main.ui" line="232"/>
<location filename="main.ui" line="233"/>
<source>Esc</source>
<translation>Esc</translation>
</message>
<message>
<location filename="main.ui" line="241"/>
<location filename="main.ui" line="242"/>
<source>&amp;Save results to file...</source>
<translation>&amp;Save results to file...</translation>
</message>
<message>
<location filename="main.ui" line="244"/>
<location filename="main.ui" line="245"/>
<source>Ctrl+S</source>
<translation>Ctrl+S</translation>
</message>
<message>
<location filename="main.ui" line="249"/>
<location filename="main.ui" line="250"/>
<source>&amp;Quit</source>
<translation>&amp;Quit</translation>
</message>
<message>
<location filename="main.ui" line="258"/>
<location filename="main.ui" line="259"/>
<source>&amp;Clear results</source>
<translation>&amp;Clear results</translation>
</message>
<message>
<location filename="main.ui" line="267"/>
<location filename="main.ui" line="268"/>
<source>&amp;Preferences</source>
<translation>&amp;Preferences</translation>
</message>
<message>
<location filename="main.ui" line="279"/>
<location filename="main.ui" line="280"/>
<source>Show style errors</source>
<translation>Show style errors</translation>
</message>
<message>
<location filename="main.ui" line="291"/>
<location filename="main.ui" line="292"/>
<source>Show common errors</source>
<translation>Show common errors</translation>
</message>
<message>
<location filename="main.ui" line="296"/>
<location filename="main.ui" line="297"/>
<source>&amp;Check all</source>
<translation>&amp;Check all</translation>
</message>
<message>
<location filename="main.ui" line="301"/>
<location filename="main.ui" line="302"/>
<source>&amp;Uncheck all</source>
<translation>&amp;Uncheck all</translation>
</message>
<message>
<location filename="main.ui" line="306"/>
<location filename="main.ui" line="307"/>
<source>Collapse &amp;all</source>
<translation>Collapse &amp;all</translation>
</message>
<message>
<location filename="main.ui" line="311"/>
<location filename="main.ui" line="312"/>
<source>&amp;Expand all</source>
<translation>&amp;Expand all</translation>
</message>
<message>
<location filename="main.ui" line="319"/>
<location filename="main.ui" line="320"/>
<source>&amp;Standard</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="322"/>
<location filename="main.ui" line="323"/>
<source>Standard items</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="338"/>
<location filename="main.ui" line="339"/>
<source>Toolbar</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="346"/>
<location filename="main.ui" line="347"/>
<source>&amp;Categories</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="349"/>
<location filename="main.ui" line="350"/>
<source>Error categories</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="354"/>
<location filename="main.ui" line="355"/>
<source>&amp;Open XML...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="360"/>
<source>Open P&amp;roject File...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="359"/>
<location filename="main.ui" line="365"/>
<source>&amp;New Project File...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="327"/>
<location filename="main.ui" line="328"/>
<source>&amp;Contents</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="161"/>
<location filename="main.ui" line="162"/>
<source>Categories</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="330"/>
<location filename="main.ui" line="331"/>
<source>Open the help contents</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="333"/>
<location filename="main.ui" line="334"/>
<source>F1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="105"/>
<location filename="main.ui" line="106"/>
<source>&amp;Language</source>
<translation>&amp;Language</translation>
</message>
<message>
<location filename="main.ui" line="110"/>
<location filename="main.ui" line="111"/>
<source>&amp;Help</source>
<translation>&amp;Help</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="253"/>
<location filename="mainwindow.cpp" line="254"/>
<source>Select files to check</source>
<translation>Select files to check</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="267"/>
<location filename="mainwindow.cpp" line="268"/>
<source>Select directory to check</source>
<translation>Select directory to check</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="221"/>
<location filename="mainwindow.cpp" line="222"/>
<source>No suitable files found to check!</source>
<translation>No suitable files found to check!</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="479"/>
<location filename="mainwindow.cpp" line="496"/>
<source>Cannot exit while checking.
Stop the checking before exiting.</source>
@ -378,47 +383,53 @@ Stop the checking before exiting.</source>
Stop the checking before exiting.</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="510"/>
<location filename="mainwindow.cpp" line="527"/>
<source>License</source>
<translation>License</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="517"/>
<location filename="mainwindow.cpp" line="534"/>
<source>Authors</source>
<translation>Authors</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="525"/>
<location filename="mainwindow.cpp" line="542"/>
<source>XML files (*.xml);;Text files (*.txt);;CSV files (*.csv)</source>
<translation>XML files (*.xml);;Text files (*.txt);;CSV files (*.csv)</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="527"/>
<location filename="mainwindow.cpp" line="544"/>
<source>Save the report file</source>
<translation>Save the report file</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="535"/>
<location filename="mainwindow.cpp" line="442"/>
<location filename="mainwindow.cpp" line="552"/>
<source>XML files (*.xml)</source>
<translation>XML files (*.xml)</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="541"/>
<location filename="mainwindow.cpp" line="444"/>
<source>Open the report file</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="558"/>
<source>Text files (*.txt)</source>
<translation>Text files (*.txt)</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="547"/>
<location filename="mainwindow.cpp" line="564"/>
<source>CSV files (*.csv)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="587"/>
<location filename="mainwindow.cpp" line="604"/>
<source>Cppcheck - %1</source>
<translation>Cppcheck - %1</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="604"/>
<location filename="mainwindow.cpp" line="621"/>
<source>Failed to change the language:
%1
@ -432,12 +443,12 @@ Stop the checking before exiting.</translation>
%1</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="671"/>
<location filename="mainwindow.cpp" line="688"/>
<source>Project files (*.cppcheck);;All files(*.*)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="673"/>
<location filename="mainwindow.cpp" line="690"/>
<source>Select Project File</source>
<translation type="unfinished"></translation>
</message>
@ -547,62 +558,67 @@ Stop the checking before exiting.</translation>
<context>
<name>ResultsTree</name>
<message>
<location filename="resultstree.cpp" line="42"/>
<location filename="resultstree.cpp" line="796"/>
<location filename="resultstree.cpp" line="43"/>
<location filename="resultstree.cpp" line="828"/>
<source>File</source>
<translation>File</translation>
</message>
<message>
<location filename="resultstree.cpp" line="42"/>
<location filename="resultstree.cpp" line="796"/>
<location filename="resultstree.cpp" line="43"/>
<location filename="resultstree.cpp" line="828"/>
<source>Severity</source>
<translation>Severity</translation>
</message>
<message>
<location filename="resultstree.cpp" line="42"/>
<location filename="resultstree.cpp" line="796"/>
<location filename="resultstree.cpp" line="43"/>
<location filename="resultstree.cpp" line="828"/>
<source>Line</source>
<translation>Line</translation>
</message>
<message>
<location filename="resultstree.cpp" line="42"/>
<location filename="resultstree.cpp" line="796"/>
<location filename="resultstree.cpp" line="43"/>
<location filename="resultstree.cpp" line="828"/>
<source>Message</source>
<translation>Message</translation>
</message>
<message>
<location filename="resultstree.cpp" line="88"/>
<location filename="resultstree.cpp" line="82"/>
<source>Undefined file</source>
<translation>Undefined file</translation>
</message>
<message>
<location filename="resultstree.cpp" line="419"/>
<location filename="resultstree.cpp" line="411"/>
<source>Copy filename</source>
<translation>Copy filename</translation>
</message>
<message>
<location filename="resultstree.cpp" line="420"/>
<location filename="resultstree.cpp" line="412"/>
<source>Copy full path</source>
<translation>Copy full path</translation>
</message>
<message>
<location filename="resultstree.cpp" line="421"/>
<location filename="resultstree.cpp" line="413"/>
<source>Copy message</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="459"/>
<location filename="resultstree.cpp" line="451"/>
<source>Cppcheck</source>
<translation>Cppcheck</translation>
</message>
<message>
<location filename="resultstree.cpp" line="460"/>
<location filename="resultstree.cpp" line="452"/>
<source>Configure the text file viewer program in Cppcheck preferences/Applications.</source>
<oldsource>You can open this error by specifying applications in program&apos;s settings.</oldsource>
<translation>You can open this error by specifying applications in program&apos;s settings.</translation>
</message>
<message>
<location filename="resultstree.cpp" line="497"/>
<location filename="resultstree.cpp" line="479"/>
<source>Could not find the file!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="517"/>
<source>Could not start %1
Please check the application path and parameters are correct.</source>
@ -611,12 +627,24 @@ Please check the application path and parameters are correct.</source>
Please check the application path and parameters are correct.</translation>
</message>
<message>
<location filename="resultstree.cpp" line="661"/>
<location filename="resultstree.cpp" line="531"/>
<source>Could not find file:
%1
Please select the directory where file is located.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="538"/>
<source>Select Directory</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="693"/>
<source>style</source>
<translation>Style</translation>
</message>
<message>
<location filename="resultstree.cpp" line="665"/>
<location filename="resultstree.cpp" line="697"/>
<source>error</source>
<translation>Error</translation>
</message>
@ -624,31 +652,37 @@ Please check the application path and parameters are correct.</translation>
<context>
<name>ResultsView</name>
<message>
<location filename="resultsview.cpp" line="174"/>
<location filename="resultsview.cpp" line="186"/>
<location filename="resultsview.cpp" line="182"/>
<location filename="resultsview.cpp" line="194"/>
<source>Cppcheck</source>
<translation>Cppcheck</translation>
</message>
<message>
<location filename="resultsview.cpp" line="175"/>
<location filename="resultsview.cpp" line="183"/>
<source>No errors found.</source>
<translation>No errors found.</translation>
</message>
<message>
<location filename="resultsview.cpp" line="183"/>
<location filename="resultsview.cpp" line="191"/>
<source>Errors were found, but they are configured to be hidden.
To toggle what kind of errors are shown, open view menu.</source>
<translation>Errors were found, but they are configured to be hidden.
To toggle what kind of errors are shown, open view menu.</translation>
</message>
<message>
<location filename="resultsview.cpp" line="101"/>
<location filename="resultsview.cpp" line="240"/>
<location filename="resultsview.cpp" line="250"/>
<source>Failed to read the report.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultsview.cpp" line="109"/>
<source>No errors found, nothing to save.</source>
<translation>No errors found, nothing to save.</translation>
</message>
<message>
<location filename="resultsview.cpp" line="128"/>
<location filename="resultsview.cpp" line="138"/>
<location filename="resultsview.cpp" line="136"/>
<location filename="resultsview.cpp" line="146"/>
<source>Failed to save the report.</source>
<translation>Failed to save the report.</translation>
</message>

View File

@ -143,15 +143,15 @@ kate -l(line) (file)
<name>MainWindow</name>
<message>
<location filename="main.ui" line="26"/>
<location filename="mainwindow.cpp" line="220"/>
<location filename="mainwindow.cpp" line="483"/>
<location filename="mainwindow.cpp" line="585"/>
<location filename="mainwindow.cpp" line="603"/>
<location filename="mainwindow.cpp" line="221"/>
<location filename="mainwindow.cpp" line="500"/>
<location filename="mainwindow.cpp" line="602"/>
<location filename="mainwindow.cpp" line="620"/>
<source>Cppcheck</source>
<translation>Cppcheck</translation>
</message>
<message>
<location filename="main.ui" line="143"/>
<location filename="main.ui" line="144"/>
<source>Standard</source>
<translation>Vakio</translation>
</message>
@ -161,217 +161,222 @@ kate -l(line) (file)
<translation>&amp;Tiedosto</translation>
</message>
<message>
<location filename="main.ui" line="83"/>
<location filename="main.ui" line="84"/>
<source>&amp;View</source>
<translation>&amp;Näytä</translation>
</message>
<message>
<location filename="main.ui" line="87"/>
<location filename="main.ui" line="88"/>
<source>&amp;Toolbars</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="120"/>
<location filename="main.ui" line="121"/>
<source>&amp;Check</source>
<translation>&amp;Tarkista</translation>
</message>
<message>
<location filename="main.ui" line="129"/>
<location filename="main.ui" line="130"/>
<source>&amp;Edit</source>
<translation>&amp;Muokkaa</translation>
</message>
<message>
<location filename="main.ui" line="174"/>
<location filename="main.ui" line="175"/>
<source>&amp;License...</source>
<translation>&amp;Lisenssi...</translation>
</message>
<message>
<location filename="main.ui" line="179"/>
<location filename="main.ui" line="180"/>
<source>A&amp;uthors...</source>
<translation>&amp;Tekijät...</translation>
</message>
<message>
<location filename="main.ui" line="188"/>
<location filename="main.ui" line="189"/>
<source>&amp;About...</source>
<translation>&amp;Tietoa ohjelmasta Cppcheck...</translation>
</message>
<message>
<location filename="main.ui" line="193"/>
<location filename="main.ui" line="194"/>
<source>&amp;Files...</source>
<translation>&amp;Tiedostot...</translation>
</message>
<message>
<location filename="main.ui" line="196"/>
<location filename="main.ui" line="197"/>
<source>Ctrl+F</source>
<translation>Ctrl+F</translation>
</message>
<message>
<location filename="main.ui" line="205"/>
<location filename="main.ui" line="206"/>
<source>&amp;Directory...</source>
<translation>&amp;Hakemisto...</translation>
</message>
<message>
<location filename="main.ui" line="208"/>
<location filename="main.ui" line="209"/>
<source>Ctrl+D</source>
<translation>Ctrl+D</translation>
</message>
<message>
<location filename="main.ui" line="217"/>
<location filename="main.ui" line="218"/>
<source>&amp;Recheck files</source>
<translation>Tarkista tiedostot &amp;uudelleen</translation>
</message>
<message>
<location filename="main.ui" line="220"/>
<location filename="main.ui" line="221"/>
<source>Ctrl+R</source>
<translation>Ctrl+R</translation>
</message>
<message>
<location filename="main.ui" line="229"/>
<location filename="main.ui" line="230"/>
<source>&amp;Stop</source>
<translation>&amp;Pysäytä</translation>
</message>
<message>
<location filename="main.ui" line="232"/>
<location filename="main.ui" line="233"/>
<source>Esc</source>
<translation>Esc</translation>
</message>
<message>
<location filename="main.ui" line="241"/>
<location filename="main.ui" line="242"/>
<source>&amp;Save results to file...</source>
<translation>&amp;Tallenna tulokset tiedostoon...</translation>
</message>
<message>
<location filename="main.ui" line="244"/>
<location filename="main.ui" line="245"/>
<source>Ctrl+S</source>
<translation>Ctrl+S</translation>
</message>
<message>
<location filename="main.ui" line="249"/>
<location filename="main.ui" line="250"/>
<source>&amp;Quit</source>
<translation>&amp;Lopeta</translation>
</message>
<message>
<location filename="main.ui" line="258"/>
<location filename="main.ui" line="259"/>
<source>&amp;Clear results</source>
<translation>&amp;Tyhjennä tulokset</translation>
</message>
<message>
<location filename="main.ui" line="267"/>
<location filename="main.ui" line="268"/>
<source>&amp;Preferences</source>
<translation>&amp;Asetukset</translation>
</message>
<message>
<location filename="main.ui" line="279"/>
<location filename="main.ui" line="280"/>
<source>Show style errors</source>
<translation>Näytä tyylivirheet</translation>
</message>
<message>
<location filename="main.ui" line="291"/>
<location filename="main.ui" line="292"/>
<source>Show common errors</source>
<translation>Näytä yleiset virheet</translation>
</message>
<message>
<location filename="main.ui" line="296"/>
<location filename="main.ui" line="297"/>
<source>&amp;Check all</source>
<translation>&amp;Valitse kaikki</translation>
</message>
<message>
<location filename="main.ui" line="301"/>
<location filename="main.ui" line="302"/>
<source>&amp;Uncheck all</source>
<translation>&amp;Poista kaikista valinta</translation>
</message>
<message>
<location filename="main.ui" line="306"/>
<location filename="main.ui" line="307"/>
<source>Collapse &amp;all</source>
<translation>&amp;Pienennä kaikki</translation>
</message>
<message>
<location filename="main.ui" line="311"/>
<location filename="main.ui" line="312"/>
<source>&amp;Expand all</source>
<translation>&amp;Laajenna kaikki</translation>
</message>
<message>
<location filename="main.ui" line="319"/>
<location filename="main.ui" line="320"/>
<source>&amp;Standard</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="322"/>
<location filename="main.ui" line="323"/>
<source>Standard items</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="338"/>
<location filename="main.ui" line="339"/>
<source>Toolbar</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="346"/>
<location filename="main.ui" line="347"/>
<source>&amp;Categories</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="349"/>
<location filename="main.ui" line="350"/>
<source>Error categories</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="354"/>
<location filename="main.ui" line="355"/>
<source>&amp;Open XML...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="360"/>
<source>Open P&amp;roject File...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="359"/>
<location filename="main.ui" line="365"/>
<source>&amp;New Project File...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="327"/>
<location filename="main.ui" line="328"/>
<source>&amp;Contents</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="161"/>
<location filename="main.ui" line="162"/>
<source>Categories</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="330"/>
<location filename="main.ui" line="331"/>
<source>Open the help contents</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="333"/>
<location filename="main.ui" line="334"/>
<source>F1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="105"/>
<location filename="main.ui" line="106"/>
<source>&amp;Language</source>
<translation>&amp;Kieli</translation>
</message>
<message>
<location filename="main.ui" line="110"/>
<location filename="main.ui" line="111"/>
<source>&amp;Help</source>
<translation>&amp;Ohje</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="253"/>
<location filename="mainwindow.cpp" line="254"/>
<source>Select files to check</source>
<translation>Valitse tarkistettavat tiedostot</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="267"/>
<location filename="mainwindow.cpp" line="268"/>
<source>Select directory to check</source>
<translation>Valitse tarkistettava hakemisto</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="221"/>
<location filename="mainwindow.cpp" line="222"/>
<source>No suitable files found to check!</source>
<translation>Tarkistettavaksi sopivia tiedostoja ei löytynyt!</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="479"/>
<location filename="mainwindow.cpp" line="496"/>
<source>Cannot exit while checking.
Stop the checking before exiting.</source>
@ -380,47 +385,53 @@ Stop the checking before exiting.</source>
Lopeta tarkistus ennen ohjelman sammuttamista.</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="510"/>
<location filename="mainwindow.cpp" line="527"/>
<source>License</source>
<translation>Lisenssi</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="517"/>
<location filename="mainwindow.cpp" line="534"/>
<source>Authors</source>
<translation>Tekijät</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="525"/>
<location filename="mainwindow.cpp" line="542"/>
<source>XML files (*.xml);;Text files (*.txt);;CSV files (*.csv)</source>
<translation>XML-tiedostot (*.xml);;Tekstitiedostot (*.txt);;CSV-tiedostot (*.csv)</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="527"/>
<location filename="mainwindow.cpp" line="544"/>
<source>Save the report file</source>
<translation>Tallenna raportti</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="535"/>
<location filename="mainwindow.cpp" line="442"/>
<location filename="mainwindow.cpp" line="552"/>
<source>XML files (*.xml)</source>
<translation>XML-tiedostot (*xml)</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="541"/>
<location filename="mainwindow.cpp" line="444"/>
<source>Open the report file</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="558"/>
<source>Text files (*.txt)</source>
<translation>Tekstitiedostot (*.txt)</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="547"/>
<location filename="mainwindow.cpp" line="564"/>
<source>CSV files (*.csv)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="587"/>
<location filename="mainwindow.cpp" line="604"/>
<source>Cppcheck - %1</source>
<translation>Cppcheck - %1</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="604"/>
<location filename="mainwindow.cpp" line="621"/>
<source>Failed to change the language:
%1
@ -436,12 +447,12 @@ Lopeta tarkistus ennen ohjelman sammuttamista.</translation>
</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="671"/>
<location filename="mainwindow.cpp" line="688"/>
<source>Project files (*.cppcheck);;All files(*.*)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="673"/>
<location filename="mainwindow.cpp" line="690"/>
<source>Select Project File</source>
<translation type="unfinished"></translation>
</message>
@ -551,62 +562,67 @@ Lopeta tarkistus ennen ohjelman sammuttamista.</translation>
<context>
<name>ResultsTree</name>
<message>
<location filename="resultstree.cpp" line="42"/>
<location filename="resultstree.cpp" line="796"/>
<location filename="resultstree.cpp" line="43"/>
<location filename="resultstree.cpp" line="828"/>
<source>File</source>
<translation>Tiedosto</translation>
</message>
<message>
<location filename="resultstree.cpp" line="42"/>
<location filename="resultstree.cpp" line="796"/>
<location filename="resultstree.cpp" line="43"/>
<location filename="resultstree.cpp" line="828"/>
<source>Severity</source>
<translation>Tyyppi</translation>
</message>
<message>
<location filename="resultstree.cpp" line="42"/>
<location filename="resultstree.cpp" line="796"/>
<location filename="resultstree.cpp" line="43"/>
<location filename="resultstree.cpp" line="828"/>
<source>Line</source>
<translation>Rivi</translation>
</message>
<message>
<location filename="resultstree.cpp" line="42"/>
<location filename="resultstree.cpp" line="796"/>
<location filename="resultstree.cpp" line="43"/>
<location filename="resultstree.cpp" line="828"/>
<source>Message</source>
<translation>Virhe</translation>
</message>
<message>
<location filename="resultstree.cpp" line="88"/>
<location filename="resultstree.cpp" line="82"/>
<source>Undefined file</source>
<translation>Määrittelemätön tiedosto</translation>
</message>
<message>
<location filename="resultstree.cpp" line="419"/>
<location filename="resultstree.cpp" line="411"/>
<source>Copy filename</source>
<translation>Kopioi tiedostonimi</translation>
</message>
<message>
<location filename="resultstree.cpp" line="420"/>
<location filename="resultstree.cpp" line="412"/>
<source>Copy full path</source>
<translation>Kopioi tiedoston koko polku</translation>
</message>
<message>
<location filename="resultstree.cpp" line="421"/>
<location filename="resultstree.cpp" line="413"/>
<source>Copy message</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="459"/>
<location filename="resultstree.cpp" line="451"/>
<source>Cppcheck</source>
<translation>Cppcheck</translation>
</message>
<message>
<location filename="resultstree.cpp" line="460"/>
<location filename="resultstree.cpp" line="452"/>
<source>Configure the text file viewer program in Cppcheck preferences/Applications.</source>
<oldsource>You can open this error by specifying applications in program&apos;s settings.</oldsource>
<translation>Voit asetuksista määritellä muita ohjelmia joilla avata tämän virheen sisältävän tiedoston.</translation>
</message>
<message>
<location filename="resultstree.cpp" line="497"/>
<location filename="resultstree.cpp" line="479"/>
<source>Could not find the file!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="517"/>
<source>Could not start %1
Please check the application path and parameters are correct.</source>
@ -615,12 +631,24 @@ Please check the application path and parameters are correct.</source>
Tarkista että ohjelman polku ja parametrit ovat oikeat.</translation>
</message>
<message>
<location filename="resultstree.cpp" line="661"/>
<location filename="resultstree.cpp" line="531"/>
<source>Could not find file:
%1
Please select the directory where file is located.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="538"/>
<source>Select Directory</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="693"/>
<source>style</source>
<translation>Tyyli</translation>
</message>
<message>
<location filename="resultstree.cpp" line="665"/>
<location filename="resultstree.cpp" line="697"/>
<source>error</source>
<translation>Yleinen</translation>
</message>
@ -628,31 +656,37 @@ Tarkista että ohjelman polku ja parametrit ovat oikeat.</translation>
<context>
<name>ResultsView</name>
<message>
<location filename="resultsview.cpp" line="174"/>
<location filename="resultsview.cpp" line="186"/>
<location filename="resultsview.cpp" line="182"/>
<location filename="resultsview.cpp" line="194"/>
<source>Cppcheck</source>
<translation>Cppcheck</translation>
</message>
<message>
<location filename="resultsview.cpp" line="175"/>
<location filename="resultsview.cpp" line="183"/>
<source>No errors found.</source>
<translation>Virheitä ei löytynyt.</translation>
</message>
<message>
<location filename="resultsview.cpp" line="183"/>
<location filename="resultsview.cpp" line="191"/>
<source>Errors were found, but they are configured to be hidden.
To toggle what kind of errors are shown, open view menu.</source>
<translation>Virheitä löytyi, mutta asetuksissa kyseiset virheet on määritelty piilotettavaksi.
Määrittääksesi minkä tyyppisiä virheitä näytetään, avaa näkymä valikko.</translation>
</message>
<message>
<location filename="resultsview.cpp" line="101"/>
<location filename="resultsview.cpp" line="240"/>
<location filename="resultsview.cpp" line="250"/>
<source>Failed to read the report.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultsview.cpp" line="109"/>
<source>No errors found, nothing to save.</source>
<translation>Virheitä ei löytynyt, ei mitään tallennettavaa.</translation>
</message>
<message>
<location filename="resultsview.cpp" line="128"/>
<location filename="resultsview.cpp" line="138"/>
<location filename="resultsview.cpp" line="136"/>
<location filename="resultsview.cpp" line="146"/>
<source>Failed to save the report.</source>
<translation>Raportin tallentaminen epäonnistui.</translation>
</message>

View File

@ -141,15 +141,15 @@ kate -l(line) (file)</translation>
<name>MainWindow</name>
<message>
<location filename="main.ui" line="26"/>
<location filename="mainwindow.cpp" line="220"/>
<location filename="mainwindow.cpp" line="483"/>
<location filename="mainwindow.cpp" line="585"/>
<location filename="mainwindow.cpp" line="603"/>
<location filename="mainwindow.cpp" line="221"/>
<location filename="mainwindow.cpp" line="500"/>
<location filename="mainwindow.cpp" line="602"/>
<location filename="mainwindow.cpp" line="620"/>
<source>Cppcheck</source>
<translation>Cppcheck</translation>
</message>
<message>
<location filename="main.ui" line="143"/>
<location filename="main.ui" line="144"/>
<source>Standard</source>
<translation>Standaard</translation>
</message>
@ -159,217 +159,222 @@ kate -l(line) (file)</translation>
<translation>&amp;Bestand</translation>
</message>
<message>
<location filename="main.ui" line="83"/>
<location filename="main.ui" line="84"/>
<source>&amp;View</source>
<translation>&amp;Weergave</translation>
</message>
<message>
<location filename="main.ui" line="87"/>
<location filename="main.ui" line="88"/>
<source>&amp;Toolbars</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="120"/>
<location filename="main.ui" line="121"/>
<source>&amp;Check</source>
<translation>&amp;Controleer</translation>
</message>
<message>
<location filename="main.ui" line="129"/>
<location filename="main.ui" line="130"/>
<source>&amp;Edit</source>
<translation>Be&amp;werken</translation>
</message>
<message>
<location filename="main.ui" line="174"/>
<location filename="main.ui" line="175"/>
<source>&amp;License...</source>
<translation>&amp;Licentie...</translation>
</message>
<message>
<location filename="main.ui" line="179"/>
<location filename="main.ui" line="180"/>
<source>A&amp;uthors...</source>
<translation>A&amp;uteurs...</translation>
</message>
<message>
<location filename="main.ui" line="188"/>
<location filename="main.ui" line="189"/>
<source>&amp;About...</source>
<translation>&amp;Over...</translation>
</message>
<message>
<location filename="main.ui" line="193"/>
<location filename="main.ui" line="194"/>
<source>&amp;Files...</source>
<translation>&amp;Bestanden...</translation>
</message>
<message>
<location filename="main.ui" line="196"/>
<location filename="main.ui" line="197"/>
<source>Ctrl+F</source>
<translation>Ctrl+F</translation>
</message>
<message>
<location filename="main.ui" line="205"/>
<location filename="main.ui" line="206"/>
<source>&amp;Directory...</source>
<translation>&amp;Mappen...</translation>
</message>
<message>
<location filename="main.ui" line="208"/>
<location filename="main.ui" line="209"/>
<source>Ctrl+D</source>
<translation>Ctrl+D</translation>
</message>
<message>
<location filename="main.ui" line="217"/>
<location filename="main.ui" line="218"/>
<source>&amp;Recheck files</source>
<translation>&amp;Opnieuw controleren</translation>
</message>
<message>
<location filename="main.ui" line="220"/>
<location filename="main.ui" line="221"/>
<source>Ctrl+R</source>
<translation>Ctrl+R</translation>
</message>
<message>
<location filename="main.ui" line="229"/>
<location filename="main.ui" line="230"/>
<source>&amp;Stop</source>
<translation>&amp;Stop</translation>
</message>
<message>
<location filename="main.ui" line="232"/>
<location filename="main.ui" line="233"/>
<source>Esc</source>
<translation>Esc</translation>
</message>
<message>
<location filename="main.ui" line="241"/>
<location filename="main.ui" line="242"/>
<source>&amp;Save results to file...</source>
<translation>&amp;Resultaten opslaan...</translation>
</message>
<message>
<location filename="main.ui" line="244"/>
<location filename="main.ui" line="245"/>
<source>Ctrl+S</source>
<translation>Ctrl+S</translation>
</message>
<message>
<location filename="main.ui" line="249"/>
<location filename="main.ui" line="250"/>
<source>&amp;Quit</source>
<translation>&amp;Afsluiten</translation>
</message>
<message>
<location filename="main.ui" line="258"/>
<location filename="main.ui" line="259"/>
<source>&amp;Clear results</source>
<translation>&amp;Resultaten wissen</translation>
</message>
<message>
<location filename="main.ui" line="267"/>
<location filename="main.ui" line="268"/>
<source>&amp;Preferences</source>
<translation>&amp;Voorkeuren</translation>
</message>
<message>
<location filename="main.ui" line="279"/>
<location filename="main.ui" line="280"/>
<source>Show style errors</source>
<translation type="unfinished">Toon stijl fouten</translation>
</message>
<message>
<location filename="main.ui" line="291"/>
<location filename="main.ui" line="292"/>
<source>Show common errors</source>
<translation>Toon gewone fouten</translation>
</message>
<message>
<location filename="main.ui" line="296"/>
<location filename="main.ui" line="297"/>
<source>&amp;Check all</source>
<translation>&amp;Selecteer alles</translation>
</message>
<message>
<location filename="main.ui" line="301"/>
<location filename="main.ui" line="302"/>
<source>&amp;Uncheck all</source>
<translation>Selecteer &amp;niets</translation>
</message>
<message>
<location filename="main.ui" line="306"/>
<location filename="main.ui" line="307"/>
<source>Collapse &amp;all</source>
<translation>Alles Inkl&amp;appen</translation>
</message>
<message>
<location filename="main.ui" line="311"/>
<location filename="main.ui" line="312"/>
<source>&amp;Expand all</source>
<translation>Alles &amp;Uitklappen</translation>
</message>
<message>
<location filename="main.ui" line="319"/>
<location filename="main.ui" line="320"/>
<source>&amp;Standard</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="322"/>
<location filename="main.ui" line="323"/>
<source>Standard items</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="338"/>
<location filename="main.ui" line="339"/>
<source>Toolbar</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="346"/>
<location filename="main.ui" line="347"/>
<source>&amp;Categories</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="349"/>
<location filename="main.ui" line="350"/>
<source>Error categories</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="354"/>
<location filename="main.ui" line="355"/>
<source>&amp;Open XML...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="360"/>
<source>Open P&amp;roject File...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="359"/>
<location filename="main.ui" line="365"/>
<source>&amp;New Project File...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="327"/>
<location filename="main.ui" line="328"/>
<source>&amp;Contents</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="161"/>
<location filename="main.ui" line="162"/>
<source>Categories</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="330"/>
<location filename="main.ui" line="331"/>
<source>Open the help contents</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="333"/>
<location filename="main.ui" line="334"/>
<source>F1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="105"/>
<location filename="main.ui" line="106"/>
<source>&amp;Language</source>
<translation>&amp;Taal</translation>
</message>
<message>
<location filename="main.ui" line="110"/>
<location filename="main.ui" line="111"/>
<source>&amp;Help</source>
<translation>&amp;Help</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="253"/>
<location filename="mainwindow.cpp" line="254"/>
<source>Select files to check</source>
<translation>Selecteer bestanden om te controleren</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="267"/>
<location filename="mainwindow.cpp" line="268"/>
<source>Select directory to check</source>
<translation>Selecteer een map om te controleren</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="221"/>
<location filename="mainwindow.cpp" line="222"/>
<source>No suitable files found to check!</source>
<translation>Geen geschikte bestanden gevonden om te controleren!</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="479"/>
<location filename="mainwindow.cpp" line="496"/>
<source>Cannot exit while checking.
Stop the checking before exiting.</source>
@ -378,47 +383,53 @@ Stop the checking before exiting.</source>
Stop de controle alvorens te sluiten.</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="510"/>
<location filename="mainwindow.cpp" line="527"/>
<source>License</source>
<translation>Licentie</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="517"/>
<location filename="mainwindow.cpp" line="534"/>
<source>Authors</source>
<translation>Auteurs</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="525"/>
<location filename="mainwindow.cpp" line="542"/>
<source>XML files (*.xml);;Text files (*.txt);;CSV files (*.csv)</source>
<translation>XML bestanden (*.xml);;Tekst bestanden (*.txt);;CSV bestanden (*.csv)</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="527"/>
<location filename="mainwindow.cpp" line="544"/>
<source>Save the report file</source>
<translation>Rapport opslaan </translation>
</message>
<message>
<location filename="mainwindow.cpp" line="535"/>
<location filename="mainwindow.cpp" line="442"/>
<location filename="mainwindow.cpp" line="552"/>
<source>XML files (*.xml)</source>
<translation>XML bestanden (*.xml)</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="541"/>
<location filename="mainwindow.cpp" line="444"/>
<source>Open the report file</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="558"/>
<source>Text files (*.txt)</source>
<translation>Tekst bestanden (*.txt)</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="547"/>
<location filename="mainwindow.cpp" line="564"/>
<source>CSV files (*.csv)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="587"/>
<location filename="mainwindow.cpp" line="604"/>
<source>Cppcheck - %1</source>
<translation>Cppcheck - %1</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="604"/>
<location filename="mainwindow.cpp" line="621"/>
<source>Failed to change the language:
%1
@ -432,12 +443,12 @@ Stop de controle alvorens te sluiten.</translation>
%1</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="671"/>
<location filename="mainwindow.cpp" line="688"/>
<source>Project files (*.cppcheck);;All files(*.*)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="673"/>
<location filename="mainwindow.cpp" line="690"/>
<source>Select Project File</source>
<translation type="unfinished"></translation>
</message>
@ -547,62 +558,67 @@ Stop de controle alvorens te sluiten.</translation>
<context>
<name>ResultsTree</name>
<message>
<location filename="resultstree.cpp" line="42"/>
<location filename="resultstree.cpp" line="796"/>
<location filename="resultstree.cpp" line="43"/>
<location filename="resultstree.cpp" line="828"/>
<source>File</source>
<translation>Bestand</translation>
</message>
<message>
<location filename="resultstree.cpp" line="42"/>
<location filename="resultstree.cpp" line="796"/>
<location filename="resultstree.cpp" line="43"/>
<location filename="resultstree.cpp" line="828"/>
<source>Severity</source>
<translation>Ernst</translation>
</message>
<message>
<location filename="resultstree.cpp" line="42"/>
<location filename="resultstree.cpp" line="796"/>
<location filename="resultstree.cpp" line="43"/>
<location filename="resultstree.cpp" line="828"/>
<source>Line</source>
<translation>Regel</translation>
</message>
<message>
<location filename="resultstree.cpp" line="42"/>
<location filename="resultstree.cpp" line="796"/>
<location filename="resultstree.cpp" line="43"/>
<location filename="resultstree.cpp" line="828"/>
<source>Message</source>
<translation>Boodschap</translation>
</message>
<message>
<location filename="resultstree.cpp" line="88"/>
<location filename="resultstree.cpp" line="82"/>
<source>Undefined file</source>
<translation>Niet gedefinieerd bestand</translation>
</message>
<message>
<location filename="resultstree.cpp" line="419"/>
<location filename="resultstree.cpp" line="411"/>
<source>Copy filename</source>
<translation>Kopier bestandsnaam</translation>
</message>
<message>
<location filename="resultstree.cpp" line="420"/>
<location filename="resultstree.cpp" line="412"/>
<source>Copy full path</source>
<translation>Kopieer volledig pad</translation>
</message>
<message>
<location filename="resultstree.cpp" line="421"/>
<location filename="resultstree.cpp" line="413"/>
<source>Copy message</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="459"/>
<location filename="resultstree.cpp" line="451"/>
<source>Cppcheck</source>
<translation>Cppcheck</translation>
</message>
<message>
<location filename="resultstree.cpp" line="460"/>
<location filename="resultstree.cpp" line="452"/>
<source>Configure the text file viewer program in Cppcheck preferences/Applications.</source>
<oldsource>You can open this error by specifying applications in program&apos;s settings.</oldsource>
<translation>U dient een applicatie te configureren in de instellingen om deze fout in te openen.</translation>
</message>
<message>
<location filename="resultstree.cpp" line="497"/>
<location filename="resultstree.cpp" line="479"/>
<source>Could not find the file!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="517"/>
<source>Could not start %1
Please check the application path and parameters are correct.</source>
@ -611,12 +627,24 @@ Please check the application path and parameters are correct.</source>
Gelieve te controleren of de het pad en de parameters correct zijn.</translation>
</message>
<message>
<location filename="resultstree.cpp" line="661"/>
<location filename="resultstree.cpp" line="531"/>
<source>Could not find file:
%1
Please select the directory where file is located.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="538"/>
<source>Select Directory</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="693"/>
<source>style</source>
<translation>Stijlfouten</translation>
</message>
<message>
<location filename="resultstree.cpp" line="665"/>
<location filename="resultstree.cpp" line="697"/>
<source>error</source>
<translation>Fouten</translation>
</message>
@ -624,31 +652,37 @@ Gelieve te controleren of de het pad en de parameters correct zijn.</translation
<context>
<name>ResultsView</name>
<message>
<location filename="resultsview.cpp" line="174"/>
<location filename="resultsview.cpp" line="186"/>
<location filename="resultsview.cpp" line="182"/>
<location filename="resultsview.cpp" line="194"/>
<source>Cppcheck</source>
<translation>Cppcheck</translation>
</message>
<message>
<location filename="resultsview.cpp" line="175"/>
<location filename="resultsview.cpp" line="183"/>
<source>No errors found.</source>
<translation>Geen fouten gevonden.</translation>
</message>
<message>
<location filename="resultsview.cpp" line="183"/>
<location filename="resultsview.cpp" line="191"/>
<source>Errors were found, but they are configured to be hidden.
To toggle what kind of errors are shown, open view menu.</source>
<translation>Fouten werden gevonden, maar volgens de configuratie zijn deze verborgen.
Gebruik het uitzicht menu om te selecteren welke fouten getoond worden.</translation>
</message>
<message>
<location filename="resultsview.cpp" line="101"/>
<location filename="resultsview.cpp" line="240"/>
<location filename="resultsview.cpp" line="250"/>
<source>Failed to read the report.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultsview.cpp" line="109"/>
<source>No errors found, nothing to save.</source>
<translation>Geen fouten gevonden; geen data om op te slaan.</translation>
</message>
<message>
<location filename="resultsview.cpp" line="128"/>
<location filename="resultsview.cpp" line="138"/>
<location filename="resultsview.cpp" line="136"/>
<location filename="resultsview.cpp" line="146"/>
<source>Failed to save the report.</source>
<translation>Kon het rapport niet opslaan.</translation>
</message>

View File

@ -128,10 +128,10 @@ kate -l(line) (file)</oldsource>
<name>MainWindow</name>
<message>
<location filename="main.ui" line="26"/>
<location filename="mainwindow.cpp" line="220"/>
<location filename="mainwindow.cpp" line="483"/>
<location filename="mainwindow.cpp" line="585"/>
<location filename="mainwindow.cpp" line="603"/>
<location filename="mainwindow.cpp" line="221"/>
<location filename="mainwindow.cpp" line="500"/>
<location filename="mainwindow.cpp" line="602"/>
<location filename="mainwindow.cpp" line="620"/>
<source>Cppcheck</source>
<translation type="unfinished"></translation>
</message>
@ -141,269 +141,280 @@ kate -l(line) (file)</oldsource>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="83"/>
<location filename="main.ui" line="84"/>
<source>&amp;View</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="87"/>
<location filename="main.ui" line="88"/>
<source>&amp;Toolbars</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="105"/>
<location filename="main.ui" line="106"/>
<source>&amp;Language</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="110"/>
<location filename="main.ui" line="111"/>
<source>&amp;Help</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="120"/>
<location filename="main.ui" line="121"/>
<source>&amp;Check</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="129"/>
<location filename="main.ui" line="130"/>
<source>&amp;Edit</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="143"/>
<location filename="main.ui" line="144"/>
<source>Standard</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="174"/>
<location filename="main.ui" line="175"/>
<source>&amp;License...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="179"/>
<location filename="main.ui" line="180"/>
<source>A&amp;uthors...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="188"/>
<location filename="main.ui" line="189"/>
<source>&amp;About...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="193"/>
<location filename="main.ui" line="194"/>
<source>&amp;Files...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="196"/>
<location filename="main.ui" line="197"/>
<source>Ctrl+F</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="205"/>
<location filename="main.ui" line="206"/>
<source>&amp;Directory...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="208"/>
<location filename="main.ui" line="209"/>
<source>Ctrl+D</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="217"/>
<location filename="main.ui" line="218"/>
<source>&amp;Recheck files</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="220"/>
<location filename="main.ui" line="221"/>
<source>Ctrl+R</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="229"/>
<location filename="main.ui" line="230"/>
<source>&amp;Stop</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="232"/>
<location filename="main.ui" line="233"/>
<source>Esc</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="241"/>
<location filename="main.ui" line="242"/>
<source>&amp;Save results to file...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="244"/>
<location filename="main.ui" line="245"/>
<source>Ctrl+S</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="249"/>
<location filename="main.ui" line="250"/>
<source>&amp;Quit</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="258"/>
<location filename="main.ui" line="259"/>
<source>&amp;Clear results</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="267"/>
<location filename="main.ui" line="268"/>
<source>&amp;Preferences</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="279"/>
<location filename="main.ui" line="280"/>
<source>Show style errors</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="291"/>
<location filename="main.ui" line="292"/>
<source>Show common errors</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="296"/>
<location filename="main.ui" line="297"/>
<source>&amp;Check all</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="301"/>
<location filename="main.ui" line="302"/>
<source>&amp;Uncheck all</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="306"/>
<location filename="main.ui" line="307"/>
<source>Collapse &amp;all</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="311"/>
<location filename="main.ui" line="312"/>
<source>&amp;Expand all</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="319"/>
<location filename="main.ui" line="320"/>
<source>&amp;Standard</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="322"/>
<location filename="main.ui" line="323"/>
<source>Standard items</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="338"/>
<location filename="main.ui" line="339"/>
<source>Toolbar</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="346"/>
<location filename="main.ui" line="347"/>
<source>&amp;Categories</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="349"/>
<location filename="main.ui" line="350"/>
<source>Error categories</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="354"/>
<location filename="main.ui" line="355"/>
<source>&amp;Open XML...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="360"/>
<source>Open P&amp;roject File...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="359"/>
<location filename="main.ui" line="365"/>
<source>&amp;New Project File...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="327"/>
<location filename="main.ui" line="328"/>
<source>&amp;Contents</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="161"/>
<location filename="main.ui" line="162"/>
<source>Categories</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="330"/>
<location filename="main.ui" line="331"/>
<source>Open the help contents</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="333"/>
<location filename="main.ui" line="334"/>
<source>F1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="221"/>
<location filename="mainwindow.cpp" line="222"/>
<source>No suitable files found to check!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="253"/>
<location filename="mainwindow.cpp" line="254"/>
<source>Select files to check</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="267"/>
<location filename="mainwindow.cpp" line="268"/>
<source>Select directory to check</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="479"/>
<location filename="mainwindow.cpp" line="444"/>
<source>Open the report file</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="496"/>
<source>Cannot exit while checking.
Stop the checking before exiting.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="510"/>
<location filename="mainwindow.cpp" line="527"/>
<source>License</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="517"/>
<location filename="mainwindow.cpp" line="534"/>
<source>Authors</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="525"/>
<location filename="mainwindow.cpp" line="542"/>
<source>XML files (*.xml);;Text files (*.txt);;CSV files (*.csv)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="527"/>
<location filename="mainwindow.cpp" line="544"/>
<source>Save the report file</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="535"/>
<location filename="mainwindow.cpp" line="442"/>
<location filename="mainwindow.cpp" line="552"/>
<source>XML files (*.xml)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="541"/>
<location filename="mainwindow.cpp" line="558"/>
<source>Text files (*.txt)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="547"/>
<location filename="mainwindow.cpp" line="564"/>
<source>CSV files (*.csv)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="587"/>
<location filename="mainwindow.cpp" line="604"/>
<source>Cppcheck - %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="604"/>
<location filename="mainwindow.cpp" line="621"/>
<source>Failed to change the language:
%1
@ -412,12 +423,12 @@ Stop the checking before exiting.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="671"/>
<location filename="mainwindow.cpp" line="688"/>
<source>Project files (*.cppcheck);;All files(*.*)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="673"/>
<location filename="mainwindow.cpp" line="690"/>
<source>Select Project File</source>
<translation type="unfinished"></translation>
</message>
@ -525,73 +536,90 @@ Stop the checking before exiting.</source>
<context>
<name>ResultsTree</name>
<message>
<location filename="resultstree.cpp" line="42"/>
<location filename="resultstree.cpp" line="796"/>
<location filename="resultstree.cpp" line="43"/>
<location filename="resultstree.cpp" line="828"/>
<source>File</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="42"/>
<location filename="resultstree.cpp" line="796"/>
<location filename="resultstree.cpp" line="43"/>
<location filename="resultstree.cpp" line="828"/>
<source>Severity</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="42"/>
<location filename="resultstree.cpp" line="796"/>
<location filename="resultstree.cpp" line="43"/>
<location filename="resultstree.cpp" line="828"/>
<source>Line</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="42"/>
<location filename="resultstree.cpp" line="796"/>
<location filename="resultstree.cpp" line="43"/>
<location filename="resultstree.cpp" line="828"/>
<source>Message</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="88"/>
<location filename="resultstree.cpp" line="82"/>
<source>Undefined file</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="419"/>
<location filename="resultstree.cpp" line="411"/>
<source>Copy filename</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="420"/>
<location filename="resultstree.cpp" line="412"/>
<source>Copy full path</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="421"/>
<location filename="resultstree.cpp" line="413"/>
<source>Copy message</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="459"/>
<location filename="resultstree.cpp" line="451"/>
<source>Cppcheck</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="460"/>
<location filename="resultstree.cpp" line="452"/>
<source>Configure the text file viewer program in Cppcheck preferences/Applications.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="497"/>
<location filename="resultstree.cpp" line="479"/>
<source>Could not find the file!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="517"/>
<source>Could not start %1
Please check the application path and parameters are correct.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="661"/>
<location filename="resultstree.cpp" line="531"/>
<source>Could not find file:
%1
Please select the directory where file is located.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="538"/>
<source>Select Directory</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="693"/>
<source>style</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="665"/>
<location filename="resultstree.cpp" line="697"/>
<source>error</source>
<translation type="unfinished"></translation>
</message>
@ -599,30 +627,36 @@ Please check the application path and parameters are correct.</source>
<context>
<name>ResultsView</name>
<message>
<location filename="resultsview.cpp" line="174"/>
<location filename="resultsview.cpp" line="186"/>
<location filename="resultsview.cpp" line="182"/>
<location filename="resultsview.cpp" line="194"/>
<source>Cppcheck</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultsview.cpp" line="175"/>
<location filename="resultsview.cpp" line="183"/>
<source>No errors found.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultsview.cpp" line="183"/>
<location filename="resultsview.cpp" line="191"/>
<source>Errors were found, but they are configured to be hidden.
To toggle what kind of errors are shown, open view menu.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultsview.cpp" line="101"/>
<location filename="resultsview.cpp" line="240"/>
<location filename="resultsview.cpp" line="250"/>
<source>Failed to read the report.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultsview.cpp" line="109"/>
<source>No errors found, nothing to save.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultsview.cpp" line="128"/>
<location filename="resultsview.cpp" line="138"/>
<location filename="resultsview.cpp" line="136"/>
<location filename="resultsview.cpp" line="146"/>
<source>Failed to save the report.</source>
<translation type="unfinished"></translation>
</message>

View File

@ -131,15 +131,15 @@ kate -l(line) (file)</oldsource>
<name>MainWindow</name>
<message>
<location filename="main.ui" line="26"/>
<location filename="mainwindow.cpp" line="220"/>
<location filename="mainwindow.cpp" line="483"/>
<location filename="mainwindow.cpp" line="585"/>
<location filename="mainwindow.cpp" line="603"/>
<location filename="mainwindow.cpp" line="221"/>
<location filename="mainwindow.cpp" line="500"/>
<location filename="mainwindow.cpp" line="602"/>
<location filename="mainwindow.cpp" line="620"/>
<source>Cppcheck</source>
<translation>Cppcheck</translation>
</message>
<message>
<location filename="main.ui" line="143"/>
<location filename="main.ui" line="144"/>
<source>Standard</source>
<translation type="unfinished"></translation>
</message>
@ -149,264 +149,275 @@ kate -l(line) (file)</oldsource>
<translation>Файл</translation>
</message>
<message>
<location filename="main.ui" line="83"/>
<location filename="main.ui" line="84"/>
<source>&amp;View</source>
<translation>Вид</translation>
</message>
<message>
<location filename="main.ui" line="87"/>
<location filename="main.ui" line="88"/>
<source>&amp;Toolbars</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="120"/>
<location filename="main.ui" line="121"/>
<source>&amp;Check</source>
<translation>Проверить</translation>
</message>
<message>
<location filename="main.ui" line="129"/>
<location filename="main.ui" line="130"/>
<source>&amp;Edit</source>
<translation>Правка</translation>
</message>
<message>
<location filename="main.ui" line="174"/>
<location filename="main.ui" line="175"/>
<source>&amp;License...</source>
<translation>Лицензия...</translation>
</message>
<message>
<location filename="main.ui" line="179"/>
<location filename="main.ui" line="180"/>
<source>A&amp;uthors...</source>
<translation>Авторы...</translation>
</message>
<message>
<location filename="main.ui" line="188"/>
<location filename="main.ui" line="189"/>
<source>&amp;About...</source>
<translation>О программе...</translation>
</message>
<message>
<location filename="main.ui" line="193"/>
<location filename="main.ui" line="194"/>
<source>&amp;Files...</source>
<translation>Файлы...</translation>
</message>
<message>
<location filename="main.ui" line="196"/>
<location filename="main.ui" line="197"/>
<source>Ctrl+F</source>
<translation>Ctrl+F</translation>
</message>
<message>
<location filename="main.ui" line="205"/>
<location filename="main.ui" line="206"/>
<source>&amp;Directory...</source>
<translation>Каталог...</translation>
</message>
<message>
<location filename="main.ui" line="208"/>
<location filename="main.ui" line="209"/>
<source>Ctrl+D</source>
<translation>Ctrl+D</translation>
</message>
<message>
<location filename="main.ui" line="217"/>
<location filename="main.ui" line="218"/>
<source>&amp;Recheck files</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="220"/>
<location filename="main.ui" line="221"/>
<source>Ctrl+R</source>
<translation>Ctrl+R</translation>
</message>
<message>
<location filename="main.ui" line="229"/>
<location filename="main.ui" line="230"/>
<source>&amp;Stop</source>
<translation>Остановить</translation>
</message>
<message>
<location filename="main.ui" line="232"/>
<location filename="main.ui" line="233"/>
<source>Esc</source>
<translation>Esc</translation>
</message>
<message>
<location filename="main.ui" line="241"/>
<location filename="main.ui" line="242"/>
<source>&amp;Save results to file...</source>
<translation>Сохранить отчёт в файл...</translation>
</message>
<message>
<location filename="main.ui" line="244"/>
<location filename="main.ui" line="245"/>
<source>Ctrl+S</source>
<translation>Ctrl+S</translation>
</message>
<message>
<location filename="main.ui" line="249"/>
<location filename="main.ui" line="250"/>
<source>&amp;Quit</source>
<translation>Выход</translation>
</message>
<message>
<location filename="main.ui" line="258"/>
<location filename="main.ui" line="259"/>
<source>&amp;Clear results</source>
<translation>Очистить отчёт</translation>
</message>
<message>
<location filename="main.ui" line="267"/>
<location filename="main.ui" line="268"/>
<source>&amp;Preferences</source>
<translation>Параметры</translation>
</message>
<message>
<location filename="main.ui" line="279"/>
<location filename="main.ui" line="280"/>
<source>Show style errors</source>
<translation>Показывать ошибки стиля</translation>
</message>
<message>
<location filename="main.ui" line="291"/>
<location filename="main.ui" line="292"/>
<source>Show common errors</source>
<translation>Показывать общие ошибки</translation>
</message>
<message>
<location filename="main.ui" line="296"/>
<location filename="main.ui" line="297"/>
<source>&amp;Check all</source>
<translation>Отметить все</translation>
</message>
<message>
<location filename="main.ui" line="301"/>
<location filename="main.ui" line="302"/>
<source>&amp;Uncheck all</source>
<translation>Сбросить все</translation>
</message>
<message>
<location filename="main.ui" line="306"/>
<location filename="main.ui" line="307"/>
<source>Collapse &amp;all</source>
<translation>Свернуть все</translation>
</message>
<message>
<location filename="main.ui" line="311"/>
<location filename="main.ui" line="312"/>
<source>&amp;Expand all</source>
<translation>Развернуть все</translation>
</message>
<message>
<location filename="main.ui" line="319"/>
<location filename="main.ui" line="320"/>
<source>&amp;Standard</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="322"/>
<location filename="main.ui" line="323"/>
<source>Standard items</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="338"/>
<location filename="main.ui" line="339"/>
<source>Toolbar</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="346"/>
<location filename="main.ui" line="347"/>
<source>&amp;Categories</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="349"/>
<location filename="main.ui" line="350"/>
<source>Error categories</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="354"/>
<location filename="main.ui" line="355"/>
<source>&amp;Open XML...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="360"/>
<source>Open P&amp;roject File...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="359"/>
<location filename="main.ui" line="365"/>
<source>&amp;New Project File...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="327"/>
<location filename="main.ui" line="328"/>
<source>&amp;Contents</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="161"/>
<location filename="main.ui" line="162"/>
<source>Categories</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="330"/>
<location filename="main.ui" line="331"/>
<source>Open the help contents</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="333"/>
<location filename="main.ui" line="334"/>
<source>F1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="105"/>
<location filename="main.ui" line="106"/>
<source>&amp;Language</source>
<translation>Язык</translation>
</message>
<message>
<location filename="main.ui" line="110"/>
<location filename="main.ui" line="111"/>
<source>&amp;Help</source>
<translation>Помощь</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="253"/>
<location filename="mainwindow.cpp" line="254"/>
<source>Select files to check</source>
<translation>Выберите файлы для проверки</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="267"/>
<location filename="mainwindow.cpp" line="268"/>
<source>Select directory to check</source>
<translation>Выберите каталог для проверки</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="221"/>
<location filename="mainwindow.cpp" line="222"/>
<source>No suitable files found to check!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="479"/>
<location filename="mainwindow.cpp" line="496"/>
<source>Cannot exit while checking.
Stop the checking before exiting.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="510"/>
<location filename="mainwindow.cpp" line="527"/>
<source>License</source>
<translation>Лицензия</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="517"/>
<location filename="mainwindow.cpp" line="534"/>
<source>Authors</source>
<translation>Авторы</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="525"/>
<location filename="mainwindow.cpp" line="542"/>
<source>XML files (*.xml);;Text files (*.txt);;CSV files (*.csv)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="527"/>
<location filename="mainwindow.cpp" line="544"/>
<source>Save the report file</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="535"/>
<location filename="mainwindow.cpp" line="442"/>
<location filename="mainwindow.cpp" line="552"/>
<source>XML files (*.xml)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="541"/>
<location filename="mainwindow.cpp" line="444"/>
<source>Open the report file</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="558"/>
<source>Text files (*.txt)</source>
<translation>Текстовые файлы (*.txt)</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="547"/>
<location filename="mainwindow.cpp" line="564"/>
<source>CSV files (*.csv)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="587"/>
<location filename="mainwindow.cpp" line="604"/>
<source>Cppcheck - %1</source>
<translation>Cppcheck - %1</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="604"/>
<location filename="mainwindow.cpp" line="621"/>
<source>Failed to change the language:
%1
@ -422,12 +433,12 @@ Stop the checking before exiting.</source>
</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="671"/>
<location filename="mainwindow.cpp" line="688"/>
<source>Project files (*.cppcheck);;All files(*.*)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="673"/>
<location filename="mainwindow.cpp" line="690"/>
<source>Select Project File</source>
<translation type="unfinished"></translation>
</message>
@ -537,74 +548,91 @@ Stop the checking before exiting.</source>
<context>
<name>ResultsTree</name>
<message>
<location filename="resultstree.cpp" line="42"/>
<location filename="resultstree.cpp" line="796"/>
<location filename="resultstree.cpp" line="43"/>
<location filename="resultstree.cpp" line="828"/>
<source>File</source>
<translation>Файл</translation>
</message>
<message>
<location filename="resultstree.cpp" line="42"/>
<location filename="resultstree.cpp" line="796"/>
<location filename="resultstree.cpp" line="43"/>
<location filename="resultstree.cpp" line="828"/>
<source>Severity</source>
<translation>Важность</translation>
</message>
<message>
<location filename="resultstree.cpp" line="42"/>
<location filename="resultstree.cpp" line="796"/>
<location filename="resultstree.cpp" line="43"/>
<location filename="resultstree.cpp" line="828"/>
<source>Line</source>
<translation>Строка</translation>
</message>
<message>
<location filename="resultstree.cpp" line="42"/>
<location filename="resultstree.cpp" line="796"/>
<location filename="resultstree.cpp" line="43"/>
<location filename="resultstree.cpp" line="828"/>
<source>Message</source>
<translation>Сообщение</translation>
</message>
<message>
<location filename="resultstree.cpp" line="88"/>
<location filename="resultstree.cpp" line="82"/>
<source>Undefined file</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="419"/>
<location filename="resultstree.cpp" line="411"/>
<source>Copy filename</source>
<translation>Скопировать имя файла</translation>
</message>
<message>
<location filename="resultstree.cpp" line="420"/>
<location filename="resultstree.cpp" line="412"/>
<source>Copy full path</source>
<translation>Скопировать полный путь</translation>
</message>
<message>
<location filename="resultstree.cpp" line="421"/>
<location filename="resultstree.cpp" line="413"/>
<source>Copy message</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="459"/>
<location filename="resultstree.cpp" line="451"/>
<source>Cppcheck</source>
<translation>Cppcheck</translation>
</message>
<message>
<location filename="resultstree.cpp" line="460"/>
<location filename="resultstree.cpp" line="452"/>
<source>Configure the text file viewer program in Cppcheck preferences/Applications.</source>
<oldsource>You can open this error by specifying applications in program&apos;s settings.</oldsource>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="497"/>
<location filename="resultstree.cpp" line="479"/>
<source>Could not find the file!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="517"/>
<source>Could not start %1
Please check the application path and parameters are correct.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="661"/>
<location filename="resultstree.cpp" line="531"/>
<source>Could not find file:
%1
Please select the directory where file is located.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="538"/>
<source>Select Directory</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="693"/>
<source>style</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="665"/>
<location filename="resultstree.cpp" line="697"/>
<source>error</source>
<translation type="unfinished"></translation>
</message>
@ -612,30 +640,36 @@ Please check the application path and parameters are correct.</source>
<context>
<name>ResultsView</name>
<message>
<location filename="resultsview.cpp" line="174"/>
<location filename="resultsview.cpp" line="186"/>
<location filename="resultsview.cpp" line="182"/>
<location filename="resultsview.cpp" line="194"/>
<source>Cppcheck</source>
<translation>Cppcheck</translation>
</message>
<message>
<location filename="resultsview.cpp" line="175"/>
<location filename="resultsview.cpp" line="183"/>
<source>No errors found.</source>
<translation>Ошибок не найдено.</translation>
</message>
<message>
<location filename="resultsview.cpp" line="183"/>
<location filename="resultsview.cpp" line="191"/>
<source>Errors were found, but they are configured to be hidden.
To toggle what kind of errors are shown, open view menu.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultsview.cpp" line="101"/>
<location filename="resultsview.cpp" line="240"/>
<location filename="resultsview.cpp" line="250"/>
<source>Failed to read the report.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultsview.cpp" line="109"/>
<source>No errors found, nothing to save.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultsview.cpp" line="128"/>
<location filename="resultsview.cpp" line="138"/>
<location filename="resultsview.cpp" line="136"/>
<location filename="resultsview.cpp" line="146"/>
<source>Failed to save the report.</source>
<translation type="unfinished"></translation>
</message>

View File

@ -141,15 +141,15 @@ kate -l(line) (file)</translation>
<name>MainWindow</name>
<message>
<location filename="main.ui" line="26"/>
<location filename="mainwindow.cpp" line="220"/>
<location filename="mainwindow.cpp" line="483"/>
<location filename="mainwindow.cpp" line="585"/>
<location filename="mainwindow.cpp" line="603"/>
<location filename="mainwindow.cpp" line="221"/>
<location filename="mainwindow.cpp" line="500"/>
<location filename="mainwindow.cpp" line="602"/>
<location filename="mainwindow.cpp" line="620"/>
<source>Cppcheck</source>
<translation>Cppcheck</translation>
</message>
<message>
<location filename="main.ui" line="143"/>
<location filename="main.ui" line="144"/>
<source>Standard</source>
<translation>Standard</translation>
</message>
@ -159,265 +159,276 @@ kate -l(line) (file)</translation>
<translation>&amp;Arkiv</translation>
</message>
<message>
<location filename="main.ui" line="83"/>
<location filename="main.ui" line="84"/>
<source>&amp;View</source>
<translation>&amp;Visa</translation>
</message>
<message>
<location filename="main.ui" line="87"/>
<location filename="main.ui" line="88"/>
<source>&amp;Toolbars</source>
<translation>Verktygsfält</translation>
</message>
<message>
<location filename="main.ui" line="120"/>
<location filename="main.ui" line="121"/>
<source>&amp;Check</source>
<translation>&amp;Check</translation>
</message>
<message>
<location filename="main.ui" line="129"/>
<location filename="main.ui" line="130"/>
<source>&amp;Edit</source>
<translation>&amp;Redigera</translation>
</message>
<message>
<location filename="main.ui" line="174"/>
<location filename="main.ui" line="175"/>
<source>&amp;License...</source>
<translation>&amp;Licens...</translation>
</message>
<message>
<location filename="main.ui" line="179"/>
<location filename="main.ui" line="180"/>
<source>A&amp;uthors...</source>
<translation>&amp;Utvecklat av...</translation>
</message>
<message>
<location filename="main.ui" line="188"/>
<location filename="main.ui" line="189"/>
<source>&amp;About...</source>
<translation>&amp;Om...</translation>
</message>
<message>
<location filename="main.ui" line="193"/>
<location filename="main.ui" line="194"/>
<source>&amp;Files...</source>
<translation>&amp;Filer...</translation>
</message>
<message>
<location filename="main.ui" line="196"/>
<location filename="main.ui" line="197"/>
<source>Ctrl+F</source>
<translation>Ctrl+F</translation>
</message>
<message>
<location filename="main.ui" line="205"/>
<location filename="main.ui" line="206"/>
<source>&amp;Directory...</source>
<translation>&amp;Katalog...</translation>
</message>
<message>
<location filename="main.ui" line="208"/>
<location filename="main.ui" line="209"/>
<source>Ctrl+D</source>
<translation>Ctrl+D</translation>
</message>
<message>
<location filename="main.ui" line="217"/>
<location filename="main.ui" line="218"/>
<source>&amp;Recheck files</source>
<translation>Starta &amp;om check</translation>
</message>
<message>
<location filename="main.ui" line="220"/>
<location filename="main.ui" line="221"/>
<source>Ctrl+R</source>
<translation>Ctrl+R</translation>
</message>
<message>
<location filename="main.ui" line="229"/>
<location filename="main.ui" line="230"/>
<source>&amp;Stop</source>
<translation>&amp;Stoppa</translation>
</message>
<message>
<location filename="main.ui" line="232"/>
<location filename="main.ui" line="233"/>
<source>Esc</source>
<translation>Esc</translation>
</message>
<message>
<location filename="main.ui" line="241"/>
<location filename="main.ui" line="242"/>
<source>&amp;Save results to file...</source>
<translation>&amp;Spara resultat till fil...</translation>
</message>
<message>
<location filename="main.ui" line="244"/>
<location filename="main.ui" line="245"/>
<source>Ctrl+S</source>
<translation>Ctrl+S</translation>
</message>
<message>
<location filename="main.ui" line="249"/>
<location filename="main.ui" line="250"/>
<source>&amp;Quit</source>
<translation>&amp;Avsluta</translation>
</message>
<message>
<location filename="main.ui" line="258"/>
<location filename="main.ui" line="259"/>
<source>&amp;Clear results</source>
<translation>&amp;Töm resultat</translation>
</message>
<message>
<location filename="main.ui" line="267"/>
<location filename="main.ui" line="268"/>
<source>&amp;Preferences</source>
<translation>&amp;Inställningar</translation>
</message>
<message>
<location filename="main.ui" line="279"/>
<location filename="main.ui" line="280"/>
<source>Show style errors</source>
<translation>Visa stilvarningar</translation>
</message>
<message>
<location filename="main.ui" line="291"/>
<location filename="main.ui" line="292"/>
<source>Show common errors</source>
<translation>Visa vanliga fel</translation>
</message>
<message>
<location filename="main.ui" line="296"/>
<location filename="main.ui" line="297"/>
<source>&amp;Check all</source>
<translation>&amp;Kryssa alla</translation>
</message>
<message>
<location filename="main.ui" line="301"/>
<location filename="main.ui" line="302"/>
<source>&amp;Uncheck all</source>
<translation>Kryssa &amp;ur alla</translation>
</message>
<message>
<location filename="main.ui" line="306"/>
<location filename="main.ui" line="307"/>
<source>Collapse &amp;all</source>
<translatorcomment>Ingen bra översättning!</translatorcomment>
<translation>&amp;Fäll ihop alla</translation>
</message>
<message>
<location filename="main.ui" line="311"/>
<location filename="main.ui" line="312"/>
<source>&amp;Expand all</source>
<translation>&amp;Expandera alla</translation>
</message>
<message>
<location filename="main.ui" line="319"/>
<location filename="main.ui" line="320"/>
<source>&amp;Standard</source>
<translation>&amp;Standard</translation>
</message>
<message>
<location filename="main.ui" line="322"/>
<location filename="main.ui" line="323"/>
<source>Standard items</source>
<translation>Standard poster</translation>
</message>
<message>
<location filename="main.ui" line="338"/>
<location filename="main.ui" line="339"/>
<source>Toolbar</source>
<translation>Verktygsfält</translation>
</message>
<message>
<location filename="main.ui" line="346"/>
<location filename="main.ui" line="347"/>
<source>&amp;Categories</source>
<translation>&amp;Kategorier</translation>
</message>
<message>
<location filename="main.ui" line="349"/>
<location filename="main.ui" line="350"/>
<source>Error categories</source>
<translation>Fel kategorier</translation>
</message>
<message>
<location filename="main.ui" line="354"/>
<location filename="main.ui" line="355"/>
<source>&amp;Open XML...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="360"/>
<source>Open P&amp;roject File...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="359"/>
<location filename="main.ui" line="365"/>
<source>&amp;New Project File...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="main.ui" line="327"/>
<location filename="main.ui" line="328"/>
<source>&amp;Contents</source>
<translation>&amp;Innehåll</translation>
</message>
<message>
<location filename="main.ui" line="161"/>
<location filename="main.ui" line="162"/>
<source>Categories</source>
<translation>Kategorier</translation>
</message>
<message>
<location filename="main.ui" line="330"/>
<location filename="main.ui" line="331"/>
<source>Open the help contents</source>
<translation>Öppna hjälp</translation>
</message>
<message>
<location filename="main.ui" line="333"/>
<location filename="main.ui" line="334"/>
<source>F1</source>
<translation>F1</translation>
</message>
<message>
<location filename="main.ui" line="105"/>
<location filename="main.ui" line="106"/>
<source>&amp;Language</source>
<translation>&amp;Språk</translation>
</message>
<message>
<location filename="main.ui" line="110"/>
<location filename="main.ui" line="111"/>
<source>&amp;Help</source>
<translation>&amp;Hjälp</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="253"/>
<location filename="mainwindow.cpp" line="254"/>
<source>Select files to check</source>
<translation>Välj filer att kontrollera</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="267"/>
<location filename="mainwindow.cpp" line="268"/>
<source>Select directory to check</source>
<translation>Välj katalog som skall kontrolleras</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="221"/>
<location filename="mainwindow.cpp" line="222"/>
<source>No suitable files found to check!</source>
<translation>Inga lämpliga filer hittades!</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="479"/>
<location filename="mainwindow.cpp" line="496"/>
<source>Cannot exit while checking.
Stop the checking before exiting.</source>
<translation>Kan ej avsluta medans check pågår.</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="510"/>
<location filename="mainwindow.cpp" line="527"/>
<source>License</source>
<translation>Licens</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="517"/>
<location filename="mainwindow.cpp" line="534"/>
<source>Authors</source>
<translation>Utvecklare</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="525"/>
<location filename="mainwindow.cpp" line="542"/>
<source>XML files (*.xml);;Text files (*.txt);;CSV files (*.csv)</source>
<translation>XML filer (*.xml);;Text filer (*.txt);;CSV filer (*.csv)</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="527"/>
<location filename="mainwindow.cpp" line="544"/>
<source>Save the report file</source>
<translation>Spara rapport</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="535"/>
<location filename="mainwindow.cpp" line="442"/>
<location filename="mainwindow.cpp" line="552"/>
<source>XML files (*.xml)</source>
<translation>XML filer (*.xml)</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="541"/>
<location filename="mainwindow.cpp" line="444"/>
<source>Open the report file</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="558"/>
<source>Text files (*.txt)</source>
<translation>Text filer (*.txt)</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="547"/>
<location filename="mainwindow.cpp" line="564"/>
<source>CSV files (*.csv)</source>
<translation>CSV filer (*.csv)</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="587"/>
<location filename="mainwindow.cpp" line="604"/>
<source>Cppcheck - %1</source>
<translation>Cppcheck - %1</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="604"/>
<location filename="mainwindow.cpp" line="621"/>
<source>Failed to change the language:
%1
@ -433,12 +444,12 @@ Stop the checking before exiting.</source>
</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="671"/>
<location filename="mainwindow.cpp" line="688"/>
<source>Project files (*.cppcheck);;All files(*.*)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="673"/>
<location filename="mainwindow.cpp" line="690"/>
<source>Select Project File</source>
<translation type="unfinished"></translation>
</message>
@ -548,62 +559,67 @@ Stop the checking before exiting.</source>
<context>
<name>ResultsTree</name>
<message>
<location filename="resultstree.cpp" line="42"/>
<location filename="resultstree.cpp" line="796"/>
<location filename="resultstree.cpp" line="43"/>
<location filename="resultstree.cpp" line="828"/>
<source>File</source>
<translation>Fil</translation>
</message>
<message>
<location filename="resultstree.cpp" line="42"/>
<location filename="resultstree.cpp" line="796"/>
<location filename="resultstree.cpp" line="43"/>
<location filename="resultstree.cpp" line="828"/>
<source>Severity</source>
<translation>Typ</translation>
</message>
<message>
<location filename="resultstree.cpp" line="42"/>
<location filename="resultstree.cpp" line="796"/>
<location filename="resultstree.cpp" line="43"/>
<location filename="resultstree.cpp" line="828"/>
<source>Line</source>
<translation>Rad</translation>
</message>
<message>
<location filename="resultstree.cpp" line="42"/>
<location filename="resultstree.cpp" line="796"/>
<location filename="resultstree.cpp" line="43"/>
<location filename="resultstree.cpp" line="828"/>
<source>Message</source>
<translation>Meddelande</translation>
</message>
<message>
<location filename="resultstree.cpp" line="88"/>
<location filename="resultstree.cpp" line="82"/>
<source>Undefined file</source>
<translation>Odefinierad fil</translation>
</message>
<message>
<location filename="resultstree.cpp" line="419"/>
<location filename="resultstree.cpp" line="411"/>
<source>Copy filename</source>
<translation>Kopiera filnamn</translation>
</message>
<message>
<location filename="resultstree.cpp" line="420"/>
<location filename="resultstree.cpp" line="412"/>
<source>Copy full path</source>
<translation>Kopiera full sökväg</translation>
</message>
<message>
<location filename="resultstree.cpp" line="421"/>
<location filename="resultstree.cpp" line="413"/>
<source>Copy message</source>
<translation>Kopiera meddelande</translation>
</message>
<message>
<location filename="resultstree.cpp" line="459"/>
<location filename="resultstree.cpp" line="451"/>
<source>Cppcheck</source>
<translation>Cppcheck</translation>
</message>
<message>
<location filename="resultstree.cpp" line="460"/>
<location filename="resultstree.cpp" line="452"/>
<source>Configure the text file viewer program in Cppcheck preferences/Applications.</source>
<oldsource>You can open this error by specifying applications in program&apos;s settings.</oldsource>
<translation>Konfigurera program i inställningar/program.</translation>
</message>
<message>
<location filename="resultstree.cpp" line="497"/>
<location filename="resultstree.cpp" line="479"/>
<source>Could not find the file!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="517"/>
<source>Could not start %1
Please check the application path and parameters are correct.</source>
@ -612,12 +628,24 @@ Please check the application path and parameters are correct.</source>
Kontrollera att sökvägen och parametrarna är korrekta.</translation>
</message>
<message>
<location filename="resultstree.cpp" line="661"/>
<location filename="resultstree.cpp" line="531"/>
<source>Could not find file:
%1
Please select the directory where file is located.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="538"/>
<source>Select Directory</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultstree.cpp" line="693"/>
<source>style</source>
<translation>stil</translation>
</message>
<message>
<location filename="resultstree.cpp" line="665"/>
<location filename="resultstree.cpp" line="697"/>
<source>error</source>
<translation>fel</translation>
</message>
@ -625,31 +653,37 @@ Kontrollera att sökvägen och parametrarna är korrekta.</translation>
<context>
<name>ResultsView</name>
<message>
<location filename="resultsview.cpp" line="174"/>
<location filename="resultsview.cpp" line="186"/>
<location filename="resultsview.cpp" line="182"/>
<location filename="resultsview.cpp" line="194"/>
<source>Cppcheck</source>
<translation>Cppcheck</translation>
</message>
<message>
<location filename="resultsview.cpp" line="175"/>
<location filename="resultsview.cpp" line="183"/>
<source>No errors found.</source>
<translation>Inga fel hittades.</translation>
</message>
<message>
<location filename="resultsview.cpp" line="183"/>
<location filename="resultsview.cpp" line="191"/>
<source>Errors were found, but they are configured to be hidden.
To toggle what kind of errors are shown, open view menu.</source>
<translation>Fel hittades, men de visas ej.
För att ställa in vilka fel som skall visas använd visa menyn.</translation>
</message>
<message>
<location filename="resultsview.cpp" line="101"/>
<location filename="resultsview.cpp" line="240"/>
<location filename="resultsview.cpp" line="250"/>
<source>Failed to read the report.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="resultsview.cpp" line="109"/>
<source>No errors found, nothing to save.</source>
<translation>Inga fel hittades, ingenting att spara.</translation>
</message>
<message>
<location filename="resultsview.cpp" line="128"/>
<location filename="resultsview.cpp" line="138"/>
<location filename="resultsview.cpp" line="136"/>
<location filename="resultsview.cpp" line="146"/>
<source>Failed to save the report.</source>
<translation>Misslyckades med att spara rapporten.</translation>
</message>

View File

@ -51,19 +51,16 @@ void CsvReport::WriteFooter()
// No footer for CSV report
}
void CsvReport::WriteError(const QStringList &files, const QStringList &lines,
const QString &id, const QString &severity, const QString &msg)
void CsvReport::WriteError(const ErrorItem &error)
{
Q_UNUSED(id);
/*
Error as CSV line
gui/test.cpp,23,error,Mismatching allocation and deallocation: k
*/
QString line;
line += QString("%1,%2,").arg(files[files.size() - 1]).arg(lines[lines.size() - 1]);
line += QString("%1,%2").arg(severity).arg(msg);
line += QString("%1,%2,").arg(error.files[error.files.size() - 1]).arg(error.lines[error.lines.size() - 1]);
line += QString("%1,%2").arg(error.severity).arg(error.msg);
mTxtWriter << line << endl;
}

View File

@ -60,10 +60,9 @@ public:
/**
* @brief Write error to report.
* @param error Error data.
*/
virtual void WriteError(const QStringList &files, const QStringList &lines,
const QString &id, const QString &severity,
const QString &msg);
virtual void WriteError(const ErrorItem &error);
private:

39
gui/erroritem.cpp Normal file
View File

@ -0,0 +1,39 @@
/*
* Cppcheck - A tool for static C/C++ code analysis
* Copyright (C) 2007-2010 Daniel Marjamäki and Cppcheck team.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "erroritem.h"
ErrorItem::ErrorItem(const ErrorItem &item)
{
file = item.file;
files = item.files;
lines = item.lines;
id = item.id;
severity = item.severity;
msg = item.msg;
}
ErrorItem::ErrorItem(const ErrorLine &line)
{
file = line.file;
files.append(line.file);
lines.append(line.line.toUInt());
id = line.id;
severity = line.severity;
msg = line.msg;
}

62
gui/erroritem.h Normal file
View File

@ -0,0 +1,62 @@
/*
* Cppcheck - A tool for static C/C++ code analysis
* Copyright (C) 2007-2010 Daniel Marjamäki and Cppcheck team.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ERRORITEM_H
#define ERRORITEM_H
#include <QString>
#include <QStringList>
class ErrorLine;
/// @addtogroup GUI
/// @{
/**
* @brief A class containing error data for one error.
*/
class ErrorItem
{
public:
ErrorItem() { }
ErrorItem(const ErrorItem &item);
ErrorItem(const ErrorLine &line);
QString file;
QStringList files;
QList<unsigned int> lines;
QString id;
QString severity;
QString msg;
};
/**
* @brief A class containing error data for one shown error line.
*/
class ErrorLine
{
public:
QString file;
QString line;
QString id;
QString severity;
QString msg;
};
/// @}
#endif // ERRORITEM_H

View File

@ -51,6 +51,7 @@ HEADERS += mainwindow.h \
applicationdialog.h \
aboutdialog.h \
common.h \
erroritem.h \
fileviewdialog.h \
projectfile.h \
projectfiledialog.h \
@ -73,6 +74,7 @@ SOURCES += main.cpp \
fileviewdialog.cpp \
projectfile.cpp \
projectfiledialog.cpp \
erroritem.cpp \
report.cpp \
txtreport.cpp \
xmlreport.cpp \
@ -85,7 +87,3 @@ win32 {
LIBS += -lshlwapi -lhtmlhelp
}
# run lrelease before build
lrelease.commands = lrelease gui.pro
QMAKE_EXTRA_TARGETS += lrelease
PRE_TARGETDEPS += lrelease

View File

@ -20,6 +20,7 @@
#include <QApplication>
#include <QTextCodec>
#include <QTranslator>
#include <QMetaType>
#include "mainwindow.h"
int main(int argc, char *argv[])
@ -27,6 +28,9 @@ int main(int argc, char *argv[])
QApplication app(argc, argv);
app.setWindowIcon(QIcon(":icon.png"));
// Register this metatype that is used to transfer error info
qRegisterMetaType<QList<unsigned int>>("QList<unsigned int>");
// Set codecs so that UTF-8 strings in sources are handled correctly.
QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));

View File

@ -73,6 +73,7 @@
<property name="title">
<string>&amp;File</string>
</property>
<addaction name="mActionOpenXML"/>
<addaction name="mActionNewProjectFile"/>
<addaction name="mActionOpenProjectFile"/>
<addaction name="mActionSave"/>
@ -349,6 +350,11 @@
<string>Error categories</string>
</property>
</action>
<action name="mActionOpenXML">
<property name="text">
<string>&amp;Open XML...</string>
</property>
</action>
<action name="mActionOpenProjectFile">
<property name="text">
<string>Open P&amp;roject File...</string>

View File

@ -57,6 +57,7 @@ MainWindow::MainWindow() :
connect(mUI.mActionCheckDirectory, SIGNAL(triggered()), this, SLOT(CheckDirectory()));
connect(mUI.mActionSettings, SIGNAL(triggered()), this, SLOT(ProgramSettings()));
connect(mUI.mActionClearResults, SIGNAL(triggered()), this, SLOT(ClearResults()));
connect(mUI.mActionOpenXML, SIGNAL(triggered()), this, SLOT(OpenXML()));
connect(mUI.mActionShowStyle, SIGNAL(toggled(bool)), this, SLOT(ShowStyle(bool)));
connect(mUI.mActionShowErrors, SIGNAL(toggled(bool)), this, SLOT(ShowErrors(bool)));
@ -435,6 +436,22 @@ void MainWindow::ClearResults()
mUI.mActionSave->setEnabled(false);
}
void MainWindow::OpenXML()
{
QString selectedFilter;
QString filter(tr("XML files (*.xml)"));
QString selectedFile = QFileDialog::getOpenFileName(this,
tr("Open the report file"),
QString(),
filter,
&selectedFilter);
if (!selectedFile.isEmpty())
{
mUI.mResults->ReadErrorsXml(selectedFile);
}
}
void MainWindow::EnableCheckButtons(bool enable)
{
mUI.mActionStop->setEnabled(!enable);

View File

@ -67,6 +67,12 @@ public slots:
*/
void ClearResults();
/**
* @brief Slot to open XML report file
*
*/
void OpenXML();
/**
* @brief Show errors with type "style"
* @param checked Should errors be shown (true) or hidden (false)

View File

@ -17,6 +17,7 @@
*/
#include <QFile>
#include "erroritem.h"
#include "report.h"
Report::Report(const QString &filename, QObject * parent) :
@ -41,6 +42,17 @@ bool Report::Create()
return succeed;
}
bool Report::Open()
{
bool succeed = false;
if (!mFile.isOpen())
{
mFile.setFileName(mFilename);
succeed = mFile.open(QIODevice::ReadOnly | QIODevice::Text);
}
return succeed;
}
void Report::Close()
{
if (mFile.isOpen())

View File

@ -23,6 +23,7 @@
#include <QString>
#include <QStringList>
#include <QFile>
#include "erroritem.h"
/// @addtogroup GUI
/// @{
@ -50,6 +51,12 @@ public:
*/
virtual bool Create();
/**
* @brief Open the existing report (file).
* @return true if succeeded, false if file could not be created.
*/
virtual bool Open();
/**
* @brief Close the report (file).
*/
@ -67,10 +74,9 @@ public:
/**
* @brief Write error to report.
* @param error Error data.
*/
virtual void WriteError(const QStringList &files, const QStringList &lines,
const QString &id, const QString &severity,
const QString &msg) = 0;
virtual void WriteError(const ErrorItem &error) = 0;
protected:

View File

@ -24,14 +24,15 @@
#include <QDir>
#include <QMessageBox>
#include <QFileInfo>
#include <QFileDialog>
#include <QClipboard>
#include "erroritem.h"
#include "resultstree.h"
#include "xmlreport.h"
ResultsTree::ResultsTree(QWidget * parent) :
QTreeView(parent),
mContextItem(0),
mCheckPath(""),
mVisibleErrors(false)
{
for (int i = 0; i < SHOW_NONE; i++)
@ -67,28 +68,21 @@ QStandardItem *ResultsTree::CreateItem(const QString &name)
return item;
}
void ResultsTree::AddErrorItem(const QString &file,
const QString &severity,
const QString &message,
const QStringList &files,
const QVariantList &lines,
const QString &id)
void ResultsTree::AddErrorItem(const ErrorItem &item)
{
Q_UNUSED(file);
if (files.isEmpty())
if (item.files.isEmpty())
{
return;
}
QString realfile = StripPath(files[0], false);
QString realfile = StripPath(item.files[0], false);
if (realfile.isEmpty())
{
realfile = tr("Undefined file");
}
bool hide = !mShowTypes[SeverityToShowType(severity)];
bool hide = !mShowTypes[SeverityToShowType(item.severity)];
//if there is at least one error that is not hidden, we have a visible error
if (!hide)
@ -96,48 +90,49 @@ void ResultsTree::AddErrorItem(const QString &file,
mVisibleErrors = true;
}
ErrorLine line;
line.file = realfile;
line.id = item.id;
line.line = QString::number(item.lines[0]);
line.msg = item.msg;
line.severity = item.severity;
//Create the base item for the error and ensure it has a proper
//file item as a parent
QStandardItem *item = AddBacktraceFiles(EnsureFileItem(files[0], hide),
realfile,
lines[0].toInt(),
severity,
message,
QStandardItem *stditem = AddBacktraceFiles(EnsureFileItem(line.file, hide),
line,
hide,
SeverityToIcon(severity));
SeverityToIcon(line.severity));
if (!item)
if (!stditem)
return;
//Add user data to that item
QMap<QString, QVariant> data;
data["severity"] = SeverityToShowType(severity);
data["message"] = message;
data["file"] = files[0];
data["line"] = lines[0];
data["id"] = id;
item->setData(QVariant(data));
data["severity"] = SeverityToShowType(item.severity);
data["message"] = item.msg;
data["file"] = item.files[0];
data["line"] = QString::number(item.lines[0]);
data["id"] = item.id;
stditem->setData(QVariant(data));
//Add backtrace files as children
for (int i = 1; i < files.size() && i < lines.size(); i++)
for (int i = 1; i < item.files.size() && i < item.lines.size(); i++)
{
line.file = StripPath(item.files[i], false);
line.line = item.lines[i];
QStandardItem *child_item;
child_item = AddBacktraceFiles(item,
StripPath(files[i], false),
lines[i].toInt(),
severity,
message,
child_item = AddBacktraceFiles(stditem,
line,
hide,
":images/go-down.png");
//Add user data to that item
QMap<QString, QVariant> child_data;
child_data["severity"] = SeverityToShowType(severity);
child_data["message"] = message;
child_data["file"] = files[i];
child_data["line"] = lines[i];
child_data["id"] = id;
child_data["severity"] = SeverityToShowType(line.severity);
child_data["message"] = line.msg;
child_data["file"] = item.files[i];
child_data["line"] = line.line;
child_data["id"] = line.id;
child_item->setData(QVariant(child_data));
}
@ -150,10 +145,7 @@ void ResultsTree::AddErrorItem(const QString &file,
}
QStandardItem *ResultsTree::AddBacktraceFiles(QStandardItem *parent,
const QString &file,
const int line,
const QString &severity,
const QString &message,
const ErrorLine &item,
const bool hide,
const QString &icon)
@ -164,12 +156,12 @@ QStandardItem *ResultsTree::AddBacktraceFiles(QStandardItem *parent,
}
QList<QStandardItem*> list;
list << CreateItem(file);
list << CreateItem(tr(severity.toLatin1()));
list << CreateItem(QString("%1").arg(line));
list << CreateItem(item.file);
list << CreateItem(tr(item.severity.toLatin1()));
list << CreateItem(QString("%1").arg(item.line));
//TODO message has parameter names so we'll need changes to the core
//cppcheck so we can get proper translations
list << CreateItem(tr(message.toLatin1()));
list << CreateItem(tr(item.msg.toLatin1()));
// Check for duplicate rows and don't add them if found
for (int i = 0; i < parent->rowCount(); i++)
@ -452,7 +444,7 @@ void ResultsTree::contextMenuEvent(QContextMenuEvent * e)
void ResultsTree::StartApplication(QStandardItem *target, int application)
{
//If there are now application's specified, tell the user about it
//If there are no applications specified, tell the user about it
if (mApplications->GetApplicationCount() == 0)
{
QMessageBox msg(QMessageBox::Information,
@ -476,6 +468,34 @@ void ResultsTree::StartApplication(QStandardItem *target, int application)
//Replace (file) with filename
QString file = data["file"].toString();
QFileInfo info(file);
if (!info.exists())
{
if (info.isAbsolute())
{
QMessageBox msgbox(this);
msgbox.setWindowTitle("Cppcheck");
msgbox.setText(tr("Could not find the file!"));
msgbox.setIcon(QMessageBox::Critical);
msgbox.exec();
}
else
{
QDir checkdir(mCheckPath);
if (checkdir.isAbsolute() && checkdir.exists())
{
file = mCheckPath + "/" + file;
}
else
{
QString dir = AskFileDir(file);
dir += '/';
file = dir + file;
}
}
}
if (file.indexOf(" ") > -1)
{
file.insert(0, "\"");
@ -506,6 +526,22 @@ void ResultsTree::StartApplication(QStandardItem *target, int application)
}
}
QString ResultsTree::AskFileDir(const QString &file)
{
QString text = tr("Could not find file:\n%1\nPlease select the directory where file is located.").arg(file);
QMessageBox msgbox(this);
msgbox.setWindowTitle("Cppcheck");
msgbox.setText(text);
msgbox.setIcon(QMessageBox::Warning);
msgbox.exec();
QString dir = QFileDialog::getExistingDirectory(this, tr("Select Directory"),
"",
QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
mCheckPath = dir;
return dir;
}
void ResultsTree::CopyFilename()
{
CopyPath(mContextItem, false);
@ -601,8 +637,6 @@ void ResultsTree::SaveErrors(Report *report, QStandardItem *item)
return;
}
//qDebug() << item->text() << "has" << item->rowCount() << "errors";
for (int i = 0; i < item->rowCount(); i++)
{
QStandardItem *error = item->child(i, 0);
@ -622,17 +656,15 @@ void ResultsTree::SaveErrors(Report *report, QStandardItem *item)
//Convert it to QVariantMap
QVariantMap data = userdata.toMap();
QString severity = ShowTypeToString(VariantToShowType(data["severity"]));
QString message = data["message"].toString();
QString id = data["id"].toString();
ErrorItem item;
item.severity = ShowTypeToString(VariantToShowType(data["severity"]));
item.msg = data["message"].toString();
item.id = data["id"].toString();
QString file = StripPath(data["file"].toString(), true);
QString line = data["line"].toString();
unsigned int line = data["line"].toUInt();
QStringList files;
QStringList lines;
files << file;
lines << line;
item.files << file;
item.lines << line;
for (int j = 0; j < error->rowCount(); j++)
{
@ -643,13 +675,13 @@ void ResultsTree::SaveErrors(Report *report, QStandardItem *item)
QVariantMap child_data = child_userdata.toMap();
file = StripPath(child_data["file"].toString(), true);
line = child_data["line"].toString();
line = child_data["line"].toUInt();
files << file;
lines << line;
item.files << file;
item.lines << line;
}
report->WriteError(files, lines, id, severity, message);
report->WriteError(item);
}
}

View File

@ -25,11 +25,13 @@
#include <QStandardItem>
#include <QSettings>
#include <QContextMenuEvent>
#include <QTextStream>
#include "common.h"
#include "applicationlist.h"
#include <QTextStream>
class Report;
class ErrorItem;
class ErrorLine;
/// @addtogroup GUI
/// @{
@ -50,19 +52,9 @@ public:
/**
* @brief Add a new item to the tree
*
* @param file filename
* @param severity error severity
* @param message error message
* @param files list of files affected by the error
* @param lines list of file line numers affected by the error
* @param id error id
* @param item Error item data
*/
void AddErrorItem(const QString &file,
const QString &severity,
const QString &message,
const QStringList &files,
const QVariantList &lines,
const QString &id);
void AddErrorItem(const ErrorItem &item);
/**
* @brief Clear all errors from the tree
@ -224,19 +216,13 @@ protected:
* @brief Add a new error item beneath a file or a backtrace item beneath an error
*
* @param parent Parent for the item. Either a file item or an error item
* @param file Filename of the error
* @param line Line numer
* @param severity Error severity
* @param message Error message
* @param item Error line data
* @param hide Should this be hidden (true) or shown (false)
* @param icon Should a default backtrace item icon be added
* @return newly created QStandardItem *
*/
QStandardItem *AddBacktraceFiles(QStandardItem *parent,
const QString &file,
const int line,
const QString &severity,
const QString &message,
const ErrorLine &item,
const bool hide,
const QString &icon);
@ -276,6 +262,12 @@ protected:
*/
void LoadSettings();
/**
* @brief Ask directory where file is located.
* @param file File name.
* @return Directory user chose.
*/
QString AskFileDir(const QString &file);
/**
* @brief Create a new QStandardItem

View File

@ -70,11 +70,19 @@ void ResultsView::Error(const QString &file,
const QString &severity,
const QString &message,
const QStringList &files,
const QVariantList &lines,
const QList<unsigned int> &lines,
const QString &id)
{
mErrorsFound = true;
mUI.mTree->AddErrorItem(file, severity, message, files, lines, id);
ErrorItem item;
item.file = file;
item.files = files;
item.id = id;
item.lines = lines;
item.msg = message;
item.severity = severity;
mUI.mTree->AddErrorItem(item);
emit GotResults();
}
@ -217,3 +225,38 @@ void ResultsView::DisableProgressbar()
{
mUI.mProgress->setEnabled(false);
}
void ResultsView::ReadErrorsXml(const QString &filename)
{
XmlReport *report = new XmlReport(filename, this);
QList<ErrorLine> errors;
if (report)
{
if (report->Open())
errors = report->Read();
else
{
QMessageBox msgBox;
msgBox.setText(tr("Failed to read the report."));
msgBox.setIcon(QMessageBox::Critical);
msgBox.exec();
}
delete report;
report = NULL;
}
else
{
QMessageBox msgBox;
msgBox.setText(tr("Failed to read the report."));
msgBox.setIcon(QMessageBox::Critical);
msgBox.exec();
}
ErrorLine line;
foreach(line, errors)
{
ErrorItem item(line);
mUI.mTree->AddErrorItem(item);
}
mUI.mTree->SetCheckDirectory("");
}

View File

@ -129,6 +129,14 @@ public:
void Translate();
void DisableProgressbar();
/**
* @brief Read errors from report XML file.
* @param filename Report file to read.
*
*/
void ReadErrorsXml(const QString &filename);
signals:
/**
@ -161,7 +169,7 @@ public slots:
const QString &severity,
const QString &message,
const QStringList &files,
const QVariantList &lines,
const QList<unsigned int> &lines,
const QString &id);
/**

View File

@ -145,13 +145,13 @@ void ThreadHandler::Initialize(ResultsView *view)
const QString &,
const QString &,
const QStringList &,
const QVariantList &,
const QList<unsigned int> &,
const QString &)),
view, SLOT(Error(const QString &,
const QString &,
const QString &,
const QStringList &,
const QVariantList &,
const QList<unsigned int> &,
const QString &)));
}

View File

@ -47,7 +47,7 @@ void ThreadResult::reportErr(const ErrorLogger::ErrorMessage &msg)
{
QMutexLocker locker(&mutex);
QVariantList lines;
QList<unsigned int> lines;
QStringList files;
for (std::list<ErrorLogger::ErrorMessage::FileLocation>::const_iterator tok = msg._callStack.begin();

View File

@ -98,7 +98,7 @@ signals:
const QString &severity,
const QString &message,
const QStringList &files,
const QVariantList &lines,
const QList<unsigned int> &lines,
const QString &id);
protected:

View File

@ -51,11 +51,8 @@ void TxtReport::WriteFooter()
// No footer for txt report
}
void TxtReport::WriteError(const QStringList &files, const QStringList &lines,
const QString &id, const QString &severity, const QString &msg)
void TxtReport::WriteError(const ErrorItem &error)
{
Q_UNUSED(id);
/*
Error example from the core program in text
[gui/test.cpp:23] -> [gui/test.cpp:14]: (error) Mismatching allocation and deallocation: k
@ -63,21 +60,21 @@ void TxtReport::WriteError(const QStringList &files, const QStringList &lines,
QString line;
for (int i = 0; i < lines.size(); i++)
for (int i = 0; i < error.lines.size(); i++)
{
line += QString("[%1:%2]").arg(files[i]).arg(lines[i]);
if (i < lines.size() - 1 && lines.size() > 0)
line += QString("[%1:%2]").arg(error.files[i]).arg(error.lines[i]);
if (i < error.lines.size() - 1 && error.lines.size() > 0)
{
line += " -> ";
}
if (i == lines.size() - 1)
if (i == error.lines.size() - 1)
{
line += ": ";
}
}
line += QString("(%1) %2").arg(severity).arg(msg);
line += QString("(%1) %2").arg(error.severity).arg(error.msg);
mTxtWriter << line << endl;
}

View File

@ -58,10 +58,9 @@ public:
/**
* @brief Write error to report.
* @param error Error data.
*/
virtual void WriteError(const QStringList &files, const QStringList &lines,
const QString &id, const QString &severity,
const QString &msg);
virtual void WriteError(const ErrorItem &error);
private:

View File

@ -18,15 +18,29 @@
#include <QFile>
#include <QXmlStreamWriter>
#include <qdebug>
#include "erroritem.h"
#include "xmlreport.h"
static const char ResultElementName[] = "results";
static const char ErrorElementName[] = "error";
static const char FilenameAttribute[] = "file";
static const char LineAttribute[] = "line";
static const char IdAttribute[] = "id";
static const char SeverityAttribute[] = "severity";
static const char MsgAttribute[] = "msg";
XmlReport::XmlReport(const QString &filename, QObject * parent) :
Report(filename, parent)
Report(filename, parent),
mXmlReader(NULL),
mXmlWriter(NULL)
{
}
XmlReport::~XmlReport()
{
delete mXmlReader;
delete mXmlWriter;
Close();
}
@ -35,7 +49,18 @@ bool XmlReport::Create()
bool success = false;
if (Report::Create())
{
mXmlWriter.setDevice(Report::GetFile());
mXmlWriter = new QXmlStreamWriter(Report::GetFile());
success = true;
}
return success;
}
bool XmlReport::Open()
{
bool success = false;
if (Report::Open())
{
mXmlReader = new QXmlStreamReader(Report::GetFile());
success = true;
}
return success;
@ -43,19 +68,18 @@ bool XmlReport::Create()
void XmlReport::WriteHeader()
{
mXmlWriter.setAutoFormatting(true);
mXmlWriter.writeStartDocument();
mXmlWriter.writeStartElement("results");
mXmlWriter->setAutoFormatting(true);
mXmlWriter->writeStartDocument();
mXmlWriter->writeStartElement(ResultElementName);
}
void XmlReport::WriteFooter()
{
mXmlWriter.writeEndElement();
mXmlWriter.writeEndDocument();
mXmlWriter->writeEndElement();
mXmlWriter->writeEndDocument();
}
void XmlReport::WriteError(const QStringList &files, const QStringList &lines,
const QString &id, const QString &severity, const QString &msg)
void XmlReport::WriteError(const ErrorItem &error)
{
/*
Error example from the core program in xml
@ -63,11 +87,73 @@ void XmlReport::WriteError(const QStringList &files, const QStringList &lines,
The callstack seems to be ignored here aswell, instead last item of the stack is used
*/
mXmlWriter.writeStartElement("error");
mXmlWriter.writeAttribute("file", files[files.size() - 1]);
mXmlWriter.writeAttribute("line", lines[lines.size() - 1]);
mXmlWriter.writeAttribute("id", id);
mXmlWriter.writeAttribute("severity", severity);
mXmlWriter.writeAttribute("msg", msg);
mXmlWriter.writeEndElement();
mXmlWriter->writeStartElement(ErrorElementName);
mXmlWriter->writeAttribute(FilenameAttribute, error.files[error.files.size() - 1]);
const QString line = QString::number(error.lines[error.lines.size() - 1]);
mXmlWriter->writeAttribute(LineAttribute, line);
mXmlWriter->writeAttribute(IdAttribute, error.id);
mXmlWriter->writeAttribute(SeverityAttribute, error.severity);
mXmlWriter->writeAttribute(MsgAttribute, error.msg);
mXmlWriter->writeEndElement();
}
QList<ErrorLine> XmlReport::Read()
{
QList<ErrorLine> errors;
bool insideResults = false;
if (!mXmlReader)
{
qDebug() << "You must Open() the file before reading it!";
return errors;
}
while (!mXmlReader->atEnd())
{
switch (mXmlReader->readNext())
{
case QXmlStreamReader::StartElement:
if (mXmlReader->name() == ResultElementName)
insideResults = true;
// Read error element from inside result element
if (insideResults && mXmlReader->name() == ErrorElementName)
{
ErrorLine line = ReadError(mXmlReader);
errors.append(line);
}
break;
case QXmlStreamReader::EndElement:
if (mXmlReader->name() == ResultElementName)
insideResults = false;
break;
// Not handled
case QXmlStreamReader::NoToken:
case QXmlStreamReader::Invalid:
case QXmlStreamReader::StartDocument:
case QXmlStreamReader::EndDocument:
case QXmlStreamReader::Characters:
case QXmlStreamReader::Comment:
case QXmlStreamReader::DTD:
case QXmlStreamReader::EntityReference:
case QXmlStreamReader::ProcessingInstruction:
break;
}
}
return errors;
}
ErrorLine XmlReport::ReadError(QXmlStreamReader *reader)
{
ErrorLine line;
if (reader->name().toString() == ErrorElementName)
{
QXmlStreamAttributes attribs = reader->attributes();
line.file = attribs.value("", FilenameAttribute).toString();
line.line = attribs.value("", LineAttribute).toString();
line.id = attribs.value("", IdAttribute).toString();
line.severity = attribs.value("", SeverityAttribute).toString();
line.msg = attribs.value("", MsgAttribute).toString();
}
return line;
}

View File

@ -23,6 +23,7 @@
#include <QString>
#include <QStringList>
#include <QFile>
#include <QXmlStreamReader>
#include <QXmlStreamWriter>
#include "report.h"
@ -47,6 +48,11 @@ public:
*/
virtual bool Create();
/**
* @brief Open existing report file.
*/
bool Open();
/**
* @brief Write report header.
*/
@ -59,16 +65,32 @@ public:
/**
* @brief Write error to report.
* @param error Error data.
*/
virtual void WriteError(const QStringList &files, const QStringList &lines,
const QString &id, const QString &severity, const QString &msg);
virtual void WriteError(const ErrorItem &error);
/**
* @brief Read contents of the report file.
*/
QList<ErrorLine> Read();
protected:
/**
* @brief Read and parse error item from XML stream.
* @param reader XML stream reader to use.
*/
ErrorLine ReadError(QXmlStreamReader *reader);
private:
/**
* @brief XML stream reader for reading the report in XML format.
*/
QXmlStreamReader *mXmlReader;
/**
* @brief XML stream writer for writing the report in XML format.
*/
QXmlStreamWriter mXmlWriter;
QXmlStreamWriter *mXmlWriter;
};
/// @}
#endif // XML_REPORT_H

View File

@ -340,7 +340,7 @@ void CheckMemoryLeak::memleakError(const Token *tok, const std::string &varname)
void CheckMemoryLeak::memleakUponReallocFailureError(const Token *tok, const std::string &varname)
{
reportErr(tok, Severity::error, "memleakOnRealloc", "Memory leak: \"" + varname + "\" nulled but not freed upon failure");
reportErr(tok, Severity::error, "memleakOnRealloc", "Common realloc mistake: \"" + varname + "\" nulled but not freed upon failure");
}
void CheckMemoryLeak::resourceLeakError(const Token *tok, const std::string &varname)

View File

@ -565,7 +565,7 @@ public:
void use(unsigned int varid);
void modified(unsigned int varid);
VariableUsage *find(unsigned int varid);
void alias(unsigned int varid1, unsigned int varid2);
void alias(unsigned int varid1, unsigned int varid2, bool replace);
void erase(unsigned int varid)
{
_varUsage.erase(varid);
@ -578,21 +578,30 @@ private:
VariableMap _varUsage;
};
void Variables::alias(unsigned int varid1, unsigned int varid2)
/**
* Alias the 2 given variables. Either replace the existing aliases if
* they exist or merge them. You would replace an existing alias when this
* assignment is in the same scope as the previous assignment. You might
* merge the aliases when this assignment is in a different scope from the
* previous assignment depending on the relationship of the 2 scopes.
*/
void Variables::alias(unsigned int varid1, unsigned int varid2, bool replace)
{
VariableUsage *var1 = find(varid1);
VariableUsage *var2 = find(varid2);
// alias to self
if (varid1 == varid2)
{
VariableUsage *var = find(varid1);
if (var)
var->use();
if (var1)
var1->use();
return;
}
std::set<unsigned int>::iterator i;
VariableUsage *var1 = find(varid1);
if (replace)
{
// remove var1 from all aliases
for (i = var1->_aliases.begin(); i != var1->_aliases.end(); ++i)
{
@ -604,8 +613,7 @@ void Variables::alias(unsigned int varid1, unsigned int varid2)
// remove all aliases from var1
var1->_aliases.clear();
VariableUsage *var2 = find(varid2);
}
// var1 gets all var2s aliases
for (i = var2->_aliases.begin(); i != var2->_aliases.end(); ++i)
@ -895,6 +903,12 @@ static int doAssignment(Variables &variables, const Token *tok, bool dereference
next = start + 5 + offset;
}
// check for var ? ...
else if (Token::Match(tok->tokAt(start), "%var% ?"))
{
next = start;
}
// no cast
else
{
@ -925,13 +939,22 @@ static int doAssignment(Variables &variables, const Token *tok, bool dereference
var2->_type == Variables::array ||
var2->_type == Variables::pointer)
{
variables.alias(varid1, varid2);
bool replace = true;
variables.alias(varid1, varid2, replace);
}
else if (tok->tokAt(next + 1)->str() == "?")
{
if (var2->_type == Variables::reference)
variables.readAliases(varid2);
else
variables.read(varid2);
}
}
}
else if (var1->_type == Variables::reference)
{
variables.alias(varid1, varid2);
variables.alias(varid1, varid2, true);
}
else
{

View File

@ -123,6 +123,10 @@ void CheckStl::iterators()
{
eraseByValueError(tok2, tok2->strAt(0), tok2->strAt(5));
}
else if (Token::Match(tok2, "return|break ;"))
{
validIterator = true;
}
}
}
}

View File

@ -30,21 +30,6 @@
// FUNCTION USAGE - Check for unused functions etc
//---------------------------------------------------------------------------
CheckUnusedFunctions::CheckUnusedFunctions(ErrorLogger *errorLogger)
{
_errorLogger = errorLogger;
}
CheckUnusedFunctions::~CheckUnusedFunctions()
{
}
void CheckUnusedFunctions::setErrorLogger(ErrorLogger *errorLogger)
{
_errorLogger = errorLogger;
}
void CheckUnusedFunctions::parseTokens(const Tokenizer &tokenizer)
{
// Function declarations..
@ -166,7 +151,7 @@ void CheckUnusedFunctions::parseTokens(const Tokenizer &tokenizer)
void CheckUnusedFunctions::check()
void CheckUnusedFunctions::check(ErrorLogger * const errorLogger)
{
for (std::map<std::string, FunctionUsage>::const_iterator it = _functions.begin(); it != _functions.end(); ++it)
{
@ -182,7 +167,7 @@ void CheckUnusedFunctions::check()
filename = "";
else
filename = func.filename;
_errorLogger->unusedFunction(filename, it->first);
unusedFunctionError(errorLogger, filename, it->first);
}
else if (! func.usedOtherFile)
{
@ -196,7 +181,20 @@ void CheckUnusedFunctions::check()
}
}
void CheckUnusedFunctions::unusedFunctionError(const Token *tok)
void CheckUnusedFunctions::unusedFunctionError(ErrorLogger * const errorLogger, const std::string &filename, const std::string &funcname)
{
reportError(tok, Severity::style, "unusedFunction", "The function 'funcName' is never used");
std::list<ErrorLogger::ErrorMessage::FileLocation> locationList;
if (!filename.empty())
{
ErrorLogger::ErrorMessage::FileLocation fileLoc;
fileLoc.file = filename;
fileLoc.line = 1;
locationList.push_back(fileLoc);
}
const ErrorLogger::ErrorMessage errmsg(locationList, Severity::stringify(Severity::style), "The function '" + funcname + "' is never used", "unusedFunction");
if (errorLogger)
errorLogger->reportErr(errmsg);
else
reportError(errmsg);
}

View File

@ -32,35 +32,33 @@
class CheckUnusedFunctions: public Check
{
public:
CheckUnusedFunctions(ErrorLogger *errorLogger = 0);
~CheckUnusedFunctions();
/** @brief This constructor is used when registering the CheckUnusedFunctions */
CheckUnusedFunctions() : Check()
{ }
/**
* Errors found by this class are forwarded to the given
* errorlogger.
* @param errorLogger The errorlogger to be used.
*/
void setErrorLogger(ErrorLogger *errorLogger);
/** @brief This constructor is used when running checks. */
CheckUnusedFunctions(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger)
: Check(tokenizer, settings, errorLogger)
{ }
// Parse current tokens and determine..
// * Check what functions are used
// * What functions are declared
void parseTokens(const Tokenizer &tokenizer);
void check();
void check(ErrorLogger * const errorLogger);
private:
void getErrorMessages()
{
unusedFunctionError(0);
unusedFunctionError(0, "", "funcName");
}
/**
* Dummy implementation, just to provide error for --errorlist
*/
void unusedFunctionError(const Token *tok);
void unusedFunctionError(ErrorLogger * const errorLogger, const std::string &filename, const std::string &funcname);
/**
* Dummy implementation, just to provide error for --errorlist
@ -80,9 +78,6 @@ private:
return "Check for functions that are never called\n";
}
ErrorLogger *_errorLogger;
class FunctionUsage
{
public:

View File

@ -202,7 +202,7 @@ void CppCheck::clearFiles()
const char * CppCheck::version()
{
return "1.43";
return "1.44";
}
@ -624,7 +624,6 @@ unsigned int CppCheck::check()
{
exitcode = 0;
_checkUnusedFunctions.setErrorLogger(this);
std::sort(_filenames.begin(), _filenames.end());
// TODO: Should this be moved out to its own function so all the files can be
@ -728,7 +727,7 @@ unsigned int CppCheck::check()
if (_settings._errorsOnly == false)
_errorLogger.reportOut("Checking usage of global functions..");
_checkUnusedFunctions.check();
_checkUnusedFunctions.check(this);
}
_errorList.clear();

View File

@ -162,17 +162,6 @@ public:
return true;
}
void unusedFunction(const std::string &filename, const std::string &funcname)
{
std::list<ErrorLogger::ErrorMessage::FileLocation> loc;
ErrorLogger::ErrorMessage::FileLocation fileLoc;
fileLoc.file = filename;
fileLoc.line = 1;
loc.push_back(fileLoc);
reportErr(ErrorLogger::ErrorMessage(loc, "style", "The function '" + funcname + "' is never used", "unusedFunction"));
}
static bool mismatchAllocDealloc()
{
return true;

View File

@ -183,6 +183,13 @@ static void checkExecutionPaths_(const Token *tok, std::list<ExecutionPath *> &c
return;
}
// ?: => bailout
if (tok->str() == "?")
{
ExecutionPath::bailOut(checks);
return;
}
if (tok->str() == "switch")
{
const Token *tok2 = tok->next()->link();

View File

@ -22,6 +22,8 @@
#include <fstream>
#include <sstream>
#include <stdexcept>
#include <iostream>
#include <cctype> // std::isdigit, std::isalnum, etc
Settings::Settings()
{
@ -43,8 +45,19 @@ Settings::Settings()
bool Settings::Suppressions::parseFile(std::istream &istr)
{
// Change '\r' to '\n' in the istr
std::string filedata;
std::string line;
while (getline(istr, line))
while (std::getline(istr, line))
filedata += line + "\n";
while (filedata.find("\r") != std::string::npos)
filedata[filedata.find("\r")] = '\n';
bool ret = true;
// Parse filedata..
std::istringstream istr2(filedata);
while (std::getline(istr2, line))
{
// Skip empty lines
if (line.empty())
@ -63,16 +76,38 @@ bool Settings::Suppressions::parseFile(std::istream &istr)
}
// We could perhaps check if the id is valid and return error if it is not
addSuppression(id, file, lineNumber);
ret &= addSuppression(id, file, lineNumber);
}
return true;
return ret;
}
void Settings::Suppressions::addSuppression(const std::string &errorId, const std::string &file, unsigned int line)
bool Settings::Suppressions::addSuppression(const std::string &errorId, const std::string &file, unsigned int line)
{
// Check that errorId is valid..
if (errorId.empty())
{
std::cerr << "Failed to add suppression. No id." << std::endl;
return false;
}
for (std::string::size_type pos = 0; pos < errorId.length(); ++pos)
{
if (errorId[pos] < 0 || !std::isalnum(errorId[pos]))
{
std::cerr << "Failed to add suppression. Invalid id \"" << errorId << "\"" << std::endl;
return false;
}
if (pos == 0 && std::isdigit(errorId[pos]))
{
std::cerr << "Failed to add suppression. Invalid id \"" << errorId << "\"" << std::endl;
return false;
}
}
_suppressions[errorId][file].push_back(line);
_suppressions[errorId][file].sort();
return true;
}
bool Settings::Suppressions::isSuppressed(const std::string &errorId, const std::string &file, unsigned int line)

View File

@ -145,8 +145,9 @@ public:
* @param errorId the id for the error, e.g. "arrayIndexOutOfBounds"
* @param file File name with the path, e.g. "src/main.cpp"
* @param line number, e.g. "123"
* @return true on success, false in syntax error is noticed.
*/
void addSuppression(const std::string &errorId, const std::string &file = "", unsigned int line = 0);
bool addSuppression(const std::string &errorId, const std::string &file = "", unsigned int line = 0);
/**
* @brief Returns true if this message should not be shown to the user.

View File

@ -97,25 +97,26 @@ man(1), man(7), http://www.tldp.org/HOWTO/Man-Page/
</refmeta>
<refnamediv>
<refname>&dhpackage;</refname>
<refpurpose>Simple syntax checking of C/C++.</refpurpose>
<refpurpose>Tool for static C/C++ code analysis</refpurpose>
</refnamediv>
<refsynopsisdiv>
<cmdsynopsis>
<command>&dhpackage;</command>
<arg choice="opt"><option>--append [file]</option></arg>
<arg choice="opt"><option>--append=[file]</option></arg>
<arg choice="opt"><option>-D[id]</option></arg>
<arg choice="opt"><option>--enable=[id]</option></arg>
<arg choice="opt"><option>--error-exitcode=[n]</option></arg>
<arg choice="opt"><option>--exitcode-suppressions [file]</option></arg>
<arg choice="opt"><option>--file-list=file</option></arg>
<arg choice="opt"><option>--force</option></arg>
<arg choice="opt"><option>--help</option></arg>
<arg choice="opt"><option>-I[dir]</option></arg>
<arg choice="opt"><option>--inline-suppr</option></arg>
<arg choice="opt"><option>-j[jobs]</option></arg>
<arg choice="opt"><option>--quiet</option></arg>
<arg choice="opt"><option>--style</option></arg>
<arg choice="opt"><option>--suppressions [file]</option></arg>
<arg choice="opt"><option>--template ['text']</option></arg>
<arg choice="opt"><option>--unused-functions</option></arg>
<arg choice="opt"><option>--template '[text]'</option></arg>
<arg choice="opt"><option>--verbose</option></arg>
<arg choice="opt"><option>--version</option></arg>
<arg choice="opt"><option>--xml</option></arg>
@ -125,10 +126,13 @@ man(1), man(7), http://www.tldp.org/HOWTO/Man-Page/
</refsynopsisdiv>
<refsect1 id="description">
<title>DESCRIPTION</title>
<para>Tool for static C/C++ code analysis
intended to complement the checking of the compiler.
Checks for: memory leaks, mismatching allocation-deallocation,
buffer overrun, and many more.</para>
<para>Cppcheck is a command-line tool that tries to detect bugs that your C/C++
compiler doesn't see. It is versatile, and can check non-standard code
including various compiler extensions, inline assembly code, etc.
Its internal preprocessor can handle includes, macros, and several
preprocessor commands. While Cppcheck is highly configurable,
you can start using it just by giving it a path to the source code.
</para>
</refsect1>
<refsect1 id="options">
<title>OPTIONS</title>
@ -262,11 +266,12 @@ files, this is not needed.</para>
<varlistentry>
<term><option>--suppressions [file]</option></term>
<listitem>
<para>Suppress warnings listed in the file. Filename and line are optional. The format of the single line in file is: [error id]:[filename]:[line]</para>
<para>Suppress warnings listed in the file. Filename and line are optional. The format of the single line in file is: [error id]:[filename]:[line].
You can use --template or --xml to see the error id.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--template ['text']</option></term>
<term><option>--template '[text]'</option></term>
<listitem>
<para>Format the error messages. E.g. '{file}:{line},{severity},{id},{message}' or '{file}({line}):({severity}) {message}'. Pre-defined templates: gcc, vs</para>
</listitem>
@ -300,7 +305,7 @@ files, this is not needed.</para>
</refsect1>
<refsect1 id="author">
<title>AUTHOR</title>
<para>The program was written by Bill Egert, Daniel Marjamäki, Gianluca Scacco, Hoang Tuan Su, Kimmo Varis, Leandro Penz, Nicolas Le Cam, Reijo Tomperi, Slava Semushin and Vesa Pikki</para>
<para>The program was written by Bill Egert, Daniel Marjamäki, Gianluca Scacco, Hoang Tuan Su, Kimmo Varis, Leandro Penz, Martin Ettl, Nguyen Duong Tuan, Nicolas Le Cam, Reijo Tomperi, Robert Reif, Slava Semushin, Vesa Pikki and Zachary Blair</para>
</refsect1>
<refsect1 id="see_also">
<title>SEE ALSO</title>

View File

@ -3,9 +3,9 @@
"/usr/share/xml/docbook/schema/dtd/4.4/docbookx.dtd">
<book>
<bookinfo>
<title>Cppcheck 1.43</title>
<title>Cppcheck 1.44</title>
<date>2010-05-08</date>
<date>2010-07-10</date>
</bookinfo>
<chapter>
@ -165,9 +165,14 @@ Checking path/file2.cpp...
<para>But if you want to manually limit the checking you can do so with
<literal>-D</literal>.</para>
<para>For example, if you want to limit the checking so the only
configuration to check should be "DEBUG=1;__cplusplus" then something like
this can be used:</para>
<para>Beware that only the macros, which are given here and the macros
defined in source files and known header files are considered. That
excludes all the macros defined in some system header files, which are by
default not examined by cppcheck.</para>
<para>The usage: if you, for example, want to limit the checking so the
only configuration to check should be "DEBUG=1;__cplusplus" then something
like this can be used:</para>
<programlisting>cppcheck -DDEBUG=1 -D__cplusplus path</programlisting>
</chapter>
@ -220,7 +225,7 @@ Checking path/file2.cpp...
<term>severity</term>
<listitem>
<para>one of: error / possible error / style / possible style</para>
<para>either error or style</para>
</listitem>
</varlistentry>

View File

@ -1089,7 +1089,7 @@ private:
" ;\n"
" free(buf);\n"
"}\n");
ASSERT_EQUALS("[test.cpp:6]: (error) Memory leak: \"buf\" nulled but not freed upon failure\n", errout.str());
ASSERT_EQUALS("[test.cpp:6]: (error) Common realloc mistake: \"buf\" nulled but not freed upon failure\n", errout.str());
}
void if11()
@ -1178,7 +1178,7 @@ private:
"\n"
" return a;\n"
"}\n", true);
ASSERT_EQUALS("[test.cpp:9]: (error) Memory leak: \"a\" nulled but not freed upon failure\n", errout.str());
ASSERT_EQUALS("[test.cpp:9]: (error) Common realloc mistake: \"a\" nulled but not freed upon failure\n", errout.str());
}
@ -1199,7 +1199,7 @@ private:
"\n"
" return a;\n"
"}\n", true);
ASSERT_EQUALS("[test.cpp:9]: (error) Memory leak: \"a\" nulled but not freed upon failure\n"
ASSERT_EQUALS("[test.cpp:9]: (error) Common realloc mistake: \"a\" nulled but not freed upon failure\n"
"[test.cpp:11]: (error) Memory leak: a\n", errout.str());
}
@ -1932,7 +1932,7 @@ private:
" char *a = (char *)malloc(10);\n"
" a = realloc(a, 100);\n"
"}\n");
ASSERT_EQUALS("[test.cpp:4]: (error) Memory leak: \"a\" nulled but not freed upon failure\n"
ASSERT_EQUALS("[test.cpp:4]: (error) Common realloc mistake: \"a\" nulled but not freed upon failure\n"
"[test.cpp:5]: (error) Memory leak: a\n", errout.str());
}
@ -1945,7 +1945,7 @@ private:
" free(a);\n"
"}\n");
ASSERT_EQUALS("[test.cpp:4]: (error) Memory leak: \"a\" nulled but not freed upon failure\n", errout.str());
ASSERT_EQUALS("[test.cpp:4]: (error) Common realloc mistake: \"a\" nulled but not freed upon failure\n", errout.str());
}
void realloc3()

View File

@ -1713,6 +1713,18 @@ private:
"}\n");
ASSERT_EQUALS("", errout.str());
checkUninitVar("void foo()\n"
"{\n"
" const char *msgid1, *msgid2;\n"
" int ret = bar(&msgid1);\n"
" if (ret > 0) {\n"
" ret = bar(&msgid2);\n"
" }\n"
" ret = ret <= 0 ? -1 :\n"
" strcmp(msgid1, msgid2) == 0;\n"
"}\n");
ASSERT_EQUALS("", errout.str());
// while..
checkUninitVar("int f()\n"
"{\n"

57
test/testsettings.cpp Normal file
View File

@ -0,0 +1,57 @@
/*
* Cppcheck - A tool for static C/C++ code analysis
* Copyright (C) 2007-2010 Daniel Marjamäki and Cppcheck team.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "settings.h"
#include "testsuite.h"
#include <sstream>
extern std::ostringstream errout;
class TestSettings : public TestFixture
{
public:
TestSettings() : TestFixture("TestSettings")
{ }
private:
void run()
{
TEST_CASE(suppressionsBadId1);
TEST_CASE(suppressionsDosFormat); // Ticket #1836
}
void suppressionsBadId1()
{
Settings::Suppressions suppressions;
std::istringstream s("123");
ASSERT_EQUALS(false, suppressions.parseFile(s));
}
void suppressionsDosFormat()
{
Settings::Suppressions suppressions;
std::istringstream s("abc\r\ndef\r\n");
ASSERT_EQUALS(true, suppressions.parseFile(s));
ASSERT_EQUALS(true, suppressions.isSuppressed("abc", "test.cpp", 1));
ASSERT_EQUALS(true, suppressions.isSuppressed("def", "test.cpp", 1));
}
};
REGISTER_TEST(TestSettings)

View File

@ -53,7 +53,8 @@ private:
TEST_CASE(erase3);
TEST_CASE(erase4);
TEST_CASE(eraseBreak);
TEST_CASE(eraseReturn);
TEST_CASE(eraseReturn1);
TEST_CASE(eraseReturn2);
TEST_CASE(eraseGoto);
TEST_CASE(eraseAssign);
TEST_CASE(eraseErase);
@ -442,10 +443,12 @@ private:
ASSERT_EQUALS("", errout.str());
}
void eraseReturn()
void eraseReturn1()
{
check("void f()\n"
"{\n"
" std::vector<int> foo;\n"
" std::vector<int>::iterator it;\n"
" for (it = foo.begin(); it != foo.end(); ++it)\n"
" {\n"
" foo.erase(it);\n"
@ -455,6 +458,27 @@ private:
ASSERT_EQUALS("", errout.str());
}
void eraseReturn2()
{
check("void f()\n"
"{\n"
" std::vector<int> foo;\n"
" std::vector<int>::iterator it;\n"
" for (it = foo.begin(); it != foo.end(); ++it)\n"
" {\n"
" if (*it == 1) {\n"
" foo.erase(it);\n"
" return;\n"
" }\n"
" else {\n"
" foo.erase(it);\n"
" return;\n"
" }\n"
" }\n"
"}\n");
ASSERT_EQUALS("", errout.str());
}
void eraseGoto()
{
check("void f()\n"

View File

@ -74,8 +74,7 @@ private:
void run()
{
// This is commented out, because it causes a deadlock
// TEST_CASE(deadlock_with_many_errors);
TEST_CASE(deadlock_with_many_errors);
TEST_CASE(no_errors_more_files);
TEST_CASE(no_errors_less_files);
TEST_CASE(no_errors_equal_amount_files);

View File

@ -58,9 +58,11 @@ private:
errout.str("");
// Check for unused functions..
CheckUnusedFunctions checkUnusedFunctions(this);
Settings settings;
settings._checkCodingStyle = true;
CheckUnusedFunctions checkUnusedFunctions(&tokenizer, &settings, this);
checkUnusedFunctions.parseTokens(tokenizer);
checkUnusedFunctions.check();
checkUnusedFunctions.check(this);
}
void incondition()

View File

@ -70,6 +70,7 @@ private:
TEST_CASE(localvar22); // ticket #1811
TEST_CASE(localvar23); // ticket #1808
TEST_CASE(localvar24); // ticket #1803
TEST_CASE(localvar25); // ticket #1729
TEST_CASE(localvaralias1);
TEST_CASE(localvaralias2); // ticket #1637
TEST_CASE(localvaralias3); // ticket #1639
@ -1232,6 +1233,18 @@ private:
ASSERT_EQUALS("", errout.str());
}
void localvar25() // ticket #1729
{
functionVariableUsage("int main() {\n"
" int ppos = 1;\n"
" int pneg = 0;\n"
" const char*edge = ppos? \" +\" : pneg ? \" -\" : \"\";\n"
" printf(\"This should be a '+' -> %s\n\", edge);\n"
" return 0;\n"
"}\n");
ASSERT_EQUALS("", errout.str());
}
void localvaralias1()
{
functionVariableUsage("void foo()\n"
@ -1796,6 +1809,56 @@ private:
"}");
ASSERT_EQUALS("", errout.str());
functionVariableUsage("void foo()\n"
"{\n"
" char buf[8];\n"
" char *srcdata;\n"
" if (a()) {\n"
" buf[0] = 1;\n"
" srcdata = buf;\n"
" srcdata = vdata;\n"
" }\n"
" b(srcdata);\n"
"}");
TODO_ASSERT_EQUALS(std::string("[test.cpp:3]: (style) Variable 'buf' is assigned a value that is never used\n"), errout.str());
functionVariableUsage("void foo()\n"
"{\n"
" char buf[8];\n"
" char *srcdata;\n"
" if (a()) {\n"
" buf[0] = 1;\n"
" srcdata = buf;\n"
" }\n"
" srcdata = vdata;\n"
" b(srcdata);\n"
"}");
TODO_ASSERT_EQUALS(std::string("[test.cpp:3]: (style) Variable 'buf' is assigned a value that is never used\n"), errout.str());
functionVariableUsage("void foo()\n"
"{\n"
" char buf[8];\n"
" char *srcdata;\n"
" if (a()) {\n"
" srcdata = buf;\n"
" }\n"
" srcdata = vdata;\n"
" b(srcdata);\n"
"}");
TODO_ASSERT_EQUALS(std::string("[test.cpp:3]: (style) Unused variable: buf\n"), errout.str());
functionVariableUsage("void foo()\n"
"{\n"
" char buf[8];\n"
" char *srcdata;\n"
" if (a()) {\n"
" srcdata = vdata;\n"
" }\n"
" srcdata = buf;\n"
" b(srcdata);\n"
"}");
ASSERT_EQUALS(std::string(""), errout.str());
functionVariableUsage("void foo()\n"
"{\n"
" char buf[8];\n"
@ -1810,6 +1873,60 @@ private:
" b(srcdata);\n"
"}");
ASSERT_EQUALS("", errout.str());
functionVariableUsage("void foo()\n"
"{\n"
" char buf[8];\n"
" char *srcdata;\n"
" char vdata[8];\n"
" if (a()) {\n"
" buf[0] = 1;\n"
" srcdata = buf;\n"
" srcdata = vdata;\n"
" }\n"
" b(srcdata);\n"
"}");
TODO_ASSERT_EQUALS(std::string("[test.cpp:3]: (style) Variable 'buf' is assigned a value that is never used\n"), errout.str());
functionVariableUsage("void foo()\n"
"{\n"
" char buf[8];\n"
" char *srcdata;\n"
" char vdata[8];\n"
" if (a()) {\n"
" buf[0] = 1;\n"
" srcdata = buf;\n"
" }\n"
" srcdata = vdata;\n"
" b(srcdata);\n"
"}");
TODO_ASSERT_EQUALS(std::string("[test.cpp:3]: (style) Variable 'buf' is assigned a value that is never used\n"), errout.str());
functionVariableUsage("void foo()\n"
"{\n"
" char buf[8];\n"
" char *srcdata;\n"
" char vdata[8];\n"
" if (a()) {\n"
" srcdata = buf;\n"
" }\n"
" srcdata = vdata;\n"
" b(srcdata);\n"
"}");
TODO_ASSERT_EQUALS(std::string("[test.cpp:3]: (style) Unused variable: buf\n"), errout.str());
functionVariableUsage("void foo()\n"
"{\n"
" char buf[8];\n"
" char *srcdata;\n"
" char vdata[8];\n"
" if (a()) {\n"
" srcdata = vdata;\n"
" }\n"
" srcdata = buf;\n"
" b(srcdata);\n"
"}");
TODO_ASSERT_EQUALS(std::string("[test.cpp:5]: (style) Unused variable: vdata\n"), errout.str());
}
void localvaralias7() // ticket 1732

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Include>
<?define ProductName = "Cppcheck 1.43" ?>
<?define ProductName = "Cppcheck 1.44" ?>
<?define ProductNameShort = "Cppcheck" ?>
<?define ProductVersion = "1.43.0" ?>
<?define ProductVersion = "1.44.0" ?>
<?define ProductManufacturer = "The Cppcheck team" ?>
<?define ProductDescription = "Cppcheck is a tool for static analysis of C/C++ code" ?>