fix v1.8 default format string if we find it

This commit is contained in:
dockes 2007-07-12 10:13:37 +00:00
parent eb252d93e9
commit acc251054e
5 changed files with 1142 additions and 51 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
#ifndef lint
static char rcsid[] = "@(#$Id: guiutils.cpp,v 1.33 2007-07-12 08:23:40 dockes Exp $ (C) 2005 Jean-Francois Dockes";
static char rcsid[] = "@(#$Id: guiutils.cpp,v 1.34 2007-07-12 10:13:37 dockes Exp $ (C) 2005 Jean-Francois Dockes";
#endif
/*
* This program is free software; you can redistribute it and/or modify
@ -192,8 +192,11 @@ void rwSettings(bool writing)
QString rlfDflt =
QString::fromAscii(prefs.getDfltResListFormat());
SETTING_RW(prefs.reslistformat, "/Recoll/prefs/reslist/format", , rlfDflt);
if (prefs.reslistformat.stripWhiteSpace().isEmpty())
if (prefs.reslistformat ==
QString::fromAscii(prefs.getV18DfltResListFormat()) ||
prefs.reslistformat.stripWhiteSpace().isEmpty())
prefs.reslistformat = rlfDflt;
SETTING_RW(prefs.queryStemLang, "/Recoll/prefs/query/stemLang", ,
"english");
SETTING_RW(prefs.useDesktopOpen,
@ -217,6 +220,8 @@ void rwSettings(bool writing)
Num, 0);
SETTING_RW(prefs.termMatchType, "/Recoll/prefs/query/termMatchType",
Num, 0);
SETTING_RW(prefs.rclVersion, "/Recoll/prefs/rclVersion",
Num, 1009);
// Ssearch combobox history list
if (writing) {

View File

@ -17,7 +17,7 @@
#ifndef _GUIUTILS_H_INCLUDED_
#define _GUIUTILS_H_INCLUDED_
/*
* @(#$Id: guiutils.h,v 1.22 2007-07-12 08:23:40 dockes Exp $ (C) 2005 Jean-Francois Dockes
* @(#$Id: guiutils.h,v 1.23 2007-07-12 10:13:37 dockes Exp $ (C) 2005 Jean-Francois Dockes
* jean-francois.dockes@wanadoo.fr
*
* This program is free software; you can redistribute it and/or modify
@ -107,6 +107,9 @@ class PrefsPack {
// Remembered term match mode
int termMatchType;
// Program version that wrote this
int rclVersion;
// Advanced search window clause list state
vector<int> advSearchClauses;
@ -118,7 +121,8 @@ class PrefsPack {
queryReplaceAbstract(false),
startWithAdvSearchOpen(false),
startWithSortToolOpen(false),
termMatchType(0)
termMatchType(0),
rclVersion(1009)
{
}
static const char *getDfltResListFormat() {
@ -127,7 +131,11 @@ class PrefsPack {
"%M&nbsp;%D&nbsp;&nbsp;&nbsp;<i>%U</i><br>"
"%A %K";
}
static const char *getV18DfltResListFormat() {
return "%R %S %L &nbsp;&nbsp;<b>%T</b><br>"
"%M&nbsp;%D&nbsp;&nbsp;&nbsp;<i>%U</i><br>"
"%A %K";
}
};
/** Global preferences record */

View File

@ -154,7 +154,7 @@
<string>Result paragraph&lt;br&gt;format string</string>
</property>
<property name="toolTip" stdset="0">
<string>Defines the format for each result list paragraph. Use qt html format and printf-like replacements:&lt;br&gt;%A Abstract&lt;br&gt; %D Date&lt;br&gt; %I Icon image name%lt;br&gt; %K Keywords (if any)&lt;br&gt; %L Preview and Edit links&lt;br&gt; %M Mime type&lt;br&gt; %N Result number&lt;br&gt; %R Relevance percentage&lt;br&gt; %S Size information&lt;br&gt; %T Title&lt;br&gt; %U Url&lt;br&gt;</string>
<string>Defines the format for each result list paragraph. Use qt html format and printf-like replacements:&lt;br&gt;%A Abstract&lt;br&gt; %D Date&lt;br&gt; %I Icon image name&lt;br&gt; %K Keywords (if any)&lt;br&gt; %L Preview and Edit links&lt;br&gt; %M Mime type&lt;br&gt; %N Result number&lt;br&gt; %R Relevance percentage&lt;br&gt; %S Size information&lt;br&gt; %T Title&lt;br&gt; %U Url&lt;br&gt;</string>
</property>
</widget>
<widget class="QTextEdit">

View File

@ -1,5 +1,5 @@
#ifndef lint
static char rcsid[] = "@(#$Id: uiprefs_w.cpp,v 1.18 2007-07-12 08:23:40 dockes Exp $ (C) 2005 J.F.Dockes";
static char rcsid[] = "@(#$Id: uiprefs_w.cpp,v 1.19 2007-07-12 10:13:37 dockes Exp $ (C) 2005 J.F.Dockes";
#endif
/*
* This program is free software; you can redistribute it and/or modify
@ -175,6 +175,13 @@ void UIPrefsDialog::accept()
prefs.reslistfontfamily = reslistFontFamily;
prefs.reslistfontsize = reslistFontSize;
prefs.reslistformat = rlfTE->text();
// Don't let us set the old default format from here, this would
// get reset to the new default. Ugly hack
if (prefs.reslistformat ==
QString::fromAscii(prefs.getV18DfltResListFormat())) {
prefs.reslistformat += " ";
rlfTE->setText(prefs.reslistformat);
}
if (prefs.reslistformat.stripWhiteSpace().isEmpty()) {
prefs.reslistformat = prefs.getDfltResListFormat();
rlfTE->setText(prefs.reslistformat);