<?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>156100</bug_id>
          
          <creation_ts>2008-01-18 14:04:25 +0000</creation_ts>
          <short_desc>plugins are disabled when opening a file from command line</short_desc>
          <delta_ts>2010-10-26 23:38:45 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>kate</product>
          <component>sessions</component>
          <version>unspecified</version>
          <rep_platform>Compiled Sources</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>159767</dup_id>
          
          <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="Carlo Segato">brandon.ml</reporter>
          <assigned_to name="KWrite Developers">kwrite-bugs-null</assigned_to>
          <cc>blizzz</cc>
    
    <cc>bluedzins</cc>
    
    <cc>finex</cc>
    
    <cc>lucas</cc>
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>80</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>572724</commentid>
    <comment_count>0</comment_count>
    <who name="Carlo Segato">brandon.ml</who>
    <bug_when>2008-01-18 14:04:25 +0000</bug_when>
    <thetext>Version:            (using Devel)
Installed from:    Compiled sources
OS:                Linux

if you open a file from command line i.e. kate file.extension, kate doesn&apos;t load plugins(file system browser, terminal etc..)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>572862</commentid>
    <comment_count>1</comment_count>
    <who name="FiNeX">finex</who>
    <bug_when>2008-01-18 21:04:24 +0000</bug_when>
    <thetext>Confirmed on revision 762662</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>572867</commentid>
    <comment_count>2</comment_count>
    <who name="Anders Lund">anderslund</who>
    <bug_when>2008-01-18 21:25:41 +0000</bug_when>
    <thetext>The plugin configuration is session specific, so you need to configure the 
defaults.

I don&apos;t know if there are ways we can improve this - by makeing it easier to 
save defaults, for example by asking, or making it more obvious that it is 
session configuration that is saved, or ...
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>572932</commentid>
    <comment_count>3</comment_count>
      <attachid>23127</attachid>
    <who name="Rafael Fernández López">ereslibre</who>
    <bug_when>2008-01-19 02:30:50 +0000</bug_when>
    <thetext>Created attachment 23127
Fix for this problem

On 3 branch we had at kateapp.cpp::startupKate() method:

  // user specified session to open
  if (m_args-&gt;isSet (&quot;start&quot;))
  {
    sessionManager()-&gt;activateSession (sessionManager()-&gt;giveSession
(QString::fromLocal8Bit(m_args-&gt;getOption(&quot;start&quot;))), false, false);
  }
  else
  {
    // let the user choose session if possible
    if (!sessionManager()-&gt;chooseSession ())
    {
      // we will exit kate now, notify the rest of the world we are done
      KStartupInfo::appStarted (startupId());
      return false;
    }
  }

now on the else part on the 4 version we also force:

else if (!m_args-&gt;isSet( &quot;stdin&quot; ) &amp;&amp; (m_args-&gt;count() == 0)) // only start
session if no files specified

This means that the tabs added by activateSession() are never added. The
proposed patch relaxes the first part of the if().

On the KDE 3 version, if you do &quot;kate foo.txt&quot; you are still asked for a
session. I think that was &quot;wrong&quot;. This way this is fixed, the asked file is
opened and the session is &quot;activated&quot;.

All the magic is at startupKate() method.

OK to commit ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>572939</commentid>
    <comment_count>4</comment_count>
      <attachid>23128</attachid>
    <who name="Rafael Fernández López">ereslibre</who>
    <bug_when>2008-01-19 02:49:02 +0000</bug_when>
    <thetext>Created attachment 23128
Fix for this problem (take 2)

This patch is very similar to the other proposed, but it is slightly more
polite, doesn&apos;t mix things. Anyway has the same effect. Can be easier to
understand.

Can this patch be committed ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>572989</commentid>
    <comment_count>5</comment_count>
    <who name="Anders Lund">anderslund</who>
    <bug_when>2008-01-19 09:45:21 +0000</bug_when>
    <thetext>We need to always start the default session, which should be implicit if i 
remember correctly. Is that what happens with the last patch?
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>572998</commentid>
    <comment_count>6</comment_count>
    <who name="Dominik Haumann">dhaumann</who>
    <bug_when>2008-01-19 10:26:28 +0000</bug_when>
    <thetext>Using giveSession(i18n(&quot;Default Session&quot;)) should use use the default session.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>573006</commentid>
    <comment_count>7</comment_count>
    <who name="Rafael Fernández López">ereslibre</who>
    <bug_when>2008-01-19 11:23:59 +0000</bug_when>
    <thetext>I disagree. We shouldn&apos;t open the default session. The default session can be opened for instance if we do &quot;kate&quot; without parameters. If we add a file to the parameters list of the kate executable, then what we expect to see is that list of files opened.

If your default session had 100 files and we do &quot;kate foo1.txt foo2.txt foo3.txt&quot; we will have with your proposal 103 files, when we wanted to modify foo1.txt foo2.txt and foo3.txt. Trying to make things easier we could try to close the rest, and only having what I expected on the files list. That could result on a overwrite of my default session with the 3 files instead of the 100 that I had before if I exit and the auto-save-session feature is enabled.

