autosuffs featurelet

This commit is contained in:
Jean-Francois Dockes
2010-09-10 09:50:11 +02:00
parent f3b0b49c77
commit 176b9b19b6
10 changed files with 201 additions and 49 deletions
+3 -1
View File
@@ -144,6 +144,9 @@ void rwSettings(bool writing)
Num, 250);
SETTING_RW(prefs.syntAbsCtx, "/Recoll/prefs/query/syntAbsCtx",
Num, 4);
SETTING_RW(prefs.autoSuffs, "/Recoll/prefs/query/autoSuffs", , "");
SETTING_RW(prefs.autoSuffsEnable,
"/Recoll/prefs/query/autoSuffsEnable", Bool, false);
SETTING_RW(prefs.sortDepth, "/Recoll/prefs/query/sortDepth",
Num, 100);
@@ -255,5 +258,4 @@ void rwSettings(bool writing)
for (list<string>::iterator it = tl.begin(); it != tl.end(); it++)
prefs.asearchSubdirHist.push_front(QString::fromUtf8(it->c_str()));
}
}
+5 -2
View File
@@ -86,8 +86,7 @@ class PrefsPack {
bool startWithSortToolOpen;
bool previewHtml;
bool collapseDuplicates;
// Extra query indexes. This are encoded to base64 before storing
// to the qt settings file to avoid any bin string/ charset conv issues
// Extra query indexes. This are stored in the history file, not qt prefs
list<string> allExtraDbs;
list<string> activeExtraDbs;
// Advanced search subdir restriction: we don't activate the last value
@@ -100,6 +99,10 @@ class PrefsPack {
// Ignored file types in adv search (startup default)
QStringList asearchIgnFilTyps;
bool fileTypesByCats;
// Words that are automatically turned to ext:xx specs in the query
// language entry.
QString autoSuffs;
bool autoSuffsEnable;
// Synthetized abstract length and word context size
int syntAbsLen;
+4 -1
View File
@@ -129,7 +129,10 @@ void SSearch::startSimpleSearch()
if (tp == SST_LANG) {
string reason;
sdata = wasaStringToRcl(u8, reason);
if (prefs.autoSuffsEnable)
sdata = wasaStringToRcl(u8, reason, (const char *)prefs.autoSuffs.utf8());
else
sdata = wasaStringToRcl(u8, reason);
if (sdata == 0) {
QMessageBox::warning(0, "Recoll", tr("Bad query string") +
QString::fromAscii(reason.c_str()));
+50
View File
@@ -561,6 +561,56 @@ May be slow for big documents.</string>
<enum>Horizontal</enum>
</property>
</widget>
<widget class="QLayoutWidget">
<property name="name">
<cstring>layoutautosuffs</cstring>
</property>
<hbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLabel">
<property name="name">
<cstring>textLabel14</cstring>
</property>
<property name="toolTip" stdset="0">
<string>The words in the list will be automatically turned to ext:xxx clauses in the query language entry.</string>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>5</hsizetype>
<vsizetype>5</vsizetype>
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Query language magic file name suffixes.</string>
</property>
</widget>
<widget class="QCheckBox">
<property name="name">
<cstring>autoSuffsCB</cstring>
</property>
<property name="text">
<string>Enable</string>
</property>
</widget>
<widget class="QLineEdit">
<property name="name">
<cstring>autoSuffsLE</cstring>
</property>
<property name="minimumSize">
<size>
<width>30</width>
<height>0</height>
</size>
</property>
</widget>
</hbox>
</widget>
<spacer>
<property name="name">
<cstring>spacer2</cstring>
+7
View File
@@ -158,6 +158,9 @@ void UIPrefsDialog::setFromPrefs()
replAbsCB->setEnabled(prefs.queryBuildAbstract);
replAbsCB->setChecked(prefs.queryReplaceAbstract);
autoSuffsCB->setChecked(prefs.autoSuffsEnable);
autoSuffsLE->setText(prefs.autoSuffs);
// Initialize the extra indexes listboxes
idxLV->clear();
for (list<string>::iterator it = prefs.allExtraDbs.begin();
@@ -223,6 +226,10 @@ void UIPrefsDialog::accept()
prefs.syntAbsLen = syntlenSB->value();
prefs.syntAbsCtx = syntctxSB->value();
prefs.autoSuffsEnable = autoSuffsCB->isChecked();
prefs.autoSuffs = autoSuffsLE->text();
QListViewItemIterator it(idxLV);
prefs.allExtraDbs.clear();
prefs.activeExtraDbs.clear();