added a test that watches test/testfile which can be given the browser as bookmark file - it work's; refs https://dev.swisssign.com/projects/swissstick/ticket/980; refs #150
parent
5df301d37e
commit
09911ffa99
6 changed files with 91 additions and 3 deletions
@ -0,0 +1,16 @@ |
||||
/*! @file
|
||||
|
||||
@id $Id$ |
||||
*/ |
||||
// 1 2 3 4 5 6 7 8
|
||||
// 45678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
|
||||
#include <filewatch.hxx> |
||||
|
||||
#include <QtCore/QCoreApplication> |
||||
|
||||
int main(int argc, char** argv) { |
||||
QCoreApplication app(argc, argv); |
||||
TestFileWatch test("testfile"); |
||||
return app.exec(); |
||||
} |
@ -0,0 +1,24 @@ |
||||
/*! @file
|
||||
|
||||
@id $Id$ |
||||
*/ |
||||
// 1 2 3 4 5 6 7 8
|
||||
// 45678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
|
||||
#include <qbrowserlib/filestorage.hxx> |
||||
|
||||
#include<QtCore/QDebug> |
||||
|
||||
class TestFileWatch: public QObject { |
||||
Q_OBJECT; |
||||
public: |
||||
TestFileWatch(QString file): _storage(file) { |
||||
assert(connect(&_storage, SIGNAL(changed()), SLOT(changed()))); |
||||
} |
||||
private Q_SLOTS: |
||||
void changed() { |
||||
qDebug()<<"File has changed: "<<_storage.read().join("; "); |
||||
} |
||||
private: |
||||
FileStorage _storage; |
||||
}; |
@ -0,0 +1,30 @@ |
||||
## @id $Id$ |
||||
|
||||
## 1 2 3 4 5 6 7 8 |
||||
## 45678901234567890123456789012345678901234567890123456789012345678901234567890 |
||||
|
||||
# noinst_PROGRAMS = filewatch |
||||
|
||||
# filewatch_SOURCES = filewatch.cxx |
||||
# filewatch_CPPFLAGS = -I${top_srcdir}/src |
||||
# filewatch_LDFLAGS = -L${top_builddir}/src/qbrowserlib |
||||
# filewatch_LDADD = -lqbrowserlib |
||||
|
||||
QMAKE_TARGETS = filewatch |
||||
QMAKE_PROJECT = qmake.pro |
||||
QMAKE_MAKEFILE = makefile.qmake |
||||
TARGETS = ${QMAKE_TARGETS} |
||||
|
||||
all: ${TARGETS} |
||||
|
||||
${QMAKE_MAKEFILE}: ${QMAKE_PROJECT} ${ALL_SRC} |
||||
${QMAKE} -o $@ $< |
||||
|
||||
${QMAKE_TARGETS}: ${QMAKE_MAKEFILE} ${ALL_SRC} $(LANGS:%=@PACKAGENAME@_%.qm) |
||||
make -f ${QMAKE_MAKEFILE} |
||||
|
||||
CLEANFILES = ${TARGETS} ${TARGETS:%=%.exe} \ |
||||
*.o *.obj qrc_*.cpp ui_*.h moc_*.cpp \ |
||||
${QMAKE_TARGETS} .deps |
||||
MAINTAINERCLEANFILES = makefile.in ${QMAKE_MAKEFILE} |
||||
|
@ -0,0 +1,11 @@ |
||||
QMAKE_INCDIR += @top_srcdir@/src |
||||
QMAKE_LIBDIR += @top_builddir@/src/qbrowserlib |
||||
QMAKE_LIBDIR += @top_builddir@/src/qbrowserlib/release |
||||
QMAKE_LIBS += -lqbrowserlib |
||||
|
||||
HEADERS = @srcdir@/filewatch.hxx |
||||
|
||||
SOURCES = @srcdir@/filewatch.cxx |
||||
|
||||
TARGET = filewatch |
||||
|
Loading…
Reference in new issue