Skip to content

Commit

Permalink
Initialise member variables in SearchView. Reported by cppcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartm committed Jan 30, 2012
1 parent 30ee762 commit cb03390
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 19 deletions.
27 changes: 12 additions & 15 deletions mythplugins/mythmusic/mythmusic/playlisteditorview.cpp
Expand Up @@ -24,7 +24,7 @@

MusicGenericTree::MusicGenericTree(MusicGenericTree *parent,
const QString &name, const QString &action,
MythUIButtonListItem::CheckState check,
MythUIButtonListItem::CheckState check,
bool showArrow)
: MythGenericTree(name)
{
Expand Down Expand Up @@ -89,14 +89,11 @@ MythUIButtonListItem *MusicGenericTree::CreateListButton(MythUIButtonList *list)
#define LOC_ERR QString("PlaylistEditorView, Error: ")

PlaylistEditorView::PlaylistEditorView(MythScreenStack *parent, const QString &layout, bool restorePosition)
:MusicCommon(parent, "playlisteditorview")
:MusicCommon(parent, "playlisteditorview"),
m_layout(layout), m_restorePosition(restorePosition),
m_rootNode(NULL), m_playlistTree(NULL), m_breadcrumbsText(NULL),
m_positionText(NULL)
{
m_rootNode = NULL;
m_playlistTree = NULL;

m_layout = layout;
m_restorePosition = restorePosition;

gCoreContext->SaveSetting("MusicPlaylistEditorView", layout);
}

Expand Down Expand Up @@ -161,11 +158,11 @@ bool PlaylistEditorView::Create(void)
restoreTreePosition(route);
}

connect(m_playlistTree, SIGNAL(itemClicked(MythUIButtonListItem*)),
connect(m_playlistTree, SIGNAL(itemClicked(MythUIButtonListItem*)),
this, SLOT(treeItemClicked(MythUIButtonListItem*)));
connect(m_playlistTree, SIGNAL(nodeChanged(MythGenericTree*)),
connect(m_playlistTree, SIGNAL(nodeChanged(MythGenericTree*)),
this, SLOT(treeNodeChanged(MythGenericTree*)));
connect(m_playlistTree, SIGNAL(itemVisible(MythUIButtonListItem*)),
connect(m_playlistTree, SIGNAL(itemVisible(MythUIButtonListItem*)),
this, SLOT(treeItemVisible(MythUIButtonListItem*)));

BuildFocusList();
Expand Down Expand Up @@ -306,7 +303,7 @@ bool PlaylistEditorView::keyPressEvent(QKeyEvent *event)
QString name = mnode->getString();

ShowOkPopup(QString("Are you sure you want to delete this Smart Playlist?\n"
"Category: %1 - Name: %2").arg(category).arg(name),
"Category: %1 - Name: %2").arg(category).arg(name),
this, SLOT(deleteSmartPlaylist(bool)), true);
handled = true;
}
Expand All @@ -315,7 +312,7 @@ bool PlaylistEditorView::keyPressEvent(QKeyEvent *event)
QString name = mnode->getString();

ShowOkPopup(QString("Are you sure you want to delete this Playlist?\n"
"Name: %1").arg(name),
"Name: %1").arg(name),
this, SLOT(deletePlaylist(bool)), true);
handled = true;
}
Expand Down Expand Up @@ -723,7 +720,7 @@ void PlaylistEditorView::filterTracks(MusicGenericTree *node)
Metadata *mdata = tracks->at(x);
if (mdata)
{
QString ratingStr = tr("%n Star(s)", "", mdata->Rating());
QString ratingStr = tr("%n Star(s)", "", mdata->Rating());
if (map.contains(ratingStr))
{
MetadataPtrList *filteredTracks = map.value(ratingStr);
Expand Down Expand Up @@ -780,7 +777,7 @@ void PlaylistEditorView::filterTracks(MusicGenericTree *node)
}

}
else if (node->getAction() == "artist" || node->getAction() == "album" ||
else if (node->getAction() == "artist" || node->getAction() == "album" ||
node->getAction() == "genre" || node->getAction() == "rating" ||
node->getAction() == "year")
{
Expand Down
9 changes: 5 additions & 4 deletions mythplugins/mythmusic/mythmusic/searchview.cpp
Expand Up @@ -15,9 +15,10 @@
#include "searchview.h"

SearchView::SearchView(MythScreenStack *parent)
:MusicCommon(parent, "searchview")
:MusicCommon(parent, "searchview"),
m_playTrack(false), m_fieldList(NULL), m_criteriaEdit(NULL),
m_matchesText(NULL), m_tracksList(NULL)
{
m_playTrack = false;
m_currentView = MV_SEARCH;
}

Expand Down Expand Up @@ -71,7 +72,7 @@ bool SearchView::Create(void)
connect(m_tracksList, SIGNAL(itemClicked(MythUIButtonListItem*)),
this, SLOT(trackClicked(MythUIButtonListItem*)));

connect(m_tracksList, SIGNAL(itemVisible(MythUIButtonListItem*)),
connect(m_tracksList, SIGNAL(itemVisible(MythUIButtonListItem*)),
this, SLOT(trackVisible(MythUIButtonListItem*)));

connect(m_criteriaEdit, SIGNAL(valueChanged()), this, SLOT(criteriaChanged()));
Expand Down Expand Up @@ -376,7 +377,7 @@ void SearchView::updateTracksList(void)
//TODO add tag query
}
case 0: // all fields
default:
default:
{
sql = "SELECT song_id "
"FROM music_songs "
Expand Down

0 comments on commit cb03390

Please sign in to comment.