revamped history feature to be udi-based while supporting old format
This commit is contained in:
@@ -184,8 +184,6 @@ void rwSettings(bool writing)
|
||||
// variable.
|
||||
// This are stored inside the dynamic configuration file (aka: history),
|
||||
// as they are likely to depend on RECOLL_CONFDIR.
|
||||
const string allEdbsSk = "allExtDbs";
|
||||
const string actEdbsSk = "actExtDbs";
|
||||
if (writing) {
|
||||
g_dynconf->eraseAll(allEdbsSk);
|
||||
for (list<string>::const_iterator it = prefs.allExtraDbs.begin();
|
||||
|
||||
+2
-2
@@ -83,7 +83,7 @@ RclConfig* RclConfig::getMainConfig()
|
||||
return rclconfig;
|
||||
}
|
||||
|
||||
RclHistory *g_dynconf;
|
||||
RclDynConf *g_dynconf;
|
||||
int recollNeedsExit;
|
||||
int startIndexingAfterConfig;
|
||||
RclMain *mainWindow;
|
||||
@@ -276,7 +276,7 @@ int main(int argc, char **argv)
|
||||
#endif
|
||||
|
||||
string historyfile = path_cat(rclconfig->getConfDir(), "history");
|
||||
g_dynconf = new RclHistory(historyfile);
|
||||
g_dynconf = new RclDynConf(historyfile);
|
||||
if (!g_dynconf || !g_dynconf->ok()) {
|
||||
QString msg = app.translate("Main", "Configuration problem (dynconf");
|
||||
QMessageBox::critical(0, "Recoll", msg);
|
||||
|
||||
@@ -75,6 +75,7 @@ using std::pair;
|
||||
#include "cancelcheck.h"
|
||||
#include "preview_w.h"
|
||||
#include "guiutils.h"
|
||||
#include "docseqhist.h"
|
||||
|
||||
#if (QT_VERSION < 0x030300)
|
||||
#define wasCanceled wasCancelled
|
||||
@@ -950,7 +951,9 @@ bool Preview::loadDocInCurrentTab(const Rcl::Doc &idoc, int docnum)
|
||||
}
|
||||
|
||||
// Enter document in document history
|
||||
g_dynconf->enterDoc(idoc.url, idoc.ipath);
|
||||
map<string,string>::const_iterator udit = idoc.meta.find(Rcl::Doc::keyudi);
|
||||
if (udit != idoc.meta.end())
|
||||
historyEnterDoc(g_dynconf, udit->second);
|
||||
|
||||
editor->setFocus();
|
||||
emit(previewExposed(this, m_searchId, docnum));
|
||||
|
||||
@@ -779,7 +779,6 @@ void RclMain::previewPrevOrNextInTab(Preview * w, int sid, int docnum, bool nxt)
|
||||
return;
|
||||
}
|
||||
|
||||
// Check that file exists in file system
|
||||
w->makeDocCurrent(doc, docnum, true);
|
||||
}
|
||||
|
||||
@@ -910,7 +909,7 @@ void RclMain::startNativeViewer(Rcl::Doc doc)
|
||||
return;
|
||||
}
|
||||
|
||||
// Extract possible attributes
|
||||
// Extract possible viewer attributes
|
||||
ConfSimple attrs;
|
||||
string cmd;
|
||||
rclconfig->valueSplitAttributes(cmdplusattr, cmd, attrs);
|
||||
@@ -1037,8 +1036,9 @@ void RclMain::startNativeViewer(Rcl::Doc doc)
|
||||
QString::fromUtf8(prcmd.c_str()) + "]";
|
||||
stb->message(msg, 5000);
|
||||
}
|
||||
|
||||
if (!istempfile)
|
||||
g_dynconf->enterDoc(fn, doc.ipath);
|
||||
historyEnterDoc(g_dynconf, doc.meta[Rcl::Doc::keyudi]);
|
||||
// We should actually monitor these processes so that we can
|
||||
// delete the temp files when they exit
|
||||
LOGDEB(("Executing: [%s]\n", ncmd.c_str()));
|
||||
@@ -1124,7 +1124,7 @@ void RclMain::eraseDocHistory()
|
||||
{
|
||||
// Clear file storage
|
||||
if (g_dynconf)
|
||||
g_dynconf->eraseAll(RclHistory::docSubkey);
|
||||
g_dynconf->eraseAll(docHistSubKey);
|
||||
// Clear possibly displayed history
|
||||
if (resList->displayingHistory()) {
|
||||
showDocHistory();
|
||||
|
||||
+2
-2
@@ -22,7 +22,7 @@
|
||||
#include "rclconfig.h"
|
||||
#include "rcldb.h"
|
||||
#include "idxthread.h"
|
||||
#include "history.h"
|
||||
#include "dynconf.h"
|
||||
|
||||
// Misc declarations in need of sharing between the UI files
|
||||
|
||||
@@ -33,7 +33,7 @@ extern RclConfig *rclconfig;
|
||||
extern Rcl::Db *rcldb;
|
||||
extern int recollNeedsExit;
|
||||
extern int startIndexingAfterConfig; // 1st startup
|
||||
extern RclHistory *g_dynconf;
|
||||
extern RclDynConf *g_dynconf;
|
||||
extern void startManual(const string& helpindex);
|
||||
|
||||
#ifdef RCL_USE_ASPELL
|
||||
|
||||
Reference in New Issue
Block a user