merged develop

This commit is contained in:
Luis Ángel San Martín 2016-06-16 19:23:36 +02:00
commit edbb642cee
8 changed files with 80 additions and 52 deletions

View File

@ -25,7 +25,7 @@ Display this text and exit.
.BR \-v, \-\- version .BR \-v, \-\- version
Display version information and exit. Display version information and exit.
.SH FEATURES .SH FEATURES
- rar, zip, cbr, cbz, tar, pdf, 7z and cb7 comics support with compatibility for jpeg, gif, png, tiff and bmp images. - rar, zip, cbr, cbz, tar and pdf comics support with compatibility for jpeg, gif, png, tiff, webp and bmp images.
.TP .TP
- Fast and easy to use. - Fast and easy to use.
.TP .TP

View File

@ -17,7 +17,10 @@ void ConsoleUILibraryCreator::createLibrary(const QString & name, const QString
QEventLoop eventLoop; QEventLoop eventLoop;
LibraryCreator * libraryCreator = new LibraryCreator(); LibraryCreator * libraryCreator = new LibraryCreator();
libraryCreator->createLibrary(QDir::cleanPath(path),QDir::cleanPath(path)+"/.yacreaderlibrary"); QDir pathDir(path);
QString cleanPath = QDir::cleanPath(pathDir.absolutePath());
libraryCreator->createLibrary(cleanPath,QDir::cleanPath(pathDir.absolutePath()+"/.yacreaderlibrary"));
connect(libraryCreator, &LibraryCreator::finished, this, &ConsoleUILibraryCreator::done); connect(libraryCreator, &LibraryCreator::finished, this, &ConsoleUILibraryCreator::done);
connect(libraryCreator, &LibraryCreator::comicAdded, this, &ConsoleUILibraryCreator::newComic); connect(libraryCreator, &LibraryCreator::comicAdded, this, &ConsoleUILibraryCreator::newComic);
@ -33,7 +36,7 @@ void ConsoleUILibraryCreator::createLibrary(const QString & name, const QString
//TODO, at some point some checking is needed for avoiding duplicated libraries //TODO, at some point some checking is needed for avoiding duplicated libraries
YACReaderLibraries yacreaderLibraries; YACReaderLibraries yacreaderLibraries;
yacreaderLibraries.load(); yacreaderLibraries.load();
yacreaderLibraries.addLibrary(name, path); yacreaderLibraries.addLibrary(name, cleanPath);
yacreaderLibraries.save(); yacreaderLibraries.save();
} }
@ -42,7 +45,10 @@ void ConsoleUILibraryCreator::updateLibrary(const QString & path)
QEventLoop eventLoop; QEventLoop eventLoop;
LibraryCreator * libraryCreator = new LibraryCreator(); LibraryCreator * libraryCreator = new LibraryCreator();
libraryCreator->updateLibrary(QDir::cleanPath(path),QDir::cleanPath(path)+"/.yacreaderlibrary"); QDir pathDir(path);
QString cleanPath = QDir::cleanPath(pathDir.absolutePath());
libraryCreator->updateLibrary(cleanPath,QDir::cleanPath(pathDir.absolutePath()+"/.yacreaderlibrary"));
connect(libraryCreator, &LibraryCreator::finished, this, &ConsoleUILibraryCreator::done); connect(libraryCreator, &LibraryCreator::finished, this, &ConsoleUILibraryCreator::done);
connect(libraryCreator, &LibraryCreator::comicAdded, this, &ConsoleUILibraryCreator::newComic); connect(libraryCreator, &LibraryCreator::comicAdded, this, &ConsoleUILibraryCreator::newComic);
@ -58,13 +64,16 @@ void ConsoleUILibraryCreator::updateLibrary(const QString & path)
void ConsoleUILibraryCreator::addExistingLibrary(const QString & name, const QString & path) void ConsoleUILibraryCreator::addExistingLibrary(const QString & name, const QString & path)
{ {
QDir pathDir(path);
QString cleanPath = QDir::cleanPath(pathDir.absolutePath());
//TODO add error handling //TODO add error handling
YACReaderLibraries yacreaderLibraries; YACReaderLibraries yacreaderLibraries;
yacreaderLibraries.load(); yacreaderLibraries.load();
yacreaderLibraries.addLibrary(name, path); yacreaderLibraries.addLibrary(name, cleanPath);
yacreaderLibraries.save(); yacreaderLibraries.save();
std::cout << "Library added : " << name.toUtf8().constData() << " at " << path.toUtf8().constData() << std::endl; std::cout << "Library added : " << name.toUtf8().constData() << " at " << cleanPath.toUtf8().constData() << std::endl;
} }
void ConsoleUILibraryCreator::removeLibrary(const QString & name) void ConsoleUILibraryCreator::removeLibrary(const QString & name)

View File

