Bug 91916 - Crash when adding tag in comment/tag dialog
Summary: Crash when adding tag in comment/tag dialog
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Tags-Captions (show other bugs)
Version: 0.7.0
Platform: Gentoo Packages Linux
: NOR crash
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-10-22 18:56 UTC by Maarten Wisse
Modified: 2022-01-22 10:13 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 7.6.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Maarten Wisse 2004-10-22 18:56:52 UTC
Version:           0.7-beta1 (using KDE KDE 3.3.0)
Installed from:    Gentoo Packages
Compiler:          gcc-3.3.4 
OS:                Linux

Steps to reproduce:

- right click on image in main window
- click `edit comments and tags'
- right click in tag area
- click `add new tag'
- enter name
- click `ok'
- applications disappears
Comment 1 Joern Ahrens 2004-10-22 20:48:29 UTC
CVS commit by jahrens: 

thanks for reporting. fixed in cvs.

BUG: 91916


  M +9 -6      imagedescedit.cpp   1.22
  M +1 -1      imagedescedit.h   1.9


--- kdeextragear-3/digikam/digikam/imagedescedit.cpp  #1.21:1.22
@@ -391,4 +391,5 @@ void ImageDescEdit::slotRightButtonClick
     {
         album = AlbumManager::instance()->findTAlbum(0);
+        albumItem = dynamic_cast<TAlbumCheckListItem*>(m_tagsView->firstChild());
     }
     else 
@@ -433,9 +434,5 @@ void ImageDescEdit::slotRightButtonClick
     {
         if (!album->isRoot()) 
-        {
-            tagDelete(album);
-            if(albumItem)
-                delete item;
-        }
+            tagDelete(album, albumItem);
         break;
     }
@@ -447,4 +444,7 @@ void ImageDescEdit::slotRightButtonClick
 void ImageDescEdit::tagNew(TAlbum* parAlbum, QCheckListItem *item)
 {
+    if(!parAlbum || !item)
+        return;
+        
     QString title, icon;
     AlbumManager *albumMan_ = AlbumManager::instance();
@@ -473,5 +473,5 @@ void ImageDescEdit::tagNew(TAlbum* parAl
 }
 
-void ImageDescEdit::tagDelete(TAlbum *album)
+void ImageDescEdit::tagDelete(TAlbum *album, QCheckListItem *item)
 {
     if (!album || album->isRoot())
@@ -490,4 +490,7 @@ void ImageDescEdit::tagDelete(TAlbum *al
             KMessageBox::error(0, errMsg);
     }
+
+    if(item)
+        delete item;    
 }
 

--- kdeextragear-3/digikam/digikam/imagedescedit.h  #1.8:1.9
@@ -49,5 +49,5 @@ private:
     void tagNew(TAlbum* parAlbum, QCheckListItem *item);
     void tagEdit(TAlbum* album);
-    void tagDelete(TAlbum *album);
+    void tagDelete(TAlbum *album, QCheckListItem *item);
     
     QGuardedPtr<Digikam::ThumbnailJob> m_thumbJob;