diff --git a/src/VERSION b/src/VERSION index ba60039e..c7c3f333 100644 --- a/src/VERSION +++ b/src/VERSION @@ -1 +1 @@ -1.26.2pre1 +1.26.2 diff --git a/src/common/autoconfig-win.h b/src/common/autoconfig-win.h index f58ee4c3..37460946 100644 --- a/src/common/autoconfig-win.h +++ b/src/common/autoconfig-win.h @@ -119,10 +119,10 @@ overriden in the c++ code by ifdefs _WIN32 anyway */ #define PACKAGE_NAME "Recoll" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "Recoll 1.26.1" +#define PACKAGE_STRING "Recoll 1.26.2" /* Define to the version of this package. */ -#define PACKAGE_VERSION "1.26.1" +#define PACKAGE_VERSION "1.26.2" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "recoll" @@ -184,7 +184,7 @@ overriden in the c++ code by ifdefs _WIN32 anyway */ /* Define for large files, on AIX-style hosts. */ /* #undef _LARGE_FILES */ -#define DISABLE_WEB_INDEXER +// #define DISABLE_WEB_INDEXER #include "conf_post.h" #endif // already included diff --git a/src/common/rclconfig.cpp b/src/common/rclconfig.cpp index 53101e79..3612ddc0 100644 --- a/src/common/rclconfig.cpp +++ b/src/common/rclconfig.cpp @@ -1526,8 +1526,13 @@ bool RclConfig::sourceChanged() const string RclConfig::getWebQueueDir() const { string webqueuedir; - if (!getConfParam("webqueuedir", webqueuedir)) + if (!getConfParam("webqueuedir", webqueuedir)) { +#ifdef _WIN32 + webqueuedir = "~/AppData/Local/RecollWebQueue"; +#else webqueuedir = "~/.recollweb/ToIndex/"; +#endif + } webqueuedir = path_tildexpand(webqueuedir); return webqueuedir; } diff --git a/src/filters/recoll-we-move-files.py b/src/filters/recoll-we-move-files.py index d64e49a1..fb528c2d 100755 --- a/src/filters/recoll-we-move-files.py +++ b/src/filters/recoll-we-move-files.py @@ -42,6 +42,8 @@ try: except: import rclconfig +_mswindows = (sys.platform == "win32") + verbosity = 0 def logdeb(s): if verbosity >= 4: @@ -114,7 +116,10 @@ if not os.path.isdir(mydir): # Get target webqueue recoll directory from recoll configuration webqueuedir = config.getConfParam("webqueuedir") if not webqueuedir: - webqueuedir = "~/.recollweb/ToIndex" + if _mswindows: + webqueuedir = "~/AppData/Local/RecollWebQueue" + else: + webqueuedir = "~/.recollweb/ToIndex" webqueuedir = os.path.expanduser(webqueuedir) os.makedirs(webqueuedir, exist_ok = True) diff --git a/src/index/indexer.cpp b/src/index/indexer.cpp index 23b57929..4b335f2d 100644 --- a/src/index/indexer.cpp +++ b/src/index/indexer.cpp @@ -32,6 +32,7 @@ #include "mimehandler.h" #include "pathut.h" #include "idxstatus.h" +#include "execmd.h" #ifdef RCL_USE_ASPELL #include "rclaspell.h" @@ -56,6 +57,56 @@ void addIdxReason(string who, string reason) } } +#ifndef DISABLE_WEB_INDEXER +bool runWebFilesMoverScript(RclConfig *config) +{ + static string downloadsdir; + if (downloadsdir.empty()) { + if (!config->getConfParam("webdownloadsdir", downloadsdir)) { + downloadsdir = path_tildexpand("~/Downloads"); + } + } + static string cmdpath; + vector args; +#ifdef _WIN32 + const static string cmdnm{"python"}; + args.push_back(config->findFilter("recoll-we-move-files.py")); +#else + const static string cmdnm{"recoll-we-move-files.py"}: +#endif + if (cmdpath.empty()) { + cmdpath = config->findFilter(cmdnm); + if (cmdpath.empty()) { + LOGERR("runWFMoverScript: recoll-we-move-files.py not found\n"); + return false; + } + } + + /* Arrange to not actually run the script if the directory did not change */ + static time_t dirmtime; + time_t ndirmtime = 0; + struct stat st; + if (path_fileprops(downloadsdir.c_str(), &st) == 0) { + ndirmtime = st.st_mtime; + } + /* If stat fails, presumably Downloads does not exist or is not + accessible, dirmtime and mdirmtime stay at 0, and we never + execute the script, which is the right thing. */ + if (dirmtime != ndirmtime) { + /* The script is going to change the directory, so updating + dirmtime before it runs means that we are going to execute + it one time too many (it will run without doing anything), + but we can't set the mtime to after the run in case files + are created during the run. */ + dirmtime = ndirmtime; + ExecCmd cmd; + int status = cmd.doexec(cmdpath, args); + return status == 0; + } + return true; +} +#endif + ConfIndexer::ConfIndexer(RclConfig *cnf, DbIxStatusUpdater *updfunc) : m_config(cnf), m_db(cnf), m_fsindexer(0), m_doweb(false), m_webindexer(0), diff --git a/src/index/recollindex.cpp b/src/index/recollindex.cpp index c577594b..e25068a1 100644 --- a/src/index/recollindex.cpp +++ b/src/index/recollindex.cpp @@ -414,47 +414,6 @@ static bool checktopdirs(RclConfig *config, vector& nonexist) return true; } -bool runWebFilesMoverScript(RclConfig *config) -{ - static string downloadsdir; - if (downloadsdir.empty()) { - if (!config->getConfParam("webdownloadsdir", downloadsdir)) { - downloadsdir = path_tildexpand("~/Downloads"); - } - } - static string cmdpath; - if (cmdpath.empty()) { - cmdpath = config->findFilter("recoll-we-move-files.py"); - if (cmdpath.empty()) { - LOGERR("runWFMoverScript: recoll-we-move-files.py not found\n"); - return false; - } - } - - /* Arrange to not actually run the script if the directory did not change */ - static time_t dirmtime; - time_t ndirmtime = 0; - struct stat st; - if (::stat(downloadsdir.c_str(), &st) == 0) { - ndirmtime = st.st_mtime; - } - /* If stat fails, presumably Downloads does not exist or is not - accessible, dirmtime and mdirmtime stay at 0, and we never - execute the script, which is the right thing. */ - if (dirmtime != ndirmtime) { - /* The script is going to change the directory, so updating - dirmtime before it runs means that we are going to execute - it one time too many (it will run without doing anything), - but we can't set the mtime to after the run in case files - are created during the run. */ - dirmtime = ndirmtime; - ExecCmd cmd; - int status = cmd.doexec(cmdpath, {}); - return status == 0; - } - return true; -} - string thisprog; diff --git a/src/qtgui/confgui/confguiindex.cpp b/src/qtgui/confgui/confguiindex.cpp index 1ba8ef7e..2accf3fd 100644 --- a/src/qtgui/confgui/confguiindex.cpp +++ b/src/qtgui/confgui/confguiindex.cpp @@ -219,10 +219,8 @@ void ConfIndexW::initPanels() new ConfSubPanelW(m_w, &m_conf, m_rclconf), tr("Local parameters")); -#ifndef _WIN32 idx = m_w->addPanel("Web history"); setupWebHistoryPanel(idx); -#endif idx = m_w->addPanel(tr("Search parameters")); setupSearchPanel(idx); diff --git a/src/qtgui/rclmain_w.cpp b/src/qtgui/rclmain_w.cpp index be8f3559..4d2a8d37 100644 --- a/src/qtgui/rclmain_w.cpp +++ b/src/qtgui/rclmain_w.cpp @@ -335,12 +335,8 @@ void RclMain::init() this, SLOT(showAdvSearchDialog())); connect(toolsSpellAction, SIGNAL(triggered()), this, SLOT(showSpellDialog())); -#ifdef _WIN32 - actionWebcache_Editor->setEnabled(false); -#else connect(actionWebcache_Editor, SIGNAL(triggered()), this, SLOT(showWebcacheDialog())); -#endif connect(actionQuery_Fragments, SIGNAL(triggered()), this, SLOT(showFragButs())); connect(actionSpecial_Indexing, SIGNAL(triggered()), diff --git a/src/windows/mimeview b/src/windows/mimeview index b335054d..63159d40 100644 --- a/src/windows/mimeview +++ b/src/windows/mimeview @@ -25,7 +25,7 @@ xallexcepts = \ # Could not get the cmd-based ones to work (tried quoting "start %u" too) #application/x-all = c:/Windows/System32/cmd /c start %u #application/x-all = cmd /c start %u -application/x-all = rclstartw %f +application/x-all = rclstartw %u ####### Special ones # Open the parent epub document for epub parts instead of opening them as