Bug 168461

Summary: info in Properties panel not updated after moving to other image
Product: [Applications] digikam Reporter: Mikolaj Machowski <mikmach>
Component: ImageEditor-WorkflowAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: caulier.gilles, marcel.wiesweg, mikmach
Priority: NOR    
Version: 0.10.0   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In: 7.5.0
Sentry Crash Report:
Attachments: fix

Description Mikolaj Machowski 2008-08-05 23:43:31 UTC
Version:           0.10-svn (using Devel)
Installed from:    Compiled sources
Compiler:          gcc4.2.2 
OS:                Linux

Info in Properties panel isn't updated after moving to another image - but only when clicking onf thumb in thumbbar. When moving by any other mean (key shortcut, buttons) it is properly updated.

Also doesn't affect other panels.
Comment 1 Andi Clemens 2008-08-15 21:34:10 UTC
Created attachment 26867 [details]
fix

This should fix the issue
Comment 2 Mikolaj Machowski 2008-08-16 15:56:19 UTC
Thanks, your patch fixes this bug.
Comment 3 Andi Clemens 2008-08-16 17:02:28 UTC
I'll commit the patch as soon as another developer has taken a look at it, because I'm not quite sure what the old code was meant to do, not that it breaks another function or so.

Andi
Comment 4 caulier.gilles 2008-08-19 11:06:50 UTC
Andi,

Patch sound fine for me... but i remember than Marcel has profiled image properties updating here in the pass to speed-up digiKam.

Marcel, i'm right ?

Mik, this problem is reproductible in KDE3 version ?

Gilles
Comment 5 Andi Clemens 2008-08-19 11:09:36 UTC
Gilles,

it is not reproducible in KDE3 and even not in showFoto (KDE4). So I guess there just went something wrong? It is also not reproducible in the album icon view, only in the image editor.

Andi
Comment 6 caulier.gilles 2008-08-19 11:13:47 UTC
Andi,

Thanks for the details. I waiting Marcel comments.

Gilles
Comment 7 Marcel Wiesweg 2008-08-19 14:42:38 UTC
The code part touched by Andi's proposed patch has a purpose: If IE is running with database information, i.e. it has ImageInfo objects, then these objects (which provide more than just a URL) shall be passed to the sidebar. There must be something wrong with the sidebar updating code that affects only one panel and only when used from IE - I need to take a look at that.
Comment 8 Mikolaj Machowski 2008-08-19 19:53:04 UTC
@#4
IE thumbbar exists only in KDE4, isn't it?
Comment 9 caulier.gilles 2008-08-19 20:10:16 UTC
Mik, 

image properties is not thumbbar. and yes thumbbar is only avaialble in editor with KDE4

Gilles
Comment 10 caulier.gilles 2008-08-24 09:27:41 UTC
SVN commit 851606 by mwiesweg:

Properly update the current ImageInfo as well as the current url in slotThumbBarItemSelected.

Add some more emptiness checks which seem necessary to me.

BUG: 168461


 M  +14 -5     imagewindow.cpp


--- trunk/extragear/graphics/digikam/utilities/imageeditor/editor/imagewindow.cpp #851605:851606
@@ -455,7 +455,13 @@
    if (!promptUserSave(d->urlCurrent))
        return;

+    int index = d->urlList.indexOf(url);
+    if (index == -1)
+        return;
+
    d->urlCurrent = url;
+    if (!d->imageInfoList.isEmpty())
+        d->imageInfoCurrent = d->imageInfoList[index];

    m_saveAction->setEnabled(false);
    m_revertAction->setEnabled(false);
@@ -482,7 +488,6 @@
 void ImageWindow::loadImageInfos(const ImageInfoList &imageInfoList, const ImageInfo &imageInfoCurrent,
                                 const QString& caption, bool allowSaving)
 {
-    // The ownership of objects of imageInfoList is passed to us.
    // imageInfoCurrent is contained in imageInfoList.

    // Very first thing is to check for changes, user may choose to cancel operation
@@ -574,7 +579,8 @@
        ++index;
        if (index != d->urlList.size())
        {
-           d->imageInfoCurrent = d->imageInfoList[index];
+           if (!d->imageInfoList.isEmpty())
+               d->imageInfoCurrent = d->imageInfoList[index];
           d->urlCurrent = d->urlList[index];
           slotLoadCurrent();
        }
@@ -594,7 +600,8 @@

        if (index != d->urlList.size())
        {
-           d->imageInfoCurrent = d->imageInfoList[index];
+           if (!d->imageInfoList.isEmpty())
+               d->imageInfoCurrent = d->imageInfoList[index];
           d->urlCurrent = d->urlList[index];
           slotLoadCurrent();
        }
@@ -607,7 +614,8 @@
        return;

    d->urlCurrent = d->urlList.first();
-    d->imageInfoCurrent = d->imageInfoList.first();
+    if (!d->imageInfoList.isEmpty())
+        d->imageInfoCurrent = d->imageInfoList.first();
    slotLoadCurrent();
 }

@@ -617,7 +625,8 @@
        return;

    d->urlCurrent = d->urlList.last();
-    d->imageInfoCurrent = d->imageInfoList.last();
+    if (!d->imageInfoList.isEmpty())
+        d->imageInfoCurrent = d->imageInfoList.last();
    slotLoadCurrent();
 }