<div dir="ltr"><font face="arial, helvetica, sans-serif">Hi,</font><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">Thanks all for your answers. Andreys solution works, it complained first for the simulator,</font></div>
<div><font face="arial, helvetica, sans-serif">but seems to work now (after it ran successfully on device).</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">I now changed the path to<font color="#000000"> <span style="font-size:9pt">/usr/share/harbour-qtimetable/data/stations.db</span></font></font></div>
<div><font face="arial, helvetica, sans-serif"><font color="#000000"><span style="font-size:9pt"><br></span></font></font></div><div><font color="#000000" face="arial, helvetica, sans-serif"><span style="font-size:12px">I have quite a big read-only part (list of train-stations) but I want to store things like favorites and stuff.</span></font></div>
<div><font color="#000000" face="arial, helvetica, sans-serif"><span style="font-size:12px">Would you suggest creating 2 separate db, or copying the whole db at first start-up to the write-able </span></font><span style="font-size:12px;color:rgb(0,0,0);font-family:arial,helvetica,sans-serif">location?</span></div>
<div><span style="font-size:12px;color:rgb(0,0,0);font-family:arial,helvetica,sans-serif"><br></span></div><div><span style="font-size:12px;color:rgb(0,0,0);font-family:arial,helvetica,sans-serif">Thanks for your help,</span></div>
<div><span style="font-size:12px;color:rgb(0,0,0);font-family:arial,helvetica,sans-serif">Lukas</span></div><div><br></div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-06-18 7:42 GMT+00:00 Michael Neufing <span dir="ltr"><<a href="mailto:m.neufing@yahoo.de" target="_blank">m.neufing@yahoo.de</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><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><br><br></div><div style="display:block"> <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"> Saija Saarenpää <<a href="mailto:setelani@live.com" target="_blank">setelani@live.com</a>> schrieb am 8:41 Mittwoch, 18.Juni 2014:<br> </font> </div><div><div class="h5"> <br><br>
<div><div><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><br clear="none">"Andrey Kozhevnikov" <<a rel="nofollow" shape="rect" href="mailto:coderusinbox@gmail.com" target="_blank">coderusinbox@gmail.com</a>> kirjoitti 18.6.2014 kello 8.50:<br clear="none">
<br clear="none"></div></div><div><blockquote type="cite"><div>
</div></blockquote></div></div><div><div>
you should build and deploy as RPM package ;)<br clear="none">
<br clear="none">
<div>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></fieldset>
<br clear="none">
<pre>_______________________________________________
<a rel="nofollow" shape="rect" href="http://sailfishos.org/" target="_blank">SailfishOS.org</a> Devel mailing list
To unsubscribe, please send a mail to <a rel="nofollow" shape="rect" href="mailto:devel-unsubscribe@lists.sailfishos.org" target="_blank">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" href="http://sailfishos.org/" target="_blank">SailfishOS.org</a> Devel mailing list</span><br clear="none">
<span>To unsubscribe, please send a mail to <a rel="nofollow" shape="rect" href="mailto:devel-unsubscribe@lists.sailfishos.org" target="_blank">devel-unsubscribe@lists.sailfishos.org</a></span></div></blockquote></div></div>
</div><br><div>_______________________________________________<br clear="none">SailfishOS.org Devel mailing list<br clear="none">To unsubscribe, please send a mail to <a shape="rect" href="mailto:devel-unsubscribe@lists.sailfishos.org" target="_blank">devel-unsubscribe@lists.sailfishos.org</a></div>
<br><div>_______________________________________________<br clear="none">SailfishOS.org Devel mailing list<br clear="none">To unsubscribe, please send a mail to <a shape="rect" href="mailto:devel-unsubscribe@lists.sailfishos.org" target="_blank">devel-unsubscribe@lists.sailfishos.org</a></div>
<br><br></div> </div></div></div> </div> </div> </div></div><br>_______________________________________________<br>
SailfishOS.org Devel mailing list<br>
To unsubscribe, please send a mail to <a href="mailto:devel-unsubscribe@lists.sailfishos.org">devel-unsubscribe@lists.sailfishos.org</a><br></blockquote></div><br></div>