@ -141,7 +141,7 @@ int main( int argc, char ** argv )
QDir().mkpath(YACReader::getSettingsPath()); QDir().mkpath(YACReader::getSettingsPath());
Logger& logger = Logger::instance(); Logger& logger = Logger::instance();
logger.setLoggingLevel(QsLogging::TraceLevel); logger.setLoggingLevel(QsLogging::InfoLevel);
DestinationPtr fileDestination(DestinationFactory::MakeFileDestination( DestinationPtr fileDestination(DestinationFactory::MakeFileDestination(
destLog, EnableLogRotation, MaxSizeBytes(1048576), MaxOldLogCount(2))); destLog, EnableLogRotation, MaxSizeBytes(1048576), MaxOldLogCount(2)));

View File

@ -5,11 +5,11 @@
TEMPLATE = app TEMPLATE = app
TARGET = YACReaderLibraryServer TARGET = YACReaderLibraryServer
CONFIG += console CONFIG += console
DEPENDPATH += . DEPENDPATH += ../YACReaderLibrary
INCLUDEPATH += . INCLUDEPATH += ../YACReaderLibrary
INCLUDEPATH += ../common \ INCLUDEPATH += ../common \
./server \ ../YACReaderLibrary/server \
./db ../YACReaderLibrary/db
DEFINES += SERVER_RELEASE NOMINMAX YACREADER_LIBRARY QT_NO_DEBUG_OUTPUT DEFINES += SERVER_RELEASE NOMINMAX YACREADER_LIBRARY QT_NO_DEBUG_OUTPUT
QMAKE_MAC_SDK = macosx10.11 QMAKE_MAC_SDK = macosx10.11
@ -46,14 +46,14 @@ CONFIG += c++11
#CONFIG += release #CONFIG += release
CONFIG -= flat CONFIG -= flat
QT += core sql network script QT += core sql network
# Input # Input
HEADERS += library_creator.h \ HEADERS += ../YACReaderLibrary/library_creator.h \
package_manager.h \ ../YACReaderLibrary/package_manager.h \
bundle_creator.h \ ../YACReaderLibrary/bundle_creator.h \
db_helper.h \ ../YACReaderLibrary/db_helper.h \
./db/data_base_management.h \ ../YACReaderLibrary/db/data_base_management.h \
../common/comic_db.h \ ../common/comic_db.h \
../common/folder.h \ ../common/folder.h \
../common/library_item.h \ ../common/library_item.h \
@ -61,36 +61,36 @@ HEADERS += library_creator.h \
../common/bookmarks.h \ ../common/bookmarks.h \
../common/qnaturalsorting.h \ ../common/qnaturalsorting.h \
../common/yacreader_global.h \ ../common/yacreader_global.h \
yacreader_local_server.h \ ../YACReaderLibrary/yacreader_local_server.h \
comics_remover.h \ ../YACReaderLibrary/comics_remover.h \
../common/http_worker.h \ ../common/http_worker.h \
yacreader_libraries.h \ ../YACReaderLibrary/yacreader_libraries.h \
comic_files_manager.h \ ../YACReaderLibrary/comic_files_manager.h \
headless/console_ui_library_creator.h ../YACReaderLibrary/headless/console_ui_library_creator.h
SOURCES += library_creator.cpp \ SOURCES += ../YACReaderLibrary/library_creator.cpp \
.\headless\main.cpp \ ../YACReaderLibrary/headless\main.cpp \
package_manager.cpp \ ../YACReaderLibrary/package_manager.cpp \
bundle_creator.cpp \ ../YACReaderLibrary/bundle_creator.cpp \
db_helper.cpp \ ../YACReaderLibrary/db_helper.cpp \
./db/data_base_management.cpp \ ../YACReaderLibrary/db/data_base_management.cpp \
../common/comic_db.cpp \ ../common/comic_db.cpp \
../common/folder.cpp \ ../common/folder.cpp \
../common/library_item.cpp \ ../common/library_item.cpp \
../common/comic.cpp \ ../common/comic.cpp \
../common/bookmarks.cpp \ ../common/bookmarks.cpp \
../common/qnaturalsorting.cpp \ ../common/qnaturalsorting.cpp \
yacreader_local_server.cpp \ ../YACReaderLibrary/yacreader_local_server.cpp \
comics_remover.cpp \ ../YACReaderLibrary/comics_remover.cpp \
../common/http_worker.cpp \ ../common/http_worker.cpp \
../common/yacreader_global.cpp \ ../common/yacreader_global.cpp \
yacreader_libraries.cpp \ ../YACReaderLibrary/yacreader_libraries.cpp \
comic_files_manager.cpp \ ../YACReaderLibrary/comic_files_manager.cpp \
headless/console_ui_library_creator.cpp ../YACReaderLibrary/headless/console_ui_library_creator.cpp
include(./server/server.pri) include(../YACReaderLibrary/server/server.pri)
CONFIG(7zip){ CONFIG(7zip){
include(../compressed_archive/wrapper.pri) include(../compressed_archive/wrapper.pri)
} else:CONFIG(unarr) { } else:CONFIG(unarr) {
@ -111,7 +111,7 @@ TRANSLATIONS = yacreaderlibraryserver_es.ts \
yacreaderlibraryserver_source.ts yacreaderlibraryserver_source.ts
RESOURCES += headless/images.qrc RESOURCES += ../YACReaderLibrary/headless/images.qrc
Release:DESTDIR = ../release Release:DESTDIR = ../release
@ -131,7 +131,17 @@ DATADIR = $$PREFIX/share
DEFINES += "LIBDIR=\\\"$$LIBDIR\\\"" "DATADIR=\\\"$$DATADIR\\\"" "BINDIR=\\\"$$BINDIR\\\"" DEFINES += "LIBDIR=\\\"$$LIBDIR\\\"" "DATADIR=\\\"$$DATADIR\\\"" "BINDIR=\\\"$$BINDIR\\\""
#MAKE INSTALL #MAKE INSTALL
INSTALLS += bin server translation #manpage CONFIG(server_standalone) {
INSTALLS += bin server translation
}
else:CONFIG(server_bundled) {
INSTALLS += bin
}
else {
INSTALLS += bin server translation
message("No build type specified. Defaulting to standalone server build (CONFIG+=server_standalone).")
message("If you wish to run YACReaderLibraryServer on a system with an existing install of YACReaderLibrary, please specify CONFIG+=server_bundled as an option when running qmake.")
}
bin.path = $$BINDIR bin.path = $$BINDIR
isEmpty(DESTDIR) { isEmpty(DESTDIR) {

View File

@ -31,41 +31,41 @@ lessThan(QT_VER_MIN, 3){
unix { unix {
!macx { !macx {
packagesExist(QtCore) { packagesExist(Qt5Core) {
message("Found QtCore") message("Found Qt5Core")
} }
else: { else: {
error("Missing dependency: QtCore") message("Missing dependency: Qt5Core")
} }
packagesExist(QtGui) { packagesExist(Qt5Gui) {
message("Found QtGui") message("Found Qt5Gui")
} }
else: { else: {
error("Missing dependency: QtGui") message("Missing dependency: Qt5Gui")
} }
packagesExist(poppler-qt5) { packagesExist(poppler-qt5) {
message("Found poppler-qt5") message("Found poppler-qt5")
} }
else: { else: {
error("Missing dependency: poppler-qt5") message("Missing dependency: poppler-qt5")
} }
packagesExist(QtNetwork) { packagesExist(Qt5Network) {
message("Found QtNetwork") message("Found Qt5Network")
} }
else: { else: {
error("Missing dependency: QtNetwork") message("Missing dependency: Qt5Network")
} }
packagesExist(QtSql) { packagesExist(Qt5Sql) {
message("Found QtSql") message("Found Qt5Sql")
} }
else: { else: {
error("Missing dependency: QtSql") message("Missing dependency: Qt5Sql")
} }
packagesExist(sqlite3) { packagesExist(sqlite3) {
message("Found sqlite3") message("Found sqlite3")
} }
else: { else: {
error("Missing dependency: sqlite3") message("Missing dependency: sqlite3")
} }
} }
} }

View File

@ -97,6 +97,15 @@ QImage MacOSXPDFComic::getPage(const int pageNum)
lastPageData = (void *)dataRef; lastPageData = (void *)dataRef;
if(!lastPageData)
{
QLOG_ERROR() << "Unable to extract image from PDF file using CGPDFDocument";
CGImageRelease(image);
CGContextRelease(bitmapContext);
CGColorSpaceRelease(genericColorSpace);
return QImage();
}
const uchar *bytes = (const uchar *)CFDataGetBytePtr(dataRef); const uchar *bytes = (const uchar *)CFDataGetBytePtr(dataRef);
qtImage = QImage(bytes, pageRect.size.width, pageRect.size.height, QImage::Format_ARGB32); qtImage = QImage(bytes, pageRect.size.width, pageRect.size.height, QImage::Format_ARGB32);

View File

@ -7,7 +7,7 @@
#include <QDesktopServices> #include <QDesktopServices>
#endif #endif
#define VERSION "8.5.0" #define VERSION "8.6.0"
#define USE_BACKGROUND_IMAGE_IN_GRID_VIEW "USE_BACKGROUND_IMAGE_IN_GRID_VIEW" #define USE_BACKGROUND_IMAGE_IN_GRID_VIEW "USE_BACKGROUND_IMAGE_IN_GRID_VIEW"
#define OPACITY_BACKGROUND_IMAGE_IN_GRID_VIEW "OPACITY_BACKGROUND_IMAGE_IN_GRID_VIEW" #define OPACITY_BACKGROUND_IMAGE_IN_GRID_VIEW "OPACITY_BACKGROUND_IMAGE_IN_GRID_VIEW"

View File

@ -2,7 +2,7 @@
#Script to create a source tarball for YACReader distribution and packaging #Script to create a source tarball for YACReader distribution and packaging
#This should be run from YACReaders top source directory #This should be run from YACReaders top source directory
YACVERSION=8.0 YACVERSION=8.6
if [ -f Makefile ] if [ -f Makefile ]
then then
make distclean make distclean