Review Request 109893: Fixed a Dolphin 2.x Regression: no option to select whole group in grouped view

Emmanuel Pescosta emmanuelpescosta099 at gmail.com
Tue Apr 9 11:32:03 BST 2013


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/109893/#review30763
-----------------------------------------------------------



dolphin/src/kitemviews/kitemlistcontroller.h
<http://git.reviewboard.kde.org/r/109893/#comment22906>

    We also store the pointer to the pressed widget (Determined in KItemListController::mousePressEvent), because not all widgets have a valid index, only file item widgets have valid indexes.
    
    The old code only stored the m_pressedIndex -> not possible to handle click events on none file item widgets.
    
    We need this change to handle mouse events on the group header widget.



dolphin/src/kitemviews/kitemlistcontroller.cpp
<http://git.reviewboard.kde.org/r/109893/#comment22883>

    Returns the widget at position m_pressedMousePos. If there isn't any widget, the return value is 0.



dolphin/src/kitemviews/kitemlistcontroller.cpp
<http://git.reviewboard.kde.org/r/109893/#comment22884>

    This switch is needed, because we have different item types (GroupHeaderWidget, ItemListWidget) which require a different selection handling for every type.
    
    ItemListWidget:
    This is the normal file item widget, we can pass it to the SelectionManager directly, because we have an valid index.
    
    GroupHeaderWidget:
    The GroupHeader itself has no valid index, so the GroupHeader contacts the SelectionManager to select all items in his group.



dolphin/src/kitemviews/kitemlistcontroller.cpp
<http://git.reviewboard.kde.org/r/109893/#comment22885>

    Same as line 541



dolphin/src/kitemviews/kitemlistcontroller.cpp
<http://git.reviewboard.kde.org/r/109893/#comment22886>

    Same as line 528



dolphin/src/kitemviews/kitemlistgroupheader.h
<http://git.reviewboard.kde.org/r/109893/#comment22908>

    We have an item range in GroupHeader. So use this enum to make the code easier to read, when we need the first or the last item index.



dolphin/src/kitemviews/kitemlistgroupheader.h
<http://git.reviewboard.kde.org/r/109893/#comment22889>

    Overwrite the isSelected() function, we only return true when all items in this group are selected.



dolphin/src/kitemviews/kitemlistgroupheader.h
<http://git.reviewboard.kde.org/r/109893/#comment22890>

    If ALL items in this group are selected, all items get deselected by toggleSelected().
    
    If NOT ALL items in this group are selected, all items get selected.



dolphin/src/kitemviews/kitemlistgroupheader.h
<http://git.reviewboard.kde.org/r/109893/#comment22888>

    We need a pointer to the selection manager, to (de-)select all items in this group.



dolphin/src/kitemviews/kitemlistview.h
<http://git.reviewboard.kde.org/r/109893/#comment22891>

    Returns the widget at position pos.
    
    We need this to handle also non file-item widgets (only file-item widgets have valid indexes).



dolphin/src/kitemviews/kitemlistview.h
<http://git.reviewboard.kde.org/r/109893/#comment22892>

    We need this change to handle also non file-item widgets.



dolphin/src/kitemviews/kitemlistview.h
<http://git.reviewboard.kde.org/r/109893/#comment22893>

    We need this change to handle also non file-item widgets.



dolphin/src/kitemviews/kitemlistview.h
<http://git.reviewboard.kde.org/r/109893/#comment22894>

    Returns all visible widgets in this view. (In this case all item-list-widgets + all group-header-widgets)



dolphin/src/kitemviews/kitemlistview.cpp
<http://git.reviewboard.kde.org/r/109893/#comment22895>

    Determine the last index in this group.
    
    If this group is the last group, use "items-count - 1" as last index.
    
    If not use "the first index of the next group - 1".



dolphin/src/kitemviews/kitemlistwidget.h
<http://git.reviewboard.kde.org/r/109893/#comment22896>

    Moved to DolphinGraphicsWidget.
    
    Use the onChange events instead.



dolphin/src/kitemviews/kitemlistwidget.h
<http://git.reviewboard.kde.org/r/109893/#comment22897>

    Moved to DolphinGraphicsWidget.
    
    Use the onChange events instead.



dolphin/src/kitemviews/kitemlistwidget.h
<http://git.reviewboard.kde.org/r/109893/#comment22898>

    Moved to DolphinGraphicsWidget.
    
    Use the onChange events instead.



