handle application tag when looking for icon, and add icons for books and book chapters (epub, chm, info)
This commit is contained in:
parent
128b54cabd
commit
217c38edb4
8 changed files with 39 additions and 34 deletions
|
@ -885,33 +885,30 @@ bool RclConfig::mimeViewerNeedsUncomp(const string &mimetype)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
string RclConfig::getMimeIconPath(const string &mtype, const string &apptag)
|
||||||
* Return icon name and path
|
|
||||||
*/
|
|
||||||
string RclConfig::getMimeIconName(const string &mtype, string *path)
|
|
||||||
{
|
{
|
||||||
string iconname;
|
string iconname;
|
||||||
mimeconf->get(mtype, iconname, "icons");
|
if (!apptag.empty())
|
||||||
|
mimeconf->get(mtype + string("|") + apptag, iconname, "icons");
|
||||||
|
if (iconname.empty())
|
||||||
|
mimeconf->get(mtype, iconname, "icons");
|
||||||
if (iconname.empty())
|
if (iconname.empty())
|
||||||
iconname = "document";
|
iconname = "document";
|
||||||
|
|
||||||
if (path) {
|
string iconpath;
|
||||||
string iconsdir;
|
|
||||||
|
|
||||||
#if defined (__FreeBSD__) && __FreeBSD_version < 500000
|
#if defined (__FreeBSD__) && __FreeBSD_version < 500000
|
||||||
// gcc 2.95 dies if we call getConfParam here ??
|
// gcc 2.95 dies if we call getConfParam here ??
|
||||||
if (m_conf) m_conf->get(string("iconsdir"), iconsdir, m_keydir);
|
if (m_conf) m_conf->get(string("iconsdir"), iconpath, m_keydir);
|
||||||
#else
|
#else
|
||||||
getConfParam("iconsdir", iconsdir);
|
getConfParam("iconsdir", iconpath);
|
||||||
#endif
|
#endif
|
||||||
if (iconsdir.empty()) {
|
|
||||||
iconsdir = path_cat(m_datadir, "images");
|
if (iconpath.empty()) {
|
||||||
} else {
|
iconpath = path_cat(m_datadir, "images");
|
||||||
iconsdir = path_tildexpand(iconsdir);
|
} else {
|
||||||
}
|
iconpath = path_tildexpand(iconpath);
|
||||||
*path = path_cat(iconsdir, iconname) + ".png";
|
|
||||||
}
|
}
|
||||||
return iconname;
|
return path_cat(iconpath, iconname) + ".png";
|
||||||
}
|
}
|
||||||
|
|
||||||
string RclConfig::getDbDir()
|
string RclConfig::getDbDir()
|
||||||
|
|
|
@ -196,8 +196,8 @@ class RclConfig {
|
||||||
bool valueSplitAttributes(const string& whole, string& value,
|
bool valueSplitAttributes(const string& whole, string& value,
|
||||||
ConfSimple& attrs);
|
ConfSimple& attrs);
|
||||||
|
|
||||||
/** mimeconf: get icon name for mimetype */
|
/** Return icon path for mime type and tag */
|
||||||
string getMimeIconName(const string &mtype, string *path = 0);
|
string getMimeIconPath(const string &mt, const string& apptag);
|
||||||
|
|
||||||
/** mimeconf: get list of file categories */
|
/** mimeconf: get list of file categories */
|
||||||
bool getMimeCategories(vector<string>&);
|
bool getMimeCategories(vector<string>&);
|
||||||
|
|
|
@ -100,7 +100,7 @@ bool RecollFilter::txtdcode(const string& who)
|
||||||
|
|
||||||
string& ocs = m_metaData[cstr_dj_keyorigcharset];
|
string& ocs = m_metaData[cstr_dj_keyorigcharset];
|
||||||
string& itext = m_metaData[cstr_dj_keycontent];
|
string& itext = m_metaData[cstr_dj_keycontent];
|
||||||
LOGDEB0(("%s::txtdcode: %d bytes from [%s] to UTF-8\n",
|
LOGDEB1(("%s::txtdcode: %d bytes from [%s] to UTF-8\n",
|
||||||
who.c_str(), itext.size(), ocs.c_str()));
|
who.c_str(), itext.size(), ocs.c_str()));
|
||||||
int ecnt;
|
int ecnt;
|
||||||
string otext;
|
string otext;
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
Most icons thanks to kde crystalsvg
|
Most icons thanks to KDE crystalsvg
|
||||||
The Python and archive icons comes from oxygen (www.oxygen-icons.org) GPL
|
|
||||||
The Pidgin icon comes from the Pidgin project (GPL)
|
Oxygen (www.oxygen-icons.org) (GPL):
|
||||||
|
archive.png book.png bookchap.png text-x-python.png
|
||||||
|
|
||||||
|
The Pidgin project (GPL):
|
||||||
|
pidgin.png
|
||||||
|
|
||||||
|
|
|
@ -453,10 +453,10 @@ string ResListPager::prevUrl()
|
||||||
|
|
||||||
string ResListPager::iconUrl(RclConfig *config, Rcl::Doc& doc)
|
string ResListPager::iconUrl(RclConfig *config, Rcl::Doc& doc)
|
||||||
{
|
{
|
||||||
string iconurl;
|
string apptag;
|
||||||
config->getMimeIconName(doc.mimetype, &iconurl);
|
doc.getmeta(Rcl::Doc::keyapptg, &apptag);
|
||||||
iconurl = cstr_fileu + iconurl;
|
|
||||||
return iconurl;
|
return cstr_fileu + config->getMimeIconPath(doc.mimetype, apptag);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ResListPager::append(const string& data)
|
bool ResListPager::append(const string& data)
|
||||||
|
|
|
@ -146,16 +146,16 @@ text/xml = exec rclxml
|
||||||
## #############################################
|
## #############################################
|
||||||
# Icons to be used in the result list if required by gui config
|
# Icons to be used in the result list if required by gui config
|
||||||
[icons]
|
[icons]
|
||||||
application/epub+zip = document
|
application/epub+zip = book
|
||||||
application/msword = wordprocessing
|
application/msword = wordprocessing
|
||||||
application/ogg = sownd
|
application/ogg = sownd
|
||||||
application/pdf = pdf
|
application/pdf = pdf
|
||||||
application/postscript = postscript
|
application/postscript = postscript
|
||||||
application/vnd.ms-excel = spreadsheet
|
application/vnd.ms-excel = spreadsheet
|
||||||
application/vnd.ms-powerpoint = presentation
|
application/vnd.ms-powerpoint = presentation
|
||||||
application/vnd.oasis.opendocument.text = wordprocessing
|
|
||||||
application/vnd.oasis.opendocument.presentation = presentation
|
application/vnd.oasis.opendocument.presentation = presentation
|
||||||
application/vnd.oasis.opendocument.spreadsheet = spreadsheet
|
application/vnd.oasis.opendocument.spreadsheet = spreadsheet
|
||||||
|
application/vnd.oasis.opendocument.text = wordprocessing
|
||||||
application/vnd.openxmlformats-officedocument.presentationml.presentation = presentation
|
application/vnd.openxmlformats-officedocument.presentationml.presentation = presentation
|
||||||
application/vnd.openxmlformats-officedocument.presentationml.template = presentation
|
application/vnd.openxmlformats-officedocument.presentationml.template = presentation
|
||||||
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet = spreadsheet
|
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet = spreadsheet
|
||||||
|
@ -175,12 +175,12 @@ application/vnd.sun.xml.writer.template = wordprocessing
|
||||||
application/vnd.wordperfect = wordprocessing
|
application/vnd.wordperfect = wordprocessing
|
||||||
application/x-abiword = wordprocessing
|
application/x-abiword = wordprocessing
|
||||||
application/x-awk = source
|
application/x-awk = source
|
||||||
application/x-chm = document
|
application/x-chm = book
|
||||||
application/x-dia-diagram = drawing
|
application/x-dia-diagram = drawing
|
||||||
application/x-dvi = document
|
application/x-dvi = document
|
||||||
application/x-flac = sownd
|
application/x-flac = sownd
|
||||||
application/x-fsdirectory = folder
|
application/x-fsdirectory = folder
|
||||||
application/x-gnuinfo = document
|
application/x-gnuinfo = book
|
||||||
application/x-gnumeric = spreadsheet
|
application/x-gnumeric = spreadsheet
|
||||||
application/x-kword = wordprocessing
|
application/x-kword = wordprocessing
|
||||||
application/x-lyx = wordprocessing
|
application/x-lyx = wordprocessing
|
||||||
|
@ -211,6 +211,9 @@ image/x-xcf = image
|
||||||
image/x-xpmi = image
|
image/x-xpmi = image
|
||||||
message/rfc822 = message
|
message/rfc822 = message
|
||||||
text/html = html
|
text/html = html
|
||||||
|
text/html|chm = bookchap
|
||||||
|
text/html|epub = bookchap
|
||||||
|
text/html|gnuinfo = bookchap
|
||||||
text/plain = txt
|
text/plain = txt
|
||||||
text/rtf = wordprocessing
|
text/rtf = wordprocessing
|
||||||
text/x-c = source
|
text/x-c = source
|
||||||
|
|
|
@ -79,6 +79,7 @@
|
||||||
<h2><a name="b_latest">recoll 1.17.3</a></h2>
|
<h2><a name="b_latest">recoll 1.17.3</a></h2>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
|
<li>Messages in Qt standard dialog messages are not translated.</li>
|
||||||
<li>The unac_except_trans mechanism can generate wrong
|
<li>The unac_except_trans mechanism can generate wrong
|
||||||
character translations in some cases.</li>
|
character translations in some cases.</li>
|
||||||
<li>The real time monitor can be terminated for for permissions-related
|
<li>The real time monitor can be terminated for for permissions-related
|
||||||
|
|
|
@ -84,8 +84,8 @@
|
||||||
<h2>News</h2>
|
<h2>News</h2>
|
||||||
<div class="news">
|
<div class="news">
|
||||||
<ul>
|
<ul>
|
||||||
<li>2012-10-19: the source for <a href="recoll-1.18.0.tar.gz">
|
<li>2012-10-19: the source for <a href="recoll-1.18.001.tar.gz">
|
||||||
recoll 1.18.0</a> is available, and this is a call to
|
recoll 1.18.001</a> is available, and this is a call to
|
||||||
volunteers to test it. There are binary
|
volunteers to test it. There are binary
|
||||||
packages for Ubuntu and Mint Linux users, and I can build
|
packages for Ubuntu and Mint Linux users, and I can build
|
||||||
others. See this
|
others. See this
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue