diff --git a/src/internfile/mh_text.cpp b/src/internfile/mh_text.cpp index a80008f6..63a127e5 100644 --- a/src/internfile/mh_text.cpp +++ b/src/internfile/mh_text.cpp @@ -198,7 +198,7 @@ bool MimeHandlerText::readnext() return false; } } else { - m_text = m_alltext.substr(m_offs, m_pagesz); + m_text = m_alltext.substr((size_t)m_offs, m_pagesz); } if (m_text.length() == 0) { diff --git a/src/rcldb/xmacros.h b/src/rcldb/xmacros.h index 40e08bfb..fb7d8001 100644 --- a/src/rcldb/xmacros.h +++ b/src/rcldb/xmacros.h @@ -21,31 +21,33 @@ // Generic Xapian exception catching code. We do this quite often, // and I have no idea how to do this except for a macro #define XCATCHERROR(MSG) \ - catch (const Xapian::Error &e) { \ - MSG = e.get_msg(); \ - if (MSG.empty()) MSG = "Empty error message"; \ - } catch (const std::string &s) { \ - MSG = s; \ - if (MSG.empty()) MSG = "Empty error message"; \ - } catch (const char *s) { \ - MSG = s; \ - if (MSG.empty()) MSG = "Empty error message"; \ - } catch (...) { \ - MSG = "Caught unknown xapian exception"; \ - } + catch (const Xapian::Error &e) { \ + MSG = e.get_msg(); \ + if (MSG.empty()) MSG = "Empty error message"; \ + } catch (const std::string &s) { \ + MSG = s; \ + if (MSG.empty()) MSG = "Empty error message"; \ + } catch (const char *s) { \ + MSG = s; \ + if (MSG.empty()) MSG = "Empty error message"; \ + } catch (std::exception& ex) { \ + MSG = std::string("Caught std::exception: ") + ex.what(); \ + } catch (...) { \ + MSG = std::string("Caught unknown exception??"); \ + } -#define XAPTRY(STMTTOTRY, XAPDB, ERSTR) \ - for (int tries = 0; tries < 2; tries++) { \ - try { \ - STMTTOTRY; \ - ERSTR.erase(); \ - break; \ - } catch (const Xapian::DatabaseModifiedError &e) { \ - ERSTR = e.get_msg(); \ - XAPDB.reopen(); \ - continue; \ - } XCATCHERROR(ERSTR); \ - break; \ +#define XAPTRY(STMTTOTRY, XAPDB, ERSTR) \ + for (int tries = 0; tries < 2; tries++) { \ + try { \ + STMTTOTRY; \ + ERSTR.erase(); \ + break; \ + } catch (const Xapian::DatabaseModifiedError &e) { \ + ERSTR = e.get_msg(); \ + XAPDB.reopen(); \ + continue; \ + } XCATCHERROR(ERSTR); \ + break; \ } #endif diff --git a/src/utils/fstreewalk.cpp b/src/utils/fstreewalk.cpp index 3930ebc2..b9a4f1be 100644 --- a/src/utils/fstreewalk.cpp +++ b/src/utils/fstreewalk.cpp @@ -18,7 +18,13 @@ #include "autoconfig.h" #include + +#ifdef _MSC_VER +#include "msvc_dirent.h" +#else // !_MSC_VER #include +#endif // _MSC_VER + #include #include #include diff --git a/src/utils/rclutil.cpp b/src/utils/rclutil.cpp index 00d5b247..9ee1b3bd 100644 --- a/src/utils/rclutil.cpp +++ b/src/utils/rclutil.cpp @@ -22,7 +22,6 @@ #include #include "safefcntl.h" #include "safeunistd.h" -#include "dirent.h" #include "cstr.h" #ifdef _WIN32 #include "safewindows.h" diff --git a/src/utils/wipedir.cpp b/src/utils/wipedir.cpp index 611c3c0e..f0d09063 100644 --- a/src/utils/wipedir.cpp +++ b/src/utils/wipedir.cpp @@ -21,7 +21,6 @@ #include #include -#include #include #include @@ -29,6 +28,12 @@ #include "log.h" #include "pathut.h" +#ifdef _MSC_VER +#include "msvc_dirent.h" +#else // !_MSC_VER +#include +#endif // _MSC_VER + #ifdef _WIN32 #include "safefcntl.h" #include "safeunistd.h" diff --git a/src/windows/mimeconf b/src/windows/mimeconf index 49574b42..d43fe313 100644 --- a/src/windows/mimeconf +++ b/src/windows/mimeconf @@ -173,6 +173,7 @@ text/calendar = execm python rclics;mimetype=text/plain text/css = internal text/plain text/html = internal text/plain = internal +text/plain1 = internal #text/rtf = execm python rclrtf.py text/rtf = exec unrtf --nopict --html;mimetype=text/html text/x-c = internal diff --git a/src/windows/mkinstdir.sh b/src/windows/mkinstdir.sh index 30868339..67f8d07f 100644 --- a/src/windows/mkinstdir.sh +++ b/src/windows/mkinstdir.sh @@ -167,6 +167,7 @@ copyrecoll() chkcp $RCL/windows/mimeview $DESTDIR/Share/examples chkcp $RCL/sampleconf/recoll.conf $DESTDIR/Share/examples chkcp $RCL/sampleconf/recoll.qss $DESTDIR/Share/examples + chkcp $RCL/sampleconf/recoll-dark.qss $DESTDIR/Share/examples chkcp $RCL/python/recoll/recoll/rclconfig.py $FILTERS chkcp $RCL/python/recoll/recoll/conftree.py $FILTERS @@ -312,6 +313,7 @@ copypyrecoll() PYRCLWHEEL=${PYRECOLL}/dist/Recoll-${VERSION}-cp37-cp37m-win32.whl DEST=${DESTDIR}/Share/dist test -d $DEST || mkdir $DEST || fatal cant create $DEST + rm -f ${DEST}/* chkcp ${PYRCLWHEEL} $DEST fi }