contrib/fbreader/fbreader-0.99.4.patch
Predrag Ivanović bbbb1ab10e fbreader: Unbreak menu display, force rebuild
Don't remove help and resources, menu display breaks without them.
Fold patches into one, reduce dependencies, Pkgfile cleanup
(thanks, @Romster).
2018-02-19 17:45:01 +01:00

62 lines
3.4 KiB
Diff

diff -Naur fbreader-0.99.4/fbreader/desktop/desktop fbreader-0.99.4-new/fbreader/desktop/desktop
--- fbreader-0.99.4/fbreader/desktop/desktop 2012-11-30 13:41:25.000000000 +0100
+++ fbreader-0.99.4-new/fbreader/desktop/desktop 2018-02-19 17:21:15.232343234 +0100
@@ -21,3 +21,4 @@
Type=Application
Icon=FBReader
Categories=Office;Viewer;Literature;
+MimeType=application/epub+zip;application/rtf;application/x-fictionbook+xml;application/x-zip-compressed-fb2;application/x-mobipocket-ebook;application/xhtml+xml;text/html;text/plain;
diff -Naur fbreader-0.99.4/fbreader/src/formats/doc/OleStorage.cpp fbreader-0.99.4-new/fbreader/src/formats/doc/OleStorage.cpp
--- fbreader-0.99.4/fbreader/src/formats/doc/OleStorage.cpp 2012-11-30 13:41:25.000000000 +0100
+++ fbreader-0.99.4-new/fbreader/src/formats/doc/OleStorage.cpp 2018-02-19 17:20:53.327387155 +0100
@@ -59,7 +59,7 @@
clear();
return false;
}
- static const char OLE_SIGN[] = {0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1, 0};
+ static const char OLE_SIGN[] = {(char)0xD0, (char)0xCF, (char)0x11, (char)0xE0, (char)0xA1, (char)0xB1, (char)0x1A, (char)0xE1, 0};
if (std::strncmp(oleBuf, OLE_SIGN, 8) != 0) {
clear();
return false;
diff -Naur fbreader-0.99.4/makefiles/config.mk fbreader-0.99.4-new/makefiles/config.mk
--- fbreader-0.99.4/makefiles/config.mk 2012-11-30 13:41:25.000000000 +0100
+++ fbreader-0.99.4-new/makefiles/config.mk 2018-02-19 17:19:25.261563732 +0100
@@ -21,6 +21,7 @@
ARCHIVER_LIBS ?= -lz -lbz2
CFLAGS += -DINSTALLDIR=\"$(INSTALLDIR_MACRO)\" -DBASEDIR=\"$(SHAREDIR_MACRO)\" -DLIBDIR=\"$(LIBDIR_MACRO)\" -DIMAGEDIR=\"$(IMAGEDIR_MACRO)\" -DAPPIMAGEDIR=\"$(APPIMAGEDIR_MACRO)\" -DVERSION=\"$(VERSION)\"
+CFLAGS += -Wno-narrowing
ifeq "$(ZLSHARED)" "yes"
CFLAGS += -fPIC -DZLSHARED
endif
diff -Naur fbreader-0.99.4/zlibrary/ui/src/qt4/filesystem/ZLQtFSManager.cpp fbreader-0.99.4-new/zlibrary/ui/src/qt4/filesystem/ZLQtFSManager.cpp
--- fbreader-0.99.4/zlibrary/ui/src/qt4/filesystem/ZLQtFSManager.cpp 2012-11-30 13:41:25.000000000 +0100
+++ fbreader-0.99.4-new/zlibrary/ui/src/qt4/filesystem/ZLQtFSManager.cpp 2018-02-19 17:19:43.699526763 +0100
@@ -48,4 +48,5 @@
static const std::string replacement = (const char*)QDir::homePath().toUtf8();
path = replacement + path.substr(1);
}
+ ZLUnixFSManager::normalizeRealPath(path);
}
diff -Naur fbreader-0.99.4/zlibrary/ui/src/qt4/tree/QtWaitingSpinner.cpp fbreader-0.99.4-new/zlibrary/ui/src/qt4/tree/QtWaitingSpinner.cpp
--- fbreader-0.99.4/zlibrary/ui/src/qt4/tree/QtWaitingSpinner.cpp 2012-11-30 13:41:25.000000000 +0100
+++ fbreader-0.99.4-new/zlibrary/ui/src/qt4/tree/QtWaitingSpinner.cpp 2018-02-19 17:21:23.657326342 +0100
@@ -86,7 +86,7 @@
}
void QtWaitingSpinner::setRoundness(qreal roundness) {
- myRoundness = std::max(0.0, std::min(100.0, roundness));
+ myRoundness = std::max(static_cast<qreal>(0.0), std::min(static_cast<qreal>(100.0), roundness));
}
void QtWaitingSpinner::setColor(QColor color) {
@@ -148,7 +148,7 @@
qreal alphaDiff = color.alphaF() - (qreal)minAlphaF;
qreal gradation = alphaDiff / (qreal)(distanceThreshold + 1);
qreal resultAlpha = color.alphaF() - gradation * distance;
- resultAlpha = std::min(1.0, std::max(0.0, resultAlpha)); //if alpha is out of bound, force it to bounds
+ resultAlpha = std::min(static_cast<qreal>(1.0), std::max(static_cast<qreal>(0.0), resultAlpha)); //if alpha is out of bound, force it to bounds
color.setAlphaF(resultAlpha);
return color;
}