Home · All Namespaces · All Classes
Public Slots | Signals | Public Member Functions | Static Public Member Functions

LauncherDataStore Class Reference

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>

Inheritance diagram for LauncherDataStore:
Inheritance graph
[legend]

List of all members.

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)

Detailed Description

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.


Constructor & Destructor Documentation

LauncherDataStore::LauncherDataStore ( MDataStore *  dataStore,
const QStringList &  directories 
)

Constructs LauncherDataStore. The ownership of the MDataStore is transferred to this LauncherDataStore.

Parameters:
dataStore The backend data store.
directories The directories to watch.
LauncherDataStore::~LauncherDataStore (  )  [virtual]

Member Function Documentation

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.

Parameters:
entryPath The absolute entry path of the desktop entry (eg. "/usr/share/applications/deskentry.desktop").
Returns:
The key for the entry.
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.

Parameters:
key The key as key prefix and entry path (eg. "KEY_PREFIX/usr/share/applications/deskentry.desktop").
Returns:
The entry path.
void LauncherDataStore::removeDataForDesktopEntry ( const QString &  entryPath  ) 

Removes the data for a desktop entry in the data store.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
desktopEntryPath Path to desktop entry that has changed

The documentation for this class was generated from the following files:

Copyright © 2011 Nokia Corporation Generated on Thu Jul 7 2011 22:14:50
Doxygen 1.7.1
MeeGo Touch