Bug 335073

Summary: Entering the digiKam database path manually is broken
Product: [Applications] digikam Reporter: qqqqqqqqq9
Component: Setup-DatabaseAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: caulier.gilles, cfeck, johannes.hirte, simonandric5
Priority: NOR    
Version: 4.0.0   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In: 4.1.0
Sentry Crash Report:

Description qqqqqqqqq9 2014-05-20 10:33:46 UTC
When I edit the database path manually, the cursor jumps to the end after entering the first character.

Reproducible: Always

Steps to Reproduce:
1. Go to: Settings - configure digikam - database
2. The database path be /home/photos
3. click after /home/ and enter: "horst/"
Actual Results:  
The path now reads;
/home/hPhotosorst/

Expected Results:  
The path should read:
/home/horst/Photos
Comment 1 caulier.gilles 2014-05-20 11:18:28 UTC
Widget used to edit Database path is KUrlRequester from KDElibs :

https://projects.kde.org/projects/extragear/graphics/digikam/repository/revisions/master/entry/libs/widgets/common/databasewidget.cpp#L99

Problem is reproducible here. there is nothing special in digiKam code about

Sound like a problem from KDELibs...

Gilles Caulier
Comment 2 Christoph Feck 2014-05-20 12:01:27 UTC
I cannot reproduce it using the KUrlRequester that are used in System Settings > Account Details > Paths. Does it also happen there?

Can you please right-click the widget and check which "Completion mode" you use and try changing these?
Comment 3 qqqqqqqqq9 2014-05-20 12:08:34 UTC
No problems in systemsettings for me. Changing the text completion mode doesn't have an effect.
Comment 4 Christoph Feck 2014-05-20 12:14:20 UTC
Gilles, could you re-check digikam code? Does the code connect to the textChanged() signal, and if yes, what does it do?
Comment 5 caulier.gilles 2014-05-20 12:31:09 UTC
yes, it's connected to textChanged() to filter path entered by user :

https://projects.kde.org/projects/extragear/graphics/digikam/repository/revisions/master/entry/libs/widgets/common/databasewidget.cpp#L236

Perhaps i need to use a timer here before to complete filtering and prevent slot cal for each characters enter in edit field ?

Gilles
Comment 6 caulier.gilles 2014-05-23 12:11:59 UTC
Git commit 646f4612f128dca8e32085447f93327164da7c0d by Gilles Caulier.
Committed on 23/05/2014 at 12:10.
Pushed by cgilles into branch 'master'.

add timer to prevent bombarding signal over DB path edit field, which can corrupt path edited.
FIXED-IN: 4.1.0

M  +11   -3    libs/widgets/common/databasewidget.cpp
M  +9    -5    libs/widgets/common/databasewidget.h

http://commits.kde.org/digikam/646f4612f128dca8e32085447f93327164da7c0d
Comment 7 Johannes Hirte 2014-10-10 16:58:49 UTC
This patch breakes config dialog when MySQL is chosen as DB backend. Please see: https://bugs.gentoo.org/show_bug.cgi?id=521992
Comment 8 caulier.gilles 2015-03-25 08:35:10 UTC
To Johannes from comment #7

Problem still reproducible with last digiKam 4.8.0 ?

Gilles Caulier
Comment 9 Johannes Hirte 2015-03-25 22:07:21 UTC
(In reply to Gilles Caulier from comment #8)
> To Johannes from comment #7
> 
> Problem still reproducible with last digiKam 4.8.0 ?
> 
> Gilles Caulier

Was already fixed in 4.5.0 with:

commit f0400ec7e518e753e0c4ccab4eb2b8b022f91767
Author: Gilles Caulier <caulier.gilles@gmail.com>
Date:   Tue Oct 28 15:58:55 2014 +0100

    apply patch #89156
    BUGS: 337737
    FIXED-IN: 4.5.0