KDE
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   Web Development Archives Mailing Lists KDE

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Web Development Archives Sponsor:
  #1  
Old January 7th, 2006, 01:15 PM
Goffredo Baroncelli
Guest
Dev Archives Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Crash during a "insert file" in the composer

Hi all, and happy new year

As also reported in the bugs
- 111383: kmail crashes while inserting files,
- 108063: kmail composer crashes when inserting file,
- 111713: kmail crashes when inserting files
I discovered that sometime the kmail composer crash when an user try to
insert a file via the menu edit->insert file.

Looking the code I noted the following lines

( file kdepim/kmail/kmcomposewin.cpp, function void KMComposeWin::slotInsertFile(), line
~2660)

ghigo@therra:~/kmail/kdepim-3.5.0/kmail$ grep -n -B8 "urls.erase( encodings.fromLast() );" kmcomposewin.cpp
2652- QStringList urls = config->readListEntry( "recent-urls" );
2653- QStringList encodings = config->readListEntry( "recent-encodings" );
2654- // Prevent config file from growing without bound
2655- // Would be nicer to get this constant from KRecentFilesAction
2656- uint mMaxRecentFiles = 30;
2657- while (urls.count() mMaxRecentFiles)
2658- urls.erase( urls.fromLast() );
2659- while (encodings.count() mMaxRecentFiles)
2660: urls.erase( encodings.fromLast() );

Note the line 2660: the code remove an item from the 'urls' list on the
basis of an iterator which comes from the the 'encoding' list !!!. I think that
the 'urls' variable have to be replaced by 'encodings'.
The patch below correct this, and should solve the bugs above: the crash happens only when
there are more than 30 items in the encodings lists and this seems coherent with which is
described in the bugs report.

2005-10-10 17:02:11.000000000 +0200
2006-01-07 18:49:06.000000000 +0100
@@ -2657,7 +2657,7 @@
while (urls.count() mMaxRecentFiles)
urls.erase( urls.fromLast() );
while (encodings.count() mMaxRecentFiles)
- urls.erase( encodings.fromLast() );
+ encodings.erase( encodings.fromLast() );
// sanity check
if (urls.count() != encodings.count()) {
urls.clear();

Goffredo

P.S.:
I am not in the list, so please cc: me in case of reply. Thanks

--
gpg key@ keyserver.linux.it: Goffredo Baroncelli (ghigo) <kreijack_AT_inwind.it>
Key fingerprint = CE3C 7E01 6782 30A3 5B87 87C0 BB86 505C 6B2A CFF9


KMail developers mailing list
KMail-devel (AT) kde (DOT) org


PGP SIGNATURE
Version: GnuPG v1.4.1 (GNU/Linux)


i7mnowT+rVpU6fSjdvqMuDI=
=WanX
PGP SIGNATURE

Reply With Quote
  #2  
Old January 9th, 2006, 04:04 AM
Don Sanders
Guest
Dev Archives Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Crash during a "insert file" in the composer

Sunday 08 January 2006 04:13, Goffredo Baroncelli wrote:
Hi all, and happy new year
>

As also reported in the bugs
- 111383: kmail crashes while inserting files,
- 108063: kmail composer crashes when inserting file,
- 111713: kmail crashes when inserting files
I discovered that sometime the kmail composer crash when an user
try to insert a file via the menu edit->insert file.

I've been meaning to look into these bugs but haven't been able to
find the time. Thanks very much for looking into the issue.

Looking the code I noted the following lines
>

( file kdepim/kmail/kmcomposewin.cpp, function void
KMComposeWin::slotInsertFile(), line ~2660)
>

ghigo@therra:~/kmail/kdepim-3.5.0/kmail$ grep -n -B8 "urls.erase(
encodings.fromLast() );" kmcomposewin.cpp 2652- QStringList urls
= config->readListEntry( "recent-urls" ); 2653- QStringList
encodings = config->readListEntry( "recent-encodings" ); 2654-
// Prevent config file from growing without bound 2655- // Would
be nicer to get this constant from KRecentFilesAction 2656- uint
mMaxRecentFiles = 30;
2657- while (urls.count() mMaxRecentFiles)
2658- urls.erase( urls.fromLast() );
2659- while (encodings.count() mMaxRecentFiles)
2660: urls.erase( encodings.fromLast() );
>

Note the line 2660: the code remove an item from the 'urls' list on
the basis of an iterator which comes from the the 'encoding' list
!!!. I think that the 'urls' variable have to be replaced by
'encodings'.

Yes you are correct, that is embarrassing. Thanks very much for
detecting this.

The patch below correct this, and should solve the bugs above: the
crash happens only when there are more than 30 items in the
encodings lists and this seems coherent with which is described in
the bugs report.
>

2005-10-10
17:02:11.000000000 +0200
2006-01-07
18:49:06.000000000 +0100 @@ -2657,7 +2657,7 @@
while (urls.count() mMaxRecentFiles)
urls.erase( urls.fromLast() );
while (encodings.count() mMaxRecentFiles)
- urls.erase( encodings.fromLast() );
+ encodings.erase( encodings.fromLast() );
// sanity check
if (urls.count() != encodings.count()) {
urls.clear();
>

Goffredo
>

P.S.:
I am not in the list, so please cc: me in case of reply. Thanks

This is excellent, the change looks fine. Thanks ever so much. Do you
have commit privs? Can you commit?

If not I'll commit the patch to HEAD and to the KDE_3_5_BRANCH (or
whatever it is called, assuming no one beats me to it).

Thanks again,
Don Sanders.

KMail developers mailing list
KMail-devel (AT) kde (DOT) org

Reply With Quote
  #3  
Old January 11th, 2006, 01:46 PM
Allen Winter
Guest
Dev Archives Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Crash during a "insert file" in the composer

Monday 09 January 2006 03:32, Don Sanders wrote:
Sunday 08 January 2006 04:13, Goffredo Baroncelli wrote:
Hi all, and happy new year
>


This is excellent, the change looks fine. Thanks ever so much. Do you
have commit privs? Can you commit?

If not I'll commit the patch to HEAD and to the KDE_3_5_BRANCH (or
whatever it is called, assuming no one beats me to it).

Patch committed, and bugs marked fixed.
Thanks again Goffredo.
-Allen
--
Let's Keep the Political Talk of KDE PLEASE

KMail developers mailing list
KMail-devel (AT) kde (DOT) org

Reply With Quote
  #4  
Old January 11th, 2006, 09:42 PM
Don Sanders
Guest
Dev Archives Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Crash during a "insert file" in the composer

Thursday 12 January 2006 04:38, Allen Winter wrote:
Monday 09 January 2006 03:32, Don Sanders wrote:
Sunday 08 January 2006 04:13, Goffredo Baroncelli wrote:
Hi all, and happy new year
>

This is excellent, the change looks fine. Thanks ever so much. Do
you have commit privs? Can you commit?
>

If not I'll commit the patch to HEAD and to the KDE_3_5_BRANCH
(or whatever it is called, assuming no one beats me to it).
>

Patch committed, and bugs marked fixed.
Thanks again Goffredo.

Thanks Allen.

Don.

KMail developers mailing list
KMail-devel (AT) kde (DOT) org

Reply With Quote
Reply

Viewing: Web Development Archives Mailing Lists KDE > Crash during a "insert file" in the composer


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
Stay green...Green IT