How to Deploy and Use Files in Application Private Directory for Symbian: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
No edit summary
 
(Remove non-functioning "toc" command)
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
'''English''' [[How to Deploy and Use Files in Application Private Directory for Symbian Bulgarian|Български]]
{{Outdated|reason=The Symbian platform is no longer supported.}}
{{Cleanup | reason=Auto-imported from ExpressionEngine.}}


=How to Deploy and Use Files in Application Private Directory for Symbian=
[[Category:HowTo]]
[[Category:Snippets]]


==Private Directory==


Symbian platform security model defines that each application has a private directory which name depends on the application <span class="caps">UID</span>.<br /> Only the application itself (and backup software) has read and write access to this directory.
'''English''' [[How_to_Deploy_and_Use_Files_in_Application_Private_Directory_for_Symbian_Bulgarian|Български]]


==File Deployment==
= How to Deploy and Use Files in Application Private Directory for Symbian =


The <span class="caps">DEPLOYMENT</span> keyword have to used at pro file to deploy file to the private directory of the application.
== Private Directory ==


The example shows how to copy test.txt from the local directory of the project to the private directory of the application on Symbian device. <br />
Symbian platform security model defines that each application has a private directory which name depends on the application UID.
Only the application itself (and backup software) has read and write access to this directory.


Please note that path should be change if you want to deploy the file on another location or in a sub folder.
== File Deployment ==


==Using Files Located at the Application Private Directory==
The DEPLOYMENT keyword have to used at pro file to deploy file to the private directory of the application.


After installation on a Symbian device the file will be located in the application private dir which can be obtained using [http://doc.qt.nokia.com/latest/qcoreapplication.html#applicationDirPath QApplication::applicationDirPath()] ''[doc.qt.nokia.com]''
The example shows how to copy test.txt from the local directory of the project to the private directory of the application on Symbian device.
<code>
test.sources = "test.txt"
test.path = .
DEPLOYMENT ''= test
</code>


* Remember to include [http://doc.qt.nokia.com/latest/qcoreapplication.html QApplication] ''[doc.qt.nokia.com]''<br />
Please note that path should be change if you want to deploy the file on another location or in a sub folder.


* Open file<br />
== Using Files Located at the Application Private Directory ==
After installation on a Symbian device the file will be located in the application private dir which can be obtained using [http://doc.qt.nokia.com/latest/qcoreapplication.html#applicationDirPath QApplication::applicationDirPath()]


==See Also==
* Remember to include [http://doc.qt.nokia.com/latest/qcoreapplication.html QApplication]
<code>
#include <QApplication>
</code>


[http://wiki.forum.nokia.com/index.php/Symbian_Platform_Security_Model Symbian Platform Security Model] ''[wiki.forum.nokia.com]''<br />[http://wiki.forum.nokia.com/index.php/CS001424_-_Using_the_DEPLOYMENT_keyword_in_a_Qt_package_file Using the <span class="caps">DEPLOYMENT</span> keyword in a Qt package file] ''[wiki.forum.nokia.com]''<br />[http://developer.qt.nokia.com/wiki/Symbian_FAQ Symbian <span class="caps">FAQ</span>] ''[developer.qt.nokia.com]''
* Open file
<code>
//generate the file path
QString sFile = QApplication::applicationDirPath()'' "/test.txt";
QFile file(sFile);
//Open the file
if (file.open(QIODevice::ReadOnly | QIODevice::Text))
{
//Do something
}
</code>


===Categories:===
== See Also ==


* [[:Category:HowTo|HowTo]]
[http://wiki.forum.nokia.com/index.php/Symbian_Platform_Security_Model Symbian Platform Security Model]
* [[:Category:snippets|snippets]]
[http://wiki.forum.nokia.com/index.php/CS001424_-_Using_the_DEPLOYMENT_keyword_in_a_Qt_package_file Using the DEPLOYMENT keyword in a Qt package file]

Latest revision as of 12:21, 17 April 2015

IMPORTANT: The content of this page is outdated. Reason: The Symbian platform is no longer supported.
If you have checked or updated this page and found the content to be suitable, please remove this notice.
This article may require cleanup to meet the Qt Wiki's quality standards. Reason: Auto-imported from ExpressionEngine.
Please improve this article if you can. Remove the {{cleanup}} tag and add this page to Updated pages list after it's clean.


English Български

How to Deploy and Use Files in Application Private Directory for Symbian

Private Directory

Symbian platform security model defines that each application has a private directory which name depends on the application UID. Only the application itself (and backup software) has read and write access to this directory.

File Deployment

The DEPLOYMENT keyword have to used at pro file to deploy file to the private directory of the application.

The example shows how to copy test.txt from the local directory of the project to the private directory of the application on Symbian device.

test.sources = "test.txt"
test.path = .
DEPLOYMENT ''= test

Please note that path should be change if you want to deploy the file on another location or in a sub folder.

Using Files Located at the Application Private Directory

After installation on a Symbian device the file will be located in the application private dir which can be obtained using QApplication::applicationDirPath()

#include <QApplication>
  • Open file
//generate the file path
QString sFile = QApplication::applicationDirPath()'' "/test.txt";
QFile file(sFile);
//Open the file
if (file.open(QIODevice::ReadOnly | QIODevice::Text))
{
 //Do something
}

See Also

Symbian Platform Security Model Using the DEPLOYMENT keyword in a Qt package file