[Solved] N950 writable folders
-
Hi, I have to manage some data to be written on files in the N950 environment. When the package is installed it is put in the folder
@
/opt/Package_Name/bin/
@
I have configuration files that are included in the application that I put in a /data/ folder that I find on the device in
@
/opt/Package_Name/data/
@
The files that I will write at runtime - as logic suggest - maybe put in the
@
/home/user/myfolder/
@
Regardless that I know what is the application folder, I build the data folder path using a call to QApplication::applicationDirPath() as shown in the snippet below
@
fullFileName.append(QApplication::applicationDirPath());
fullFileName.append("/../");
fullFileName.append("myfolder/");
fullFileName.append(m_fname);
@
Is there a similar way to acquire the path of the current user folder where I can create my folders, save files etc. or I should use the string "/home/user/" as a constant ?Many thanks for any suggestion.
-
I think that QDir::homePath() should help you
-
Thank you Denis,
now I will check what other parameters can be obatined from QDir. :)
-
@Denis: thanks, this is the right way. I can manage almost all the essential system folders and create new ones in the writable folders (user permissions).
-
I have a similar problem.
my application contains a database that i should write in at runtime.
but I always get the following message in the console.bq. "attempt to write a readonly database Unable to fetch row"
I think it a problem of permissions.
My application deployed to
@/opt/myapplication/bin@
and the database deployed to
@/home/user/myapplication/data/faces.db@I deployed it using the following lines in the pro file
@unix:!symbian{
db.files = faces.db
db.path = /home/user/myApplication/data
INSTALLS += db
}@So how could I make it writable for the user?
Thanks in advance