<?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>120046</bug_id>
          
          <creation_ts>2006-01-13 16:28:19 +0000</creation_ts>
          <short_desc>history information not used from saved profile</short_desc>
          <delta_ts>2006-01-22 07:48:14 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>konsole</product>
          <component>general</component>
          <version>unspecified</version>
          <rep_platform>openSUSE</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="Richard Bos">richard.bos</reporter>
          <assigned_to name="Konsole Bugs">konsole-bugs-null</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>405788</commentid>
    <comment_count>0</comment_count>
    <who name="Richard Bos">richard.bos</who>
    <bug_when>2006-01-13 16:28:20 +0000</bug_when>
    <thetext>Version:            (using KDE KDE 3.5.0)
Installed from:    SuSE RPMs
OS:                Linux

This history information &apos;settings -&gt; history -&gt;
number of lines&apos; is not read from a saved profile.

To reproduce:
- start konsole
- change number of lines in history buffer to 250 (e.g.)
- save profile (as let&apos;s say hist)
- start konsole again, but now with:
  konsole --profile hist

Check the history setting in konsole, it is set to 1000.
Check the profile information, the history field is
set to the save no of lines in history buffer (in this
case 250).

It seems that konsole neglects the history information
saved in the profile.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>406031</commentid>
    <comment_count>1</comment_count>
    <who name="Philip Rodrigues">phil</who>
    <bug_when>2006-01-14 16:44:05 +0000</bug_when>
    <thetext>Confirmed with 3.5 branch r496940</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>406053</commentid>
    <comment_count>2</comment_count>
    <who name="Kurt Hindenburg">khindenburg</who>
    <bug_when>2006-01-14 17:34:46 +0000</bug_when>
    <thetext>Konsole ignores the history line in the profile.

% grep -i history $KDEHOME/share/apps/konsole/profiles/testhistory
history=500
historyenabled=true

Konsole currently uses the history in the konsolerc file.
% grep -i history /home/kvh/.kdehome-3.5/share/config/konsolerc
history=250
historyenabled=true


To Fix: Save each sessions history (ie History0 ,History1, etc...).

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>406140</commentid>
    <comment_count>3</comment_count>
    <who name="Kurt Hindenburg">khindenburg</who>
    <bug_when>2006-01-14 19:28:11 +0000</bug_when>
    <thetext>SVN commit 498108 by hindenburg:

The history options (line #/enabled) are now used in the profiles.

BUG: 120046


 M  +16 -0     konsole.cpp  
 M  +1 -0      konsole.h  
 M  +8 -0      main.cpp  


--- branches/KDE/3.5/kdebase/konsole/konsole/konsole.cpp #498107:498108
@@ -1458,6 +1458,10 @@
         config-&gt;writeEntry(key, sessions.current()-&gt;isMasterMode());
         key = QString(&quot;TabColor%1&quot;).arg(counter);
         config-&gt;writeEntry(key, tabwidget-&gt;tabColor((sessions.current())-&gt;widget()));
+        key = QString(&quot;History%1&quot;).arg(counter);
+        config-&gt;writeEntry(key, sessions.current()-&gt;history().getSize());
+        key = QString(&quot;HistoryEnabled%1&quot;).arg(counter);
+        config-&gt;writeEntry(key, sessions.current()-&gt;history().isOn());
 
         QString cwd=sessions.current()-&gt;getCwd();
         if (cwd.isEmpty())
@@ -3184,6 +3188,18 @@
     tabwidget-&gt;setTabColor( se-&gt;widget(), color );
 }
 
