Bug 153739 - korganizer crash deleting new filters
Summary: korganizer crash deleting new filters
Status: RESOLVED FIXED
Alias: None
Product: korganizer
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-09 18:50 UTC by FiNeX
Modified: 2008-01-09 14:55 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
log of the crash (9.08 KB, text/x-log)
2007-12-09 18:51 UTC, FiNeX
Details
one-line-patch to fix the bug (486 bytes, patch)
2007-12-10 19:09 UTC, Fábio Firmo
Details
new patch (480 bytes, patch)
2007-12-11 15:11 UTC, Fábio Firmo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description FiNeX 2007-12-09 18:50:01 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources

Step to reproduce (Revision  from SVN)

1) start korganizer
2) open "filter" dialog (settings->manage view filter)
3) add a filter
4) delete it
5) click to "delete" on the confirm dialog box.

korganizer will crash.

There is no backtrace on gdb (stack empty). I'll attach the log from the shell.
Comment 1 FiNeX 2007-12-09 18:51:10 UTC
Created attachment 22433 [details]
log of the crash
Comment 2 FiNeX 2007-12-09 18:52:55 UTC
Tested on revision 746602.
Comment 3 Fábio Firmo 2007-12-10 19:09:00 UTC
Created attachment 22456 [details]
one-line-patch to fix the bug

This small patch solved the bug for me. It prevents the code to look in an
index that does not exists.

This is my first patch, if I made something wrong or not-so-elegant please tell
me.
Comment 4 FiNeX 2007-12-11 10:17:51 UTC
The patch is not right, because doing that, you select ever the previous element.
Comment 5 Fábio Firmo 2007-12-11 15:11:07 UTC
Created attachment 22486 [details]
new patch

Ops, in my rush I forgot that FilterEdit::filterSelected() is called in other
situations and forgot to look at the filter actually selected, just tested
various deletion cases. Sorry

Anyway I made another patch, that at least fixes the crash and select the right
filter. However I found another bug: if you create some filters and the delete
all of them, the Ok and Apply buttons will become disabled until you edit the
name field. I can't tell if this bug was already there, since the app used to
crash in such situation.

I think I will fill the bug report when someone reviews the patch, since the
bug is not visible in the actual revision.
Comment 6 FiNeX 2007-12-11 15:36:41 UTC
Ok, with this patch korganizer doesn't crash AND the select list works correctly.
It seems that when the list is empty the two buttons are disabled. It is not a major problem. If you find the way to let them enabled it should be better. Thanks Fábio!
Comment 7 Allen Winter 2008-01-09 14:55:46 UTC
SVN commit 758897 by winterz:

fix "korganizer crash deleting new filters"
thanks for the patch Fábio!
BUG: 153739


 M  +3 -1      filtereditdialog.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=758897