Commit 8ec8835c authored by Urs Fleisch's avatar Urs Fleisch
Browse files

Fixed warnings found by cppcheck.

parent 27df20a6
......@@ -52,7 +52,9 @@ ServerImporterConfig::ServerImporterConfig(const QString& grp, bool cgiPathUsed,
* Constructor.
* Used to create temporary configuration.
*/
ServerImporterConfig::ServerImporterConfig() : GeneralConfig("Temporary") {}
ServerImporterConfig::ServerImporterConfig() : GeneralConfig("Temporary"),
m_windowWidth(-1), m_windowHeight(-1), m_cgiPathUsed(false),
m_additionalTagsUsed(false), m_additionalTags(false), m_coverArt(false) {}
/**
* Destructor.
......
......@@ -76,7 +76,7 @@ public:
* Get the directory of the item.
* @return directory path with trailing separator.
*/
const QString& getDirName() { return m_dirName; }
QString getDirName() const { return m_dirName; }
/**
* Add item to playlist.
......
......@@ -379,8 +379,6 @@ protected:
CommentList m_comments;
/** true if file has been read. */
bool m_fileRead;
/** true if comments are changed. */
bool m_changed;
private:
OggFile(const OggFile&);
......@@ -389,6 +387,10 @@ private:
#ifdef HAVE_VORBIS
/** Information about Ogg/Vorbis file. */
struct FileInfo {
/** Constructor. */
FileInfo() : valid(false), version(0), channels(0),
sampleRate(0), bitrate(0), duration(0) {}
/**
* Read information about an Ogg/Vorbis file.
* @param fn file name
......
......@@ -167,10 +167,9 @@ static void parseFreedbTrackDurations(
*/
trackDuration.clear();
QRegExp discLenRe("Disc length:\\s*\\d+");
int discLenPos, len;
discLenPos = discLenRe.indexIn(text, 0);
int discLenPos = discLenRe.indexIn(text, 0);
if (discLenPos != -1) {
len = discLenRe.matchedLength();
int len = discLenRe.matchedLength();
discLenPos += 12;
int discLen = text.mid(discLenPos, len - 12).toInt();
int trackOffsetPos = text.indexOf("Track frame offsets", 0);
......
......@@ -29,6 +29,13 @@
#include "genres.h"
#include "qtcompatmac.h"
/**
* Constructor.
*/
ImportParser::ImportParser() : m_trackIncrEnabled(false), m_trackIncrNr(0)
{
}
/**
* Get help text for format codes supported by setFormat().
*
......
......@@ -39,6 +39,11 @@ class FrameCollection;
*/
class ImportParser {
public:
/**
* Constructor.
*/
ImportParser();
/**
* Set import format.
*
......@@ -63,7 +68,7 @@ public:
*
* @return list with track durations.
*/
QList<int> getTrackDurations() { return m_trackDuration; }
QList<int> getTrackDurations() const { return m_trackDuration; }
/**
* Get help text for format codes supported by setFormat().
......
......@@ -34,7 +34,8 @@
* Constructor.
* @param parent parent object
*/
DirRenamer::DirRenamer(QObject* parent) : QObject(parent), m_aborted(false)
DirRenamer::DirRenamer(QObject* parent) : QObject(parent), m_aborted(false),
m_tagVersion(TrackData::TagV2V1), m_actionCreate(false)
{
setObjectName("DirRenamer");
}
......
......@@ -139,21 +139,6 @@ void ExpressionParser::tokenizeRpn(const QString& expr)
m_rpnIterator = m_rpnStack.begin();
}
/**
* Get the next token from the RPN stack.
*
* @return token, QString::null if stack is empty.
*/
QString ExpressionParser::getToken()
{
if (!m_rpnStack.empty()) {
QString token = m_rpnStack.front();
m_rpnStack.pop_front();
return token;
}
return QString::null;
}
/**
* Convert a string to a boolean.
......
......@@ -104,13 +104,6 @@ public:
bool popBool(bool& var);
private:
/**
* Get the next token from the RPN stack.
*
* @return token, QString::null if stack is empty.
*/
QString getToken();
/**
* Compare operator priority.
*
......
......@@ -398,7 +398,8 @@ TaggedFile* SelectedTaggedFileOfDirectoryIterator::peekNext() const
* @param selectModel selection model
*/
TaggedFileOfSelectedDirectoriesIterator::TaggedFileOfSelectedDirectoriesIterator(
const QItemSelectionModel* selectModel) : m_dirIdx(0), m_row(0), m_nextFile(0)
const QItemSelectionModel* selectModel) : m_model(0), m_dirIdx(0), m_row(0),
m_nextFile(0)
{
if (selectModel &&
(m_model = qobject_cast<const FileProxyModel*>(selectModel->model()))
......
......@@ -451,7 +451,6 @@ private:
QModelIndexList getIndexesOfDirWithSubDirs(const QModelIndex& dirIndex);
const FileProxyModel* m_model;
const QItemSelectionModel* m_selectModel;
QModelIndexList m_dirIndexes;
int m_dirIdx;
int m_row;
......
......@@ -339,7 +339,7 @@ public:
* @param field field to edit
*/
TextFieldControl(Frame::Field& field) :
Mp3FieldControl(field) {}
Mp3FieldControl(field), m_edit(0) {}
/**
* Destructor.
......@@ -373,7 +373,7 @@ public:
* @param field field to edit
*/
LineFieldControl(Frame::Field& field) :
Mp3FieldControl(field) {}
Mp3FieldControl(field), m_edit(0) {}
/**
* Destructor.
......@@ -407,7 +407,7 @@ public:
* @param field field to edit
*/
IntFieldControl(Frame::Field& field) :
Mp3FieldControl(field) {}
Mp3FieldControl(field), m_numInp(0) {}
/**
* Destructor.
......@@ -443,7 +443,7 @@ public:
*/
IntComboBoxControl(Frame::Field& field,
const char **lst) :
Mp3FieldControl(field), m_strLst(lst) {}
Mp3FieldControl(field), m_ptInp(0), m_strLst(lst) {}
/**
* Destructor.
......@@ -482,7 +482,7 @@ public:
*/
BinFieldControl(Frame::Field& field,
const Frame& frame, const TaggedFile* taggedFile) :
Mp3FieldControl(field), m_frame(frame), m_taggedFile(taggedFile) {}
Mp3FieldControl(field), m_bos(0), m_frame(frame), m_taggedFile(taggedFile) {}
/**
* Destructor.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment