summaryrefslogtreecommitdiff
path: root/libopie2/opiecore
Side-by-side diff
Diffstat (limited to 'libopie2/opiecore') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/ofilenotify.cpp58
-rw-r--r--libopie2/opiecore/ofilenotify.h37
2 files changed, 94 insertions, 1 deletions
diff --git a/libopie2/opiecore/ofilenotify.cpp b/libopie2/opiecore/ofilenotify.cpp
index 4264327..36ec6bf 100644
--- a/libopie2/opiecore/ofilenotify.cpp
+++ b/libopie2/opiecore/ofilenotify.cpp
@@ -61,2 +61,58 @@ namespace Core {
//=================================================================================================
+// OFile
+//=================================================================================================
+
+OFile::OFile() : QObject( 0, 0 ), QFile()
+{
+ qDebug( "OFile()" );
+}
+
+OFile::OFile( const QString& name ) : QObject( 0, 0 ), QFile( name )
+{
+ qDebug( "OFile()" );
+}
+
+OFile::~OFile()
+{
+ qDebug( "~OFile()" );
+}
+
+void OFile::connectNotify( const char *signal )
+{
+ QString s = normalizeSignalSlot( signal+1 );
+ qDebug( "OFile::connectNotify() signal = '%s'", (const char*) s );
+
+ if ( s.startsWith( "accessed" ) )
+
+
+
+
+
+
+
+ QObject::connectNotify( signal );
+
+/*
+ void accessed( const QString& );
+ void modified( const QString& );
+ void attributed( const QString& );
+ void closed( const QString&, bool );
+ void opened( const QString& );
+ void deleted( const QString& );
+ void unmounted( const QString& );
+*/
+
+}
+
+void OFile::disconnectNotify( const char* signal )
+{
+ qDebug( "OFile::disconnectNotify() signal = '%s'", signal );
+ QObject::disconnectNotify( signal );
+}
+
+int OFile::startWatch( int mode )
+{
+}
+
+//=================================================================================================
// OFileNotificationEvent
@@ -221,3 +277,3 @@ void OFileNotification::inotifyEventHandler()
char buffer[16384];
- size_t buffer_i;
+ ssize_t buffer_i;
struct inotify_event *pevent, *event;
diff --git a/libopie2/opiecore/ofilenotify.h b/libopie2/opiecore/ofilenotify.h
index 5bbf421..05343b9 100644
--- a/libopie2/opiecore/ofilenotify.h
+++ b/libopie2/opiecore/ofilenotify.h
@@ -40,2 +40,4 @@ _;:,     .>    :=|. This program is free software; you can
#include <qstring.h>
+#include <qobject.h>
+#include <qfile.h>
@@ -44,2 +46,37 @@ namespace Core {
+class OFile : public QObject, public QFile
+{
+ Q_OBJECT
+
+ public:
+ OFile();
+ OFile( const QString & name );
+ virtual ~OFile();
+
+ protected:
+ virtual void connectNotify( const char* signal );
+ virtual void disconnectNotify( const char* signal );
+
+ private:
+ int startWatch( int mode );
+
+ signals:
+ void accessed( const QString& );
+ void modified( const QString& );
+ void attributed( const QString& );
+ void closed( const QString&, bool );
+ void opened( const QString& );
+ void deleted( const QString& );
+ void unmounted( const QString& );
+};
+
+/*
+ void movedTo( const QString&, const QString& );
+ void movedFrom( const QString&, const QString& );
+ void deletedSubdir( const QString&, const QString& );
+ void deletedFile( const QString&, const QString& );
+ void createdSubdir( const QString&, const QString& );
+ void createdFile( const QString&, const QString& );
+*/
+
class OFileNotificationEvent;