diff --git a/src/qbrowserlib/filestorage.hxx b/src/qbrowserlib/filestorage.hxx index c7dde4c..13d33fe 100644 --- a/src/qbrowserlib/filestorage.hxx +++ b/src/qbrowserlib/filestorage.hxx @@ -60,7 +60,7 @@ class FileStorage: public Storage { Q_OBJECT; public: /*! @param file full path to storage file */ - FileStorage(QString file, int msec=1000): _file(file), _fileInfo(_file) { + FileStorage(QString file, int msec=1000): _file(file) { TRC; LOG<<"file: "< - #include +#endif #include #include @@ -82,15 +83,23 @@ namespace qbrowserlib { unsigned long _line; }; - class LogDialog: public QDialog, public Ui::LogDialog { + class LogDialog: +#ifdef QT_GUI_LIB + public QDialog, public Ui::LogDialog +#else + public QObject +#endif + { Q_OBJECT; public: - LogDialog(QWidget* p): QDialog(p) { +#ifdef QT_GUI_LIB + LogDialog(QWidget* p=0): QDialog(p) { setupUi(this); } +#endif template LogDialog& append(const Log& log, TYPE* arg) { std::ostringstream ss; @@ -99,6 +108,7 @@ namespace qbrowserlib { } template LogDialog& append(const Log& log, TYPE arg) { +#ifdef QT_GUI_LIB int pos(_logs->rowCount()); _logs->insertRow(pos); _logs->setItem @@ -116,11 +126,13 @@ namespace qbrowserlib { _logs->setItem (pos, MESSAGE, new QTableWidgetItem(QVariant(arg).toString())); +#endif return *this; } protected Q_SLOTS: +#ifdef QT_GUI_LIB void on__fileLine_toggled(bool checked) { if (checked) { _logs->showColumn(FILE); @@ -166,6 +178,7 @@ namespace qbrowserlib { if (!items.isEmpty()) _logs->scrollToItem(items[0]); unsetCursor(); } +#endif private: @@ -181,7 +194,7 @@ namespace qbrowserlib { init(ss); indent(ss)<<" → "<append(*this, arg); return *this; } diff --git a/test/filewatch.cxx b/test/filewatch.cxx index 3256f24..a9c220a 100644 --- a/test/filewatch.cxx +++ b/test/filewatch.cxx @@ -10,6 +10,7 @@ #include int main(int argc, char** argv) { + qbrowserlib::Log::DEBUG = true; QCoreApplication app(argc, argv); TestFileWatch test("testfile"); return app.exec(); diff --git a/test/qmake.pro.in b/test/qmake.pro.in index a035236..95411a4 100644 --- a/test/qmake.pro.in +++ b/test/qmake.pro.in @@ -3,6 +3,9 @@ QMAKE_LIBDIR += @top_builddir@/src/qbrowserlib QMAKE_LIBDIR += @top_builddir@/src/qbrowserlib/release QMAKE_LIBS += -lqbrowserlib +QT = core +CONFIG += debug + macx { CONFIG += x86 }