Bug 241523 - KHotNewStuff doesn't copy downloaded file to target directory
Summary: KHotNewStuff doesn't copy downloaded file to target directory
Status: RESOLVED FIXED
Alias: None
Product: kdelibs
Classification: Frameworks and Libraries
Component: knewstuff (show other bugs)
Version: unspecified
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Jeremy Whiting
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-12 10:31 UTC by Peter Grasch
Modified: 2010-09-14 23:08 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Grasch 2010-06-12 10:31:21 UTC
Version:           unspecified (using KDE 4.4.3) 
OS:                MS Windows

First of all this really is KDE 4.4.4 but the version box didn't provide that option.

When using KHNS on windows, the dialog displays fine and I can view deatiled information, previews, everything.

When I select to download an item, it even correctly downloads and is stored in the temporary directory (%appdata%\.kde\tmp-342EBFCA2C26439).

However, it is never moved to the target directory.

Debugview displays the following debug output:

[3416] Warning:QFSFileEngine::open: No file name specified
[3416] Critical:simon(3416)/knewstuff (api): Cannot move file ' "c:/dokumente und einstellungen/simon/anwendungsdaten/.kde/tmp-342ebfca2c26439/MD3D0xoHiN" ' to destination ' "c:/dokumente und einstellungen/simon/anwendungsdaten/.kde/share/apps/simon/scenarios//123578-amarok.scenario" '

The file "c:/dokumente und einstellungen/simon/anwendungsdaten/.kde/tmp-342ebfca2c26439/MD3D0xoHiN" exists and is really what KNS just downloaded. The target folder exists as well.

Reproducible: Always

Steps to Reproduce:
Open a KNS Dialog
Try to download something

Actual Results:  
The download button changes to the busy state for a second but nothing really happens.

Expected Results:  
The item to be installed.

As I said above, this is actually KDE 4.4.4.
Comment 1 Frederik Gladhorn 2010-08-05 14:45:18 UTC
SVN commit 1159468 by gladhorn:

Use KUrl::toLocalFile instead of urlOrPath which should fix installation on windows.

backport r1159467 
BUG: 241523


 M  +2 -3      installation.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1159468
Comment 2 Peter Grasch 2010-09-06 09:00:43 UTC
This is not yet fixed (for me at least).

On line 480 the file is renamed:
success = file.rename(QUrl(installpath).toLocalFile());

If I change this to that:
success = file.rename(installpath);

It installs fine.

I added some debug output and am recompiling right now...
Comment 3 Peter Grasch 2010-09-06 14:02:49 UTC
Ok there seems to be a problem when using QUrl. I added this debug code:
http://pastebin.com/E3NGPfuH

Which produces these log messages:
http://pastebin.com/VmASWx71

QUrl(installpath).toLocalFile() returns an empty string.

Changing success = file.rename(QUrl(installpath).toLocalFile()); to success = file.rename(KUrl(installpath).toLocalFile()); (QUrl -> KUrl) fixes the bug for me.

Regards,
Peter
Comment 4 Frederik Gladhorn 2010-09-13 22:52:31 UTC
Do you have an account? if so please commit your fix. else I can do it.
Comment 5 Peter Grasch 2010-09-14 23:00:03 UTC
SVN commit 1175372 by grasch:

Bugfix: Copying installed files to target directory was broken on Windows
BUG: 241523


 M  +1 -1      installation.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1175372
Comment 6 Peter Grasch 2010-09-14 23:08:52 UTC
Commited and backported to the 4.5 branch.

My first commit(s) to the KDE svn :D