Bug 141305 - kaddressbook crashes while adding a picture to a contact
Summary: kaddressbook crashes while adding a picture to a contact
Status: RESOLVED UNMAINTAINED
Alias: None
Product: kab3
Classification: Miscellaneous
Component: general (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Tobias Koenig
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-07 00:58 UTC by Sergio Martins
Modified: 2009-08-05 16:32 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Where you must go to reproduce the bug (75.44 KB, image/png)
2007-02-07 01:00 UTC, Sergio Martins
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sergio Martins 2007-02-07 00:58:35 UTC
Version:            (using KDE KDE 3.5.6)
Installed from:    Gentoo Packages
OS:                Linux

Edit a contact, go to "Misc" tab, click the photo button, choose an image from the file selector

See: http://img390.imageshack.us/img390/1092/38734412nt3.png 

Now, press button 1 then button 2 and kaddressbook crashes.

If you can't reproduce the bug i'll post a backtrace.
Comment 1 Sergio Martins 2007-02-07 01:00:00 UTC
Created attachment 19573 [details]
Where you must go to reproduce the bug
Comment 2 Tobias Koenig 2007-02-09 18:53:30 UTC
SVN commit 631989 by tokoe:

Give the KPixmapSelectorDialog a real parent to make modular
dialog working...

BUG:141305


 M  +6 -6      imagewidget.cpp  
 M  +2 -1      imagewidget.h  


--- branches/KDE/3.5/kdepim/kaddressbook/imagewidget.cpp #631988:631989
@@ -47,8 +47,8 @@
 
 #include "imagewidget.h"
 
-ImageLoader::ImageLoader()
-  : QObject( 0, "ImageLoader" )
+ImageLoader::ImageLoader( QWidget *parent )
+  : QObject( 0, "ImageLoader" ), mParent( parent )
 {
 }
 
@@ -67,7 +67,7 @@
     image.load( url.path() );
     picture.setData( image );
     (*ok) = true;
-  } else if ( KIO::NetAccess::download( url, tempFile, 0 ) ) {
+  } else if ( KIO::NetAccess::download( url, tempFile, mParent ) ) {
     image.load( tempFile );
     picture.setData( image );
     (*ok) = true;
@@ -76,13 +76,13 @@
 
   if ( !(*ok) ) {
     // image does not exist (any more)
-    KMessageBox::sorry( 0, i18n( "This contact's image cannot be found." ) );
+    KMessageBox::sorry( mParent, i18n( "This contact's image cannot be found." ) );
     return picture;
   }
 
   QPixmap pixmap = picture.data();
 
-  QPixmap selectedPixmap = KPIM::KPixmapRegionSelectorDialog::getSelectedImage( pixmap, 100, 140, 0 );
+  QPixmap selectedPixmap = KPIM::KPixmapRegionSelectorDialog::getSelectedImage( pixmap, 100, 140, mParent );
   if ( selectedPixmap.isNull() ) {
     (*ok) = false;
     return picture;
@@ -248,7 +248,7 @@
                                   QWidget *parent, const char *name )
   : QWidget( parent, name ), mReadOnly( false )
 {
-  mImageLoader = new ImageLoader();
+  mImageLoader = new ImageLoader( this );
 
   QVBoxLayout *topLayout = new QVBoxLayout( this, KDialog::marginHint(),
                                             KDialog::spacingHint() );
--- branches/KDE/3.5/kdepim/kaddressbook/imagewidget.h #631988:631989
@@ -40,12 +40,13 @@
   Q_OBJECT
 
   public:
-    ImageLoader();
+    ImageLoader( QWidget *parent );
 
     KABC::Picture loadPicture( const KURL &url, bool *ok );
 
   private:
     KABC::Picture mPicture;
+    QWidget *mParent;
 };
 
 /**
Comment 3 Tobias Koenig 2009-08-05 16:32:23 UTC
The development of the old KAddressBook will be discontinued for KDE 4.4.
Since the new application has the same name, but a completly new code base we close all bug reports against the old version and ask the submitters to resend there reports against the new product.