Bug 366630

Summary: digiKam Not Responding if 'Right Click' on a empty area below the album lists
Product: [Applications] digikam Reporter: Zabir <FxZabir>
Component: Albums-TreeViewAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: crash CC: caulier.gilles
Priority: NOR    
Version: 5.1.0   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed In: 5.2.0
Sentry Crash Report:
Attachments: Right Clicking on The empty area (Marked) crash digiKam

Description Zabir 2016-08-11 11:11:34 UTC
Browsing album has no problem.
Clicking on album list showing context menu, no problem.
But if i Right click on empty area. (Empty area below the  album lists), then  Crashing/Not responding. And there is no way but close it. 

NB: using DigiKam x64 bit app, don't know about x86 and about other platforms.

Reproducible: Always

Steps to Reproduce:
1. Open DigiKam
2.Right Click on a empty area  below the  album lists

Actual Results:  
Not Responding/Crash

Expected Results:  
Currently nothing should happen

PC Config
----------------
Windows 10
x64 based OS
Clock: 3200 Mhz
Nvidia GeForce GT 730
8 GB RAM
Comment 1 caulier.gilles 2016-08-11 11:30:44 UTC
Where exactly you right click with mouse exactly? Can you take a screenshot please ?
Comment 2 caulier.gilles 2016-08-11 11:35:43 UTC
Can be relevant of Coverity Scan report #1368976 :

1083void AbstractAlbumTreeView::contextMenuEvent(QContextMenuEvent* event)
1084{
1085    if (!d->enableContextMenu)
1086    {
1087        return;
1088    }
1089
1090    Album* const album = albumFilterModel()->albumForIndex(indexAt(event->pos()));
1091
    	deref_ptr_in_call: Dereferencing pointer album. [show details]
1092    if (album->isTrashAlbum())
1093    {
1094        // For the moment, disabling context menu for trash.
1095        // TODO : customize it.
1096        return;
1097    }
1098
1099    if (!showContextMenuAt(event, album))
1100    {
1101        return;
1102    }
1103
1104    // switch to the selected album if need
    	
CID 1368976 (#1 of 1): Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking album suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
1105    if (d->selectOnContextMenu && album)
1106    {
1107        setCurrentAlbums(QList<Album*>() << album);
1108    }
Comment 3 caulier.gilles 2016-08-11 11:41:52 UTC
Git commit 7c628bac74afe24dbc4ca66b1bd5d513e46f6377 by Gilles Caulier.
Committed on 11/08/2016 at 11:41.
Pushed by cgilles into branch 'master'.

Fix CR #1368976
FIXED-IN: 5.2.0

M  +6    -1    libs/album/albumtreeview.cpp

http://commits.kde.org/digikam/7c628bac74afe24dbc4ca66b1bd5d513e46f6377
Comment 4 Zabir 2016-08-11 11:43:05 UTC
Created attachment 100548 [details]
Right Clicking on The empty area (Marked) crash digiKam
Comment 5 Zabir 2016-08-11 12:28:23 UTC
Also right clicking here crashing in same way:

On 'Timeline' tab/sidebar : 'Searches' section/module
On 'Searches' tab/sidebar: 'Searches' section/module
On 'Fuzzy' tab/sidebar: 'Searches' section/module for both 'Image' and 'Sketch' tab
On 'Map' tab/sidebar: 'Searches' section/module