Bug 512321

Summary: Incomplete Extraction
Product: [Applications] ark Reporter: Jpn <ngrnjp>
Component: generalAssignee: Jpn <ngrnjp>
Status: REPORTED ---    
Severity: normal CC: rthomsen6
Priority: NOR    
Version First Reported In: 25.08.1   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: A video showing the bug

Description Jpn 2025-11-19 02:04:26 UTC
Created attachment 186939 [details]
A video showing the bug

SUMMARY
Ark file manager fails to extract all selected files from specific archives when using drag-and-drop, despite functioning correctly with menu-based extraction methods.

STEPS TO REPRODUCE
1. Open the Ark file manager.
2. Select all desired files within an archive for extraction.
3. Initiate the extraction process by dragging and dropping the selected files into the target folder or using a custom destination.

OBSERVED RESULT
Some folders or files are missing from the extracted content in the target folder.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 6.12.48-1-MANJARO (Wayland)
KDE Plasma Version: 6.3.6
KDE Frameworks Version: 6.18.0
Qt Version: 6.9.2
Comment 1 Jpn 2025-11-27 20:21:32 UTC
This appears to be a Qt bug. The method `selectedRows` in the selection model of QTreeView returns an incomplete list, missing some selected items.
Replacing `selectedRows` by `selectedIndexes` solves the problem:
```c++
QModelIndexList Part::getSelectedIndexes()
{
    QModelIndexList list;

    auto selected = m_view->selectionModel()->selectedIndexes();
    for (const QModelIndex &index: selected) {
        if (index.column() == 0) {
            list.append(m_filterModel->mapToSource(index));
        }
    }
    return list;
}
```