Bug 385551

Summary: kphotoalbum-5.2/ThumbnailView/ThumbnailDND.cpp: broken if statement ?
Product: [Applications] kphotoalbum Reporter: dcb314
Component: Thumbnail ViewerAssignee: KPhotoAlbum Bugs <kphotoalbum-bugs-null>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

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