~neon/amarok/master

Viewing all changes in revision 32247.

  • Committer: Wolfgang Bauer
  • Date: 2019-09-20 09:09:13 UTC
  • Revision ID: git-v1:b986f52d1d53b675a0d21a7507941e368acd3a14
Don't delete whole folder when deleting a track

`SqlCollectionLocation::moodFile()` tries to replace the filename's
extension with ".mood" (and prepend a '.') to get the Url of the
moodfile.
But it does that *after* the filename has already been removed from the
Url, so `QUrl::fileName()` gives an empty string and the end result is
actually "/path/to/folder/." which depicts the containing folder.

As a result, when Amarok tries to delete the corresponding moodfile
after a track is deleted, the whole folder gets deleted instead.

To fix this, save the filename in a temporary variable before removing
it, and use that for generating the new filename.

BUG: 411760
Differential Revision: https://phabricator.kde.org/D24040

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: