Summary: | The number in the tab title gets incremented whether or not it's necessary | ||
---|---|---|---|
Product: | [Applications] yakuake | Reporter: | Stephan Sokolow <kde_bugzilla_2> |
Component: | general | Assignee: | Eike Hein <hein> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | 2.7.5 | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Stephan Sokolow
2006-08-04 20:02:56 UTC
Coming in the next release. SVN commit 671379 by hein: Make initial session naming/numbering consistent with Konsole. BUG:131881 M +34 -1 tabbed_widget.cpp M +1 -0 tabbed_widget.h --- branches/extragear/kde3/utils/yakuake/src/tabbed_widget.cpp #671378:671379 @@ -94,7 +94,7 @@ { items.append(session_id); areas.append(0); - captions.append(defaultTabCaption(session_id)); + captions.append(lowestAvailableCaption()); refreshBuffer(); } @@ -104,6 +104,39 @@ return i18n("Shell", "Shell No. %n", id+1); } +QString TabbedWidget::lowestAvailableCaption() +{ + QString newTitle = defaultTabCaption(0); + + bool nameOk; + int count = 0; + + do + { + nameOk = true; + + QValueList<QString>::iterator it; + + for (it = captions.begin(); it != captions.end(); ++it) + { + if (newTitle == (*it)) + { + nameOk = false; + break; + } + } + + if (!nameOk) + { + count++; + newTitle = newTitle = defaultTabCaption(count); + } + } + while (!nameOk); + + return newTitle; +} + int TabbedWidget::removeItem(int session_id) { uint position = items.findIndex(session_id); --- branches/extragear/kde3/utils/yakuake/src/tabbed_widget.h #671378:671379 @@ -106,6 +106,7 @@ void createContextMenu(); const int drawButton(int position, QPainter& painter); QString defaultTabCaption(int session_id); + QString lowestAvailableCaption(); int current_position; bool pressed; |