Version: (using Devel) Compiler: GCC 4.3.2 OS: Linux Installed from: Compiled sources When I move a tab left, using ctrl-shift-left, then tab we just replaced gets the same title as the tab we just moved. Icons are preserved properly. Moving tabs to the right doesn't show this behaviour. I can reproduce this on both the latest stable KDE 4.1.3, and the current snapshot (4.1.81). -Ingmar
Definitely present in trunk r891451. I experience further unusual behavior. While moving a tab to the left, the tab replaced does get the same title as the one we moved, but in addition, moving a tab to the right makes the tab one to the right of the one we just replaced match the one we just moved. Looks like a KTabWidget issue.
You're right, I see both here too. :)
Created attachment 29087 [details] Fix moving tabs in KTabWidget For some reason, KTabWidget adds another string to m_tabNames every time you move a tab. There's a comment about it being a workaround for kmdi behavior, which I don't think exists in KDE4. Removing the extra string insertion fixed this bug for me in trunk, so I hope I'm not missing something. Can a dev review and commit this patch?
Reassigning to kdelibs
Created attachment 29107 [details] Fix moving tabs in KTabWidget, v2 I needed to add a resizeTabs() call, otherwise tabs with shortened titles would wind up putting the full title in the tab, making very unevenly-sized tabs.
Created attachment 29108 [details] Fix moving tabs in KTabWidget, v3 Specifically, resize the tab we just added, or else the same issue persists.
I've tested the patch from comment #6 and it works well.
David comments: < dfaure> looks good < dfaure> (would look better with an addition to the unit test :)
Created attachment 29337 [details] unittest for moving tabs Patch seems to work fine but I tried to create an unittest and it fails. Test case moves first tab from left to right which works fine but when moving it back one tab title disappears. Any ideas?
Curious, the new unittest passed in my builds, and looking at the debug info, did not produce null strings. Are you sure the unit test linked against the newly patched libkdeui?
Unbelievable. I was 100% sure that I had fresh libkdeui.so but after rm && make, ktabwidget_unittest works fine. Go a head and commit your fix (and remove my kDebug line from UT). PASS : KTabWidget_UnitTest::testMoveTab()
I don't have commit access (and don't do enough dev work to merit it yet); could one of you apply the patch and (quieted) unittest? Thanks.
SVN commit 898491 by dfaure: Apply patch from Drew Fisher and unit test from Tommi Tervo, to fix the tab title mess-up when moving a tab. I love it when bug reports contain patch + unit test... perfect ;-) BUG: 177036 M +26 -0 tests/ktabwidget_unittest.cpp M +3 -8 widgets/ktabwidget.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=898491
*** Bug 181630 has been marked as a duplicate of this bug. ***
*** Bug 172135 has been marked as a duplicate of this bug. ***