dolphin/src/kitemviews/kitemlistwidget.h
<http://git.reviewboard.kde.org/r/109893/#comment22899>

    Moved to DolphinGraphicsWidget



dolphin/src/kitemviews/kitemlistwidget.h
<http://git.reviewboard.kde.org/r/109893/#comment22900>

    Moved to DolphinGraphicsWidget



dolphin/src/kitemviews/kitemlistwidget.cpp
<http://git.reviewboard.kde.org/r/109893/#comment22901>

    Moved to DolphinGraphicsWidget.
    
    Use the onChange events instead.



dolphin/src/kitemviews/kitemlistwidget.cpp
<http://git.reviewboard.kde.org/r/109893/#comment22902>

    Moved to DolphinGraphicsWidget.
    
    Use the onChange events instead.



dolphin/src/kitemviews/kstandarditemlistgroupheader.cpp
<http://git.reviewboard.kde.org/r/109893/#comment22905>

    We have an item-index-range in GroupHeader -> So query the index of the first item instead.



dolphin/src/kitemviews/private/dolphingraphicswidget.h
<http://git.reviewboard.kde.org/r/109893/#comment22909>

    This is the new base class for KItemListWidget and KItemListGroupHeader.
    
    It provides an standardized interface for widgets, which are used in Dolphins View Widgets/Controller.



dolphin/src/kitemviews/private/dolphingraphicswidget.h
<http://git.reviewboard.kde.org/r/109893/#comment22910>

    Returns the Item-Type.
    
    Needed because we need different code paths for different items (See controller)



dolphin/src/kitemviews/private/dolphingraphicswidget.h
<http://git.reviewboard.kde.org/r/109893/#comment22911>

    Needed because the controller checks if the mouse event happend within the selection toggle area of the item.
    
    Returns an empty QRectF if item selecting is not supported.



dolphin/src/kitemviews/private/dolphingraphicswidget.h
<http://git.reviewboard.kde.org/r/109893/#comment22912>

    Needed because the controller checks if the mouse event happend within the expansion toggle area of the item.
    
    Returns an empty QRectF if item expanding is not supported.


- Emmanuel Pescosta


On April 7, 2013, 6:04 p.m., Emmanuel Pescosta wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/109893/
> -----------------------------------------------------------
> 
> (Updated April 7, 2013, 6:04 p.m.)
> 
> 
> Review request for Dolphin and Frank Reininghaus.
> 
> 
> Description
> -------
> 
> Fixed a Dolphin 2.x Regression: no option to select whole group in grouped view
> 
> Added the (de-)selector widget to the item list group-header, to (de-)select all items in the group.
> 
> This feature got lost in Dolphin 2.0
> 
> 
> This addresses bug 292508.
>     http://bugs.kde.org/show_bug.cgi?id=292508
> 
> 
> Diffs
> -----
> 
>   dolphin/src/kitemviews/private/dolphingraphicswidget.cpp PRE-CREATION 
>   dolphin/src/kitemviews/private/dolphingraphicswidget.h PRE-CREATION 
>   dolphin/src/kitemviews/kstandarditemlistwidget.cpp 6adb546 
>   dolphin/src/kitemviews/kstandarditemlistgroupheader.cpp 1e23c0a 
>   dolphin/src/kitemviews/kitemlistwidget.cpp 6a7111a 
>   dolphin/src/kitemviews/kitemlistwidget.h 55181fa 
>   dolphin/src/kitemviews/kitemlistview.cpp 9ebad7f 
>   dolphin/src/kitemviews/kitemlistview.h cd59ddc 
>   dolphin/src/kitemviews/kitemlistgroupheader.cpp 17c95a9 
>   dolphin/src/kitemviews/kitemlistgroupheader.h 1e8ed2c 
>   dolphin/src/kitemviews/kitemlistcontroller.cpp c6239df 
>   dolphin/src/CMakeLists.txt ffb232c 
>   dolphin/src/kitemviews/kitemlistcontroller.h 4d5fee3 
> 
> Diff: http://git.reviewboard.kde.org/r/109893/diff/
> 
> 
> Testing
> -------
> 
> Works fine. All tests passed.
> 
> * Enable grouping
> * Hover the group header
> * Click on the selector -> All items in this group are selected
> * Click on the selector again -> No item in this group is selected
> 
> 
> Thanks,
> 
> Emmanuel Pescosta
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20130409/032d10ce/attachment.htm>


More information about the kfm-devel mailing list