Bug 205341

Summary: digikam get mixed up with windows path. need of head '/' before C:/ ?
Product: [Applications] digikam Reporter: battmanux <battmanu>
Component: Bundle-WindowsAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: caulier.gilles, Ch.Ehrlicher, marcel.wiesweg, meldavid, michaelangelgp+kde
Priority: NOR    
Version: 1.0.0   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed In: 1.0.0
Sentry Crash Report:

Description battmanux 2009-08-27 15:27:42 UTC
Version:           1.0.0-beta3 (using 4.3.00 (KDE 4.3.0), MS Visual Studio 2008 SP1)
Compiler:          cl.exe
OS:                Microsoft Windows (i686) release 5.1 (XP Professional)

Using KDE windows installer, digikam (marked unstable) does not succed do setup my albums. First sqlite3 was not installed, then what was entered by digikam wisard inthe db was not good. I had to enter it by hand in order to have mu album to show up. ( I edited digikam4.db Albums and AlbumRoot paths and removed head '/')
Comment 1 David Eriksson 2009-08-30 14:37:05 UTC
I think this problem comes with KDE 4.3.0 and via commit 930172, which makes KUrl::path() return /C:/... instead of C:/.... It can be fixed by using KUrl::toLocalFile() instead of KUrl::path(). There are many places in the code where KUrl::path() are used and I guess that all of them have stoped working on Windows.

Is there a reason why KUrl::path() is used and not KUrl::toLocalFile()? Is it needed when having network collections?
Comment 2 caulier.gilles 2009-08-30 15:19:06 UTC
The right qestion is why KUrl::path() return /C:/... instead of C:/

I don't understand really... It's not logic...

Gilles Caulier
Comment 3 Marcel Wiesweg 2009-08-30 16:09:33 UTC
I dont know the rationale for this neither.
I remember some time ago someone change path() to toLocalFile() all over the KDE code base, but apparently not everywhere in digikam where it is needed.

David: we use path() and not toLocalFile() because path() was just there and working for years.
Comment 4 Christian Ehrlicher 2009-08-30 18:01:58 UTC
The return value of KUrl::path() is correct. You've to use KUrl::toLocalFile().
Comment 5 Christian Ehrlicher 2009-08-30 18:03:36 UTC
Oh, and here the explanation: http://lists.kde.org/?l=kde-core-devel&m=123550729120429&w=2
Comment 6 caulier.gilles 2009-08-30 18:14:16 UTC
Andy,

Can you make a script to fix KUrl::path() to KUrel::localPath() everywhere ? This include digiKam, kipi-plugins, and KDEGraphics/libs...

Thanks in advance

Gilles Caulier
Comment 7 Christian Ehrlicher 2009-08-30 18:22:55 UTC
I'm sure you won't do that. It's not a simple search'n'replace. Soemtimes you want KUrl::path() - at least I found a lot of places during my manual replacing some months ago (and some which I overlooked and had to be fixed afterwards)
Comment 8 Marcel Wiesweg 2009-09-12 15:50:16 UTC
SVN commit 1022773 by mwiesweg:

Replace most occurrences of KUrl::path with KUrl::toLocalFile.
Searched with git grep and selected manually. At a few places
the url does not refer to a local file and toLocalFile must therefore not be used.

