<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:10pt"><div><span>Hi,</span></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: HelveticaNeue-Light,Helvetica Neue Light,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; background-color: transparent; font-style: normal;"><br><span></span></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: HelveticaNeue-Light,Helvetica Neue Light,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; background-color: transparent; font-style: normal;"><span>my app needs an SQLITE db, also. I deploy it into /usr/share/harbour-{APPNAME}/data.</span></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: HelveticaNeue-Light,Helvetica Neue Light,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; background-color:
transparent; font-style: normal;"><span>You could then use it either from this location, or copy it into the home dir on the first run.</span></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: HelveticaNeue-Light,Helvetica Neue Light,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; background-color: transparent; font-style: normal;"><br><span></span></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: HelveticaNeue-Light,Helvetica Neue Light,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; background-color: transparent; font-style: normal;"><span>As the db seems to be readonly, I think you don't need to copy it into the home dir.<br></span></div> <div>Mit freundlichen Grüßen,
<br>
<br>Michael Neufing
<br></div> <div class="qtdSeparateBR"><br><br></div><div style="display: block;" class="yahoo_quoted"> <div style="font-family: HelveticaNeue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 10pt;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 12pt;"> <div dir="ltr"> <font face="Arial" size="2"> Saija Saarenpää <setelani@live.com> schrieb am 8:41 Mittwoch, 18.Juni 2014:<br> </font> </div> <br><br> <div class="y_msg_container"><div id="yiv0079599145"><div><div>Hi,</div><div><br clear="none"></div><div>What comes to having datalocation path variable in the .pro file:</div><div>I was having similar thoughts when I wanted to install something in the writable storage location, but I was corrected. Nothing should be installed in the home directory with the application, but under application directory /usr/share/harbour-yourappname/.
There can be also subdirs under that location. Then, at runtime, you can create the writable storage location if it does not exist, and copy or create stuff there. Preferably the app would not pre-install any data, but everything would be downloaded / created runtime. That would be the ideal though, not always applicable.</div><div><br clear="none"></div><div>- Saija</div><div>@setelani</div><div>matrixx #sailfishOS<br clear="none"><br clear="none">Lähetetty iPadista</div><div><div class="yiv0079599145yqt7559536578" id="yiv0079599145yqtfd81369"><br clear="none">"Andrey Kozhevnikov" <<a rel="nofollow" shape="rect" ymailto="mailto:coderusinbox@gmail.com" target="_blank" href="mailto:coderusinbox@gmail.com">coderusinbox@gmail.com</a>> kirjoitti 18.6.2014 kello 8.50:<br clear="none"><br clear="none"></div></div><div class="yiv0079599145yqt7559536578" id="yiv0079599145yqtfd85326"><blockquote type="cite"><div>
</div></blockquote></div></div><div class="yiv0079599145yqt7559536578" id="yiv0079599145yqtfd88744"><div>
you should build and deploy as RPM package ;)<br clear="none">
<br clear="none">
<div class="yiv0079599145moz-cite-prefix">18.06.2014 03:42, Lukas Vogel пишет:<br clear="none">
</div>
<blockquote type="cite">
<div dir="ltr">Hi there,
<div><br clear="none">
</div>
<div>I try to create an app in which I want to have an existing
database bind in the binary.</div>
<div><br clear="none">
</div>
<div>My approach was the following: </div>
<div>in pro file:</div>
<div>
<font color="#000000">QT</font><span style="color:rgb(192,192,192);"> </span>+=<span style="color:rgb(192,192,192);"> </span>sql</div>
<div>
<pre style="margin-top:0px;margin-bottom:0px;"></pre>
<pre style="margin-top:0px;margin-bottom:0px;"></pre><pre style="margin-top:0px;margin-bottom:0px;">database.files<span style="color:rgb(192,192,192);"> </span>=<span style="color:rgb(192,192,192);"> </span>stations.db</pre><pre style="margin-top:0px;margin-bottom:0px;">database.path<span style="color:rgb(192,192,192);"> </span>=<span style="color:rgb(192,192,192);"> </span>/home/nemo/.local/share/harbour-qtimetable/harbour-qtimetable</pre>
<pre style="margin-top:0px;margin-bottom:0px;">INSTALLS += database</pre><pre style="margin-top:0px;margin-bottom:0px;"></pre><pre style="margin-top:0px;margin-bottom:0px;">To open the database:</pre><pre style="margin-top:0px;margin-bottom:0px;">db = QSqlDatabase::addDatabase("QSQLITE");
db.setDatabaseName(DB_NAME);
db.setUserName(USER_NAME);
db.setPassword(PASSWORD);
db.setConnectOptions("QSQLITE_OPEN_READONLY=1");
</pre><pre style="margin-top:0px;margin-bottom:0px;">if(db.open()) {...}</pre><pre style="margin-top:0px;margin-bottom:0px;"></pre><pre style="margin-top:0px;margin-bottom:0px;">for DB_NAME I use QStandardPaths::writableLocation(QStandardPaths::DataLocation) with stations.db appended. </pre><pre style="margin-top:0px;margin-bottom:0px;"></pre><pre style="margin-top:0px;margin-bottom:0px;">However when I deploy this will fail as the path on emulator has</pre>
<pre style="margin-top:0px;margin-bottom:0px;">home/deploy/installroot/ prefix, and when deploying on device there is /opt/sdk/..
</pre><pre style="margin-top:0px;margin-bottom:0px;">prefix. </pre><pre style="margin-top:0px;margin-bottom:0px;"></pre><pre style="margin-top:0px;margin-bottom:0px;">This makes testing quite annoying, is there a genuine way to get the database to open both in the emulator and the device? </pre><pre style="margin-top:0px;margin-bottom:0px;"></pre><pre style="margin-top:0px;margin-bottom:0px;">Side question is there a "standard path::datalocation" variable for the .pro file?</pre><pre style="margin-top:0px;margin-bottom:0px;"></pre><pre style="margin-top:0px;margin-bottom:0px;">Thanks for any help,</pre><pre style="margin-top:0px;margin-bottom:0px;">Lukas</pre>
</div>
</div>
<br clear="none">
<fieldset class="yiv0079599145mimeAttachmentHeader"></fieldset>
<br clear="none">
<pre>_______________________________________________
<a rel="nofollow" shape="rect" target="_blank" href="http://sailfishos.org/">SailfishOS.org</a> Devel mailing list
To unsubscribe, please send a mail to <a rel="nofollow" shape="rect" class="yiv0079599145moz-txt-link-abbreviated" ymailto="mailto:devel-unsubscribe@lists.sailfishos.org" target="_blank" href="mailto:devel-unsubscribe@lists.sailfishos.org">devel-unsubscribe@lists.sailfishos.org</a></pre>
</blockquote>
<br clear="none">
<blockquote type="cite"><div><span>_______________________________________________</span><br clear="none"><span><a rel="nofollow" shape="rect" target="_blank" href="http://sailfishos.org/">SailfishOS.org</a> Devel mailing list</span><br clear="none"><span>To unsubscribe, please send a mail to <a rel="nofollow" shape="rect" ymailto="mailto:devel-unsubscribe@lists.sailfishos.org" target="_blank" href="mailto:devel-unsubscribe@lists.sailfishos.org">devel-unsubscribe@lists.sailfishos.org</a></span></div></blockquote></div></div></div><br><div class="yqt7559536578" id="yqtfd06466">_______________________________________________<br clear="none">SailfishOS.org Devel mailing list<br clear="none">To unsubscribe, please send a mail to <a shape="rect" ymailto="mailto:devel-unsubscribe@lists.sailfishos.org" href="mailto:devel-unsubscribe@lists.sailfishos.org">devel-unsubscribe@lists.sailfishos.org</a></div><br><div class="yqt7559536578"
id="yqtfd81406">_______________________________________________<br clear="none">SailfishOS.org Devel mailing list<br clear="none">To unsubscribe, please send a mail to <a shape="rect" ymailto="mailto:devel-unsubscribe@lists.sailfishos.org" href="mailto:devel-unsubscribe@lists.sailfishos.org">devel-unsubscribe@lists.sailfishos.org</a></div><br><br></div> </div> </div> </div> </div></body></html>