Skip to content

Commit

Permalink
Use empty() or isEmpty() rather than size() for checking emptiness of…
Browse files Browse the repository at this point in the history
… containers.
  • Loading branch information
stuartm committed May 7, 2012
1 parent 9be52e2 commit 0d8e93c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mythplugins/mythgallery/mythgallery/iconview.cpp
Expand Up @@ -280,9 +280,9 @@ void IconView::LoadDirectory(const QString &dir)
m_childCountThread->start();

if (m_noImagesText)
m_noImagesText->SetVisible((m_itemList.size() == 0));
m_noImagesText->SetVisible(m_itemList.isEmpty());

if (m_itemList.size() != 0)
if (!m_itemList.isEmpty())
{
UpdateText(m_imageList->GetItemCurrent());
UpdateImage(m_imageList->GetItemCurrent());
Expand Down Expand Up @@ -443,7 +443,7 @@ bool IconView::keyPressEvent(QKeyEvent *event)
QString action = actions[i];
handled = true;

if (m_itemList.size() != 0)
if (!m_itemList.isEmpty())
{
if (action == "MENU")
{
Expand Down Expand Up @@ -670,7 +670,7 @@ bool IconView::HandleSubDirEscape(const QString &parent)

QDir curdir(m_currDir);
QDir pdir(parent);
if ((curdir != pdir) && is_subdir(pdir, curdir) && m_history.size())
if ((curdir != pdir) && is_subdir(pdir, curdir) && !m_history.empty())
{
QString oldDirName = curdir.dirName();
curdir.cdUp();
Expand Down

0 comments on commit 0d8e93c

Please sign in to comment.