Detect doc source snippets capability
This commit is contained in:
parent
4681ce672a
commit
91a2c5c338
3 changed files with 24 additions and 3 deletions
|
@ -893,8 +893,9 @@ void ResList::createPopupMenu(const QPoint& pos)
|
|||
this, SLOT(menuPreviewParent()));
|
||||
popup->addAction(tr("&Open Parent document/folder"),
|
||||
this, SLOT(menuOpenParent()));
|
||||
popup->addAction(tr("Open &Snippets window"),
|
||||
this, SLOT(menuOpenSnippets()));
|
||||
if (m_source->snippetsCapable())
|
||||
popup->addAction(tr("Open &Snippets window"),
|
||||
this, SLOT(menuOpenSnippets()));
|
||||
popup->popup(mapToGlobal(pos));
|
||||
}
|
||||
|
||||
|
|
|
@ -113,8 +113,16 @@ class DocSequence {
|
|||
virtual int getResCnt() = 0;
|
||||
|
||||
/** Get title for result list */
|
||||
virtual std::string title() {return m_title;}
|
||||
virtual std::string title()
|
||||
{
|
||||
return m_title;
|
||||
}
|
||||
|
||||
/** Can do snippets ? */
|
||||
virtual bool snippetsCapable()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
/** Get description for underlying query */
|
||||
virtual std::string getDescription() = 0;
|
||||
|
||||
|
@ -171,6 +179,13 @@ public:
|
|||
return false;
|
||||
return m_seq->getAbstract(doc, abs);
|
||||
}
|
||||
|
||||
virtual bool snippetsCapable()
|
||||
{
|
||||
if (m_seq.isNull())
|
||||
return false;
|
||||
return m_seq->snippetsCapable();
|
||||
}
|
||||
virtual std::string getDescription()
|
||||
{
|
||||
if (m_seq.isNull())
|
||||
|
|
|
@ -50,6 +50,11 @@ class DocSequenceDb : public DocSequence {
|
|||
m_queryBuildAbstract = qba;
|
||||
m_queryReplaceAbstract = qra;
|
||||
}
|
||||
|
||||
virtual bool snippetsCapable()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
virtual string title();
|
||||
|
||||
private:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue