diff --git a/harbour-seaprint.pro b/harbour-seaprint.pro index edddf15..82bdc61 100644 --- a/harbour-seaprint.pro +++ b/harbour-seaprint.pro @@ -27,12 +27,10 @@ SOURCES += src/harbour-seaprint.cpp \ src/bytestream.cpp \ src/ippmsg.cpp \ src/ippprinter.cpp \ - src/mimer.cpp \ - src/ippraster.cpp + src/mimer.cpp DISTFILES += qml/harbour-seaprint.qml \ - ../harbour-splay/qml/pages/ChannelItem.qml \ qml/cover/CoverPage.qml \ qml/components/*.qml \ qml/pages/*.qml \ @@ -67,5 +65,4 @@ HEADERS += \ src/bytestream.h \ src/ippmsg.h \ src/ippprinter.h \ - src/mimer.h \ - src/ippraster.h + src/mimer.h diff --git a/src/ippprinter.cpp b/src/ippprinter.cpp index 922cdb9..375980b 100644 --- a/src/ippprinter.cpp +++ b/src/ippprinter.cpp @@ -1,5 +1,4 @@ #include "ippprinter.h" -#include "ippraster.h" #include IppPrinter::IppPrinter() diff --git a/src/ippraster.cpp b/src/ippraster.cpp deleted file mode 100644 index 03ba815..0000000 --- a/src/ippraster.cpp +++ /dev/null @@ -1,57 +0,0 @@ -#include "ippraster.h" - -IppRaster::IppRaster(QIODevice *underlyingDevice) - : underlyingDevice(underlyingDevice) -{ - connect(underlyingDevice, SIGNAL(readyRead()), this, SLOT(doDataAvail())); - connect(underlyingDevice, SIGNAL(readChannelFinished()), this, SLOT(doReadFinished())); -} - -bool IppRaster::open(QIODevice::OpenMode mode) -{ - qDebug() << "open"; - - bool underlyingOk; - if (underlyingDevice->isOpen()) - underlyingOk = (underlyingDevice->openMode() == mode); - else - underlyingOk = underlyingDevice->open(mode); - - if (underlyingOk) { - setOpenMode(mode); - qDebug() << "open true"; - emit readyRead(); - return true; - } - qDebug() << underlyingOk << underlyingDevice->openMode() << underlyingDevice->isOpen() << mode << "borked"; - return false; -} - -void IppRaster::close() -{ - qDebug() << "close"; - underlyingDevice->close(); -} - -bool IppRaster::seek(qint64 pos) -{ - qDebug() << "seek"; - - return false; -} - -bool IppRaster::atEnd() const -{ - qDebug() << "atend"; - return underlyingDevice->atEnd(); -} - -qint64 IppRaster::readData(char *data, qint64 maxlen) -{ - qDebug() << "read" << maxlen; - return underlyingDevice->read(data, maxlen); -} -qint64 IppRaster::writeData(const char *data, qint64 len) -{ - return underlyingDevice->write(data, len); -} diff --git a/src/ippraster.h b/src/ippraster.h deleted file mode 100644 index da228c9..0000000 --- a/src/ippraster.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef IPPRASTER_H -#define IPPRASTER_H - -#include -#include - - -class IppRaster : public QIODevice -{ - Q_OBJECT - -public: - IppRaster(QIODevice *underlyingDevice); - ~IppRaster() {qDebug() << "deleted";} - - bool open(QIODevice::OpenMode mode) override; - void close() override; - bool seek(qint64) override; - bool atEnd() const override; - - qint64 readData(char *data, qint64 maxlen) override; - qint64 writeData(const char *data, qint64 len) override; - - bool isSequential() const override {return false;} - qint64 bytesAvailable() const override {return underlyingDevice->bytesAvailable();} - qint64 size() const override {return underlyingDevice->size();} - - bool waitForReadyRead(int msecs) {return true;} - - public slots: - void doDataAvail() {emit readyRead();} - void doReadFinished() {emit readChannelFinished();} - - -private: - QIODevice* underlyingDevice; -}; - -#endif