KDE

A typo

V501 There are identical sub-expressions ‘mimeData->hasFormat(QLatin1String(“application/x-kde-ark-dndextract-service”))’ to the left and to the right of the ‘&&’ operator. iconview.cpp 2357

void IconView::dropEvent(QGraphicsSceneDragDropEvent *event)
{
  ....
  if (mimeData->hasFormat(QLatin1String(
       "application/x-kde-ark-dndextract-service")) &&      
      mimeData->hasFormat(QLatin1String(
       "application/x-kde-ark-dndextract-service")))        
  {
    const QString remoteDBusClient = mimeData->data(
      QLatin1String("application/x-kde-ark-dndextract-service"));
    const QString remoteDBusPath = mimeData->data(
      QLatin1String("application/x-kde-ark-dndextract-path"));
    ....
  }
  ....
}

The analyzer has detected two identical conditional expressions. The conditional operator’s body suggests that the condition should have looked like this:

if (mimeData->hasFormat(QLatin1String(
       "application/x-kde-ark-dndextract-service")) &&     
      mimeData->hasFormat(QLatin1String(
       "application/x-kde-ark-dndextract-path ")))        
{
  ....
}

Please click here to see more bugs from this project.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s