| Home · All Classes · Main Classes · Deprecated |
MExtensionWatcher provides means to watch if either a given applet or a application extension has been updated by the package manager. If the change happens a corresponding signal will be emitted.
More...


Signals | |
| void | extensionChanged (const MDesktopEntry &extension) const |
Public Member Functions | |
| MExtensionWatcher () | |
| virtual | ~MExtensionWatcher () |
| void | addExtension (QSharedPointer< const MDesktopEntry > extension) |
| void | removeExtension (const QString &fileName) |
MExtensionWatcher provides means to watch if either a given applet or a application extension has been updated by the package manager. If the change happens a corresponding signal will be emitted.
The user of this class is responsible for the lifecycle management of the watched entries. This class does not assume ownership of the items nor can it detect if they are deleted. The user must remove the item from this watcher before deleting the item. Otherwise desktop file modification notification leads to undefined behaviour, because the target item of the notification will not exist.
Definition at line 42 of file mextensionwatcher.h.
| MExtensionWatcher::MExtensionWatcher | ( | ) |
Constructs the watcher instance
Definition at line 27 of file mextensionwatcher.cpp.
{
connect(&watcher, SIGNAL(fileChanged(const QString &)), this, SLOT(notifyDataChanged(const QString &)));
}

| MExtensionWatcher::~MExtensionWatcher | ( | ) | [virtual] |
| void MExtensionWatcher::addExtension | ( | QSharedPointer< const MDesktopEntry > | extension | ) |
Add an extension to the list of watched extensions. If the extension (its desktop entry) changes, a signal
| extension | The extension to watch. |
Definition at line 36 of file mextensionwatcher.cpp.
{
QString fileName = extension->fileName();
if (!extensionsToWatch.contains(fileName)) {
extensionsToWatch.insert(fileName, extension);
watcher.addPath(fileName);
}
}

| void MExtensionWatcher::extensionChanged | ( | const MDesktopEntry & | extension | ) | const [signal] |
Informs that an extension (its desktop file) has changed.
| extension | The extension that has changed |
| void MExtensionWatcher::removeExtension | ( | const QString & | fileName | ) |
Removes an extension from the list of watched extension
| fileName | Name of the desktop file of the extension to remove |
Definition at line 46 of file mextensionwatcher.cpp.
{
extensionsToWatch.remove(fileName);
}

| Copyright © 2010 Nokia Corporation | Generated on Thu Nov 4 2010 18:14:25 (PDT) Doxygen 1.7.1 |
MeeGo Touch |