[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    konsole patch to disable argument inheriting by new sessions by default
From:       Antonio Larrosa =?iso-8859-1?q?Jim=E9nez?= <larrosa () kde ! org>
Date:       2001-07-31 1:21:26
[Download RAW message or body]

Hi,

Well, the subject says it all.

This patch disables the "feature" that makes new sessions (opened by using 
the New button) run the same commands than the first one run specified in 
the -e argument.

I think it was a bad idea to implement it in the first place, but in case 
I'm being blind or something, I've made it configurable (but disabled by 
default). The only way to turn it on is by editing the konsolerc file 
manually and setting inheritArgs to true.

Please, review, commit it and tag it to be included into 2.2 .

Greetings,

--
Antonio Larrosa Jimenez
KDE Core developer  - larrosa@kde.org
SuSE Labs developer - larrosa@suse.de
http://perso.wanadoo.es/antlarr
KDE - The development framework of the future, today.

["konsole.diff" (text/x-diff)]

Index: include/konsole.h
===================================================================
RCS file: /home/kde/kdebase/konsole/include/konsole.h,v
retrieving revision 1.48
diff -u -p -r1.48 konsole.h
--- include/konsole.h	2001/07/16 06:36:04	1.48
+++ include/konsole.h	2001/07/31 01:10:25
@@ -192,6 +192,7 @@ private:
   QRect       _saveGeometry;
 
   bool        bIsBlankNewSession;
+  bool        b_inheritArgs;
   bool        b_scroll:1;
   bool        b_framevis:1;
   bool        b_fullscreen:1;
Index: src/konsole.C
===================================================================
RCS file: /home/kde/kdebase/konsole/src/konsole.C,v
retrieving revision 1.150
diff -u -p -r1.150 konsole.C
--- src/konsole.C	2001/07/29 15:33:42	1.150
+++ src/konsole.C	2001/07/31 01:10:30
@@ -776,6 +776,7 @@ void Konsole::readProperties(KConfig* co
    n_scroll   = QMIN(config->readUnsignedNumEntry("scrollbar",TEWidget::SCRRIGHT),2);
    s_word_seps= config->readEntry("wordseps",":@-./_~");
    b_framevis = config->readBoolEntry("has frame",TRUE);
+   b_inheritArgs = config->readBoolEntry("inheritArgs",FALSE);
 
    // Global options ///////////////////////
 
@@ -1394,9 +1395,8 @@ TESession *Konsole::newSession(KSimpleCo
       txt = co->readEntry("Comment", txt);
       fno = co->readUnsignedNumEntry("Font", fno);
 
-      if (!(bIsBlankNewSession)) {
-        cmdArgs.append(shell);
-        }
+      if ( !bIsBlankNewSession || !b_inheritArgs) 
+	cmdArgs.append(shell);
 
       if (!cmd.isEmpty())
       {
@@ -1404,11 +1404,10 @@ TESession *Konsole::newSession(KSimpleCo
         cmdArgs.append(QFile::encodeName(cmd));
       }
   }
-  else  {
-      cmdArgs = args;
-      }
+  else 
+    cmdArgs = args;
 
-  if (bIsBlankNewSession) {
+  if ( b_inheritArgs && bIsBlankNewSession) {
     //This session was started with the New button or the newSession key combo
     shell = pgm;
     if(!(args.isEmpty())) {


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic