#ifndef MEXTENSIONWATCHER_STUB #define MEXTENSIONWATCHER_STUB #include "mextensionwatcher.h" #include // 1. DECLARE STUB // FIXME - stubgen is not yet finished class MExtensionWatcherStub : public StubBase { public: virtual void MExtensionWatcherConstructor(); virtual void MExtensionWatcherDestructor(); virtual void addExtension(QSharedPointer extension); virtual void removeExtension(const QString &fileName); virtual void notifyDataChanged(const QString &path) const; QFileSystemWatcher watcher ; QHash > extensionsToWatch ; }; // 2. IMPLEMENT STUB void MExtensionWatcherStub::MExtensionWatcherConstructor() { } void MExtensionWatcherStub::MExtensionWatcherDestructor() { } void MExtensionWatcherStub::addExtension(QSharedPointer extension) { QList params; params.append( new Parameter >(extension)); stubMethodEntered("addExtension",params); } void MExtensionWatcherStub::removeExtension(const QString &fileName) { QList params; params.append( new Parameter(fileName)); stubMethodEntered("removeExtension",params); } void MExtensionWatcherStub::notifyDataChanged(const QString &path) const { QList params; params.append( new Parameter(path)); stubMethodEntered("notifyDataChanged",params); } // 3. CREATE A STUB INSTANCE MExtensionWatcherStub gDefaultMExtensionWatcherStub; MExtensionWatcherStub* gMExtensionWatcherStub = &gDefaultMExtensionWatcherStub; // 4. CREATE A PROXY WHICH CALLS THE STUB MExtensionWatcher::MExtensionWatcher() { gMExtensionWatcherStub->MExtensionWatcherConstructor(); } MExtensionWatcher::~MExtensionWatcher() { gMExtensionWatcherStub->MExtensionWatcherDestructor(); } void MExtensionWatcher::addExtension(QSharedPointer extension) { gMExtensionWatcherStub->addExtension(extension); } void MExtensionWatcher::removeExtension(const QString &fileName) { gMExtensionWatcherStub->removeExtension(fileName); } void MExtensionWatcher::notifyDataChanged(const QString &path) const { gMExtensionWatcherStub->notifyDataChanged(path); } #endif