Home · All Classes · Main Classes · Deprecated
Signals | Public Member Functions

MExtensionWatcher Class Reference

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

Inheritance diagram for MExtensionWatcher:
Inheritance graph
[legend]
Collaboration diagram for MExtensionWatcher:
Collaboration graph
[legend]

List of all members.

Signals

void extensionChanged (const MDesktopEntry &extension) const

Public Member Functions

 MExtensionWatcher ()
virtual ~MExtensionWatcher ()
void addExtension (QSharedPointer< const MDesktopEntry > extension)
void removeExtension (const QString &fileName)

Detailed Description

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.


Constructor & Destructor Documentation

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 &)));
}

Here is the call graph for this function:

MExtensionWatcher::~MExtensionWatcher (  )  [virtual]

Destroys the wathcer instance

Definition at line 32 of file mextensionwatcher.cpp.

{
}


Member Function Documentation

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

See also:
extensionChanged will be emitted.
Parameters:
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);
    }
}

Here is the call graph for this function:

void MExtensionWatcher::extensionChanged ( const MDesktopEntry extension  )  const [signal]

Informs that an extension (its desktop file) has changed.

Parameters:
extension The extension that has changed
void MExtensionWatcher::removeExtension ( const QString fileName  ) 

Removes an extension from the list of watched extension

Parameters:
fileName Name of the desktop file of the extension to remove

Definition at line 46 of file mextensionwatcher.cpp.

{
    extensionsToWatch.remove(fileName);
}

Here is the call graph for this function:


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