This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Automatic selection after renaming files

Tags: None
(comma "," separated)
kyrawertho
Registered Member
Posts
6
Karma
0
I am cleaning up my music collection which for me includes renaming a lot of files. Problem is Dolphin tries to select the renamed file all the time so it takes much more effort than necessary.

Here is what I mean:

A file is selected -> [F2] -> enter new name -> [Enter]
Press [down] to select next file -> Dolpin sorts the file that was just renamed, then selects the file after that (instead of file that was under it before renaming)
If you're quick and press [F2] on the next file, it will re-select the renamed file again. So, if the name change didn't change the sorting, you still won't have the next file selected.

Sorting the file list by something that doesn't change (such as file size), makes it easier but still it messes up the selection all the time.

So,
- Is this a bug?
- Is there a way to prevent files from automatically sorting until refresh (Win XP-style)?
- Is there a better way to rename files one by one?

btw: I tried it with in-line renaming disabled. This also sorts the file list so the next file has to be selected by mouse-click.
airdrik
Registered Member
Posts
1854
Karma
5
OS
One idea you can try is to sort by something that won't be affected by the rename like the file size or creation timestamp (creation timestamp will need to be added by right-clicking on the headers).

Depending on the number and nature of the renames and your comfort with scripting, you might consider a bulk or scripted approach. If the resulting file names are something like "Some file name N" where N is an incrementing number you can just select all of them and use the built-in bulk rename tool. Other scripted options may be explored as desired.


airdrik, proud to be a member of KDE forums since 2008-Dec.
kyrawertho
Registered Member
Posts
6
Karma
0
As I mentioned, it does make it slightly easier to sort by size or date or something that doesn't change, but it's not ideal.

I just get rid of gibberish and random numbers, correct typos add/remove info etc. so scripting is not an option for me (filenames are not predictable).

I noticed pcmanfm-qt works as expected so I could use that (but I do prefer Dolphin overall so a solution would be nice).
airdrik
Registered Member
Posts
1854
Karma
5
OS
Well, depending on your capabilities, a scripted option isn't out of the question.
One idea is to create a csv file containing the before and after names of the files in the directory:
Run "ls path/to/music/files/ > myFiles.csv" from a command prompt to create the file with the original file names, then you can open that up in a spreadsheet editor to add a second column with the destination names. Make sure to re-save as a csv.
Then you could use a script that reads the csv file and renames the files:
Code: Select all
#!/usr/bin/env python3
import csv, os
with open('myFiles.csv') as csvFile:
   reader = csv.reader(csvFile)
   for fromName, toName in reader:
      os.rename(fromName, toName)
.

Granted, this is a little beyond most users' capabilities, so I'd recommend filing a case to bugs.kde.org to get the behavior fixed.


airdrik, proud to be a member of KDE forums since 2008-Dec.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], lockheed