fixed compiler error when building gui

This commit is contained in:
Daniel Marjamäki 2009-10-17 11:34:17 +02:00
parent 48669e61a1
commit fa14dcbf68
3 changed files with 9 additions and 7 deletions

View File

@ -503,12 +503,8 @@ void MainWindow::About()
{
//TODO make a "GetVersionNumber" function to core cppcheck
CppCheckExecutor exec;
CppCheck check(exec);
const char *argv[] = {"", "--version"};
QString version = check.parseFromArgs(2, argv).c_str();
version.replace("Cppcheck ", "");
AboutDialog *dlg = new AboutDialog(version, this);
const CppCheck check(exec);
AboutDialog *dlg = new AboutDialog(check.version(), this);
dlg->exec();
}

View File

@ -78,6 +78,10 @@ void CppCheck::clearFiles()
const char * CppCheck::version() const
{
return "1.37";
}
void CppCheck::parseFromArgs(int argc, const char* const argv[])
{
@ -87,7 +91,7 @@ void CppCheck::parseFromArgs(int argc, const char* const argv[])
{
if (strcmp(argv[i], "--version") == 0)
{
reportOut("Cppcheck 1.37");
reportOut(std::string("Cppcheck ") + version());
return;
}

View File

@ -106,6 +106,8 @@ public:
*/
void parseFromArgs(int argc, const char* const argv[]);
const char * version() const;
const std::vector<std::string> &filenames() const;
virtual void reportStatus(unsigned int index, unsigned int max);