dfaust / soundkonverter

soundKonverter is in maintenance mode, PRs are welcome.
https://github.com/dfaust/soundkonverter/wiki
98 stars 28 forks source link

Add Folder ignores symlinks #9

Closed waucka closed 11 years ago

waucka commented 11 years ago

I replicate and back up my music collection using git-annex, so all of my music files are actually symlinks to the real files. If I attempt to add any of my music folders, no files are added. Using the Add Files option to add the files individually works just fine.

I found the problem in FileList::listDir:

dir.setFilter( QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot | QDir::NoSymLinks | QDir::Readable );

Note the QDir::NoSymLinks. Was there a particular reason for disregarding symlinks?

dfaust commented 11 years ago

Thanks for your report. It's a long time ago that I wrote that code but I guess I was unsure how the back-ends would handle symlinks. I made some quick testing and everything seems to work fine with symlinks. I guess I'll wait for bug reports in case there are problems.

waucka commented 11 years ago

OK, I wanted to make sure I wasn't doing anything stupid before proceeding, so I built soundkonverter 2.0.4 and tried it out. As before, it refuses to pick up symlinks when using the "Add Folder" option. If I remove QDir::NoSymlinks from FileList::listDir and FileList::countDir, then it picks up the files just fine.

I don't know what "quick testing" you did, but here's how to reproduce the situation I find myself in:

  1. Create a directory containing a bunch of symlinks to audio files.
  2. In soundkonverter, click the down-arrow next to the "Add" button and select "Add folder..."
  3. Select the folder you created.
  4. Select all applicable file formats (or just select all) and click "Proceed".
  5. Click "OK".
  6. Observe that no files have been added to the list.

If you repeat the above steps after removing QDir::NoSymlinks from FileList::listDir and FileList::countDir, then you will find that the files DO get added to the list.

waucka commented 11 years ago

Oh, I just checked the changelog and saw that you fixed the problem a few days ago. Why didn't you say you fixed it when you closed this ticket?

dfaust commented 11 years ago

Oops, I really didn't write it :), sorry.