Home · All Namespaces · All Classes |
LauncherDataStore provides a way to store .desktop entry file related data such as the location of the .desktop entry in the user interface. More...
#include <launcherdatastore.h>
Public Slots | |
void | updateDesktopEntry (const QString &desktopEntryPath) |
Signals | |
void | dataStoreChanged () |
A signal for informing that the contents of the data store have changed. | |
void | desktopEntryChanged (const QString &) |
A signal for informing that the contents of a desktop entry have changed. | |
void | desktopEntryAdded (const QString &) |
void | desktopEntryRemoved (const QString &) |
Public Member Functions | |
LauncherDataStore (MDataStore *dataStore, const QStringList &directories) | |
virtual | ~LauncherDataStore () |
QHash< QString, QVariant > | dataForAllDesktopEntries () |
void | updateDataForDesktopEntry (const QString &entryPath, const QVariant &data) |
void | updateDataForDesktopEntries (const QHash< QString, QString > &newValues) |
void | removeDataForDesktopEntry (const QString &entryPath) |
Static Public Member Functions | |
static QString | entryPathToKey (const QString &entryPath) |
static QString | keyToEntryPath (const QString &key) |
LauncherDataStore provides a way to store .desktop entry file related data such as the location of the .desktop entry in the user interface.
The data is stored as key-value pairs. Key is entry file path relative to root. (eg. "usr/share/applications/deskentry.desktop"). The value is user specific data.
The LauncherDataStore uses a MDataStore as a backend to actually store the the data. The ownership of the MDataStore is transferred to the LauncherDataStore.
LauncherDataStore::LauncherDataStore | ( | MDataStore * | dataStore, | |
const QStringList & | directories | |||
) |
Constructs LauncherDataStore. The ownership of the MDataStore is transferred to this LauncherDataStore.
dataStore | The backend data store. | |
directories | The directories to watch. |
LauncherDataStore::~LauncherDataStore | ( | ) | [virtual] |
Destroys LauncherDataStore
QHash< QString, QVariant > LauncherDataStore::dataForAllDesktopEntries | ( | ) |
Returns the data for all desktop entries stored in the data store.
void LauncherDataStore::dataStoreChanged | ( | ) | [signal] |
A signal for informing that the contents of the data store have changed.
void LauncherDataStore::desktopEntryAdded | ( | const QString & | ) | [signal] |
A signal for informing that the a new entry has been added.
Added desktop entry path as parameter.
void LauncherDataStore::desktopEntryChanged | ( | const QString & | ) | [signal] |
A signal for informing that the contents of a desktop entry have changed.
void LauncherDataStore::desktopEntryRemoved | ( | const QString & | ) | [signal] |
A signal for informing that the a entry has been removed.
Removed desktop entry path as parameter.
QString LauncherDataStore::entryPathToKey | ( | const QString & | entryPath | ) | [static] |
This helper method gets a key from entry path by adding key prefix to the path.
Due QSettings HomeFileDataStore removes preceding forward slash from key. To overcome this we need to use a key prefix in the key.
entryPath | The absolute entry path of the desktop entry (eg. "/usr/share/applications/deskentry.desktop"). |
QString LauncherDataStore::keyToEntryPath | ( | const QString & | key | ) | [static] |
This helper method gets entry path from key by removing key prefix.
Due QSettings HomeFileDataStore removes preceding forward slash from key. To overcome this we need to use a key prefix in the key.
key | The key as key prefix and entry path (eg. "KEY_PREFIX/usr/share/applications/deskentry.desktop"). |
void LauncherDataStore::removeDataForDesktopEntry | ( | const QString & | entryPath | ) |
Removes the data for a desktop entry in the data store.
entryPath | the path of the desktop entry to remove |
void LauncherDataStore::updateDataForDesktopEntries | ( | const QHash< QString, QString > & | newValues | ) |
Updates the data for given desktop entries in the data store.
newValues | The desktop entries to update, as 'entry path'-'placement' pairs |
void LauncherDataStore::updateDataForDesktopEntry | ( | const QString & | entryPath, | |
const QVariant & | data | |||
) |
Updates the data for a desktop entry in the data store.
entryPath | the path of the desktop entry to update | |
data | the data to update the desktop entry with |
void LauncherDataStore::updateDesktopEntry | ( | const QString & | desktopEntryPath | ) | [slot] |
Updates a desktop entry. If file exists, sends a signal about the change. If file does NOT exist, removes path from watcher.
desktopEntryPath | Path to desktop entry that has changed |
Copyright © 2011 Nokia Corporation | Generated on Thu Jul 7 2011 22:14:50 Doxygen 1.7.1 |
MeeGo Touch |