document already shown test was wrong, wouldnt show more docs from same file
This commit is contained in:
parent
9247d9f7d5
commit
698fade930
@ -214,7 +214,7 @@
|
|||||||
<function access="private" specifier="non virtual">init()</function>
|
<function access="private" specifier="non virtual">init()</function>
|
||||||
<function>closeEvent( QCloseEvent * e )</function>
|
<function>closeEvent( QCloseEvent * e )</function>
|
||||||
<function returnType="bool">eventFilter( QObject * target, QEvent * event )</function>
|
<function returnType="bool">eventFilter( QObject * target, QEvent * event )</function>
|
||||||
<function returnType="bool">makeFileCurrent( const string & fn )</function>
|
<function returnType="bool">makeDocCurrent( const string & fn, const Rcl::Doc & doc )</function>
|
||||||
<function returnType="QTextEdit *">getCurrentEditor()</function>
|
<function returnType="QTextEdit *">getCurrentEditor()</function>
|
||||||
<function returnType="QTextEdit *">addEditorTab()</function>
|
<function returnType="QTextEdit *">addEditorTab()</function>
|
||||||
<function access="private">destroy()</function>
|
<function access="private">destroy()</function>
|
||||||
|
|||||||
@ -25,12 +25,15 @@ using std::pair;
|
|||||||
#include "recoll.h"
|
#include "recoll.h"
|
||||||
#include "plaintorich.h"
|
#include "plaintorich.h"
|
||||||
|
|
||||||
|
extern int recollNeedsExit;
|
||||||
|
|
||||||
// We keep a list of data associated to each tab
|
// We keep a list of data associated to each tab
|
||||||
class TabData {
|
class TabData {
|
||||||
public:
|
public:
|
||||||
string fn; // filename for this tab
|
string fn; // filename for this tab
|
||||||
|
string ipath; // Internal doc path inside file
|
||||||
QWidget *w; // widget for setCurrent
|
QWidget *w; // widget for setCurrent
|
||||||
TabData(const string &str, QWidget *wi) : fn(str), w(wi) {}
|
TabData(QWidget *wi) : w(wi) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
#define TABDATA ((list<TabData> *)tabData)
|
#define TABDATA ((list<TabData> *)tabData)
|
||||||
@ -43,8 +46,9 @@ void Preview::init()
|
|||||||
dynSearchActive = false;
|
dynSearchActive = false;
|
||||||
canBeep = true;
|
canBeep = true;
|
||||||
tabData = new list<TabData>;
|
tabData = new list<TabData>;
|
||||||
TABDATA->push_back(TabData(string(""), pvTab->currentPage()));
|
TABDATA->push_back(TabData(pvTab->currentPage()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Preview::destroy()
|
void Preview::destroy()
|
||||||
{
|
{
|
||||||
delete TABDATA;
|
delete TABDATA;
|
||||||
@ -56,8 +60,6 @@ void Preview::closeEvent(QCloseEvent *e)
|
|||||||
QWidget::closeEvent(e);
|
QWidget::closeEvent(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
extern int recollNeedsExit;
|
|
||||||
|
|
||||||
bool Preview::eventFilter(QObject *target, QEvent *event)
|
bool Preview::eventFilter(QObject *target, QEvent *event)
|
||||||
{
|
{
|
||||||
if (event->type() != QEvent::KeyPress)
|
if (event->type() != QEvent::KeyPress)
|
||||||
@ -243,7 +245,7 @@ QTextEdit * Preview::addEditorTab()
|
|||||||
pvTab->addTab(anon, "Tab");
|
pvTab->addTab(anon, "Tab");
|
||||||
pvTab->showPage(anon);
|
pvTab->showPage(anon);
|
||||||
if (tabData)
|
if (tabData)
|
||||||
TABDATA->push_back(TabData(string(""), anon));
|
TABDATA->push_back(TabData(anon));
|
||||||
return editor;
|
return editor;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -275,19 +277,20 @@ void Preview::setCurTabProps(const string &fn, const Rcl::Doc &doc)
|
|||||||
it != TABDATA->end(); it++) {
|
it != TABDATA->end(); it++) {
|
||||||
if (it->w == w) {
|
if (it->w == w) {
|
||||||
it->fn = fn;
|
it->fn = fn;
|
||||||
|
it->ipath = doc.ipath;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Preview::makeFileCurrent(const string &fn)
|
bool Preview::makeDocCurrent(const string &fn, const Rcl::Doc &doc)
|
||||||
{
|
{
|
||||||
LOGDEB(("Preview::makeFileCurrent: %s\n", fn.c_str()));
|
LOGDEB(("Preview::makeFileCurrent: %s\n", fn.c_str()));
|
||||||
for (list<TabData>::iterator it = TABDATA->begin();
|
for (list<TabData>::iterator it = TABDATA->begin();
|
||||||
it != TABDATA->end(); it++) {
|
it != TABDATA->end(); it++) {
|
||||||
LOGDEB2(("Preview::makeFileCurrent: compare to w %p, file %s\n",
|
LOGDEB2(("Preview::makeFileCurrent: compare to w %p, file %s\n",
|
||||||
it->w, it->fn.c_str()));
|
it->w, it->fn.c_str()));
|
||||||
if (!it->fn.compare(fn)) {
|
if (!it->fn.compare(fn) && !it->ipath.compare(doc.ipath)) {
|
||||||
pvTab->showPage(it->w);
|
pvTab->showPage(it->w);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -33,7 +33,6 @@ using std::pair;
|
|||||||
#include "mimehandler.h"
|
#include "mimehandler.h"
|
||||||
#include "pathut.h"
|
#include "pathut.h"
|
||||||
#include "recoll.h"
|
#include "recoll.h"
|
||||||
#include "internfile.h"
|
|
||||||
#include "smallut.h"
|
#include "smallut.h"
|
||||||
#include "plaintorich.h"
|
#include "plaintorich.h"
|
||||||
#include "unacpp.h"
|
#include "unacpp.h"
|
||||||
@ -602,7 +601,7 @@ void RecollMain::startPreview(int docnum)
|
|||||||
this, SLOT(previewClosed(Preview *)));
|
this, SLOT(previewClosed(Preview *)));
|
||||||
curPreview->show();
|
curPreview->show();
|
||||||
} else {
|
} else {
|
||||||
if (curPreview->makeFileCurrent(fn)) {
|
if (curPreview->makeDocCurrent(fn, doc)) {
|
||||||
// Already there
|
// Already there
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user