Fix scope

GitKraken has some serious issues when resolving conflicts
This commit is contained in:
Luis Ángel San Martín 2019-09-24 09:17:39 +02:00
parent be547081f2
commit 7ed19ddd78

View File

@ -560,13 +560,14 @@ QList<QVector<quint32>> FileComic::getSections(int &sectionIndex)
} else { } else {
sections.append(section); sections.append(section);
} }
}
//out << "se han encontrado : " << sections.count() << " sectionIndex : " << sectionIndex << endl; //out << "se han encontrado : " << sections.count() << " sectionIndex : " << sectionIndex << endl;
return sections; return sections;
} }
void FileComic::process() void FileComic::process()
{ {
CompressedArchive archive(_path); CompressedArchive archive(_path);
if (!archive.toolsLoaded()) { if (!archive.toolsLoaded()) {
//moveToThread(QCoreApplication::instance()->thread()); //moveToThread(QCoreApplication::instance()->thread());
@ -646,29 +647,29 @@ QList<QVector<quint32>> FileComic::getSections(int &sectionIndex)
}*/ }*/
//moveToThread(QCoreApplication::instance()->thread()); //moveToThread(QCoreApplication::instance()->thread());
emit imagesLoaded(); emit imagesLoaded();
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
FolderComic::FolderComic() FolderComic::FolderComic()
: Comic() : Comic()
{ {
} }
FolderComic::FolderComic(const QString &path, int atPage) FolderComic::FolderComic(const QString &path, int atPage)
: Comic(path, atPage) : Comic(path, atPage)
{ {
load(path, atPage); load(path, atPage);
} }
FolderComic::~FolderComic() FolderComic::~FolderComic()
{ {
} }
bool FolderComic::load(const QString &path, int atPage) bool FolderComic::load(const QString &path, int atPage)
{ {
_path = path; _path = path;
if (atPage == -1) { if (atPage == -1) {
bm->newComic(_path); bm->newComic(_path);
@ -677,10 +678,10 @@ QList<QVector<quint32>> FileComic::getSections(int &sectionIndex)
_firstPage = atPage; _firstPage = atPage;
//emit bookmarksLoaded(*bm); //emit bookmarksLoaded(*bm);
return true; return true;
} }
void FolderComic::process() void FolderComic::process()
{ {
QDir d(_path); QDir d(_path);
d.setNameFilters(getSupportedImageFormats()); d.setNameFilters(getSupportedImageFormats());
@ -740,31 +741,31 @@ QList<QVector<quint32>> FileComic::getSections(int &sectionIndex)
} }
//moveToThread(QCoreApplication::instance()->thread()); //moveToThread(QCoreApplication::instance()->thread());
emit imagesLoaded(); emit imagesLoaded();
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
#ifndef NO_PDF #ifndef NO_PDF
PDFComic::PDFComic() PDFComic::PDFComic()
: Comic() : Comic()
{ {
} }
PDFComic::PDFComic(const QString &path, int atPage) PDFComic::PDFComic(const QString &path, int atPage)
: Comic(path, atPage) : Comic(path, atPage)
{ {
load(path, atPage); load(path, atPage);
} }
PDFComic::~PDFComic() PDFComic::~PDFComic()
{ {
} }
bool PDFComic::load(const QString &path, int atPage) bool PDFComic::load(const QString &path, int atPage)
{ {
QFileInfo fi(path); QFileInfo fi(path);
if (fi.exists()) { if (fi.exists()) {
@ -781,10 +782,10 @@ QList<QVector<quint32>> FileComic::getSections(int &sectionIndex)
emit errorOpening(); emit errorOpening();
return false; return false;
} }
} }
bool PDFComic::load(const QString &path, const ComicDB &comic) bool PDFComic::load(const QString &path, const ComicDB &comic)
{ {
QFileInfo fi(path); QFileInfo fi(path);
if (fi.exists()) { if (fi.exists()) {
@ -802,10 +803,10 @@ QList<QVector<quint32>> FileComic::getSections(int &sectionIndex)
emit errorOpening(); emit errorOpening();
return false; return false;
} }
} }
void PDFComic::process() void PDFComic::process()
{ {
#if defined Q_OS_MAC && defined USE_PDFKIT #if defined Q_OS_MAC && defined USE_PDFKIT
pdfComic = new MacOSXPDFComic(); pdfComic = new MacOSXPDFComic();
if (!pdfComic->openComic(_path)) { if (!pdfComic->openComic(_path)) {
@ -883,10 +884,10 @@ QList<QVector<quint32>> FileComic::getSections(int &sectionIndex)
delete pdfComic; delete pdfComic;
//moveToThread(QCoreApplication::instance()->thread()); //moveToThread(QCoreApplication::instance()->thread());
emit imagesLoaded(); emit imagesLoaded();
} }
void PDFComic::renderPage(int page) void PDFComic::renderPage(int page)
{ {
#if defined Q_OS_MAC && defined USE_PDFKIT #if defined Q_OS_MAC && defined USE_PDFKIT
QImage img = pdfComic->getPage(page); QImage img = pdfComic->getPage(page);
if (!img.isNull()) { if (!img.isNull()) {
@ -906,12 +907,12 @@ QList<QVector<quint32>> FileComic::getSections(int &sectionIndex)
emit imageLoaded(page); emit imageLoaded(page);
emit imageLoaded(page, _pages[page]); emit imageLoaded(page, _pages[page]);
} }
} }
#endif //NO_PDF #endif //NO_PDF
Comic *FactoryComic::newComic(const QString &path) Comic *FactoryComic::newComic(const QString &path)
{ {
QFileInfo fi(path); QFileInfo fi(path);
if (fi.exists()) { if (fi.exists()) {
@ -934,10 +935,10 @@ QList<QVector<quint32>> FileComic::getSections(int &sectionIndex)
} }
} else } else
return NULL; return NULL;
} }
bool is_double_page(const QString &pageName, const QString &commonPrefix, const int maxExpectedDoublePagesNumberLenght) bool is_double_page(const QString &pageName, const QString &commonPrefix, const int maxExpectedDoublePagesNumberLenght)
{ {
if (pageName.startsWith(commonPrefix)) { if (pageName.startsWith(commonPrefix)) {
QString substringContainingPageNumbers = pageName.mid(commonPrefix.length()); QString substringContainingPageNumbers = pageName.mid(commonPrefix.length());
QString pageNumbersSubString; QString pageNumbersSubString;
@ -959,10 +960,10 @@ QList<QVector<quint32>> FileComic::getSections(int &sectionIndex)
} }
} }
return false; return false;
} }
QString get_most_common_prefix(const QList<QString> &pageNames) QString get_most_common_prefix(const QList<QString> &pageNames)
{ {
if (pageNames.isEmpty()) { if (pageNames.isEmpty()) {
return ""; return "";
} }
@ -1023,10 +1024,10 @@ QList<QVector<quint32>> FileComic::getSections(int &sectionIndex)
} }
return common_prefix; return common_prefix;
} }
void get_double_pages(const QList<QString> &pageNames, QList<QString> &singlePageNames /*out*/, QList<QString> &doublePageNames /*out*/) void get_double_pages(const QList<QString> &pageNames, QList<QString> &singlePageNames /*out*/, QList<QString> &doublePageNames /*out*/)
{ {
uint maxExpectedDoublePagesNumberLenght = (int)(log10(pageNames.length()) + 1) * 2; uint maxExpectedDoublePagesNumberLenght = (int)(log10(pageNames.length()) + 1) * 2;
QString mostCommonPrefix = get_most_common_prefix(pageNames); QString mostCommonPrefix = get_most_common_prefix(pageNames);
@ -1038,10 +1039,10 @@ QList<QVector<quint32>> FileComic::getSections(int &sectionIndex)
singlePageNames.append(pageName); singlePageNames.append(pageName);
} }
} }
} }
QList<QString> merge_pages(QList<QString> & singlePageNames, QList<QString> & doublePageNames) QList<QString> merge_pages(QList<QString> &singlePageNames, QList<QString> &doublePageNames)
{ {
//NOTE: this implementation doesn't differ from std::merge using a custom comparator, but it can be easily tweaked if merging requeries an additional heuristic behaviour //NOTE: this implementation doesn't differ from std::merge using a custom comparator, but it can be easily tweaked if merging requeries an additional heuristic behaviour
QList<QString> pageNames; QList<QString> pageNames;
@ -1065,10 +1066,10 @@ QList<QVector<quint32>> FileComic::getSections(int &sectionIndex)
} }
return pageNames; return pageNames;
} }
void comic_pages_sort(QList<QString> & pageNames, YACReaderPageSortingMode sortingMode) void comic_pages_sort(QList<QString> &pageNames, YACReaderPageSortingMode sortingMode)
{ {
switch (sortingMode) { switch (sortingMode) {
case YACReaderNumericalSorting: case YACReaderNumericalSorting:
std::sort(pageNames.begin(), pageNames.end(), naturalSortLessThanCI); std::sort(pageNames.begin(), pageNames.end(), naturalSortLessThanCI);
@ -1091,4 +1092,4 @@ QList<QVector<quint32>> FileComic::getSections(int &sectionIndex)
std::sort(pageNames.begin(), pageNames.end()); std::sort(pageNames.begin(), pageNames.end());
break; break;
} }
} }