Bug 290838 - Crash pressing key on treeview while channel list is open
Summary: Crash pressing key on treeview while channel list is open
Status: RESOLVED FIXED
Alias: None
Product: konversation
Classification: Applications
Component: general (show other bugs)
Version: Git
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: Konversation Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-07 01:48 UTC by Nicolás Alvarez
Modified: 2012-01-07 02:40 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolás Alvarez 2012-01-07 01:48:13 UTC
Steps to reproduce:
 - Open the server's channel list (F5)
 - Focus the tree view (leaving the channel list as current tab)
 - Press *any* key on your keyboard, other than up or down arrows

Konversation immediately crashes:

#6  0x00007f7a22e17fa0 in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#7  0x000000000054ccf1 in QCoreApplication::sendEvent (receiver=0x0, event=0x7fff926bc4a0) at /usr/include/qt4/QtCore/qcoreapplication.h:215
#8  0x0000000000577a95 in ViewTree::keyPressEvent (this=0x26297c0, e=0x7fff926bc4a0) at /home/nicolas/src/konversation/src/viewer/viewtree.cpp:681
#9  0x00007f7a21fa609a in QWidget::event(QEvent*) () from /usr/lib/libQtGui.so.4
#10 0x00000000005770de in ViewTree::event (this=0x26297c0, e=0x7fff926bc4a0) at /home/nicolas/src/konversation/src/viewer/viewtree.cpp:515
#11 0x00007f7a21f559f4 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#12 0x00007f7a21f5af76 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#13 0x00007f7a23adeb96 in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdeui.so.5
#14 0x00007f7a22e17fbc in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#15 0x00007f7a21ff59d9 in ?? () from /usr/lib/libQtGui.so.4
#16 0x00007f7a21ff5e1b in ?? () from /usr/lib/libQtGui.so.4
#17 0x00007f7a21fd17d4 in QApplication::x11ProcessEvent(_XEvent*) () from /usr/lib/libQtGui.so.4
#18 0x00007f7a21ff9d32 in ?? () from /usr/lib/libQtGui.so.4
#19 0x00007f7a1d2d50cf in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#20 0x00007f7a1d2d58c8 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#21 0x00007f7a1d2d5a99 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#22 0x00007f7a22e42abf in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#23 0x00007f7a21ff99ce in ?? () from /usr/lib/libQtGui.so.4
#24 0x00007f7a22e171c2 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#25 0x00007f7a22e173bf in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#26 0x00007f7a22e1b567 in QCoreApplication::exec() () from /usr/lib/libQtCore.so.4
#27 0x000000000047e1f6 in main (argc=5, argv=0x7fff926be248) at /home/nicolas/src/konversation/src/main.cpp:123

When the tree view is focused, pressing arrow keys moves around in the list, while pressing other keys such as a letter focuses the text input of the open tab and enters the letter there instead. However, a channel list has no text input, so item->getView()->getTextView() returns null in ViewTree::keyPressEvent, and the attempt to re-send the QKeyEvent to it (null) causes a crash.

This only happens with the channel list. I didn't yet find why it doesn't happen for other text-input-less tabs such as Watched Nicks, URL Extractor, etc.
Comment 1 Eike Hein 2012-01-07 02:40:04 UTC
Git commit d1e594fabe29ff45a6fc5dd1a7c16de406f61c5d by Eike Hein.
Committed on 07/01/2012 at 03:35.
Pushed by hein into branch 'master'.

Support keyboard event forwarding from ViewTree to inputbar-less views.

M  +11   -8    src/viewer/viewtree.cpp

http://commits.kde.org/konversation/d1e594fabe29ff45a6fc5dd1a7c16de406f61c5d