+void Konsole::initHistory(int lines, bool enable)
+{
+   // If no History#= is given in the profile, use the history
+   // parameter saved in konsolerc.
+   if ( lines &lt; 0 ) lines = m_histSize;
+
+   if ( enable )
+      se-&gt;setHistory( HistoryTypeBuffer( lines ) );
+   else
+      se-&gt;setHistory( HistoryTypeNone() );
+}
+
 void Konsole::slotToggleMasterMode()
 {
   setMasterMode( masterMode-&gt;isChecked() );
--- branches/KDE/3.5/kdebase/konsole/konsole/konsole.h #498107:498108
@@ -82,6 +82,7 @@
   void initMonitorSilence(bool on);
   void initMasterMode(bool on);
   void initTabColor(QColor color);
+  void initHistory(int lines, bool enable);
   void newSession(const QString &amp;program, const QStrList &amp;args, const QString &amp;term, const QString &amp;icon, const QString &amp;title, const QString &amp;cwd);
   void setSchema(const QString &amp; path);
   void setEncoding(int);
--- branches/KDE/3.5/kdebase/konsole/konsole/main.cpp #498107:498108
@@ -514,6 +514,9 @@
         m-&gt;initMonitorSilence(sessionconfig-&gt;readBoolEntry(&quot;MonitorSilence0&quot;,false));
         m-&gt;initMasterMode(sessionconfig-&gt;readBoolEntry(&quot;MasterMode0&quot;,false));
         m-&gt;initTabColor(sessionconfig-&gt;readColorEntry(&quot;TabColor0&quot;));
+        // -1 will be changed to the default history in konsolerc
+        m-&gt;initHistory(sessionconfig-&gt;readNumEntry(&quot;History0&quot;, -1), 
+                       sessionconfig-&gt;readBoolEntry(&quot;HistoryEnabled0&quot;, true));
         counter++;
 
         // show() before 2nd+ sessions are created allows --profile to
@@ -553,6 +556,11 @@
           m-&gt;initMasterMode(sessionconfig-&gt;readBoolEntry(key,false));
           key = QString(&quot;TabColor%1&quot;).arg(counter);
           m-&gt;initTabColor(sessionconfig-&gt;readColorEntry(key));
+          // -1 will be changed to the default history in konsolerc
+          key = QString(&quot;History%1&quot;).arg(counter);
+          QString key2 = QString(&quot;HistoryEnabled%1&quot;).arg(counter);
+          m-&gt;initHistory(sessionconfig-&gt;readNumEntry(key, -1), 
+                         sessionconfig-&gt;readBoolEntry(key2, true));
           counter++;
         }
         m-&gt;setDefaultSession( sessionconfig-&gt;readEntry(&quot;DefaultSession&quot;,&quot;shell.desktop&quot;) );
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>406155</commentid>
    <comment_count>4</comment_count>
    <who name="Richard Bos">richard.bos</who>
    <bug_when>2006-01-14 20:46:44 +0000</bug_when>
    <thetext>Wow, that&apos;s fast!  Thanks for the swift followup.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>406169</commentid>
    <comment_count>5</comment_count>
    <who name="Kurt Hindenburg">khindenburg</who>
    <bug_when>2006-01-14 21:58:15 +0000</bug_when>
    <thetext>SVN commit 498170 by hindenburg:

Forward port: The history options (line #/enabled) are now used in 
the profiles.  Currently Konsole crashes with --profile=.  The dialogs
don&apos;t work know anyway... test later.

CCBUG: 120046 


 M  +20 -1     konsole.cpp  
 M  +1 -0      konsole.h  
 M  +12 -0     main.cpp  


--- trunk/KDE/kdebase/konsole/konsole/konsole.cpp #498169:498170
@@ -1467,8 +1467,14 @@
         config-&gt;writeEntry(key, sessions.current()-&gt;isMonitorSilence());
         key = QString(&quot;MasterMode%1&quot;).arg(counter);
         config-&gt;writeEntry(key, sessions.current()-&gt;isMasterMode());
-        key = QString(&quot;TabColor%1&quot;).arg(counter);
+        //key = QString(&quot;TabColor%1&quot;).arg(counter);
         //config-&gt;writeEntry(key, tabwidget-&gt;tabColor((sessions.current())-&gt;widget()));
+/* Test this when dialogs work again
+        key = QString(&quot;History%1&quot;).arg(counter);
+        config-&gt;writeEntry(key, sessions.current()-&gt;history().getSize());
+        key = QString(&quot;HistoryEnabled%1&quot;).arg(counter);
+        config-&gt;writeEntry(key, sessions.current()-&gt;history().isOn());
+*/
 
         QString cwd=sessions.current()-&gt;getCwd();
         if (cwd.isEmpty())
@@ -3127,6 +3133,19 @@
    ; //tabwidget-&gt;setTabColor( se-&gt;widget(), color );
 }
 
