<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>131881</bug_id>
          
          <creation_ts>2006-08-04 20:02:56 +0000</creation_ts>
          <short_desc>The number in the tab title gets incremented whether or not it&apos;s necessary</short_desc>
          <delta_ts>2007-06-04 18:15:43 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>yakuake</product>
          <component>general</component>
          <version>2.7.5</version>
          <rep_platform>unspecified</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Stephan Sokolow">kde_bugzilla_2</reporter>
          <assigned_to name="Eike Hein">hein</assigned_to>
          
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>377559</commentid>
    <comment_count>0</comment_count>
    <who name="Stephan Sokolow">kde_bugzilla_2</who>
    <bug_when>2006-08-04 20:02:56 +0000</bug_when>
    <thetext>Version:           2.7.5 (using KDE KDE 3.5.2)
Compiler:          gcc (GCC) 3.4.5 (Gentoo 3.4.5-r1, ssp-3.4.5-1.0, pie-8.7.9) 
OS:                Linux

Open Yakuake and open two tabs. They will default to &quot;Shell&quot; and &quot;Shell No. 2&quot;. Then close &quot;Shell No. 2&quot; and open a new one.

Instead of re-using &quot;Shell No. 2&quot;, it gets called &quot;Shell No. 3&quot;. For someone who does a lot of tab opening and closing, this gets very irritating very quickly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>377563</commentid>
    <comment_count>1</comment_count>
    <who name="Eike Hein">hein</who>
    <bug_when>2006-08-04 20:25:05 +0000</bug_when>
    <thetext>Coming in the next release.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>529804</commentid>
    <comment_count>2</comment_count>
    <who name="Eike Hein">hein</who>
    <bug_when>2007-06-04 18:15:42 +0000</bug_when>
    <thetext>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(&quot;Shell&quot;, &quot;Shell No. %n&quot;, id+1);
 }
 
+QString TabbedWidget::lowestAvailableCaption()
+{
+    QString newTitle = defaultTabCaption(0);
+
+    bool nameOk;
+    int count = 0;
+
+    do
+    {
+        nameOk = true;
+
+        QValueList&lt;QString&gt;::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&amp; painter);
         QString defaultTabCaption(int session_id);
+        QString lowestAvailableCaption();
 
         int current_position;
         bool pressed;
</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>