Bug 116605 - HTML Gallery crashing when exporting to an existing dir an choosing no to overwrite [Patch]
Summary: HTML Gallery crashing when exporting to an existing dir an choosing no to ove...
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Plugin-Generic-HTMLGallery (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR crash
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-18 09:14 UTC by Matiyam
Modified: 2017-07-09 13:17 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 5.7.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matiyam 2005-11-18 09:14:52 UTC
Version:           0.1+rc1-1ubuntu1 (using KDE KDE 3.4.3)
Installed from:    Ubuntu Packages
OS:                Linux

Digikam is always crashing in this situation (i have filled as a bug, not a crash because is not a big problem, it just lokks bad):


- I export a HTML album (with kipi-plugins, imagesgallery plugin) in some dir. It works
- I export again another album (i am just testing how it looks). I leave
the same directory destination than before
- A dialog appears: "The target folder "/path/to/KIPIHTMLExport" already
exists. Do you want to overwrite it?

- If I press "Yes", it gets overwriten (it works ok)
- BUT if I press "No", digikam crashes

I just get this in the console:
KCrash: Application 'digikam' crashing...
Unable to start Dr. Konqi

The code handling this is here (imagesgallery.cpp):

bool ImagesGallery::removeTargetGalleryFolder(void)
{
    QDir TargetDir;
    QString MainTPath = m_configDlg->getImageName() + "/KIPIHTMLExport";

    if (TargetDir.exists (MainTPath) == true)
       {
       if (KMessageBox::warningYesNo(kapp->activeWindow(),
           i18n("The target folder\n'%1'\nalready exists; do you want
overwrite it? (all data "
                "in this folder will be lost.)").arg(MainTPath)) ==
KMessageBox::Yes)
          {
          if ( DeleteDir(MainTPath) == false )
             {
             KMessageBox::error(kapp->activeWindow(), i18n("Cannot
remove folder '%1'.").arg(MainTPath));
             return false;
             }
          }
       }

    return true;
}

It looks that if the answer to KMessageBox::warningYesNo is "No", the
function returns true anyway.

I guess it should be like this:
--- imagesgallery.cpp.orig      2005-11-18 09:12:07.000000000 +0100
+++ imagesgallery.cpp   2005-11-18 09:13:32.000000000 +0100
@@ -280,6 +280,10 @@
              }
           }
        }
+       else
+       {
+       return false;
+       }

     return true;
 }

Thanks a lof for sucha  great program!!
Comment 1 Tung NGUYEN 2005-11-18 21:44:49 UTC
I can reproduce the crash too, KCrash:

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 -1237412160 (LWP 4271)]
[KCrash handler]
#4  0xb604cce8 in KIPIImagesGalleryPlugin::ImagesGallery::run ()
   from /usr/lib/kde3/kipiplugin_imagesgallery.so
#5  0xb6036015 in Plugin_Imagesgallery::slotActivate ()
   from /usr/lib/kde3/kipiplugin_imagesgallery.so
#6  0xb6036141 in Plugin_Imagesgallery::qt_invoke ()
   from /usr/lib/kde3/kipiplugin_imagesgallery.so
#7  0xb6c8925d in QObject::activate_signal ()
   from /usr/lib/qt3/lib/libqt-mt.so.3
#8  0xb7726ce0 in ?? ()
#9  0xb743b568 in ?? () from /usr/lib/libkdeui.so.4
#10 0x00000000 in ?? ()
Comment 2 Tom Albers 2005-12-28 18:20:45 UTC
SVN commit 492067 by toma:

Matiyam is right, return false if user says 'no' to the dialog else it will crash...
BUG: 116605



 M  +3 -1      imagesgallery.cpp  


--- trunk/extragear/libs/kipi-plugins/imagesgallery/imagesgallery.cpp #492066:492067
@@ -278,7 +278,9 @@
              KMessageBox::error(kapp->activeWindow(), i18n("Cannot remove folder '%1'.").arg(MainTPath));
              return false;
              }
-          }
+          } 
+          else
+              return false;
        }
        
     return true;
Comment 3 caulier.gilles 2017-07-09 13:17:50 UTC
This problem is not reproducible with current HTML Gallery tool implemented in
digiKam core.

Gilles Caulier