Fixed #1925 (fix some cppcheck warnings in cppcheck)

This commit is contained in:
Robert Reif 2010-08-10 07:26:59 +02:00 committed by Daniel Marjamäki
parent 0b41d822cb
commit 483a3ddfe1
7 changed files with 13 additions and 13 deletions

View File

@ -210,7 +210,7 @@ ShowTypes ResultsTree::VariantToShowType(const QVariant &data)
return (ShowTypes)value;
}
ShowTypes ResultsTree::SeverityToShowType(const QString & severity)
ShowTypes ResultsTree::SeverityToShowType(const QString & severity) const
{
if (severity == "error")
return SHOW_ERRORS;
@ -610,7 +610,7 @@ void ResultsTree::CopyPath(QStandardItem *target, bool fullPath)
}
}
QString ResultsTree::SeverityToIcon(const QString &severity)
QString ResultsTree::SeverityToIcon(const QString &severity) const
{
if (severity == "possible error")
return ":images/dialog-warning.png";

View File

@ -187,7 +187,7 @@ protected:
*
* @param severity Severity string
*/
QString SeverityToIcon(const QString &severity);
QString SeverityToIcon(const QString &severity) const;
/**
* @brief Helper function to open an error within target with application*
@ -247,7 +247,7 @@ protected:
* @param severity Error severity string
* @return Severity converted to ShowTypes value
*/
ShowTypes SeverityToShowType(const QString &severity);
ShowTypes SeverityToShowType(const QString &severity) const;
/**
* @brief Convert ShowType to severity string

View File

@ -77,7 +77,7 @@ SettingsDialog::~SettingsDialog()
SaveSettings();
}
Qt::CheckState SettingsDialog::BoolToCheckState(bool yes)
Qt::CheckState SettingsDialog::BoolToCheckState(bool yes) const
{
if (yes)
{
@ -86,7 +86,7 @@ Qt::CheckState SettingsDialog::BoolToCheckState(bool yes)
return Qt::Unchecked;
}
bool SettingsDialog::CheckStateToBool(Qt::CheckState state)
bool SettingsDialog::CheckStateToBool(Qt::CheckState state) const
{
if (state == Qt::Checked)
{

View File

@ -146,7 +146,7 @@ protected:
* @param yes value to convert
* @return value converted to Qt::CheckState
*/
Qt::CheckState BoolToCheckState(bool yes);
Qt::CheckState BoolToCheckState(bool yes) const;
/**
* @brief Converts Qt::CheckState to bool
@ -154,7 +154,7 @@ protected:
* @param state Qt::CheckState to convert
* @return converted value
*/
bool CheckStateToBool(Qt::CheckState state);
bool CheckStateToBool(Qt::CheckState state) const;
/**

View File

@ -62,12 +62,12 @@ TranslationHandler::~TranslationHandler()
{
}
const QStringList TranslationHandler::GetNames()
const QStringList TranslationHandler::GetNames() const
{
return mNames;
}
const QStringList TranslationHandler::GetFiles()
const QStringList TranslationHandler::GetFiles() const
{
return mFiles;
}

View File

@ -33,8 +33,8 @@ class TranslationHandler : QObject
public:
TranslationHandler(QObject *parent);
virtual ~TranslationHandler();
const QStringList GetNames();
const QStringList GetFiles();
const QStringList GetNames() const;
const QStringList GetFiles() const;
bool SetLanguage(const int index, QString &error);
int GetCurrentLanguage() const;
int SuggestLanguage() const;

View File

@ -1831,7 +1831,7 @@ class ExecutionPathBufferOverrun : public ExecutionPath
public:
/** Startup constructor */
ExecutionPathBufferOverrun(Check *c, const std::map<unsigned int, CheckBufferOverrun::ArrayInfo> &arrayinfo)
: ExecutionPath(c, 0), arrayInfo(arrayinfo)
: ExecutionPath(c, 0), arrayInfo(arrayinfo), value(0)
{
}