-rw-r--r-- | core/pim/todo/templatedialogimpl.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/core/pim/todo/templatedialogimpl.cpp b/core/pim/todo/templatedialogimpl.cpp index c2306ac..63d8107 100644 --- a/core/pim/todo/templatedialogimpl.cpp +++ b/core/pim/todo/templatedialogimpl.cpp | |||
@@ -78,5 +78,8 @@ void TemplateDialogImpl::slotAdd() { | |||
78 | } | 78 | } |
79 | void TemplateDialogImpl::slotRemove() { | 79 | void TemplateDialogImpl::slotRemove() { |
80 | TemplateListItem* item = (TemplateListItem*) listView()->currentItem(); | 80 | if (!listView()->currentItem() ) |
81 | return; | ||
82 | |||
83 | TemplateListItem* item = static_cast<TemplateListItem*>( listView()->currentItem() ); | ||
81 | listView()->takeItem( item ); | 84 | listView()->takeItem( item ); |
82 | 85 | ||
@@ -86,5 +89,8 @@ void TemplateDialogImpl::slotRemove() { | |||
86 | } | 89 | } |
87 | void TemplateDialogImpl::slotEdit() { | 90 | void TemplateDialogImpl::slotEdit() { |
88 | TemplateListItem* item = (TemplateListItem*)listView()->currentItem(); | 91 | if ( !listView()->currentItem() ) |
92 | return; | ||
93 | |||
94 | TemplateListItem* item = static_cast<TemplateListItem*>( listView()->currentItem() ); | ||
89 | OTodo ev = m_win->currentEditor()->edit( m_win, item->event() ); | 95 | OTodo ev = m_win->currentEditor()->edit( m_win, item->event() ); |
90 | if ( m_win->currentEditor()->accepted() ) { | 96 | if ( m_win->currentEditor()->accepted() ) { |
@@ -100,5 +106,8 @@ void TemplateDialogImpl::slotEdit() { | |||
100 | 106 | ||
101 | void TemplateDialogImpl::slotReturn() { | 107 | void TemplateDialogImpl::slotReturn() { |
102 | TemplateListItem* tbl = (TemplateListItem*)listView()->currentItem(); | 108 | if ( !listView()->currentItem() ) |
109 | return; | ||
110 | |||
111 | TemplateListItem* tbl = static_cast<TemplateListItem*>( listView()->currentItem() ); | ||
103 | 112 | ||
104 | if (tbl->text() != edit()->text() ) { | 113 | if (tbl->text() != edit()->text() ) { |