I really think we should ask for giveSession(QString()).

If you think i18n(&quot;Default Session&quot;) still should be used, just tell here and I will commit the same patch as the last one but instead QString(), i18n(&quot;Default Session&quot;).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>573012</commentid>
    <comment_count>8</comment_count>
    <who name="Anders Lund">anderslund</who>
    <bug_when>2008-01-19 11:54:27 +0000</bug_when>
    <thetext>The default session should *be* katerc in my opinion. That would load all the 
default settings, and settings would automatically be saved there when no 
other session is selected.

I do see the problem with files, but maybe we should simply disable that in 
the defaults.

But it is an area that needs consideration, as it is NOT well thought out as 
is.

My take is

* we should always have a session, because some data otherwise can&apos;t be saved 
(for example recent files)

* If no session is specified the session file should default to katerc.

* If files are given on the command line, the file list should only be loaded 
if a session is also explicitly given
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>573014</commentid>
    <comment_count>9</comment_count>
    <who name="Rafael Fernández López">ereslibre</who>
    <bug_when>2008-01-19 12:09:52 +0000</bug_when>
    <thetext>&gt; My take is
&gt;
&gt; * we should always have a session, because some data otherwise can&apos;t be
&gt; saved (for example recent files)


The proposed patch activates a session with no name. It is *only* done so when 
we give parameters to kate executable. If you run &quot;kate&quot; only you will be 
asked for a session (or not) depending on your katerc preferences.

The only thing that can break those preferences is to give files to be opened 
as parameters.

&gt; * If no session is specified the session file should default to katerc.
&gt;
&gt; * If files are given on the command line, the file list should only be
&gt; loaded if a session is also explicitly given


From my point of view what Kate on KDE3 does here is in some way, wrong. If 
you have kate configured to ask you for a session when loading, it will still 
ask you for a session when you give files to be opened as parameters. From my 
point of view that is wrong. When you specify files as parameters to the 
executable you want to start editing them at the moment, and don&apos;t care about 
he session. In that case you should have opened &quot;kate&quot;, opening the session 
for later opening those files inside kate.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>573016</commentid>
    <comment_count>10</comment_count>
    <who name="Anders Lund">anderslund</who>
    <bug_when>2008-01-19 12:15:49 +0000</bug_when>
    <thetext>On Saturday 19 January 2008, Rafael Fern</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>573017</commentid>
    <comment_count>11</comment_count>
    <who name="Anders Lund">anderslund</who>
    <bug_when>2008-01-19 12:16:43 +0000</bug_when>
    <thetext>On Saturday 19 January 2008, Rafael Fern</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>573018</commentid>
    <comment_count>12</comment_count>
    <who name="Rafael Fernández López">ereslibre</who>
    <bug_when>2008-01-19 12:27:05 +0000</bug_when>
    <thetext>Hehe, and that is what the last attached patch does. :)

- Running &quot;kate&quot; will ask for your session or not, depending on your preferences there. That is not touched.

- Running &quot;kate file1 file2 ... fileN&quot; will not ask for session. Never. It will just open those files in a session with no name, activating the session, and therefore using the defaults from katerc.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>573022</commentid>
    <comment_count>13</comment_count>
    <who name="Anders Lund">anderslund</who>
    <bug_when>2008-01-19 12:38:48 +0000</bug_when>
    <thetext>I think the missing part is just making session data be saved to katerc as 
well.

And I think we should loose the autocreated &apos;default session&apos;.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>573025</commentid>
    <comment_count>14</comment_count>
    <who name="FiNeX">finex</who>
    <bug_when>2008-01-19 12:45:45 +0000</bug_when>
    <thetext>When a user launch kate with a list of files, kate should open that list, without extra parameters and esotheric sessions management :-)

Just open that files.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>573031</commentid>
    <comment_count>15</comment_count>
    <who name="Rafael Fernández López">ereslibre</who>
    <bug_when>2008-01-19 13:07:20 +0000</bug_when>
    <thetext>I am afraid those preferences weren&apos;t saved before either. Just check it. 
Without the patch if you disable the &quot;Terminal&quot; complement for instance on a 
session, close kate and open the session the terminal complement will be 
loaded anyway.

So the patch is unrelated to that problem. That problem is apart as far as I 
see.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>573629</commentid>
    <comment_count>16</comment_count>
    <who name="Anders Lund">anderslund</who>
    <bug_when>2008-01-21 14:01:41 +0000</bug_when>
    <thetext>On Saturday 19 January 2008, FiNeX wrote:
&gt; When a user launch kate with a list of files, kate should open that list,
&gt; without extra parameters and esotheric sessions management :-)
&gt;
&gt; Just open that files.


