aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/raweditor/RawEditorWindow.cpp
diff options
context:
space:
mode:
authorGravatar ctrlaltca2023-12-24 23:49:34 +0100
committerGravatar GitHub2023-12-24 23:49:34 +0100
commit158f3cc6b535e985a63bcad50d5dc2239dfa6696 (patch)
treebc3c54a3c726f922e5ff2360797f62e82f5c9621 /src/modules/raweditor/RawEditorWindow.cpp
parentTray icon fixes (#2581) (diff)
downloadKVIrc-158f3cc6b535e985a63bcad50d5dc2239dfa6696.tar.gz
KVIrc-158f3cc6b535e985a63bcad50d5dc2239dfa6696.tar.bz2
KVIrc-158f3cc6b535e985a63bcad50d5dc2239dfa6696.zip
Remove raw event when it has no handlers. fix #2427 (#2583)
Diffstat (limited to 'src/modules/raweditor/RawEditorWindow.cpp')
-rw-r--r--src/modules/raweditor/RawEditorWindow.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/modules/raweditor/RawEditorWindow.cpp b/src/modules/raweditor/RawEditorWindow.cpp
index e3277673d..5bed0381e 100644
--- a/src/modules/raweditor/RawEditorWindow.cpp
+++ b/src/modules/raweditor/RawEditorWindow.cpp
@@ -268,7 +268,7 @@ void RawEditorWidget::removeCurrentHandler()
m_pEditor->setEnabled(false);
m_pNameEditor->setEnabled(false);
if(!parent->childCount())
- parent->setEnabled(false);
+ delete parent;
}
}
@@ -344,7 +344,7 @@ void RawEditorWidget::currentItemChanged(QTreeWidgetItem * it, QTreeWidgetItem *
{
KVI_ASSERT(m_bOneTimeSetupDone);
saveLastEditedItem();
- if(it->parent())
+ if(it && it->parent())
{
m_pLastEditedItem = (RawHandlerTreeWidgetItem *)it;
m_pNameEditor->setEnabled(true);
@@ -358,7 +358,7 @@ void RawEditorWidget::currentItemChanged(QTreeWidgetItem * it, QTreeWidgetItem *
m_pNameEditor->setEnabled(false);
m_pNameEditor->setText("");
m_pEditor->setEnabled(false);
- QString szTmp = QString(__tr2qs_ctx("\n\nRAW Event:\n%1", "editor")).arg(((RawHandlerTreeWidgetItem *)it)->text(0));
+ QString szTmp = it ? QString(__tr2qs_ctx("\n\nRAW Event:\n%1", "editor")).arg(((RawHandlerTreeWidgetItem *)it)->text(0)) : "";
m_pEditor->setText(szTmp);
}
}