SqlCollectionLocation::startNextJob() not properly copying files patch

Maximilian Kossick maximilian.kossick at googlemail.com
Fri Oct 9 08:38:49 CEST 2009


The patch is wrong. If you look at
OrganizeCollectionDialog::buildFormatString() you will see that
organizing the collection *should* change the filename to some
reasonable format as well (which it apparently does not).

The patch simply takes the filename of the source, which might be totally crap.

I'd suggest putting some debug output into
OrganizeCollectionDialog::getDestinations or ::buildDestination to
figure out why the filename is missing from the destination. It looks
as if it should be there.

On Fri, Oct 9, 2009 at 12:11 AM, Casey Jones <jonescaseyb at gmail.com> wrote:
> On Wednesday 07 October 2009 2:26:24 am Mark Kretschmann wrote:
>>
>> Yes, I will try to evaluate this patch today.
>>
>
> What I did to test was to create a backup of my collection (obvious), and then
> I used the OrganizeCollectionDialog to organize my collection by Album.
>
> Without this patch, in the debug output you'll see that you get errors for
> most files it tries to copy.   This happens because the first file it copies ends
> up being root/AlbumName.  And each file after that in that folder tries to copy
> to root/AlbumName, but that file already exists.
>
> KUrl src is the url to the original file, but KUrl dest is only the url to the
> directory to put the file in.
> So when copying the files with KIO::file_copy(src, dest) it translates to this
> unix stlye cp command.
> cp root/oldDir/song.mp3 root/AlbumName
>
> Which doesn't mean "put the file _in_ AlbumName", it means "put the file _in_
> root, and _name_ it AlbumName."  So by creating finalDest and appending the
> file's name to the end you get this working cp command.
> cp root/oldDir/song.mp3 root/AlbumName/song.mp3
>
> QFileInfo info.dir() only returned the collection root, I'm assuming that's
> because it thinks AlbumName is a file, not a directory.  So by using
> info.absoluteFilePath() it returned root/AlbumName, which was then checked for
> existance, and then it makes that directory.
>
> Casey
> _______________________________________________
> Amarok-devel mailing list
> Amarok-devel at kde.org
> https://mail.kde.org/mailman/listinfo/amarok-devel
>


More information about the Amarok-devel mailing list