[Digikam-devel] [Bug 116344] Disable the button "Back" after changing album library path, if not it crashes DigiKam.
Joern Ahrens
joern.ahrens at kdemail.net
Sat Nov 19 23:02:22 GMT 2005
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.kde.org/show_bug.cgi?id=116344
joern.ahrens kdemail net changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
------- Additional Comments From joern.ahrens kdemail net 2005-11-20 00:02 -------
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);
More information about the Digikam-devel
mailing list