Bug 78142 - Menu item text in View|Tree Tool Views doesn't show
Summary: Menu item text in View|Tree Tool Views doesn't show
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: general (show other bugs)
Version: 3.0.2
Platform: RedHat Enterprise Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KDevelop Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-03-21 14:11 UTC by Jonathan Solomon
Modified: 2004-12-15 23:50 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Fixes a bug that causes data to be lost in a method call. (1023 bytes, patch)
2004-03-26 05:22 UTC, Jonathan Solomon
Details
Fix for the "Show..." bug in the "Tool Views" menu (1.47 KB, patch)
2004-03-28 03:19 UTC, Jonathan Solomon
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Solomon 2004-03-21 14:11:06 UTC
Version:           3.0.2 (using KDE KDE 3.2.1)
Installed from:    RedHat RPMs
Compiler:          gcc 3.3.3 
OS:          Linux

This bug is nearly identical to the resolved bug #69224 except that it has reappeared in KDevelop 3.0.2. It seemed to first show up after switching from XFree86 to xorg-X11. This is in Fedora Core 2 test 1, debug kernel 2.6.3-2.1.258-2-1.

It also appears to be affecting View|Tool Views. About half the items in there only say "Show" while the rest have complete text.
Comment 1 Jonathan Solomon 2004-03-25 02:32:43 UTC
I've made some progress in tracking this down. The first problem was the result of a temporary being passed to a routine expecting a reference. In my experience this always causes trouble. The value being passed in is fine but it's not getting into the routine being called. The following patch fixes that problem.

------------------------------------------------------------------

--- kdockwidget.cpp.backup      2004-03-24 12:33:24.000000000 -0500
+++ kdockwidget.cpp     2004-03-24 12:38:46.000000000 -0500
@@ -2659,8 +2659,13 @@
       obj->setGeometry(r);

       c->setGroup( group );
-      obj->setTabPageLabel(c->readEntry( oname + ":tabCaption" ));
-      obj->setToolTipString(c->readEntry( oname + ":tabToolTip" ));
+
+         QString               entryname;
+
+         entryname = oname + ":tabCaption";
+      obj->setTabPageLabel(c->readEntry( entryname ));
+         entryname = oname + ":tabToolTip";
+      obj->setToolTipString(c->readEntry( entryname ));
       if ( c->readBoolEntry( oname + ":visible" ) ){
         obj->QWidget::show();
       }
@@ -2668,8 +2673,13 @@

     if ( type == "DOCK"  ){
       obj = getDockWidgetFromName( oname );
-      obj->setTabPageLabel(c->readEntry( oname + ":tabCaption" ));
-      obj->setToolTipString(c->readEntry( oname + ":tabToolTip" ));
+
+         QString               entryname;
+
+         entryname = oname + ":tabCaption";
+      obj->setTabPageLabel(c->readEntry( entryname ));
+         entryname = oname + ":tabToolTip";
+      obj->setToolTipString(c->readEntry( entryname ));
     }

     if (obj && obj->d->isContainer) {

--------------------------------------------------------------------------------

A second problem is that because the dock tab names are getting whacked, empty values are written out to '~/.kde/share/config/kdeveloprc'. If you replace the missing values they're deleted the next time kdevelop is run.

--------------------------------------------------------------------------------

Now that I've got the dock widget names being properly set, there still appears to be a problem with them being lost before MainWindow::fillToolViewsMenu() can be called. Still working on this. Unfortunately my libc++ is still non-debug but kdevelop, kdelibs, and qt are debug. Getting some crashes on deletion as you would expect because of this.
Comment 2 Jonathan Solomon 2004-03-26 05:22:06 UTC
Created attachment 5398 [details]
Fixes a bug that causes data to be lost in a method call.
Comment 3 Jonathan Solomon 2004-03-26 05:22:55 UTC
Hmm. Lost my comment on that last one. Anyway, this patch fixes another bug like the first one. Still doesn't solve the problem. More investigation needed.
Comment 4 Jonathan Solomon 2004-03-26 20:47:47 UTC
I've apparently "fixed" this one but the problem is a design issue so my hack really isn't a bug-fix. In my second patch, if you replace the trinary expression in the declaration of "caption" with "caption = shortname;" the menu works again. Apparently someone changed the tab code not to put labels on the tabs in "Tabbed" mode (and other non-IDEAlmodes) without realizing that those labels were being used for the dynamically generated menu-text. The authors will have to decide which way they want to go on this.
Comment 5 Jonathan Solomon 2004-03-26 20:53:07 UTC
Didn't mention: The above hack fixes the View|Tree Tool Views menu but doesn't completely fix the View|Tool Views menu. Apparently some of the Output View tab labels aren't showing in that menu. This is a different bug than the first as all of the Output View tab labels _are_ showing in the View|Output Tools menus.
Comment 6 Jonathan Solomon 2004-03-27 18:56:13 UTC
(NB) The "Show..." bug from the View|Tool Views menu also affects the corresponding action text in the Shortcuts dialog.
Comment 7 Jonathan Solomon 2004-03-27 21:18:48 UTC
I've done a little more leg-work on the "Show..." bug but I've gone about as far as I can. What _appears_ to be the problem is that the "View|Tool Views" submenu is initialized from the dock widgets' captions as opposed to the View|Tree Tool Views and View|Output Tool Views submenus which are initialized from the dock widgets' "tab page label/title". It seems that the captions are only being initialized for KDockWidgets associated with an external Part and thus the bug. I don't really know anything about KDE/Qt yet so I may have misinterpreted something.
Comment 8 Jonathan Solomon 2004-03-28 03:19:55 UTC
Created attachment 5441 [details]
Fix for the "Show..." bug in the "Tool Views" menu

Includes changes from previous patch.
Comment 9 Jonathan Solomon 2004-03-28 03:25:47 UTC
The libKDE patch given in the first comment and the attached patch fix all of the described menu problems (and the shortcut window as mentioned in #6) I don't know if this provides the best solution but it works and seems to be otherwise innocuous. Good enough for me ;)
Comment 10 Lars-Göran Thieme 2004-05-18 19:36:30 UTC
hi,
thank you for this patch. on kdevelop 3.0.3 it's works fine for me. but i have a little problem with it. the treeview-button doesn't work anymore :( if i close the treeview there a no way to get it back.
Comment 11 Matt Rogers 2004-12-12 05:15:54 UTC
I don't see this anymore with KDevelop 3.1.90 (KDevelop 3.2 Alpha 1). Does the MDI mode matter here? I've only used ideal mode.
Comment 12 Alexander Dymo 2004-12-15 23:50:38 UTC
Shouldn't happen with 3.1.90 because we provided captions for all tool views so that menus are correct. Also dockwidget configuration is not stored/restored on/from disc now (because restoration was too buggy) so no problems with configuration files are possible.