Spring cleaning

This commit is contained in:
Anton Thomasson 2022-02-20 14:13:11 +01:00
parent 3be30e58e6
commit 71b2986a37
8 changed files with 9 additions and 29 deletions

View file

@ -4,7 +4,6 @@
#include "convertchecker.h" #include "convertchecker.h"
#include <QProcess> #include <QProcess>
#include <QtDebug> #include <QtDebug>
#include "mimer.h"
ConvertChecker::ConvertChecker() : poppler("libpoppler-glib.so.8") ConvertChecker::ConvertChecker() : poppler("libpoppler-glib.so.8")
{ {

View file

@ -4,7 +4,6 @@
#include <QUrl> #include <QUrl>
#include <QThread> #include <QThread>
#include <QSemaphore> #include <QSemaphore>
#include <QMetaMethod>
#include <QtConcurrent/QtConcurrent> #include <QtConcurrent/QtConcurrent>
#include <curl/curl.h> #include <curl/curl.h>
#include <bytestream.h> #include <bytestream.h>

View file

@ -1,5 +1,4 @@
#include "imageitem.h" #include "imageitem.h"
#include "svgprovider.h"
ImageItem::ImageItem() ImageItem::ImageItem()
{ {
@ -8,7 +7,6 @@ ImageItem::ImageItem()
void ImageItem::paint(QPainter *painter) void ImageItem::paint(QPainter *painter)
{ {
QImage scaled = _image.scaledToHeight(boundingRect().height(), Qt::SmoothTransformation); QImage scaled = _image.scaledToHeight(boundingRect().height(), Qt::SmoothTransformation);
painter->drawImage(QPoint {0, 0}, scaled); painter->drawImage(QPoint {0, 0}, scaled);
} }
@ -25,7 +23,6 @@ void ImageItem::setImage(const QImage &image)
update(); update();
} }
bool ImageItem::isValid() const bool ImageItem::isValid() const
{ {
return !_image.isNull(); return !_image.isNull();

View file

@ -4,11 +4,11 @@
#include "bytestream.h" #include "bytestream.h"
#include <QObject> #include <QObject>
#include <QJsonObject>
#include <QJsonArray>
#include <QDate>
#include <QTime>
#include <QDebug> #include <QDebug>
#include <QUrl>
#include <QtNetwork>
#include <QNetworkReply>
#include <QIODevice>
class IppMsg class IppMsg
{ {

View file

@ -329,16 +329,6 @@ void IppPrinter::getImageFinished(CURLcode res, Bytestream data)
} }
} }
void IppPrinter::ignoreSslErrors(QNetworkReply *reply, const QList<QSslError> &errors)
{
bool ignore = Settings::instance()->ignoreSslErrors();
qDebug() << reply->request().url() << "SSL handshake failed" << errors << ignore;
if(ignore)
{
reply->ignoreSslErrors(errors);
}
}
void IppPrinter::convertFailed(QString message) void IppPrinter::convertFailed(QString message)
{ {
_jobAttrs = QJsonObject(); _jobAttrs = QJsonObject();

View file

@ -1,11 +1,11 @@
#ifndef IPPPRINTER_H #ifndef IPPPRINTER_H
#define IPPPRINTER_H #define IPPPRINTER_H
#include <QImage>
#include "ippmsg.h" #include "ippmsg.h"
#include "printerworker.h" #include "printerworker.h"
#include "curlrequester.h" #include "curlrequester.h"
#include <mlite5/MGConfItem> #include <QImage>
class IppPrinter : public QObject class IppPrinter : public QObject
{ {
@ -101,8 +101,6 @@ public slots:
void getStringsFinished(CURLcode res, Bytestream data); void getStringsFinished(CURLcode res, Bytestream data);
void getImageFinished(CURLcode res, Bytestream data); void getImageFinished(CURLcode res, Bytestream data);
static void ignoreSslErrors(QNetworkReply *reply, const QList<QSslError> &errors);
void convertFailed(QString message); void convertFailed(QString message);
private: private:

View file

@ -1,5 +1,4 @@
#include "printerworker.h" #include "printerworker.h"
#include <sailfishapp.h>
#include "papersizes.h" #include "papersizes.h"
#include "convertchecker.h" #include "convertchecker.h"
#include "mimer.h" #include "mimer.h"

View file

@ -1,7 +1,6 @@
#ifndef PRINTERWORKER_H #ifndef PRINTERWORKER_H
#define PRINTERWORKER_H #define PRINTERWORKER_H
#include <QObject> #include <QObject>
#include <QtNetwork>
#include "curlrequester.h" #include "curlrequester.h"
class IppPrinter; class IppPrinter;
@ -9,14 +8,14 @@ class IppPrinter;
class ConvertFailedException: public std::exception class ConvertFailedException: public std::exception
{ {
private: private:
QString _msg; std::string _msg;
public: public:
ConvertFailedException(QString msg = "") : _msg(msg = msg) ConvertFailedException(QString msg = "") : _msg(msg.toStdString())
{ {
} }
virtual const char* what() const throw() virtual const char* what() const throw()
{ {
return _msg.toStdString().c_str(); return _msg.c_str();
} }
}; };
@ -58,7 +57,6 @@ public slots:
quint32 HwResX, quint32 HwResY, bool TwoSided, bool Tumble, bool BackHFlip, bool BackVFlip); quint32 HwResX, quint32 HwResY, bool TwoSided, bool Tumble, bool BackHFlip, bool BackVFlip);
signals: signals:
void done(QNetworkRequest request, QTemporaryFile* data);
void progress(qint64 done, qint64 pages); void progress(qint64 done, qint64 pages);
void busyMessage(QString msg); void busyMessage(QString msg);
void failed(QString message); void failed(QString message);