Bug 385551 - kphotoalbum-5.2/ThumbnailView/ThumbnailDND.cpp: broken if statement ?
Summary: kphotoalbum-5.2/ThumbnailView/ThumbnailDND.cpp: broken if statement ?
Status: RESOLVED FIXED
Alias: None
Product: kphotoalbum
Classification: Applications
Component: Thumbnail Viewer (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KPhotoAlbum Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-10 16:02 UTC by dcb314
Modified: 2017-10-10 20:39 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dcb314 2017-10-10 16:02:32 UTC
[/home/dcb/rpmbuild/BUILD/kphotoalbum-5.2/ThumbnailView/ThumbnailDND.cpp:48] -> [/home/dcb/rpmbuild/BUILD/kphotoalbum-5.2/ThumbnailView/ThumbnailDND.cpp:62]: (warning) Identical condition 'fileName.isNull()', second condition is always false

Source code is

    if (fileName.isNull())
    {
        // cursor not in drop zone (e.g. empty space right/below of the thumbnails)
        return;
    }

then later:

        if ( fileName.isNull() ) {
            // We're dragging behind the last item
            model()->setRightDropItem(model()->imageAt( model()->imageCount() - 1));
        } else {

The second if can never be true.
Comment 1 Johannes Zarl-Zierl 2017-10-10 20:39:37 UTC
Git commit 0f2be90f3df95b38b011361e3c90528084747bbd by Johannes Zarl-Zierl.
Committed on 10/10/2017 at 20:18.
Pushed by johanneszarl into branch 'master'.

Remove dead/unreachable code.

M  +4    -9    ThumbnailView/ThumbnailDND.cpp

https://commits.kde.org/kphotoalbum/0f2be90f3df95b38b011361e3c90528084747bbd