<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>I am trying to find a way to access some application data. Examples are, plasma desktopthemes and kwin colorschemes...</div><div><br></div><div>In the future this will also be needed because Latte will provide installable qml indicators (something like plasma qml applets currently</div><div>do but these are going to be used only to draw the task/applet activeORstate indicator</div><div><br></div><div>what I did is the following:</div><div><br></div><div>///////////////////////////////</div><div>//! returns the standard path found that contains the subPath<br>//! local paths have higher priority by default<br></div><div>QString Importer::standardPath(QString subPath, bool localfirst)<br>{<br>    QStringList paths = QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation);<br><br>    if (localfirst) {<br>        foreach (auto pt, paths) {<br>            QString ptF = pt + "/" +subPath;<br>            if (QFileInfo(ptF).exists()) {<br>                return ptF;<br>            }<br>        }<br>    } else {<br>        for (int i=paths.count()-1; i>=0; i--) {<br>            QString ptF = paths[i] + "/" +subPath;<br>            if (QFileInfo(ptF).exists()) {<br>                return ptF;<br>            }<br>        }<br>    }<br><br>    //! in any case that above fails<br>    if (QFileInfo("/usr/share/"+subPath).exists()) {<br>        return "/usr/share/"+subPath;<br>    }<br><br>    return "";<br>}</div><div><br></div><div>///////////////////////////////////<br></div><div><br></div><div>In my code I can use it for example as: <br></div><div>Importer::standardPath("color-schemes");</div><div><br></div><div>OR if I know the name I am searching<br></div><div>Importer::standardPath("color-schemes/" + schemeName + ".colors");<br></div><div><br></div><div><br></div><div>BUT I dont think this approach works when user has installed Plasma on its local directory and how that directory can be KNOWN.</div><div><br></div><div>regards,</div><div>michail<br></div><div><br></div></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Στις Τρί, 19 Μαρ 2019 στις 11:34 π.μ., ο/η David Edmundson <<a href="mailto:david@davidedmundson.co.uk">david@davidedmundson.co.uk</a>> έγραψε:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Can you elaborate on what you're trying to accomplish?<br>
</blockquote></div>