Madness ensues

This commit is contained in:
Anton Thomasson 2021-11-20 17:10:55 +01:00
parent 4336dd6d7b
commit 7e528ca2bd
3 changed files with 6 additions and 16 deletions

View file

@ -28,7 +28,8 @@ system(lrelease $$PWD/translations/*.ts)
CONFIG += sailfishapp
QT += svg
PKGCONFIG += mlite5 libcurl poppler glib-2.0 cairo
LIBS += -lcurl -lpoppler -lcairo -lglib-2.0 -lgobject-2.0 -lpoppler-glib
LIBS += -lcurl -lglib-2.0 -lgobject-2.0 -ldl
DEFINES += MADNESS=1
# Write version file
VERSION_H = \
@ -95,6 +96,7 @@ HEADERS += \
src/mimer.h \
ppm2pwg/ppm2pwg.h \
ppm2pwg/pdf2printable.h \
ppm2pwg/madness.h \
ppm2pwg/PwgPgHdr.h \
ppm2pwg/PwgPgHdr.codable \
ppm2pwg/UrfPgHdr.h \

@ -1 +1 @@
Subproject commit c76191ee841e995ce1dc31f101d100bce2e55192
Subproject commit 0252d23f96b6b6933680813f6a92ea752b555de7

View file

@ -1,8 +1,3 @@
#include <poppler/glib/poppler.h>
#include <poppler/glib/poppler-document.h>
#include <dlfcn.h>
#include "convertchecker.h"
#include <QProcess>
#include <QtDebug>
@ -49,14 +44,7 @@ ConvertChecker* ConvertChecker::instance()
return m_Instance;
}
quint32 ConvertChecker::pdfPages(QString filename)
quint32 ConvertChecker::pdfPages(QString /*filename*/)
{
std::string url("file://");
url.append(filename.toStdString());
GError* error = nullptr;
PopplerDocument* doc = poppler_document_new_from_file(url.c_str(), nullptr, &error);
quint32 pages = poppler_document_get_n_pages(doc);
g_object_unref(doc);
return pages;
return 0;
}