<?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>58970</bug_id>
          
          <creation_ts>2003-05-26 10:39:34 +0000</creation_ts>
          <short_desc>don&apos;t collapse structure tree on save or document change</short_desc>
          <delta_ts>2004-08-06 21:43:15 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>kile</product>
          <component>general</component>
          <version>unspecified</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>wishlist</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>mrudolf</reporter>
          <assigned_to name="Jeroen Wijnhout">spam</assigned_to>
          <cc>jens-bugs.kde.org</cc>
          
          <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>136012</commentid>
    <comment_count>0</comment_count>
    <who name="">mrudolf</who>
    <bug_when>2003-05-26 10:39:34 +0000</bug_when>
    <thetext>Version:           CVS-2003-05-25 (using KDE KDE 3.1.1a)
OS:          Linux

Now after every save and document change, document structure tree is collapse and only first-level items are shown.

I suggest not to collapse structure tree in such case, leaving tree in current state. As an easy-to-implement replacement: allow configuring default tree expansion level.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>151254</commentid>
    <comment_count>1</comment_count>
    <who name="Jeroen Wijnhout">spam</who>
    <bug_when>2003-08-10 17:33:47 +0000</bug_when>
    <thetext>When switching between tabs, the structure view is now untouched. 
 
However upon save (or anything that implies an update of the structure view), the 
structure tree stills collapse. Will do something about this later. 
 
best, 
Jeroen </thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>156063</commentid>
    <comment_count>2</comment_count>
    <who name="Jeroen Wijnhout">spam</who>
    <bug_when>2003-09-04 16:04:30 +0000</bug_when>
    <thetext>Fixed. You can now specify a default expansion level ( 1 = parts, 2 =chapters, ..., 5 = 
subsubsections). </thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>199672</commentid>
    <comment_count>3</comment_count>
    <who name="Jens">jens-bugs.kde.org</who>
    <bug_when>2004-01-28 12:07:28 +0000</bug_when>
    <thetext>Hi,

this does not work yet (at least as how I understand the bug).

When you save a changed file, I would like the expansion status to be _preserved_ for nodes that didn&apos;t change. I.e. for example, expand chapter 1 and some sections within it, but don&apos;t expand chapter 2.

Of course, added and removed nodes cannot be respected that way, but that is kind of obvious. I guess you recreate the whole tree when one saves the document, and that this makes preserving the status difficult. What about saving the nodes in an array like

expanded_status = array(
 labels = array(expanded=BOOL),
 toc = array(
   1 = array(
	name=&quot;title of first chapter&quot;,
	expanded=BOOL
   ), // no subchapters
   2 = array(
	name=&quot;...&quot;, expanded=BOOL,
	toc = array(
		name = &quot;name of subchapter&quot;,
		expanded=BOOL,
		...
	),
	...
);

... and then use this after you recreated the tree, to restore the expansion status of each node - if it still exists. If it doesn&apos;t, just ignore it (and perhaps use the default expansion level).


Would that be possible?

Thanks for thinking about it! :-)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>200225</commentid>
    <comment_count>4</comment_count>
    <who name="Jeroen Wijnhout">spam</who>
    <bug_when>2004-01-30 13:30:18 +0000</bug_when>
    <thetext>Subject: Re:  don&apos;t collapse structure tree on save or document change

On Wednesday 28 January 2004 12:07, you wrote:
&gt; this does not work yet (at least as how I understand the bug).
&gt;
&gt; When you save a changed file, I would like the expansion status to be
&gt; _preserved_ for nodes that didn&apos;t change. I.e. for example, expand chapter
&gt; 1 and some sections within it, but don&apos;t expand chapter 2.

Yes, I did not meant to say that the wish was fully implemented. You can only 
set the default expansion level (Settings-&gt;Configure Kile).

&gt; Of course, added and removed nodes cannot be respected that way, but that
&gt; is kind of obvious. I guess you recreate the whole tree when one saves the
&gt; document, and that this makes preserving the status difficult. What about
&gt; saving the nodes in an array like
&lt;snip&gt;
&gt; ... and then use this after you recreated the tree, to restore the
&gt; expansion status of each node - if it still exists. If it doesn&apos;t, just
&gt; ignore it (and perhaps use the default expansion level).
&gt;
&gt;
&gt; Would that be possible?

It would be possible I guess, but not so easy considering how the structure 
view is built internally. Since this part of the code is subject to change 
anyway, I will give it an extra thought.

best,
Jeroen

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>228958</commentid>
    <comment_count>5</comment_count>
    <who name="David Grant">davidgrant</who>
    <bug_when>2004-05-05 06:45:55 +0000</bug_when>
    <thetext>Can this bug be re-opened as the ultimate solution wasn&apos;t fixed?  Thanks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>228988</commentid>
    <comment_count>6</comment_count>
    <who name="Jeroen Wijnhout">spam</who>
    <bug_when>2004-05-05 09:50:30 +0000</bug_when>
    <thetext>I have a patch for this somewhere, but it will take some time to 
1. find it 
2. modify it to the current situation

best,
Jeroen</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>256623</commentid>
    <comment_count>7</comment_count>
    <who name="Jeroen Wijnhout">spam</who>
    <bug_when>2004-08-06 21:43:15 +0000</bug_when>
    <thetext>It is fixed (for a while already actually). Kile does it best to restore the structure view, it is only perfect if either the sections did not move or did not change their title.

best,
Jeroen</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>