×
Namespaces

Variants
Actions
(Difference between revisions)

Get private path in Qt

From Nokia Developer Wiki
Jump to: navigation, search
hamishwillee (Talk | contribs)
m (Hamishwillee - Addition to article of: Category:MeeGo Category:Symbian. (Add platform categories))
hamishwillee (Talk | contribs)
m (Text replace - "Category:MeeGo" to "Category:MeeGo Harmattan")
Line 51: Line 51:
  
 
== References ==
 
== References ==
* [http://doc.qt.nokia.com/latest/qdesktopservices.html#StandardLocation-enum QDesktopServices::DataLocation][[Category:MeeGo]] [[Category:Symbian]]
+
* [http://doc.qt.nokia.com/latest/qdesktopservices.html#StandardLocation-enum QDesktopServices::DataLocation][[Category:MeeGo Harmattan]] [[Category:Symbian]]

Revision as of 13:53, 13 June 2012

Article Metadata
Compatibility
Platform(s):
Symbian
Article
Created: savaj (20 Jun 2009)
Last edited: hamishwillee (13 Jun 2012)

This article explains how to get the Symbian application private path where you can safely store application data.

Description

Symbian applications store their data in a secure area, known as a "private directory", or data cage. Other applications cannot read/write this folder unless they have the manufacturer capability AllFiles - this is hard to obtain.

The private directory is located at \private\<sid>, where the SID is a special identifier that is unique to the application (usually the same value as the application UID). In Qt you will get full path of private folder using QDir::currentPath() method or QDesktopServices::storageLocation (QDesktopServices::DataLocation). Either method returns the absolute path of the application's current directory.


Source code

/* This method will return private path as C:/Private/ed8788dc
assuming application installed on c drive and has UID ed8788dc */

QString myPrivateDirectory (QDesktopServices::storageLocation (QDesktopServices::DataLocation));

or

/* This method will return private path as C:/Private/ed8788dc
assuming application installed on c drive and has UID ed8788dc */

QString privatePathQt(QApplication::applicationDirPath());

Converting path from Qt format to Symbian format

In pure Qt applications you can use the returned path directly. If you need to interact with Symbian code then you will need to read Converting between Qt and Symbian Directory Separators.

References

94 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×