Plasma
filebrowserengine.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef FILEBROWSERENGINE_H
00021 #define FILEBROWSERENGINE_H
00022
00023 #include <Plasma/DataEngine>
00024 #include <QMap>
00025
00026 class KDirWatch;
00027
00031 class FileBrowserEngine : public Plasma::DataEngine
00032 {
00033 Q_OBJECT
00034
00035 public:
00036 FileBrowserEngine( QObject* parent, const QVariantList& args );
00037 ~FileBrowserEngine();
00038
00039 protected:
00040 bool sourceRequestEvent(const QString &path);
00041 void init();
00042
00043 protected slots:
00044 void dirDirty (const QString &path);
00045 void dirCreated(const QString &path);
00046 void dirDeleted(const QString &path);
00047
00048 private:
00049 enum EventType {INIT, DIRTY, CREATED, DELETED};
00050 enum ObjectType {NOTHING, FILE, DIRECTORY};
00051
00052 KDirWatch * m_dirWatch;
00053 void updateData(const QString &path, EventType event);
00054 void clearData(const QString &path);
00055
00056
00057 };
00058
00059 K_EXPORT_PLASMA_DATAENGINE(filebrowser, FileBrowserEngine)
00060
00061 #endif