CCBUG: 205341

 M  +5 -5      digikam/albumthumbnailloader.cpp  
 M  +2 -2      digikam/imagecategorizedview.cpp  
 M  +2 -2      digikam/imageviewutilities.cpp  
 M  +2 -2      imageplugins/channelmixer/channelmixertool.cpp  
 M  +2 -2      imageplugins/coreplugin/bwsepiatool.cpp  
 M  +11 -11    imageplugins/coreplugin/iccprooftool.cpp  
 M  +2 -2      imageplugins/coreplugin/resizetool.cpp  
 M  +2 -2      imageplugins/coreplugin/sharpentool.cpp  
 M  +2 -2      imageplugins/inpainting/inpaintingtool.cpp  
 M  +2 -2      imageplugins/localcontrast/localcontrasttool.cpp  
 M  +2 -2      imageplugins/noisereduction/noisereductiontool.cpp  
 M  +2 -2      imageplugins/restoration/restorationtool.cpp  
 M  +4 -4      imageplugins/superimpose/dirselectwidget.cpp  
 M  +6 -6      imageplugins/superimpose/superimposetool.cpp  
 M  +1 -1      imageplugins/superimpose/superimposewidget.cpp  
 M  +2 -2      imageplugins/whitebalance/whitebalancetool.cpp  
 M  +0 -3      kioslave/digikamdates.cpp  
 M  +2 -2      libs/curves/imagecurves.cpp  
 M  +1 -2      libs/database/albumdb.cpp  
 M  +14 -14    libs/database/collectionmanager.cpp  
 M  +3 -3      libs/database/databaseurl.cpp  
 M  +4 -4      libs/database/imagequerybuilder.cpp  
 M  +1 -1      libs/database/imagescanner.cpp  
 M  +2 -1      libs/dialogs/deletedialog.cpp  
 M  +2 -2      libs/dialogs/imagedialog.cpp  
 M  +2 -2      libs/imageproperties/cameraitempropertiestab.cpp  
 M  +2 -2      libs/imageproperties/imagepropertiescolorstab.cpp  
 M  +1 -1      libs/imageproperties/imagepropertiesgpstab.cpp  
 M  +1 -1      libs/imageproperties/imagepropertiesmetadatatab.cpp  
 M  +2 -2      libs/imageproperties/imagepropertiessidebar.cpp  
 M  +1 -1      libs/imageproperties/imagepropertiessidebarcamgui.cpp  
 M  +2 -2      libs/levels/imagelevels.cpp  
 M  +1 -1      libs/template/subjectwidget.cpp  
 M  +1 -1      libs/threadimageio/thumbnailloadthread.cpp  
 M  +1 -1      libs/widgets/iccprofiles/cietonguewidget.cpp  
 M  +1 -1      libs/widgets/iccprofiles/iccpreviewwidget.cpp  
 M  +2 -2      libs/widgets/iccprofiles/iccprofilewidget.cpp  
 M  +2 -2      libs/widgets/metadata/exifwidget.cpp  
 M  +1 -1      libs/widgets/metadata/iptcwidget.cpp  
 M  +2 -2      libs/widgets/metadata/makernotewidget.cpp  
 M  +1 -1      libs/widgets/metadata/metadatawidget.cpp  
 M  +1 -1      libs/widgets/metadata/xmpwidget.cpp  
 M  +7 -7      showfoto/showfoto.cpp  
 M  +12 -12    utilities/cameragui/cameracontroller.cpp  
 M  +10 -10    utilities/cameragui/cameraui.cpp  
 M  +3 -3      utilities/fuzzysearch/findduplicatesview.cpp  
 M  +1 -1      utilities/fuzzysearch/fuzzysearchview.cpp  
 M  +12 -12    utilities/imageeditor/editor/editorwindow.cpp  
 M  +10 -10    utilities/imageeditor/editor/imagewindow.cpp  
 M  +1 -1      utilities/imageeditor/rawimport/rawpreview.cpp  
 M  +1 -1      utilities/kipiiface/kipiimageinfo.cpp  
 M  +3 -3      utilities/kipiiface/kipiinterface.cpp  
 M  +1 -1      utilities/queuemanager/actionthread.cpp  
 M  +3 -3      utilities/queuemanager/basetools/transform/flip.cpp  
 M  +6 -6      utilities/queuemanager/basetools/transform/rotate.cpp  
 M  +4 -4      utilities/queuemanager/batchtool.cpp  
 M  +1 -1      utilities/queuemanager/queuelist.cpp  
 M  +4 -4      utilities/queuemanager/queuemgrwindow.cpp  
 M  +1 -1      utilities/setup/cameraselection.cpp  
 M  +2 -2      utilities/setup/setupcollections.cpp  
 M  +2 -2      utilities/setup/setupicc.cpp  
 M  +5 -5      utilities/slideshow/slideshow.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1022773
Comment 9 Michael 2009-10-05 02:51:52 UTC
Hi,

I don't know if this is fixed on git but I'm using 1.0.0-beta4 (installed through the KDE installer) on Windows Vista and can confirm the issue. As a matter of fact, the issue seems fixed in some places and not others (don't know if they are digiKam specific or KDE related). For example, the location of the database file dialog works fine, however, the dialog to add a folder to the collection does not. If you need any tests or other information don't hesitate to ask.

Best regards,

Michael
Comment 10 Marcel Wiesweg 2009-11-30 20:28:29 UTC
Can digikam-on-windows users report here if there are still issues around? After the coding sprint I would expect everything works ;-)
Comment 11 David Eriksson 2009-12-09 22:46:26 UTC
I think most of the problems are gone. There are at least one still there, bug 210969. That one is related to KUrl::directory() and there can be other places where directory gives problems. One place I noticed is in the file info in the right sidebar where the directory for the file is shown with a starting / and also the windowtitle in showfoto.
Comment 12 Marcel Wiesweg 2009-12-10 20:30:19 UTC
I'm closing this one, 210969 remains to do.