Bug 116344 - Disable the button "Back" after changing album library path, if not it crashes DigiKam.
Summary: Disable the button "Back" after changing album library path, if not it crashe...
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Albums-Engine (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: VHI crash
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-14 14:52 UTC by Tung NGUYEN
Modified: 2022-01-12 03:52 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 7.5.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tung NGUYEN 2005-11-14 14:52:49 UTC
Version:           0.8.0-rc (using KDE KDE 3.4.2)
Installed from:    Compiled From Sources
OS:                Linux

Situation 1:
===========
- The "Albums" view is the current opened view.
- Open "Settings->Configure Digikam..." and change the album library path to another album library.
- After this change, the button "Back" is active and a click on it crashes DigiKam with the messages:

Using host libthread_db library "/lib/tls/libthread_db.so.1".
`shared object read from target memory' has disappeared; keeping its symbols.
[Thread debugging using libthread_db enabled]
[New Thread -1237686592 (LWP 4757)]
[KCrash handler]
#4  0xb7d90588 in QMapPrivate<void const*, void*>::find ()
   from /usr/lib/libdigikam.so.0
#5  0xb7d8eb98 in Album::extraData () from /usr/lib/libdigikam.so.0
#6  0xb7dabd12 in DigikamView::slotAlbumHistoryBack ()
   from /usr/lib/libdigikam.so.0
#7  0xb7dae0a0 in DigikamView::qt_invoke () from /usr/lib/libdigikam.so.0
#8  0xb6c4625d in QObject::activate_signal ()
   from /usr/lib/qt3/lib/libqt-mt.so.3
#9  0xb640e191 in malloc_usable_size () from /lib/tls/libc.so.6

Situation 2:
===========
- The "Dates" view is the current opened view.
- Open "Settings->Configure Digikam..." and change the album library path to another album library.
- After this change, click on a month which contains images => the button "Back" is active and a click on it crashes DigiKam with the same messages.

Situation 3:
===========
- The "Tags" view is the current opened view.
- Open "Settings->Configure Digikam..." and change the album library path to another album library.
- After this change, click on "My Tags" => the button "Back" is active and a click on it crashes DigiKam with the same messages.

Situation 4:
===========
- The "Searches" view is the current opened view.
- Open "Settings->Configure Digikam..." and change the album library path to another album library.
- After this change, click on a search which contains images =>the button "Back" is active and a click on it crashes DigiKam with the same messages.
Comment 1 Tom Albers 2005-11-18 00:12:19 UTC
imho we have to resolve these issues before releasing, I will have a look this weekend, but I'm unsure I can fix it on my own.
Comment 2 Tung NGUYEN 2005-11-18 00:37:07 UTC
Thank you very much.
---
Tung.
Comment 3 Joern Ahrens 2005-11-20 00:02:19 UTC
SVN commit 481653 by jahrens:

Oh Tung, how do you find all these stupid bugs? Cool :)
The album history wasn't cleared if another album library path was set.

BUG: 116344



 M  +13 -4     albumhistory.cpp  
 M  +1 -0      albumhistory.h  
 M  +2 -0      digikamapp.cpp  
 M  +7 -0      digikamview.cpp  
 M  +1 -0      digikamview.h  


--- trunk/extragear/graphics/digikam/digikam/albumhistory.cpp #481652:481653
@@ -66,18 +66,27 @@
 
 AlbumHistory::~AlbumHistory()
 {
+    clearHistory();
+    
+    delete m_backwardStack;
+    delete m_forwardStack;
+}
+
+void AlbumHistory::clearHistory()
+{
     AlbumStack::iterator iter = m_backwardStack->begin();
     AlbumStack::iterator end = m_backwardStack->end();
     for(; iter != end; ++iter)
         delete *iter;
-    
+    m_backwardStack->clear();
+
     iter = m_forwardStack->begin();
     end = m_forwardStack->end();
     for(; iter != end; ++iter)
         delete *iter;
-    
-    delete m_backwardStack;
-    delete m_forwardStack;
+    m_forwardStack->clear();
+
+    m_moving = false;
 }
 
 void AlbumHistory::addAlbum(Album *album, QWidget *widget)
--- trunk/extragear/graphics/digikam/digikam/albumhistory.h #481652:481653
@@ -47,6 +47,7 @@
 
     void            addAlbum(Album *album, QWidget *widget = 0);
     void            deleteAlbum(Album *album);
+    void            clearHistory();
     void            back(Album **album, QWidget **widget, unsigned int steps=1);
     void            forward(Album **album, QWidget **widget, unsigned int steps=1);
     void            getCurrentAlbum(Album **album, QWidget **widget) const;
--- trunk/extragear/graphics/digikam/digikam/digikamapp.cpp #481652:481653
@@ -934,6 +934,8 @@
 
 void DigikamApp::slotSetupChanged()
 {
+    if(mAlbumSettings->getAlbumLibraryPath() != mAlbumManager->getLibraryPath())
+        mView->clearHistory();
     mAlbumManager->setLibraryPath(mAlbumSettings->getAlbumLibraryPath());
     mAlbumManager->startScan();
 
--- trunk/extragear/graphics/digikam/digikam/digikamview.cpp #481652:481653
@@ -353,6 +353,13 @@
     }
 }
 
+void DigikamView::clearHistory()
+{
+    mAlbumHistory->clearHistory();
+    mParent->enableAlbumBackwardHistory(false);
+    mParent->enableAlbumForwardHistory(false);
+}
+
 void DigikamView::getBackwardHistory(QStringList &titles)
 {
     mAlbumHistory->getBackwardHistory(titles);
--- trunk/extragear/graphics/digikam/digikam/digikamview.h #481652:481653
@@ -67,6 +67,7 @@
 
     void applySettings(const AlbumSettings* settings);
 
+    void clearHistory();
     void getForwardHistory(QStringList &titles);
     void getBackwardHistory(QStringList &titles);