mirror of
https://github.com/YACReader/yacreader
synced 2025-05-25 18:00:46 -04:00
Merged in selmf/yacreader/pdf_refactoring (pull request #46)
Compilation problem will be fixed once merged :( Pdf refactoring
This commit is contained in:
commit
b1b91d5013
@ -1,6 +0,0 @@
|
||||
<RCC>
|
||||
<qresource prefix="/">
|
||||
<file>../../images/f_overlayed.png</file>
|
||||
<file>../../images/f_overlayed_retina.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
@ -91,11 +91,10 @@ HEADERS += ../YACReaderLibrary/library_creator.h \
|
||||
../common/http_worker.h \
|
||||
../YACReaderLibrary/yacreader_libraries.h \
|
||||
../YACReaderLibrary/comic_files_manager.h \
|
||||
../YACReaderLibrary/headless/console_ui_library_creator.h
|
||||
console_ui_library_creator.h
|
||||
|
||||
|
||||
SOURCES += ../YACReaderLibrary/library_creator.cpp \
|
||||
../YACReaderLibrary/headless\main.cpp \
|
||||
../YACReaderLibrary/package_manager.cpp \
|
||||
../YACReaderLibrary/bundle_creator.cpp \
|
||||
../YACReaderLibrary/db_helper.cpp \
|
||||
@ -113,7 +112,9 @@ SOURCES += ../YACReaderLibrary/library_creator.cpp \
|
||||
../common/yacreader_global.cpp \
|
||||
../YACReaderLibrary/yacreader_libraries.cpp \
|
||||
../YACReaderLibrary/comic_files_manager.cpp \
|
||||
../YACReaderLibrary/headless/console_ui_library_creator.cpp
|
||||
console_ui_library_creator.cpp \
|
||||
main.cpp
|
||||
|
||||
|
||||
|
||||
include(../YACReaderLibrary/server/server.pri)
|
||||
@ -137,7 +138,7 @@ TRANSLATIONS = yacreaderlibraryserver_es.ts \
|
||||
yacreaderlibraryserver_source.ts
|
||||
|
||||
|
||||
RESOURCES += ../YACReaderLibrary/headless/images.qrc
|
||||
RESOURCES += images.qrc
|
||||
|
||||
|
||||
Release:DESTDIR = ../release
|
||||
|
@ -18,7 +18,21 @@ void ConsoleUILibraryCreator::createLibrary(const QString & name, const QString
|
||||
LibraryCreator * libraryCreator = new LibraryCreator();
|
||||
|
||||
QDir pathDir(path);
|
||||
if (!pathDir.exists())
|
||||
{
|
||||
std::cout << "Directory not found." << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
QString cleanPath = QDir::cleanPath(pathDir.absolutePath());
|
||||
|
||||
YACReaderLibraries yacreaderLibraries;
|
||||
yacreaderLibraries.load();
|
||||
if (yacreaderLibraries.contains(name))
|
||||
{
|
||||
std::cout << "A Library named \"" << name.toUtf8().constData() << "\" already exists in database." << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
libraryCreator->createLibrary(cleanPath,QDir::cleanPath(pathDir.absolutePath()+"/.yacreaderlibrary"));
|
||||
|
||||
@ -33,9 +47,6 @@ void ConsoleUILibraryCreator::createLibrary(const QString & name, const QString
|
||||
libraryCreator->start();
|
||||
eventLoop.exec();
|
||||
|
||||
//TODO, at some point some checking is needed for avoiding duplicated libraries
|
||||
YACReaderLibraries yacreaderLibraries;
|
||||
yacreaderLibraries.load();
|
||||
yacreaderLibraries.addLibrary(name, cleanPath);
|
||||
yacreaderLibraries.save();
|
||||
}
|
||||
@ -46,6 +57,11 @@ void ConsoleUILibraryCreator::updateLibrary(const QString & path)
|
||||
LibraryCreator * libraryCreator = new LibraryCreator();
|
||||
|
||||
QDir pathDir(path);
|
||||
if (!pathDir.exists())
|
||||
{
|
||||
std::cout << "Directory not found." << std::endl;
|
||||
return;
|
||||
}
|
||||
QString cleanPath = QDir::cleanPath(pathDir.absolutePath());
|
||||
|
||||
libraryCreator->updateLibrary(cleanPath,QDir::cleanPath(pathDir.absolutePath()+"/.yacreaderlibrary"));
|
||||
@ -65,11 +81,26 @@ void ConsoleUILibraryCreator::updateLibrary(const QString & path)
|
||||
void ConsoleUILibraryCreator::addExistingLibrary(const QString & name, const QString & path)
|
||||
{
|
||||
QDir pathDir(path);
|
||||
if (!pathDir.exists())
|
||||
{
|
||||
std::cout << "Directory not found." << std::endl;
|
||||
return;
|
||||
}
|
||||
QString cleanPath = QDir::cleanPath(pathDir.absolutePath());
|
||||
|
||||
if (!QDir(cleanPath + "/.yacreaderlibrary").exists())
|
||||
{
|
||||
std::cout << "No library database found in directory." << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
//TODO add error handling
|
||||
YACReaderLibraries yacreaderLibraries;
|
||||
yacreaderLibraries.load();
|
||||
if (yacreaderLibraries.contains(name))
|
||||
{
|
||||
std::cout << "A Library named \"" << name.toUtf8().constData() << "\" already exists in the database." << std::endl;
|
||||
return;
|
||||
}
|
||||
yacreaderLibraries.addLibrary(name, cleanPath);
|
||||
yacreaderLibraries.save();
|
||||
|
||||
@ -81,6 +112,11 @@ void ConsoleUILibraryCreator::removeLibrary(const QString & name)
|
||||
//TODO add error handling
|
||||
YACReaderLibraries yacreaderLibraries;
|
||||
yacreaderLibraries.load();
|
||||
if (!yacreaderLibraries.contains(name))
|
||||
{
|
||||
std::cout << "No Library named \"" << name.toUtf8().constData() << "\" in database." << std::endl;
|
||||
return;
|
||||
}
|
||||
yacreaderLibraries.remove(name);
|
||||
yacreaderLibraries.save();
|
||||
|
||||
@ -95,12 +131,12 @@ void ConsoleUILibraryCreator::newComic(const QString & /*relativeComicPath*/, co
|
||||
|
||||
void ConsoleUILibraryCreator::manageCreatingError(const QString & error)
|
||||
{
|
||||
std::cout << std::endl << "Error creating library! " << error.toUtf8().constData();
|
||||
std::cout << std::endl << "Error creating library! " << error.toUtf8().constData() << std::endl;
|
||||
}
|
||||
|
||||
void ConsoleUILibraryCreator::manageUpdatingError(const QString & error)
|
||||
{
|
||||
std::cout << std::endl << "Error updating library! " << error.toUtf8().constData();
|
||||
std::cout << std::endl << "Error updating library! " << error.toUtf8().constData() << std::endl;
|
||||
}
|
||||
|
||||
void ConsoleUILibraryCreator::done()
|
||||
@ -108,5 +144,5 @@ void ConsoleUILibraryCreator::done()
|
||||
std::cout << "Done!" << std::endl;
|
||||
|
||||
if(numComicsProcessed > 0)
|
||||
std::cout << "Number of comis processed = " << numComicsProcessed << std::endl;
|
||||
std::cout << "Number of comics processed = " << numComicsProcessed << std::endl;
|
||||
}
|
6
YACReaderLibraryServer/images.qrc
Normal file
6
YACReaderLibraryServer/images.qrc
Normal file
@ -0,0 +1,6 @@
|
||||
<RCC>
|
||||
<qresource prefix="/">
|
||||
<file>../images/f_overlayed.png</file>
|
||||
<file>../images/f_overlayed_retina.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
@ -1,26 +1,21 @@
|
||||
INCLUDEPATH += $$PWD/unarr-master/
|
||||
DEPENDPATH += $$PWD/unarr-master/
|
||||
|
||||
unix:QMAKE_CFLAGS_RELEASE -= "-O2"
|
||||
unix:QMAKE_CFLAGS_RELEASE += "-O3"
|
||||
unix:QMAKE_CFLAGS_RELEASE += "-DNDEBUG"
|
||||
unix:QMAKE_CFLAGS += "-D_FILE_OFFSET_BITS=64"
|
||||
|
||||
win32:QMAKE_CFLAGS_RELEASE += "/DNDEBUG"
|
||||
|
||||
HEADERS+=$$PWD/unarr-master/common/allocator.h\
|
||||
$$PWD/unarr-master/common/unarr-imp.h\
|
||||
$$PWD/unarr-master/lzmasdk/CpuArch.h\
|
||||
$$PWD/unarr-master/lzmasdk/Ppmd7.h\
|
||||
$$PWD/unarr-master/lzmasdk/Ppmd.h\
|
||||
$$PWD/unarr-master/lzmasdk/LzmaDec.h\
|
||||
$$PWD/unarr-master/lzmasdk/Ppmd8.h\
|
||||
$$PWD/unarr-master/lzmasdk/Types.h\
|
||||
$$PWD/unarr-master/lzmasdk/CpuArch.h\
|
||||
$$PWD/unarr-master/lzmasdk/Ppmd7.h\
|
||||
$$PWD/unarr-master/lzmasdk/Ppmd.h\
|
||||
$$PWD/unarr-master/lzmasdk/LzmaDec.h\
|
||||
$$PWD/unarr-master/lzmasdk/Ppmd8.h\
|
||||
$$PWD/unarr-master/lzmasdk/Types.h\
|
||||
$$PWD/unarr-master/lzmasdk/CpuArch.h\
|
||||
$$PWD/unarr-master/lzmasdk/Ppmd7.h\
|
||||
$$PWD/unarr-master/lzmasdk/Ppmd.h\
|
||||
$$PWD/unarr-master/lzmasdk/LzmaDec.h\
|
||||
$$PWD/unarr-master/lzmasdk/Ppmd8.h\
|
||||
$$PWD/unarr-master/lzmasdk/7zTypes.h\
|
||||
$$PWD/unarr-master/lzmasdk/CpuArch.h\
|
||||
$$PWD/unarr-master/lzmasdk/Ppmd7.h\
|
||||
$$PWD/unarr-master/lzmasdk/Ppmd.h\
|
||||
$$PWD/unarr-master/lzmasdk/LzmaDec.h\
|
||||
$$PWD/unarr-master/lzmasdk/Ppmd8.h\
|
||||
$$PWD/unarr-master/tar/tar.h\
|
||||
$$PWD/unarr-master/_7z/_7z.h\
|
||||
$$PWD/unarr-master/unarr.h
|
||||
|
Loading…
Reference in New Issue
Block a user