Use std[::tr1]::shared_ptr instead of local RefCntr by default
This commit is contained in:
@@ -364,7 +364,7 @@ using namespace Rcl;
|
||||
void AdvSearch::runSearch()
|
||||
{
|
||||
string stemLang = prefs.stemlang();
|
||||
RefCntr<SearchData> sdata(new SearchData(conjunctCMB->currentIndex() == 0 ?
|
||||
STD_SHARED_PTR<SearchData> sdata(new SearchData(conjunctCMB->currentIndex() == 0 ?
|
||||
SCLT_AND : SCLT_OR, stemLang));
|
||||
bool hasclause = false;
|
||||
|
||||
@@ -455,7 +455,7 @@ void AdvSearch::runSearch()
|
||||
|
||||
// Set up fields from existing search data, which must be compatible
|
||||
// with what we can do...
|
||||
void AdvSearch::fromSearch(RefCntr<SearchData> sdata)
|
||||
void AdvSearch::fromSearch(STD_SHARED_PTR<SearchData> sdata)
|
||||
{
|
||||
if (sdata->m_tp == SCLT_OR)
|
||||
conjunctCMB->setCurrentIndex(1);
|
||||
@@ -553,8 +553,8 @@ void AdvSearch::slotHistoryNext()
|
||||
{
|
||||
if (g_advshistory == 0)
|
||||
return;
|
||||
RefCntr<Rcl::SearchData> sd = g_advshistory->getnewer();
|
||||
if (sd.isNull())
|
||||
STD_SHARED_PTR<Rcl::SearchData> sd = g_advshistory->getnewer();
|
||||
if (!sd)
|
||||
return;
|
||||
fromSearch(sd);
|
||||
}
|
||||
@@ -563,8 +563,8 @@ void AdvSearch::slotHistoryPrev()
|
||||
{
|
||||
if (g_advshistory == 0)
|
||||
return;
|
||||
RefCntr<Rcl::SearchData> sd = g_advshistory->getolder();
|
||||
if (sd.isNull())
|
||||
STD_SHARED_PTR<Rcl::SearchData> sd = g_advshistory->getolder();
|
||||
if (!sd)
|
||||
return;
|
||||
fromSearch(sd);
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
#include "searchclause_w.h"
|
||||
#include "recoll.h"
|
||||
#include "refcntr.h"
|
||||
#include MEMORY_INCLUDE
|
||||
#include "searchdata.h"
|
||||
#include "advshist.h"
|
||||
|
||||
@@ -56,7 +56,7 @@ public slots:
|
||||
virtual void restrictFtCB_toggled(bool);
|
||||
virtual void restrictCtCB_toggled(bool);
|
||||
virtual void runSearch();
|
||||
virtual void fromSearch(RefCntr<Rcl::SearchData> sdata);
|
||||
virtual void fromSearch(STD_SHARED_PTR<Rcl::SearchData> sdata);
|
||||
virtual void browsePB_clicked();
|
||||
virtual void saveFileTypes();
|
||||
virtual void delClause();
|
||||
@@ -67,7 +67,7 @@ public slots:
|
||||
virtual void slotHistoryPrev();
|
||||
|
||||
signals:
|
||||
void startSearch(RefCntr<Rcl::SearchData>, bool);
|
||||
void startSearch(STD_SHARED_PTR<Rcl::SearchData>, bool);
|
||||
|
||||
private:
|
||||
virtual void init();
|
||||
|
||||
+10
-10
@@ -33,38 +33,38 @@ AdvSearchHist::AdvSearchHist()
|
||||
|
||||
AdvSearchHist::~AdvSearchHist()
|
||||
{
|
||||
for (vector<RefCntr<SearchData> >::iterator it = m_entries.begin();
|
||||
for (vector<STD_SHARED_PTR<SearchData> >::iterator it = m_entries.begin();
|
||||
it != m_entries.end(); it++) {
|
||||
it->release();
|
||||
it->reset();
|
||||
}
|
||||
}
|
||||
|
||||
RefCntr<Rcl::SearchData> AdvSearchHist::getnewest()
|
||||
STD_SHARED_PTR<Rcl::SearchData> AdvSearchHist::getnewest()
|
||||
{
|
||||
if (m_entries.empty())
|
||||
return RefCntr<Rcl::SearchData>();
|
||||
return STD_SHARED_PTR<Rcl::SearchData>();
|
||||
|
||||
return m_entries[0];
|
||||
}
|
||||
|
||||
RefCntr<Rcl::SearchData> AdvSearchHist::getolder()
|
||||
STD_SHARED_PTR<Rcl::SearchData> AdvSearchHist::getolder()
|
||||
{
|
||||
m_current++;
|
||||
if (m_current >= int(m_entries.size())) {
|
||||
m_current--;
|
||||
return RefCntr<Rcl::SearchData>();
|
||||
return STD_SHARED_PTR<Rcl::SearchData>();
|
||||
}
|
||||
return m_entries[m_current];
|
||||
}
|
||||
|
||||
RefCntr<Rcl::SearchData> AdvSearchHist::getnewer()
|
||||
STD_SHARED_PTR<Rcl::SearchData> AdvSearchHist::getnewer()
|
||||
{
|
||||
if (m_current == -1 || m_current == 0 || m_entries.empty())
|
||||
return RefCntr<Rcl::SearchData>();
|
||||
return STD_SHARED_PTR<Rcl::SearchData>();
|
||||
return m_entries[--m_current];
|
||||
}
|
||||
|
||||
bool AdvSearchHist::push(RefCntr<SearchData> sd)
|
||||
bool AdvSearchHist::push(STD_SHARED_PTR<SearchData> sd)
|
||||
{
|
||||
m_entries.insert(m_entries.begin(), sd);
|
||||
if (m_current != -1)
|
||||
@@ -83,7 +83,7 @@ bool AdvSearchHist::read()
|
||||
|
||||
for (list<string>::const_iterator it = lxml.begin(); it != lxml.end();
|
||||
it++) {
|
||||
RefCntr<SearchData> sd = xmlToSearchData(*it);
|
||||
STD_SHARED_PTR<SearchData> sd = xmlToSearchData(*it);
|
||||
if (sd)
|
||||
m_entries.push_back(sd);
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "recoll.h"
|
||||
#include "refcntr.h"
|
||||
#include MEMORY_INCLUDE
|
||||
#include "searchdata.h"
|
||||
|
||||
/** Advanced search history.
|
||||
@@ -43,14 +43,14 @@ public:
|
||||
~AdvSearchHist();
|
||||
|
||||
// Add entry
|
||||
bool push(RefCntr<Rcl::SearchData>);
|
||||
bool push(STD_SHARED_PTR<Rcl::SearchData>);
|
||||
|
||||
// Get latest. does not change state
|
||||
RefCntr<Rcl::SearchData> getnewest();
|
||||
STD_SHARED_PTR<Rcl::SearchData> getnewest();
|
||||
|
||||
// Cursor
|
||||
RefCntr<Rcl::SearchData> getolder();
|
||||
RefCntr<Rcl::SearchData> getnewer();
|
||||
STD_SHARED_PTR<Rcl::SearchData> getolder();
|
||||
STD_SHARED_PTR<Rcl::SearchData> getnewer();
|
||||
|
||||
void clear();
|
||||
|
||||
@@ -58,7 +58,7 @@ private:
|
||||
bool read();
|
||||
|
||||
int m_current;
|
||||
std::vector<RefCntr<Rcl::SearchData> > m_entries;
|
||||
std::vector<STD_SHARED_PTR<Rcl::SearchData> > m_entries;
|
||||
};
|
||||
|
||||
#endif // _ADVSHIST_H_INCLUDED_
|
||||
|
||||
@@ -36,6 +36,8 @@
|
||||
* destroyed and recreated as a copy if Cancel is pressed (you have to
|
||||
* delete/recreate the widgets in this case as the links are no longer valid).
|
||||
*/
|
||||
#include "autoconfig.h"
|
||||
|
||||
#include <string>
|
||||
#include <limits.h>
|
||||
|
||||
@@ -43,9 +45,7 @@
|
||||
#include <qstring.h>
|
||||
#include <qwidget.h>
|
||||
|
||||
#include "refcntr.h"
|
||||
|
||||
using std::string;
|
||||
#include MEMORY_INCLUDE
|
||||
|
||||
class QHBoxLayout;
|
||||
class QLineEdit;
|
||||
@@ -61,21 +61,21 @@ namespace confgui {
|
||||
class ConfLinkRep {
|
||||
public:
|
||||
virtual ~ConfLinkRep() {}
|
||||
virtual bool set(const string& val) = 0;
|
||||
virtual bool get(string& val) = 0;
|
||||
virtual bool set(const std::string& val) = 0;
|
||||
virtual bool get(std::string& val) = 0;
|
||||
};
|
||||
typedef RefCntr<ConfLinkRep> ConfLink;
|
||||
typedef STD_SHARED_PTR<ConfLinkRep> ConfLink;
|
||||
|
||||
// Useful to store/manage data which has no direct representation in
|
||||
// the config, ie list of subkey directories
|
||||
class ConfLinkNullRep : public ConfLinkRep {
|
||||
public:
|
||||
virtual ~ConfLinkNullRep() {}
|
||||
virtual bool set(const string&)
|
||||
virtual bool set(const std::string&)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
virtual bool get(string& val) {val = ""; return true;}
|
||||
virtual bool get(std::string& val) {val = ""; return true;}
|
||||
};
|
||||
|
||||
// A widget to let the user change one configuration
|
||||
|
||||
+2
-2
@@ -70,8 +70,8 @@ void forgetTempFile(string &fn)
|
||||
PTMutexLocker locker(thetempfileslock);
|
||||
for (vector<TempFile>::iterator it = o_tempfiles.begin();
|
||||
it != o_tempfiles.end(); it++) {
|
||||
if ((*it).isNotNull() && !fn.compare((*it)->filename())) {
|
||||
it->release();
|
||||
if ((*it) && !fn.compare((*it)->filename())) {
|
||||
it->reset();
|
||||
}
|
||||
}
|
||||
fn.erase();
|
||||
|
||||
@@ -1028,13 +1028,13 @@ bool Preview::loadDocInCurrentTab(const Rcl::Doc &idoc, int docnum)
|
||||
theconfig->setKeyDir(path_getfather(fn));
|
||||
if (fn.empty() || !idoc.ipath.empty()) {
|
||||
TempFile temp = lthr.imgtmp;
|
||||
if (temp.isNotNull()) {
|
||||
if (temp) {
|
||||
LOGDEB1(("Preview: load: got temp file from internfile\n"));
|
||||
} else if (!FileInterner::idocToFile(temp, string(),
|
||||
theconfig, idoc)) {
|
||||
temp.release(); // just in case.
|
||||
temp.reset(); // just in case.
|
||||
}
|
||||
if (temp.isNotNull()) {
|
||||
if (temp) {
|
||||
rememberTempFile(temp);
|
||||
fn = temp->filename();
|
||||
editor->m_tmpfilename = fn;
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
#ifndef _PREVIEW_W_H_INCLUDED_
|
||||
#define _PREVIEW_W_H_INCLUDED_
|
||||
#include "autoconfig.h"
|
||||
|
||||
// Always use a qtextbrowser for now, there is no compelling reason to
|
||||
// switch to webkit here
|
||||
@@ -25,6 +26,8 @@
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include MEMORY_INCLUDE
|
||||
|
||||
#include <QComboBox>
|
||||
#include <qvariant.h>
|
||||
#include <qwidget.h>
|
||||
@@ -39,7 +42,6 @@
|
||||
#include <qimage.h>
|
||||
|
||||
#include "rcldb.h"
|
||||
#include "refcntr.h"
|
||||
#include "plaintorich.h"
|
||||
#include "rclmain_w.h"
|
||||
|
||||
|
||||
@@ -231,7 +231,7 @@ void RclMain::previewPrevOrNextInTab(Preview * w, int sid, int docnum, bool nxt)
|
||||
docnum++;
|
||||
else
|
||||
docnum--;
|
||||
if (docnum < 0 || m_source.isNull() || docnum >= m_source->getResCnt()) {
|
||||
if (docnum < 0 || !m_source || docnum >= m_source->getResCnt()) {
|
||||
QApplication::beep();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ void RclMain::saveLastQuery()
|
||||
xml = sSearch->asXML();
|
||||
} else {
|
||||
if (g_advshistory) {
|
||||
RefCntr<Rcl::SearchData> sd;
|
||||
STD_SHARED_PTR<Rcl::SearchData> sd;
|
||||
sd = g_advshistory->getnewest();
|
||||
if (sd) {
|
||||
xml = sd->asXML();
|
||||
@@ -118,7 +118,7 @@ void RclMain::loadSavedQuery()
|
||||
}
|
||||
|
||||
// Try to parse as SearchData
|
||||
RefCntr<SearchData> sd = xmlToSearchData(xml);
|
||||
STD_SHARED_PTR<SearchData> sd = xmlToSearchData(xml);
|
||||
if (sd) {
|
||||
showAdvSearchDialog();
|
||||
asearchform->fromSearch(sd);
|
||||
|
||||
@@ -64,9 +64,9 @@ void RclMain::viewUrl()
|
||||
// StartNativeViewer needs a db source to call getEnclosing() on.
|
||||
Rcl::Query *query = new Rcl::Query(rcldb);
|
||||
DocSequenceDb *src =
|
||||
new DocSequenceDb(RefCntr<Rcl::Query>(query), "",
|
||||
RefCntr<Rcl::SearchData>(new Rcl::SearchData));
|
||||
m_source = RefCntr<DocSequence>(src);
|
||||
new DocSequenceDb(STD_SHARED_PTR<Rcl::Query>(query), "",
|
||||
STD_SHARED_PTR<Rcl::SearchData>(new Rcl::SearchData));
|
||||
m_source = STD_SHARED_PTR<DocSequence>(src);
|
||||
|
||||
|
||||
// Start a native viewer if the mimetype has one defined, else a
|
||||
@@ -269,7 +269,7 @@ void RclMain::startNativeViewer(Rcl::Doc doc, int pagenum, QString term)
|
||||
// We want the path for the parent document. For example to
|
||||
// open the chm file, not the internal page. Note that we just
|
||||
// override the other file name in this case.
|
||||
if (m_source.isNull() || !m_source->getEnclosing(doc, pdoc)) {
|
||||
if (!m_source || !m_source->getEnclosing(doc, pdoc)) {
|
||||
QMessageBox::warning(0, "Recoll",
|
||||
tr("Cannot find parent document"));
|
||||
return;
|
||||
@@ -330,7 +330,7 @@ void RclMain::startNativeViewer(Rcl::Doc doc, int pagenum, QString term)
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (!temp.isNull()) {
|
||||
if (temp) {
|
||||
rememberTempFile(temp);
|
||||
fn = temp->filename();
|
||||
url = string("file://") + fn;
|
||||
@@ -342,7 +342,7 @@ void RclMain::startNativeViewer(Rcl::Doc doc, int pagenum, QString term)
|
||||
if (pagenum == -1) {
|
||||
pagenum = 1;
|
||||
string lterm;
|
||||
if (m_source.isNotNull())
|
||||
if (m_source)
|
||||
pagenum = m_source->getFirstMatchPage(doc, lterm);
|
||||
if (pagenum == -1)
|
||||
pagenum = 1;
|
||||
|
||||
@@ -47,8 +47,8 @@ void RclMain::showAdvSearchDialog()
|
||||
this, SLOT (fileExit()));
|
||||
|
||||
connect(asearchform,
|
||||
SIGNAL(startSearch(RefCntr<Rcl::SearchData>, bool)),
|
||||
this, SLOT(startSearch(RefCntr<Rcl::SearchData>, bool)));
|
||||
SIGNAL(startSearch(STD_SHARED_PTR<Rcl::SearchData>, bool)),
|
||||
this, SLOT(startSearch(STD_SHARED_PTR<Rcl::SearchData>, bool)));
|
||||
asearchform->show();
|
||||
} else {
|
||||
// Close and reopen, in hope that makes us visible...
|
||||
|
||||
+25
-25
@@ -52,7 +52,7 @@
|
||||
#include "uiprefs_w.h"
|
||||
#include "guiutils.h"
|
||||
#include "reslist.h"
|
||||
#include "refcntr.h"
|
||||
#include MEMORY_INCLUDE
|
||||
#include "ssearch_w.h"
|
||||
#include "internfile.h"
|
||||
#include "docseqdb.h"
|
||||
@@ -285,8 +285,8 @@ void RclMain::init()
|
||||
|
||||
connect(&m_watcher, SIGNAL(fileChanged(QString)),
|
||||
this, SLOT(idxStatus()));
|
||||
connect(sSearch, SIGNAL(startSearch(RefCntr<Rcl::SearchData>, bool)),
|
||||
this, SLOT(startSearch(RefCntr<Rcl::SearchData>, bool)));
|
||||
connect(sSearch, SIGNAL(startSearch(STD_SHARED_PTR<Rcl::SearchData>, bool)),
|
||||
this, SLOT(startSearch(STD_SHARED_PTR<Rcl::SearchData>, bool)));
|
||||
connect(sSearch, SIGNAL(clearSearch()),
|
||||
this, SLOT(resetSearch()));
|
||||
|
||||
@@ -344,8 +344,8 @@ void RclMain::init()
|
||||
restable->setRclMain(this, true);
|
||||
connect(actionSaveResultsAsCSV, SIGNAL(triggered()),
|
||||
restable, SLOT(saveAsCSV()));
|
||||
connect(this, SIGNAL(docSourceChanged(RefCntr<DocSequence>)),
|
||||
restable, SLOT(setDocSource(RefCntr<DocSequence>)));
|
||||
connect(this, SIGNAL(docSourceChanged(STD_SHARED_PTR<DocSequence>)),
|
||||
restable, SLOT(setDocSource(STD_SHARED_PTR<DocSequence>)));
|
||||
connect(this, SIGNAL(searchReset()),
|
||||
restable, SLOT(resetSource()));
|
||||
connect(this, SIGNAL(resultsReady()),
|
||||
@@ -374,8 +374,8 @@ void RclMain::init()
|
||||
this, SLOT(showSnippets(Rcl::Doc)));
|
||||
|
||||
reslist->setRclMain(this, true);
|
||||
connect(this, SIGNAL(docSourceChanged(RefCntr<DocSequence>)),
|
||||
reslist, SLOT(setDocSource(RefCntr<DocSequence>)));
|
||||
connect(this, SIGNAL(docSourceChanged(STD_SHARED_PTR<DocSequence>)),
|
||||
reslist, SLOT(setDocSource(STD_SHARED_PTR<DocSequence>)));
|
||||
connect(firstPageAction, SIGNAL(triggered()),
|
||||
reslist, SLOT(resultPageFirst()));
|
||||
connect(prevPageAction, SIGNAL(triggered()),
|
||||
@@ -636,7 +636,7 @@ void RclMain::fileExit()
|
||||
}
|
||||
|
||||
// Start a db query and set the reslist docsource
|
||||
void RclMain::startSearch(RefCntr<Rcl::SearchData> sdata, bool issimple)
|
||||
void RclMain::startSearch(STD_SHARED_PTR<Rcl::SearchData> sdata, bool issimple)
|
||||
{
|
||||
LOGDEB(("RclMain::startSearch. Indexing %s Active %d\n",
|
||||
m_idxproc?"on":"off", m_queryActive));
|
||||
@@ -646,7 +646,7 @@ void RclMain::startSearch(RefCntr<Rcl::SearchData> sdata, bool issimple)
|
||||
}
|
||||
m_queryActive = true;
|
||||
restable->setEnabled(false);
|
||||
m_source = RefCntr<DocSequence>();
|
||||
m_source = STD_SHARED_PTR<DocSequence>();
|
||||
|
||||
m_searchIsSimple = issimple;
|
||||
|
||||
@@ -665,11 +665,11 @@ void RclMain::startSearch(RefCntr<Rcl::SearchData> sdata, bool issimple)
|
||||
|
||||
curPreview = 0;
|
||||
DocSequenceDb *src =
|
||||
new DocSequenceDb(RefCntr<Rcl::Query>(query),
|
||||
new DocSequenceDb(STD_SHARED_PTR<Rcl::Query>(query),
|
||||
string(tr("Query results").toUtf8()), sdata);
|
||||
src->setAbstractParams(prefs.queryBuildAbstract,
|
||||
prefs.queryReplaceAbstract);
|
||||
m_source = RefCntr<DocSequence>(src);
|
||||
m_source = STD_SHARED_PTR<DocSequence>(src);
|
||||
m_source->setSortSpec(m_sortspec);
|
||||
m_source->setFiltSpec(m_filtspec);
|
||||
|
||||
@@ -680,9 +680,9 @@ void RclMain::startSearch(RefCntr<Rcl::SearchData> sdata, bool issimple)
|
||||
|
||||
class QueryThread : public QThread {
|
||||
int loglevel;
|
||||
RefCntr<DocSequence> m_source;
|
||||
STD_SHARED_PTR<DocSequence> m_source;
|
||||
public:
|
||||
QueryThread(RefCntr<DocSequence> source)
|
||||
QueryThread(STD_SHARED_PTR<DocSequence> source)
|
||||
: m_source(source)
|
||||
{
|
||||
loglevel = DebugLog::getdbl()->getlevel();
|
||||
@@ -698,7 +698,7 @@ class QueryThread : public QThread {
|
||||
|
||||
void RclMain::initiateQuery()
|
||||
{
|
||||
if (m_source.isNull())
|
||||
if (!m_source)
|
||||
return;
|
||||
|
||||
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
|
||||
@@ -778,7 +778,7 @@ void RclMain::onSortCtlChanged()
|
||||
prefs.sortActive = prefs.sortDesc = false;
|
||||
prefs.sortField = "";
|
||||
}
|
||||
if (m_source.isNotNull())
|
||||
if (m_source)
|
||||
m_source->setSortSpec(m_sortspec);
|
||||
emit sortDataChanged(m_sortspec);
|
||||
initiateQuery();
|
||||
@@ -796,7 +796,7 @@ void RclMain::onSortDataChanged(DocSeqSortSpec spec)
|
||||
actionSortByDateAsc->setChecked(!spec.desc);
|
||||
}
|
||||
m_sortspecnochange = false;
|
||||
if (m_source.isNotNull())
|
||||
if (m_source)
|
||||
m_source->setSortSpec(spec);
|
||||
m_sortspec = spec;
|
||||
|
||||
@@ -896,8 +896,8 @@ void RclMain::showSubDocs(Rcl::Doc doc)
|
||||
new DocSequenceDocs(rcldb, docs,
|
||||
qs2utf8s(tr("Sub-documents and attachments")));
|
||||
src->setDescription(qs2utf8s(tr("Sub-documents and attachments")));
|
||||
RefCntr<DocSequence>
|
||||
source(new DocSource(theconfig, RefCntr<DocSequence>(src)));
|
||||
STD_SHARED_PTR<DocSequence>
|
||||
source(new DocSource(theconfig, STD_SHARED_PTR<DocSequence>(src)));
|
||||
|
||||
ResTable *res = new ResTable();
|
||||
res->setRclMain(this, false);
|
||||
@@ -938,7 +938,7 @@ void RclMain::showDocHistory()
|
||||
{
|
||||
LOGDEB(("RclMain::showDocHistory\n"));
|
||||
emit searchReset();
|
||||
m_source = RefCntr<DocSequence>();
|
||||
m_source = STD_SHARED_PTR<DocSequence>();
|
||||
curPreview = 0;
|
||||
|
||||
string reason;
|
||||
@@ -947,8 +947,8 @@ void RclMain::showDocHistory()
|
||||
return;
|
||||
}
|
||||
// Construct a bogus SearchData structure
|
||||
RefCntr<Rcl::SearchData>searchdata =
|
||||
RefCntr<Rcl::SearchData>(new Rcl::SearchData(Rcl::SCLT_AND, cstr_null));
|
||||
STD_SHARED_PTR<Rcl::SearchData>searchdata =
|
||||
STD_SHARED_PTR<Rcl::SearchData>(new Rcl::SearchData(Rcl::SCLT_AND, cstr_null));
|
||||
searchdata->setDescription((const char *)tr("History data").toUtf8());
|
||||
|
||||
|
||||
@@ -957,8 +957,8 @@ void RclMain::showDocHistory()
|
||||
new DocSequenceHistory(rcldb, g_dynconf,
|
||||
string(tr("Document history").toUtf8()));
|
||||
src->setDescription((const char *)tr("History data").toUtf8());
|
||||
DocSource *source = new DocSource(theconfig, RefCntr<DocSequence>(src));
|
||||
m_source = RefCntr<DocSequence>(source);
|
||||
DocSource *source = new DocSource(theconfig, STD_SHARED_PTR<DocSequence>(src));
|
||||
m_source = STD_SHARED_PTR<DocSequence>(source);
|
||||
m_source->setSortSpec(m_sortspec);
|
||||
m_source->setFiltSpec(m_filtspec);
|
||||
emit docSourceChanged(m_source);
|
||||
@@ -1013,7 +1013,7 @@ void RclMain::enablePrevPage(bool yesno)
|
||||
|
||||
QString RclMain::getQueryDescription()
|
||||
{
|
||||
if (m_source.isNull())
|
||||
if (!m_source)
|
||||
return "";
|
||||
return QString::fromUtf8(m_source->getDescription().c_str());
|
||||
}
|
||||
@@ -1073,7 +1073,7 @@ void RclMain::setFiltSpec()
|
||||
}
|
||||
}
|
||||
|
||||
if (m_source.isNotNull())
|
||||
if (m_source)
|
||||
m_source->setFiltSpec(m_filtspec);
|
||||
initiateQuery();
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include "rcldb.h"
|
||||
#include "searchdata.h"
|
||||
#include "spell_w.h"
|
||||
#include "refcntr.h"
|
||||
#include MEMORY_INCLUDE
|
||||
#include "pathut.h"
|
||||
#include "guiutils.h"
|
||||
|
||||
@@ -114,7 +114,7 @@ public slots:
|
||||
virtual void periodic100();
|
||||
virtual void toggleIndexing();
|
||||
virtual void rebuildIndex();
|
||||
virtual void startSearch(RefCntr<Rcl::SearchData> sdata, bool issimple);
|
||||
virtual void startSearch(STD_SHARED_PTR<Rcl::SearchData> sdata, bool issimple);
|
||||
virtual void previewClosed(Preview *w);
|
||||
virtual void showAdvSearchDialog();
|
||||
virtual void showSpellDialog();
|
||||
@@ -172,7 +172,7 @@ public slots:
|
||||
virtual void showTrayMessage(const QString& text);
|
||||
|
||||
signals:
|
||||
void docSourceChanged(RefCntr<DocSequence>);
|
||||
void docSourceChanged(STD_SHARED_PTR<DocSequence>);
|
||||
void stemLangChanged(const QString& lang);
|
||||
void sortDataChanged(DocSeqSortSpec);
|
||||
void resultsReady();
|
||||
@@ -212,7 +212,7 @@ private:
|
||||
DocSeqFiltSpec m_filtspec;
|
||||
bool m_sortspecnochange;
|
||||
DocSeqSortSpec m_sortspec;
|
||||
RefCntr<DocSequence> m_source;
|
||||
STD_SHARED_PTR<DocSequence> m_source;
|
||||
IndexerState m_indexerState;
|
||||
bool m_queryActive;
|
||||
bool m_firstIndexing;
|
||||
|
||||
+12
-12
@@ -47,7 +47,7 @@
|
||||
#include "pathut.h"
|
||||
#include "mimehandler.h"
|
||||
#include "plaintorich.h"
|
||||
#include "refcntr.h"
|
||||
#include MEMORY_INCLUDE
|
||||
#include "internfile.h"
|
||||
#include "indexer.h"
|
||||
#include "snippets_w.h"
|
||||
@@ -423,10 +423,10 @@ int ResList::newListId()
|
||||
|
||||
extern "C" int XFlush(void *);
|
||||
|
||||
void ResList::setDocSource(RefCntr<DocSequence> nsource)
|
||||
void ResList::setDocSource(STD_SHARED_PTR<DocSequence> nsource)
|
||||
{
|
||||
LOGDEB(("ResList::setDocSource()\n"));
|
||||
m_source = RefCntr<DocSequence>(new DocSource(theconfig, nsource));
|
||||
m_source = STD_SHARED_PTR<DocSequence>(new DocSource(theconfig, nsource));
|
||||
}
|
||||
|
||||
// A query was executed, or the filtering/sorting parameters changed,
|
||||
@@ -435,7 +435,7 @@ void ResList::readDocSource()
|
||||
{
|
||||
LOGDEB(("ResList::readDocSource()\n"));
|
||||
resetView();
|
||||
if (m_source.isNull())
|
||||
if (!m_source)
|
||||
return;
|
||||
m_listId = newListId();
|
||||
|
||||
@@ -449,7 +449,7 @@ void ResList::readDocSource()
|
||||
void ResList::resetList()
|
||||
{
|
||||
LOGDEB(("ResList::resetList()\n"));
|
||||
setDocSource(RefCntr<DocSequence>());
|
||||
setDocSource(STD_SHARED_PTR<DocSequence>());
|
||||
resetView();
|
||||
}
|
||||
|
||||
@@ -481,7 +481,7 @@ bool ResList::displayingHistory()
|
||||
// We want to reset the displayed history if it is currently
|
||||
// shown. Using the title value is an ugly hack
|
||||
string htstring = string((const char *)tr("Document history").toUtf8());
|
||||
if (m_source.isNull() || m_source->title().empty())
|
||||
if (!m_source || m_source->title().empty())
|
||||
return false;
|
||||
return m_source->title().find(htstring) == 0;
|
||||
}
|
||||
@@ -850,7 +850,7 @@ void ResList::mouseDoubleClickEvent(QMouseEvent *event)
|
||||
|
||||
void ResList::showQueryDetails()
|
||||
{
|
||||
if (m_source.isNull())
|
||||
if (!m_source)
|
||||
return;
|
||||
string oq = breakIntoLines(m_source->getDescription(), 100, 50);
|
||||
QString str;
|
||||
@@ -871,7 +871,7 @@ void ResList::linkWasClicked(const QUrl &url)
|
||||
// Open abstract/snippets window
|
||||
case 'A':
|
||||
{
|
||||
if (m_source.isNull())
|
||||
if (!m_source)
|
||||
return;
|
||||
int i = atoi(ascurl.c_str()+1) - 1;
|
||||
Rcl::Doc doc;
|
||||
@@ -886,7 +886,7 @@ void ResList::linkWasClicked(const QUrl &url)
|
||||
// Show duplicates
|
||||
case 'D':
|
||||
{
|
||||
if (m_source.isNull())
|
||||
if (!m_source)
|
||||
return;
|
||||
int i = atoi(ascurl.c_str()+1) - 1;
|
||||
Rcl::Doc doc;
|
||||
@@ -910,7 +910,7 @@ void ResList::linkWasClicked(const QUrl &url)
|
||||
LOGERR(("ResList::linkWasClicked: can't get doc for %d\n", i));
|
||||
return;
|
||||
}
|
||||
emit editRequested(ResultPopup::getParent(RefCntr<DocSequence>(),
|
||||
emit editRequested(ResultPopup::getParent(STD_SHARED_PTR<DocSequence>(),
|
||||
doc));
|
||||
}
|
||||
break;
|
||||
@@ -1050,7 +1050,7 @@ void ResList::menuSaveToFile()
|
||||
void ResList::menuPreviewParent()
|
||||
{
|
||||
Rcl::Doc doc;
|
||||
if (getDoc(m_popDoc, doc) && !m_source.isNull()) {
|
||||
if (getDoc(m_popDoc, doc) && m_source) {
|
||||
Rcl::Doc pdoc = ResultPopup::getParent(m_source, doc);
|
||||
if (pdoc.mimetype == "inode/directory") {
|
||||
emit editRequested(pdoc);
|
||||
@@ -1063,7 +1063,7 @@ void ResList::menuPreviewParent()
|
||||
void ResList::menuOpenParent()
|
||||
{
|
||||
Rcl::Doc doc;
|
||||
if (getDoc(m_popDoc, doc) && m_source.isNotNull())
|
||||
if (getDoc(m_popDoc, doc) && m_source)
|
||||
emit editRequested(ResultPopup::getParent(m_source, doc));
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -37,7 +37,7 @@ using std::pair;
|
||||
#include "docseq.h"
|
||||
#include "sortseq.h"
|
||||
#include "filtseq.h"
|
||||
#include "refcntr.h"
|
||||
#include MEMORY_INCLUDE
|
||||
#include "rcldoc.h"
|
||||
#include "reslistpager.h"
|
||||
|
||||
@@ -70,7 +70,7 @@ class ResList : public RESLIST_PARENTCLASS
|
||||
void setRclMain(RclMain *m, bool ismain);
|
||||
|
||||
public slots:
|
||||
virtual void setDocSource(RefCntr<DocSequence> nsource);
|
||||
virtual void setDocSource(STD_SHARED_PTR<DocSequence> nsource);
|
||||
virtual void resetList(); // Erase current list
|
||||
virtual void resPageUpOrBack(); // Page up pressed
|
||||
virtual void resPageDownOrNext(); // Page down pressed
|
||||
@@ -122,7 +122,7 @@ class ResList : public RESLIST_PARENTCLASS
|
||||
|
||||
private:
|
||||
QtGuiResListPager *m_pager;
|
||||
RefCntr<DocSequence> m_source;
|
||||
STD_SHARED_PTR<DocSequence> m_source;
|
||||
int m_popDoc; // Docnum for the popup menu.
|
||||
int m_curPvDoc;// Docnum for current preview
|
||||
int m_lstClckMod; // Last click modifier.
|
||||
|
||||
@@ -29,15 +29,14 @@
|
||||
|
||||
namespace ResultPopup {
|
||||
|
||||
QMenu *create(QWidget *me, int opts, RefCntr<DocSequence> source, Rcl::Doc& doc)
|
||||
QMenu *create(QWidget *me, int opts, STD_SHARED_PTR<DocSequence> source, Rcl::Doc& doc)
|
||||
{
|
||||
QMenu *popup = new QMenu(me);
|
||||
|
||||
LOGDEB(("ResultPopup::create: opts %x haspages %d %s %s\n", opts,
|
||||
doc.haspages, source.isNull() ?
|
||||
"Source is Null" : "Source not null",
|
||||
source.isNull() ? "" : source->snippetsCapable() ?
|
||||
"snippetsCapable" : "not snippetsCapable"));
|
||||
doc.haspages, source ? "Source not null" : "Source is Null",
|
||||
source ? (source->snippetsCapable() ?
|
||||
"snippetsCapable" : "not snippetsCapable") : ""));
|
||||
|
||||
string apptag;
|
||||
doc.getmeta(Rcl::Doc::keyapptg, &apptag);
|
||||
@@ -112,7 +111,7 @@ QMenu *create(QWidget *me, int opts, RefCntr<DocSequence> source, Rcl::Doc& doc)
|
||||
me, SLOT(menuSaveSelection()));
|
||||
|
||||
Rcl::Doc pdoc;
|
||||
if (source.isNotNull() && source->getEnclosing(doc, pdoc)) {
|
||||
if (source && source->getEnclosing(doc, pdoc)) {
|
||||
popup->addAction(QWidget::tr("Preview P&arent document/folder"),
|
||||
me, SLOT(menuPreviewParent()));
|
||||
}
|
||||
@@ -126,7 +125,7 @@ QMenu *create(QWidget *me, int opts, RefCntr<DocSequence> source, Rcl::Doc& doc)
|
||||
popup->addAction(QWidget::tr("Find &similar documents"),
|
||||
me, SLOT(menuExpand()));
|
||||
|
||||
if (doc.haspages && source.isNotNull() && source->snippetsCapable())
|
||||
if (doc.haspages && source && source->snippetsCapable())
|
||||
popup->addAction(QWidget::tr("Open &Snippets window"),
|
||||
me, SLOT(menuShowSnippets()));
|
||||
|
||||
@@ -137,10 +136,10 @@ QMenu *create(QWidget *me, int opts, RefCntr<DocSequence> source, Rcl::Doc& doc)
|
||||
return popup;
|
||||
}
|
||||
|
||||
Rcl::Doc getParent(RefCntr<DocSequence> source, Rcl::Doc& doc)
|
||||
Rcl::Doc getParent(STD_SHARED_PTR<DocSequence> source, Rcl::Doc& doc)
|
||||
{
|
||||
Rcl::Doc pdoc;
|
||||
if (source.isNull() || !source->getEnclosing(doc, pdoc)) {
|
||||
if (!source || !source->getEnclosing(doc, pdoc)) {
|
||||
// No parent doc: show enclosing folder with app configured for
|
||||
// directories
|
||||
pdoc.url = url_parentfolder(doc.url);
|
||||
|
||||
@@ -21,9 +21,9 @@ namespace ResultPopup {
|
||||
enum Options {showExpand = 0x1, showSubs = 0x2, isMain = 0x3,
|
||||
showSaveOne = 0x4, showSaveSel = 0x8};
|
||||
extern QMenu *create(QWidget *me, int opts,
|
||||
RefCntr<DocSequence> source,
|
||||
STD_SHARED_PTR<DocSequence> source,
|
||||
Rcl::Doc& doc);
|
||||
extern Rcl::Doc getParent(RefCntr<DocSequence> source,
|
||||
extern Rcl::Doc getParent(STD_SHARED_PTR<DocSequence> source,
|
||||
Rcl::Doc& doc);
|
||||
extern void copyFN(const Rcl::Doc &doc);
|
||||
extern void copyURL(const Rcl::Doc &doc);
|
||||
|
||||
+16
-16
@@ -35,7 +35,7 @@
|
||||
#include <QMessageBox>
|
||||
|
||||
#include "recoll.h"
|
||||
#include "refcntr.h"
|
||||
#include MEMORY_INCLUDE
|
||||
#include "docseq.h"
|
||||
#include "debuglog.h"
|
||||
#include "restable.h"
|
||||
@@ -272,7 +272,7 @@ RecollModel::RecollModel(const QStringList fields, QObject *parent)
|
||||
int RecollModel::rowCount(const QModelIndex&) const
|
||||
{
|
||||
LOGDEB2(("RecollModel::rowCount\n"));
|
||||
if (m_source.isNull())
|
||||
if (!m_source)
|
||||
return 0;
|
||||
return m_source->getResCnt();
|
||||
}
|
||||
@@ -290,13 +290,13 @@ void RecollModel::readDocSource()
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
void RecollModel::setDocSource(RefCntr<DocSequence> nsource)
|
||||
void RecollModel::setDocSource(STD_SHARED_PTR<DocSequence> nsource)
|
||||
{
|
||||
LOGDEB(("RecollModel::setDocSource\n"));
|
||||
if (nsource.isNull()) {
|
||||
m_source = RefCntr<DocSequence>();
|
||||
if (!nsource) {
|
||||
m_source = STD_SHARED_PTR<DocSequence>();
|
||||
} else {
|
||||
m_source = RefCntr<DocSequence>(new DocSource(theconfig, nsource));
|
||||
m_source = STD_SHARED_PTR<DocSequence>(new DocSource(theconfig, nsource));
|
||||
m_hdata.clear();
|
||||
m_source->getTerms(m_hdata);
|
||||
}
|
||||
@@ -356,7 +356,7 @@ QVariant RecollModel::data(const QModelIndex& index, int role) const
|
||||
{
|
||||
LOGDEB2(("RecollModel::data: row %d col %d role %d\n", index.row(),
|
||||
index.column(), role));
|
||||
if (m_source.isNull() || role != Qt::DisplayRole || !index.isValid() ||
|
||||
if (!m_source || role != Qt::DisplayRole || !index.isValid() ||
|
||||
index.column() >= int(m_fields.size())) {
|
||||
return QVariant();
|
||||
}
|
||||
@@ -375,7 +375,7 @@ QVariant RecollModel::data(const QModelIndex& index, int role) const
|
||||
|
||||
void RecollModel::saveAsCSV(FILE *fp)
|
||||
{
|
||||
if (m_source.isNull())
|
||||
if (!m_source)
|
||||
return;
|
||||
|
||||
int cols = columnCount();
|
||||
@@ -637,7 +637,7 @@ void ResTable::onTableView_currentChanged(const QModelIndex& index)
|
||||
LOGDEB2(("ResTable::onTableView_currentChanged(%d, %d)\n",
|
||||
index.row(), index.column()));
|
||||
|
||||
if (!m_model || m_model->getDocSource().isNull())
|
||||
if (!m_model || !m_model->getDocSource())
|
||||
return;
|
||||
Rcl::Doc doc;
|
||||
if (m_model->getDocSource()->getDoc(index.row(), doc)) {
|
||||
@@ -665,7 +665,7 @@ void ResTable::takeFocus()
|
||||
tableView->setFocus(Qt::ShortcutFocusReason);
|
||||
}
|
||||
|
||||
void ResTable::setDocSource(RefCntr<DocSequence> nsource)
|
||||
void ResTable::setDocSource(STD_SHARED_PTR<DocSequence> nsource)
|
||||
{
|
||||
LOGDEB(("ResTable::setDocSource\n"));
|
||||
if (m_model)
|
||||
@@ -680,7 +680,7 @@ void ResTable::setDocSource(RefCntr<DocSequence> nsource)
|
||||
void ResTable::resetSource()
|
||||
{
|
||||
LOGDEB(("ResTable::resetSource\n"));
|
||||
setDocSource(RefCntr<DocSequence>());
|
||||
setDocSource(STD_SHARED_PTR<DocSequence>());
|
||||
}
|
||||
|
||||
void ResTable::saveAsCSV()
|
||||
@@ -782,7 +782,7 @@ void ResTable::linkWasClicked(const QUrl &url)
|
||||
// Open parent folder
|
||||
case 'F':
|
||||
{
|
||||
emit editRequested(ResultPopup::getParent(RefCntr<DocSequence>(),
|
||||
emit editRequested(ResultPopup::getParent(STD_SHARED_PTR<DocSequence>(),
|
||||
m_detaildoc));
|
||||
}
|
||||
break;
|
||||
@@ -823,7 +823,7 @@ void ResTable::linkWasClicked(const QUrl &url)
|
||||
|
||||
void ResTable::onDoubleClick(const QModelIndex& index)
|
||||
{
|
||||
if (!m_model || m_model->getDocSource().isNull())
|
||||
if (!m_model || !m_model->getDocSource())
|
||||
return;
|
||||
Rcl::Doc doc;
|
||||
if (m_model->getDocSource()->getDoc(index.row(), doc)) {
|
||||
@@ -877,7 +877,7 @@ void ResTable::menuSaveToFile()
|
||||
|
||||
void ResTable::menuSaveSelection()
|
||||
{
|
||||
if (m_model == 0 || m_model->getDocSource().isNull())
|
||||
if (m_model == 0 || !m_model->getDocSource())
|
||||
return;
|
||||
|
||||
QModelIndexList indexl = tableView->selectionModel()->selectedRows();
|
||||
@@ -899,7 +899,7 @@ void ResTable::menuSaveSelection()
|
||||
void ResTable::menuPreviewParent()
|
||||
{
|
||||
if (m_detaildocnum >= 0 && m_model &&
|
||||
m_model->getDocSource().isNotNull()) {
|
||||
m_model->getDocSource()) {
|
||||
Rcl::Doc pdoc = ResultPopup::getParent(m_model->getDocSource(),
|
||||
m_detaildoc);
|
||||
if (pdoc.mimetype == "inode/directory") {
|
||||
@@ -912,7 +912,7 @@ void ResTable::menuPreviewParent()
|
||||
|
||||
void ResTable::menuOpenParent()
|
||||
{
|
||||
if (m_detaildocnum >= 0 && m_model && m_model->getDocSource().isNotNull())
|
||||
if (m_detaildocnum >= 0 && m_model && m_model->getDocSource())
|
||||
emit editRequested(
|
||||
ResultPopup::getParent(m_model->getDocSource(), m_detaildoc));
|
||||
}
|
||||
|
||||
@@ -16,15 +16,16 @@
|
||||
*/
|
||||
#ifndef _RESTABLE_H_INCLUDED_
|
||||
#define _RESTABLE_H_INCLUDED_
|
||||
#include "autoconfig.h"
|
||||
|
||||
#include <Qt>
|
||||
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include <vector>
|
||||
#include MEMORY_INCLUDE
|
||||
|
||||
#include "ui_restable.h"
|
||||
#include "refcntr.h"
|
||||
#include "docseq.h"
|
||||
#include "plaintorich.h"
|
||||
|
||||
@@ -50,8 +51,8 @@ public:
|
||||
virtual void sort(int column, Qt::SortOrder order = Qt::AscendingOrder);
|
||||
// Specific methods
|
||||
virtual void readDocSource();
|
||||
virtual void setDocSource(RefCntr<DocSequence> nsource);
|
||||
virtual RefCntr<DocSequence> getDocSource() {return m_source;}
|
||||
virtual void setDocSource(STD_SHARED_PTR<DocSequence> nsource);
|
||||
virtual STD_SHARED_PTR<DocSequence> getDocSource() {return m_source;}
|
||||
virtual void deleteColumn(int);
|
||||
virtual const std::vector<std::string>& getFields() {return m_fields;}
|
||||
virtual const std::map<std::string, QString>& getAllFields()
|
||||
@@ -72,7 +73,7 @@ signals:
|
||||
void sortDataChanged(DocSeqSortSpec);
|
||||
|
||||
private:
|
||||
mutable RefCntr<DocSequence> m_source;
|
||||
mutable STD_SHARED_PTR<DocSequence> m_source;
|
||||
std::vector<std::string> m_fields;
|
||||
std::vector<FieldGetter*> m_getters;
|
||||
static std::map<std::string, QString> o_displayableFields;
|
||||
@@ -126,7 +127,7 @@ public:
|
||||
public slots:
|
||||
virtual void onTableView_currentChanged(const QModelIndex&);
|
||||
virtual void on_tableView_entered(const QModelIndex& index);
|
||||
virtual void setDocSource(RefCntr<DocSequence> nsource);
|
||||
virtual void setDocSource(STD_SHARED_PTR<DocSequence> nsource);
|
||||
virtual void saveColState();
|
||||
virtual void resetSource();
|
||||
virtual void readDocSource(bool resetPos = true);
|
||||
|
||||
@@ -65,7 +65,7 @@ static PlainToRichQtSnippets g_hiliter;
|
||||
|
||||
void SnippetsW::init()
|
||||
{
|
||||
if (m_source.isNull())
|
||||
if (!m_source)
|
||||
return;
|
||||
|
||||
QPushButton *searchButton = new QPushButton(tr("Search"));
|
||||
|
||||
@@ -16,10 +16,14 @@
|
||||
*/
|
||||
#ifndef _SNIPPETS_W_H_INCLUDED_
|
||||
#define _SNIPPETS_W_H_INCLUDED_
|
||||
|
||||
#include "autoconfig.h"
|
||||
|
||||
#include MEMORY_INCLUDE
|
||||
|
||||
#include <QString>
|
||||
|
||||
#include "rcldoc.h"
|
||||
#include "refcntr.h"
|
||||
#include "docseq.h"
|
||||
#include "rclmain_w.h"
|
||||
|
||||
@@ -29,7 +33,7 @@ class SnippetsW : public QWidget, public Ui::Snippets
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
SnippetsW(Rcl::Doc doc, RefCntr<DocSequence> source, QWidget* parent = 0)
|
||||
SnippetsW(Rcl::Doc doc, STD_SHARED_PTR<DocSequence> source, QWidget* parent = 0)
|
||||
: QWidget(parent), m_doc(doc), m_source(source)
|
||||
{
|
||||
setupUi((QDialog*)this);
|
||||
@@ -48,7 +52,7 @@ signals:
|
||||
private:
|
||||
void init();
|
||||
Rcl::Doc m_doc;
|
||||
RefCntr<DocSequence> m_source;
|
||||
STD_SHARED_PTR<DocSequence> m_source;
|
||||
};
|
||||
|
||||
#endif /* _SNIPPETS_W_H_INCLUDED_ */
|
||||
|
||||
@@ -332,7 +332,7 @@ void SpellW::showStats()
|
||||
string reason;
|
||||
string q = string("mime:") + *it;
|
||||
Rcl::SearchData *sd = wasaStringToRcl(theconfig, "", q, reason);
|
||||
RefCntr<Rcl::SearchData> rq(sd);
|
||||
STD_SHARED_PTR<Rcl::SearchData> rq(sd);
|
||||
Rcl::Query query(rcldb);
|
||||
if (!query.setQuery(rq)) {
|
||||
LOGERR(("Query setup failed: %s",query.getReason().c_str()));
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#include "guiutils.h"
|
||||
#include "searchdata.h"
|
||||
#include "ssearch_w.h"
|
||||
#include "refcntr.h"
|
||||
#include MEMORY_INCLUDE
|
||||
#include "textsplit.h"
|
||||
#include "wasatorcl.h"
|
||||
#include "rclhelp.h"
|
||||
@@ -309,7 +309,7 @@ bool SSearch::startSimpleSearch(const string& u8, int maxexp)
|
||||
m_xml = xml.str();
|
||||
LOGDEB(("SSearch::startSimpleSearch:xml:[%s]\n", m_xml.c_str()));
|
||||
|
||||
RefCntr<Rcl::SearchData> rsdata(sdata);
|
||||
STD_SHARED_PTR<Rcl::SearchData> rsdata(sdata);
|
||||
emit startSearch(rsdata, true);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ class QTimer;
|
||||
|
||||
#include "recoll.h"
|
||||
#include "searchdata.h"
|
||||
#include "refcntr.h"
|
||||
#include MEMORY_INCLUDE
|
||||
|
||||
#include "ui_ssearchb.h"
|
||||
|
||||
@@ -72,7 +72,7 @@ public slots:
|
||||
virtual void takeFocus();
|
||||
|
||||
signals:
|
||||
void startSearch(RefCntr<Rcl::SearchData>, bool);
|
||||
void startSearch(STD_SHARED_PTR<Rcl::SearchData>, bool);
|
||||
void clearSearch();
|
||||
private:
|
||||
bool m_escape;
|
||||
|
||||
@@ -51,7 +51,7 @@ public:
|
||||
}
|
||||
|
||||
// The object we set up
|
||||
RefCntr<SearchData> sd;
|
||||
STD_SHARED_PTR<SearchData> sd;
|
||||
bool isvalid;
|
||||
|
||||
private:
|
||||
@@ -94,8 +94,8 @@ bool SDHXMLHandler::startElement(const QString & /* namespaceURI */,
|
||||
}
|
||||
resetTemps();
|
||||
// A new search descriptor. Allocate data structure
|
||||
sd = RefCntr<SearchData>(new SearchData);
|
||||
if (sd.isNull()) {
|
||||
sd = STD_SHARED_PTR<SearchData>(new SearchData);
|
||||
if (!sd) {
|
||||
LOGERR(("SDHXMLHandler::startElement: out of memory\n"));
|
||||
return false;
|
||||
}
|
||||
@@ -208,7 +208,7 @@ bool SDHXMLHandler::endElement(const QString & /* namespaceURI */,
|
||||
}
|
||||
|
||||
|
||||
RefCntr<Rcl::SearchData> xmlToSearchData(const string& xml)
|
||||
STD_SHARED_PTR<Rcl::SearchData> xmlToSearchData(const string& xml)
|
||||
{
|
||||
SDHXMLHandler handler;
|
||||
QXmlSimpleReader reader;
|
||||
@@ -221,7 +221,7 @@ RefCntr<Rcl::SearchData> xmlToSearchData(const string& xml)
|
||||
if (!reader.parse(xmlInputSource) || !handler.isvalid) {
|
||||
LOGERR(("xmlToSearchData: parse failed for [%s]\n",
|
||||
xml.c_str()));
|
||||
return RefCntr<SearchData>();
|
||||
return STD_SHARED_PTR<SearchData>();
|
||||
}
|
||||
return handler.sd;
|
||||
}
|
||||
|
||||
+2
-2
@@ -57,12 +57,12 @@
|
||||
* </SD>
|
||||
*/
|
||||
|
||||
#include "refcntr.h"
|
||||
#include MEMORY_INCLUDE
|
||||
#include "searchdata.h"
|
||||
|
||||
// Parsing XML from advanced search history or saved advanced search to to
|
||||
// SearchData structure:
|
||||
RefCntr<Rcl::SearchData> xmlToSearchData(const string& xml);
|
||||
STD_SHARED_PTR<Rcl::SearchData> xmlToSearchData(const string& xml);
|
||||
|
||||
// Parsing XML from saved simple search to ssearch parameters
|
||||
struct SSearchDef {
|
||||
|
||||
Reference in New Issue
Block a user