+void Konsole::initHistory(int lines, bool enable)
+{
+return;
+   // If no History#= is given in the profile, use the history
+   // parameter saved in konsolerc.
+   if ( lines &lt; 0 ) lines = m_histSize;
+
+   if ( enable )
+      se-&gt;setHistory( HistoryTypeBuffer( lines ) );
+   else
+      se-&gt;setHistory( HistoryTypeNone() );
+}
+
 void Konsole::slotToggleMasterMode()
 {
   setMasterMode( masterMode-&gt;isChecked() );
--- trunk/KDE/kdebase/konsole/konsole/konsole.h #498169:498170
@@ -87,6 +87,7 @@
   void initMonitorSilence(bool on);
   void initMasterMode(bool on);
   void initTabColor(QColor color);
+  void initHistory(int lines, bool enable);
   void newSession(const QString &amp;program, const QStringList &amp;args, const QString &amp;term, const QString &amp;icon, const QString &amp;title, const QString &amp;cwd);
   void setSchema(const QString &amp; path);
   void setEncoding(int);
--- trunk/KDE/kdebase/konsole/konsole/main.cpp #498169:498170
@@ -519,6 +519,9 @@
         //FIXME: Verify this code when KDE4 supports tab colors... kvh
         QVariant v_tabColor = sessionconfig-&gt;readEntry(&quot;TabColor0&quot;);
         m-&gt;initTabColor( v_tabColor.value&lt;QColor&gt;() );
+        // -1 will be changed to the default history in konsolerc
+//        m-&gt;initHistory(sessionconfig-&gt;readNumEntry(&quot;History0&quot;, -1),
+//                       sessionconfig-&gt;readBoolEntry(&quot;HistoryEnabled0&quot;, true));
 
         counter++;
 
@@ -566,6 +569,15 @@
           //FIXME: Verify this code when KDE4 supports tab colors... kvh
 //          QVariant v_tabColor = sessionconfig-&gt;readEntry(key));
 //          m-&gt;initTabColor( v_tabColor.value&lt;QColor&gt;() );
+
+/* Test this when the dialogs work again...kvh
+          // -1 will be changed to the default history in konsolerc
+          key = QString(&quot;History%1&quot;).arg(counter);
+          QString key2 = QString(&quot;HistoryEnabled%1&quot;).arg(counter);
+          m-&gt;initHistory(sessionconfig-&gt;readNumEntry(key, -1),
+                         sessionconfig-&gt;readBoolEntry(key2, true));
+*/
+
           counter++;
         }
         m-&gt;setDefaultSession( sessionconfig-&gt;readEntry(&quot;DefaultSession&quot;,&quot;shell.desktop&quot;) );
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>408004</commentid>
    <comment_count>6</comment_count>
    <who name="Kurt Hindenburg">khindenburg</who>
    <bug_when>2006-01-22 07:48:13 +0000</bug_when>
    <thetext>SVN commit 501108 by hindenburg:

Fix issue where history size is unlimited.

Please make sure this goes into 3.5.1.

CCBUG: 120046



 M  +3 -1      konsole.cpp  


--- branches/KDE/3.5/kdebase/konsole/konsole/konsole.cpp #501107:501108
@@ -3194,8 +3194,10 @@
    // parameter saved in konsolerc.
    if ( lines &lt; 0 ) lines = m_histSize;
 
-   if ( enable )
+   if ( enable &amp;&amp; lines &gt; 0 )
       se-&gt;setHistory( HistoryTypeBuffer( lines ) );
+   else if ( enable )  // Unlimited buffer
+      se-&gt;setHistory(HistoryTypeFile());
    else
       se-&gt;setHistory( HistoryTypeNone() );
 }
</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>