That is a stupid comment simply. Kate needs to load and save its configuration 
in a way that makes sense, which is obviously not the case currently.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>660164</commentid>
    <comment_count>17</comment_count>
    <who name="FiNeX">finex</who>
    <bug_when>2008-11-04 09:59:52 +0000</bug_when>
    <thetext>It is not stupid: it&apos;s what, imho, users needs (or at least I&apos;d like). If internally kate needs to load settings, in this case it should simply use the default settings. Probably an user which starts kate from the shell, is a bit more skilled than one which starts it from the GUI, probably the default settings should be good enough for him :-) But this is only my opinion, maybe it due to a limited vision of the whole problem.

Anyway, I&apos;ve just tested the current trunk and the problem reported initially seems fixed now! :-)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>759344</commentid>
    <comment_count>18</comment_count>
    <who name="Dominik Haumann">dhaumann</who>
    <bug_when>2009-05-17 23:25:42 +0000</bug_when>
    <thetext>related: bug #156330</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>921516</commentid>
    <comment_count>19</comment_count>
    <who name="Dominik Haumann">dhaumann</who>
    <bug_when>2010-02-21 00:53:57 +0000</bug_when>
    <thetext>*** Bug 126952 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1037464</commentid>
    <comment_count>20</comment_count>
    <who name="Dominik Haumann">dhaumann</who>
    <bug_when>2010-10-26 23:38:45 +0000</bug_when>
    <thetext>Yes, it&apos;s fixed because Anders funnily enough fixed it 3 months later in another report with a very similar patch. So mark as duplicate! :)

*** This bug has been marked as a duplicate of bug 159767 ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>23127</attachid>
            <date>2008-01-19 02:30:50 +0000</date>
            <delta_ts>2008-01-19 02:49:03 +0000</delta_ts>
            <desc>Fix for this problem</desc>
            <filename>kate.diff</filename>
            <type>text/plain</type>
            <size>512</size>
            <attacher name="Rafael Fernández López">ereslibre</attacher>
            
              <data encoding="base64">SW5kZXg6IGthdGUvYXBwL2thdGVhcHAuY3BwCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIGthdGUvYXBwL2thdGVh
cHAuY3BwCShyZXZpc2nDs246IDc2Mjg0MSkKKysrIGthdGUvYXBwL2thdGVhcHAuY3BwCShjb3Bp
YSBkZSB0cmFiYWpvKQpAQCAtMTU2LDcgKzE1Niw3IEBAIHZvaWQgS2F0ZUFwcDo6cmVzdG9yZUth
dGUgKCkKIGJvb2wgS2F0ZUFwcDo6c3RhcnR1cEthdGUgKCkKIHsKICAgLy8gdXNlciBzcGVjaWZp
ZWQgc2Vzc2lvbiB0byBvcGVuCi0gIGlmIChtX2FyZ3MtPmlzU2V0ICgic3RhcnQiKSkKKyAgaWYg
KG1fYXJncy0+aXNTZXQgKCJzdGFydCIpIHx8IG1fYXJncy0+Y291bnQoKSkKICAgewogICAgIHNl
c3Npb25NYW5hZ2VyKCktPmFjdGl2YXRlU2Vzc2lvbiAoc2Vzc2lvbk1hbmFnZXIoKS0+Z2l2ZVNl
c3Npb24gKG1fYXJncy0+Z2V0T3B0aW9uKCJzdGFydCIpKSwgZmFsc2UsIGZhbHNlKTsKICAgfQo=
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>23128</attachid>
            <date>2008-01-19 02:49:02 +0000</date>
            <delta_ts>2008-01-19 02:49:02 +0000</delta_ts>
            <desc>Fix for this problem (take 2)</desc>
            <filename>kate.diff</filename>
            <type>text/plain</type>
            <size>507</size>
            <attacher name="Rafael Fernández López">ereslibre</attacher>
            
              <data encoding="base64">SW5kZXg6IGthdGUvYXBwL2thdGVhcHAuY3BwCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIGthdGUvYXBwL2thdGVh
cHAuY3BwCShyZXZpc2nDs246IDc2Mjg0MSkKKysrIGthdGUvYXBwL2thdGVhcHAuY3BwCShjb3Bp
YSBkZSB0cmFiYWpvKQpAQCAtMTczLDYgKzE3MywxMCBAQCBib29sIEthdGVBcHA6OnN0YXJ0dXBL
YXRlICgpCiAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgfQogICB9CisgIGVsc2UgaWYgKG1fYXJn
cy0+Y291bnQoKSkKKyAgeworICAgIHNlc3Npb25NYW5hZ2VyKCktPmFjdGl2YXRlU2Vzc2lvbiAo
c2Vzc2lvbk1hbmFnZXIoKS0+Z2l2ZVNlc3Npb24gKFFTdHJpbmcoKSksIGZhbHNlLCBmYWxzZSk7
CisgIH0KIAogICAvLyBvaCwgbm8gbWFpbndpbmRvdywgY3JlYXRlIG9uZSwgc2hvdWxkIG5vdCBo
YXBwZW4sIGJ1dCBtYWtlIHN1cmUgOykKICAgaWYgKG1haW5XaW5kb3dzKCkgPT0gMCkK
</data>

          </attachment>
      

    </bug>

</bugzilla>