[KDE/Mac] QStandardPaths possible solution

Ian Wadham iandw.au at gmail.com
Thu Jan 8 10:39:26 UTC 2015


Hello David,

On 08/01/2015, at 7:19 PM, David Faure wrote:

> On Thursday 08 January 2015 16:18:39 Ian Wadham wrote:
>> 2) Looking at the documentation on QStandardPaths at
>> http://doc-snapshot.qt-project.org/qt5-5.4/qstandardpaths.html,
>> a notional prefix called <APPROOT> is used to describe the
>> typical Blackberry and Android paths.  We could do something
>> similar for XDG-like paths on Apple OS X.  Blackberry does not
>> use "APPROOT" in its code, but Android uses something like it.
>> It looks to see if "APPROOT_FILES" is defined, and if so, it uses
>> that path.  On Windows and OS X, the notional prefix <APPDIR>
>> appears, but it is defined as the directory where the *executable*
>> resides, so no use to us.
>> 
>> I suggest our patch could look for APPROOT_XDG.
> 
> That sounds really confusing. APPROOT in the QSP documentation means "the 
> sandbox for the application".

No, not at all, the documentation says "(often a sandbox)", by way of an example
only.  The word "often" implies "not necessarily" or "not always".  And "sandbox", 
is a vaguely defined, metaphoric term.  To me a sandbox (or "sandpit" in the English
I speak) is simply an area in which children can play with sand, surrounded by low
walls which (partially at least) prevents the sand from spilling everywhere.  I have built
a few for my children --- and now my children have built them for my grandchildren.

In software, "sandbox" seems to have several meanings, just as "frameworks" does,
would you believe?  Why cannot software people invent unique terms for things, as
scientists have been doing for the last couple of centuries at least?  Never mind, we
are stuck with that, which means that software people keep having Wittgensteinian
arguments [1].

> You could use that for app bundles, but using that for e.g. /opt/local is very 
> confusing because this is not a sandbox!

"Ceci n'est pas une pipe"?… :-)  See here what Wikipedia says a sandbox is [2].
But here is what Apple OS X means by it [3].  And the trend is for Apple to insist
that all apps installed on Apple OS X or iOS (used in iDevices) are "sandboxed",
from what I can gather.  I have no idea what Qt means by "sandbox", but it does
not matter, they only mention it in passing on this occasion… :-)

> Files in there are shared with other  apps.
> I recommend against using APPROOT here in your case, which is much more 
> similar to the XDG case than to sandboxed apps.

I liked using <APPROOT> because I did not wish to bring a new term into the Qt
documentation of QStandardPaths, so I just extended <APPROOT> a little.  See
the patch for the documentation I attached to my email.  I don't really care what
term is used, as long as it is UNIQUE (like quark, electron or Tyrannosaurus rex),
but I hesitate to introduce a new term into some of Qt's nice, simple, well-written
documentation.  It goes against all my instincts as a writer of documentation.
That is why I did not invent a new term, <XDGBASE> or some such, but I did
toy with that idea.

Now can we stop arguing about semantics and angels on pins and discuss
something really important (as I asked previously), namely the role of kinit
and friends in KF5 and to what extent they are important, or even needed, on
desktops that do not use Linux?  And is kinit really going to be abolished?  Or
was that just David Faure thinking aloud on IRC?  Or being quoted out of context?

All the best, Ian W.

> David Faure, faure at kde.org, http://www.davidfaure.fr
> Working on KDE Frameworks 5

[1]
http://www.brainyquote.com/quotes/authors/l/ludwig_wittgenstein.html
http://en.wikipedia.org/wiki/Ludwig_Wittgenstein
http://en.wikipedia.org/wiki/Ludwig_Wittgenstein#1953:_Publication_of_the_Philosophical_Investigations
http://en.wikipedia.org/wiki/Philosophical_Investigations
[2]
http://en.wikipedia.org/wiki/Sandbox_%28software_development%29
[3]
https://developer.apple.com/library/mac/documentation/Security/Conceptual/AppSandboxDesignGuide/AboutAppSandbox/AboutAppSandbox.html#//apple_ref/doc/uid/TP40011183-CH1-SW1


More information about the kde-mac mailing list