Bug 466420 - Add ability to delete devices from Dolphin faster
Summary: Add ability to delete devices from Dolphin faster
Status: REPORTED
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: 22.12.2
Platform: Neon Linux
: NOR wishlist
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-25 18:14 UTC by Andrei Rybak
Modified: 2023-02-25 22:10 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
screen recording of steps to reproduce and observed result (363.66 KB, video/mp4)
2023-02-25 18:14 UTC, Andrei Rybak
Details
Four panels in Dolphin (65.69 KB, image/png)
2023-02-25 18:18 UTC, Andrei Rybak
Details
Only three panels of Dolphin in Component field on bugs.kde.org (14.42 KB, image/png)
2023-02-25 18:19 UTC, Andrei Rybak
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrei Rybak 2023-02-25 18:14:00 UTC
Created attachment 156719 [details]
screen recording of steps to reproduce and observed result

SUMMARY
There is a bug – https://bugs.kde.org/show_bug.cgi?id=466416 – that causes too many entries being added to the Dolphin's panel "Places". If that bug is ever fixed, it would be nice to get rid of the wrong entries. It would be a good addition to the wonderful UI of Dolphin if it could allow its users to delete these incorrect entries in some _fast_ way.


STEPS TO REPRODUCE
1. Open Dolphin on a computer affected by https://bugs.kde.org/show_bug.cgi?id=466416
2. Try selecting multiple devices at once.
3. Try removing a device using the Delete key
4. Remove a device using the context menu

OBSERVED RESULT
For step 2 — there is no way to select multiple devices at once.
For step 3 — the "Selection mode" turns on 
For step 4 — Dolphin freezes. I don't actually know if a device gets removed or not — I don't know how to count them in an easy way. On the screen recording I'm trying to 1) resize the window - it doesn't work, 2) click on the "Cancel" button (it doesn't work) and 3) click on the close application button in the top right (it doesn't work).

EXPECTED RESULT
- There is a way to select multiple devices at once, similar to how it is possible to select multiple folders or files in the main panel of Dolphin
- There is some kind of shortcut to delete devices while navigating the panel "Places" via keyboard, without having to open the context menu
- Dolphin doesn't freeze

SOFTWARE/OS VERSIONS

> $ apt show dolphin 2>/dev/null | head -2
> Package: dolphin
> Version: 4:22.12.2-0xneon+22.04+jammy+release+build16

Operating System: KDE neon 5.27
KDE Plasma Version: 5.27.1
KDE Frameworks Version: 5.103.0
Qt Version: 5.15.8
Kernel Version: 5.19.0-32-generic (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Core™ i5-8250U CPU @ 1.60GHz
Memory: 7.7 GiB of RAM
Graphics Processor: Mesa Intel® UHD Graphics 620
Manufacturer: Dell Inc.
Product Name: Inspiron 5570


ADDITIONAL INFORMATION
Value "panels: places" is missing from the "Component:" field when creating a new bug on https://bugs.kde.org/enter_bug.cgi?product=dolphin
Comment 1 Andrei Rybak 2023-02-25 18:18:10 UTC
Created attachment 156720 [details]
Four panels in Dolphin
Comment 2 Andrei Rybak 2023-02-25 18:19:35 UTC
Created attachment 156721 [details]
Only three panels of Dolphin in Component field on bugs.kde.org

Here are two screenshots showing the missing value for "Component" field for Dolphin on bugs.kde.org — the issue that I mentioned in the "ADDITIONAL INFORMATION" section.
Comment 3 Andrei Rybak 2023-02-25 22:10:43 UTC
For those who don't mind editing Dolphin's data manually, zacharytalis proposed a hacky solution over at https://bugs.kde.org/show_bug.cgi?id=466416#c4:

> For the time being, you can prune these spam entries by editing
> "~/.local/share/user-places.xbel" directly. (make sure to be careful and
> take a backup, yada yada)

I looked at the structure of this XML file, which consisted mostly of <bookmark> tags. Each bookmark has a <title> tag, which has the strings which I was interested in -- the names of the phones. I grepped the file for all <title> tags. I noticed that all the erroneous entries are clumped together:

> $ cd ~/.local/share
> $ grep '<title>' user-places.xbel | uniq
> [...]
> <title>Xiaomi</title>
> <title>Pixel 6A</title>
> <title>Xiaomi</title>
> <title>Pixel 6A</title>
> <title>Xiaomi</title>
> <title>Pixel 6A</title>
> <title>Xiaomi</title>
> <title>Pixel 6A</title>
> <title>Xiaomi</title>
> <title>Pixel 6A</title>
> <title>Xiaomi</title>
> <title>Pixel 6A</title>
> <title>Xiaomi</title>
> <title>Pixel 6A</title>

So I did the following:

1. Found the first bookmark with the <title> of an erroneous entry
2. Started selection
3. Found the last erroneous bookmark
4. Made sure the selection starts at an opening tag <bookmark> and ends at a closing tag </bookmark>
5. Deleted the whole selection