Konqueror in the file bowsing mode crashes with an assert when File Size View is selected and then one of the icons/details/compact modes is selected again. ASSERT: "modeName.endsWith("-viewmode")" in file /ws/trunk/kdebase/kdebaseapps/konqueror/src/konqmainwindow.cpp, line 1606 The code in question, added by commit e1428451 to fix bug 299020, says: QString modeName = action->objectName(); Q_ASSERT(modeName.endsWith("-viewmode")); When switching between these modes, though, the name appears to be set to "dolphinpart" (verified with a kDebug and with gdb). Reproducible: Always Steps to Reproduce: 1. Open Konqueror in file browsing mode viewing a local directory. 2. Select Menu bar - View - View Mode - File Size View 3. Select Menu bar - View - View Mode - Icons Actual Results: Assert crash after step 3. Expected Results: No crash.
I cannot reproduce this no matter what I tried. I guess you have a viewmode whose action name does not end with "-viewmode". Can you add a debug statement just above the Q_ASSERT to see the actual action name that causes this? That is if you still hit this assert today.
Have done some more investigating and the crash depends on exactly how the mode is switched in the GUI. It also does not necessarily involve File Size View, so have changed bug title to better reflect the cause. Start Konqueror in file browsing mode, with toolbars visible. Go to menu Settings - Configure Toolbars and select the "Dolphin Toolbar <dolphinpart>" toolbar, confirm that it contains three actions "Icons", "Compact" and "Details". Switch between view modes using these three actions in the toolbar. There is no crash. Adding a kDebug() just before the assert indicates that slotViewModeTriggered() is *not* being called here. Select "Compact", then go to menu View - View Mode. Observe that the check state here may not reflect that actually shown in the view; for example, on the first startup of Konqueror "Icons" is checked here even though the view mode was set to "Compact" above. Select one of the "Icons", "Details" or "Compact" modes in this menu, crash. Here slotViewModeTriggered() is called and the action name (for either of these 3 modes) is "dolphinpart".
I do see that the sync view mode menu items are not in sync with what is selected in the toolbar, but switching to any of the other view modes listed in that menu still does cause a crash for me. I will see if I can fix the out sync issue.
Patch that fixes the crash for me, and keeps the menu entries in sync, is at https://git.reviewboard.kde.org/r/114924/
(In reply to comment #4) > Patch that fixes the crash for me, and keeps the menu entries in sync, is at > https://git.reviewboard.kde.org/r/114924/ That is one way to fix it, but the more simpler fix is to actually fix the part that David forgot to update when he committed the patch for another crash. See For the record, though I cannot reproduce the crash, I can see how you could hit that Q_ASSERT. Basically when actions for a service like the dolphinpart that provides several views, we do not append "-viewmode" to the objectname we use. Hence, when you change the view from the toolbar the checked action in the "View->View Mode" menu is never updated because the check in slotInternalViewModeChanged() only matches object names that end with "-viewmode". The fix is to append "-viewmode" to the object names.
Forgot the link in previous reply: https://git.reviewboard.kde.org/r/114926/
Git commit af5a796edddefb08f9d7c02068a6e891a327b25a by Dawit Alemayehu. Committed on 09/01/2014 at 13:10. Pushed by adawit into branch 'KDE/4.12'. Append "-viewmode" to object name of actions associated with services that provide multiple views. FIXED-IN: 4.12.1 REVIEW: 114926 M +1 -1 konqueror/src/konqmainwindow.cpp http://commits.kde.org/kde-baseapps/af5a796edddefb08f9d7c02068a6e891a327b25a