Bug 49379 - Setting the Temp path (Tools > Options) impossible with an extension
Summary: Setting the Temp path (Tools > Options) impossible with an extension
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Extensions (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: Other All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard: target:3.6.0
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-02 06:22 UTC by Cor Nouws
Modified: 2012-05-07 07:07 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample extension to change temp path (453 bytes, text/plain)
2012-05-03 00:23 UTC, Stephan Bergmann
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Cor Nouws 2012-05-02 06:22:30 UTC
( Follow up from Bug 49378 )

An extension to set the various paths, does not modify the "Temp" path.
That however is possible via the UI.
I do not see this working in any version of LibreOffice (and doubt if it does in OOo, where the attached extension in the other bug fails all together).

Contents of the Path.xcu:

 <node oor:name="Variables">
  <prop oor:name="Work">
   <value>file://~/Documenten/DATA/LibO</value>
  </prop>
 </node>
 <node oor:name="Paths">
  <node oor:name="Temp">
   <prop oor:name="WritePath">
    <value>file://~/Documenten/DATA/LibO</value>
   </prop>
  </node>
  <node oor:name="Template" oor:op="fuse">
   <prop oor:name="WritePath">
    <value>file://~/Documenten/DATA/LibO</value>
   </prop>
  </node>
 </node>

It does not make a difference when the following prop is added to the node Variables and removed from the node Paths :

  <prop oor:name="Temp">
   <value>file://~/Documenten/DATA/LibO</value>
  </prop>
Comment 1 Not Assigned 2012-05-02 23:59:00 UTC
Stephan Bergmann committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=920db17e94a8880658090f0887f788db0b15e2a2

Related fdo#49379: Some old Paths need to be nillable after all
Comment 2 Stephan Bergmann 2012-05-03 00:23:15 UTC
Created attachment 60946 [details]
Sample extension to change temp path

Turns out these paths are stored in two different formats in the configuration, an old format (/org.openoffice.Office.Common/Path) and a new format (/org.openoffice.Office.Paths/Paths), and you explicitly need to deactivate the old format if you store something in the new format (cf. PathSettings::impl_storePath in framework/source/services/pathsettings.cxx).

The attached temp.xcu is an example extension to change the temp path (works on current master).
Comment 3 Cor Nouws 2012-05-07 07:07:30 UTC
(In reply to comment #2)

> The attached temp.xcu is an example extension to change the temp path (works on
> current master).

thanks. Works on 3.5 too.
And for the record, setting the Work path in 3.5 and master needs a similar approach:

 <item oor:path="/org.openoffice.Office.Common/Path/Current">
  <prop oor:name="Work" oor:op="fuse">
   <value xsi:nil="true"/>
  </prop>
 </item>
 <item oor:path="/org.openoffice.Office.Common/Path/Info">
  <prop oor:name="WorkPathChanged" oor:op="fuse">
   <value>true</value> 
  </prop>
 </item>
 <item oor:path="/org.openoffice.Office.Paths/Paths/org.openoffice.Office.Paths:NamedPath['Work']">
  <prop oor:name="WritePath" oor:op="fuse">
   <value>file:///foo/bar/work</value>
  </prop>
 </item>