From 265bbd0c6e9284e04ec0cdc94311724127608120 Mon Sep 17 00:00:00 2001 From: Jean-Francois Dockes Date: Sat, 15 Jan 2022 09:12:39 +0000 Subject: [PATCH] Define system specific default configuration directory to allow sharing most of the default configuration files contents --- src/common/rclconfig.cpp | 22 +- src/utils/conftree.h | 39 ++-- src/windows/mimeconf | 434 ++------------------------------------- src/windows/mimeview | 175 +--------------- src/windows/mkinstdir.sh | 16 +- 5 files changed, 69 insertions(+), 617 deletions(-) diff --git a/src/common/rclconfig.cpp b/src/common/rclconfig.cpp index ef8f6351..490d30ea 100644 --- a/src/common/rclconfig.cpp +++ b/src/common/rclconfig.cpp @@ -58,6 +58,16 @@ using namespace std; +// Naming the directory for platform-specific default config files, overriding the top-level ones +// E.g. /usr/share/recoll/examples/windows +#ifdef _WIN32 +static const string confsysdir{"windows"}; +#elif defined(_APPLE__) +static const string confsysdir{"macos"}; +#else +static const string confsysdir; +#endif + // Static, logically const, RclConfig members or module static // variables are initialized once from the first object build during // process initialization. @@ -303,8 +313,15 @@ RclConfig::RclConfig(const string *argcnf) m_cdirs.push_back(cp); } - // Base/installation config - m_cdirs.push_back(path_cat(m_datadir, "examples")); + // Base/installation config, and its platform-specific overrides + std::string defaultsdir = path_cat(m_datadir, "examples"); + if (!confsysdir.empty()) { + std::string sdir = path_cat(defaultsdir, confsysdir); + if (path_isdir(sdir)) { + m_cdirs.push_back(sdir); + } + } + m_cdirs.push_back(defaultsdir); string cnferrloc; for (const auto& dir : m_cdirs) { @@ -376,6 +393,7 @@ bool RclConfig::updateMainConfig() { ConfStack *newconf = new ConfStack("recoll.conf", m_cdirs, true); if (newconf == 0 || !newconf->ok()) { + std::cerr << "updateMainConfig: new Confstack not ok\n"; if (m_conf) return false; m_ok = false; diff --git a/src/utils/conftree.h b/src/utils/conftree.h index d868e436..dc6f86ad 100644 --- a/src/utils/conftree.h +++ b/src/utils/conftree.h @@ -125,8 +125,7 @@ public: * @param readonly if true open readonly, else rw * @param tildexp try tilde (home dir) expansion for subkey values */ - ConfSimple(const char *fname, int readonly = 0, bool tildexp = false, - bool trimvalues = true); + ConfSimple(const char *fname, int readonly = 0, bool tildexp = false, bool trimvalues = true); /** * Build the object by reading content from a string @@ -142,8 +141,7 @@ public: * @param readonly if true open read only, else rw * @param tildexp try tilde (home dir) expansion for subsection names */ - ConfSimple(int readonly = 0, bool tildexp = false, - bool trimvalues = true); + ConfSimple(int readonly = 0, bool tildexp = false, bool trimvalues = true); virtual ~ConfSimple() {}; @@ -184,8 +182,7 @@ public: * Set value for named integer parameter in specified subsection (or global) * @return 0 for error, 1 else */ - virtual int set(const std::string& nm, long long val, - const std::string& sk = std::string()); + virtual int set(const std::string& nm, long long val, const std::string& sk = std::string()); /** * Remove name and value from config @@ -388,8 +385,7 @@ public: construct(fns, ro); } /// Construct out of single file name and multiple directories - ConfStack(const std::string& nm, const std::vector& dirs, - bool ro = true) { + ConfStack(const std::string& nm, const std::vector& dirs, bool ro = true) { std::vector fns; for (const auto& dir : dirs) { fns.push_back(path_cat(dir, nm)); @@ -501,8 +497,8 @@ public: const std::string& sk, const char *pattern = 0) const override { return getNames1(sk, pattern, false); } - virtual std::vector getNamesShallow(const std::string& sk, - const char *patt = 0) const { + virtual std::vector getNamesShallow( + const std::string& sk, const char *patt = 0) const { return getNames1(sk, patt, true); } @@ -570,27 +566,30 @@ private: } } - /// Common construct from file names code. We used to be ok even - /// if some files were not readable/parsable. Now fail if any - /// fails. + /// Common construct from file names. + /// Fail if any fails, except for missing files in all but the bottom location, or the + /// top one in rw mode. void construct(const std::vector& fns, bool ro) { bool ok{true}; - bool first{true}; - for (const auto& fn : fns) { + for (unsigned int i = 0; i < fns.size(); i++) { + const auto& fn{fns[i]}; T* p = new T(fn.c_str(), ro); if (p && p->ok()) { m_confs.push_back(p); } else { delete p; - // In ro mode, we accept a non-existing topmost file - // and treat it as an empty one. - if (!(ro && first && !path_exists(fn))) { - ok = false; + // We accept missing files in all but the bottom/ directory. + // In rw mode, the topmost file must be present. + if (!path_exists(fn)) { + // !ro can only be true for i==0 + if (!ro || (i == fns.size() - 1)) { + ok = false; + break; + } } } // Only the first file is opened rw ro = true; - first = false; } m_ok = ok; } diff --git a/src/windows/mimeconf b/src/windows/mimeconf index 832afa45..19a021d8 100644 --- a/src/windows/mimeconf +++ b/src/windows/mimeconf @@ -1,438 +1,38 @@ # (C) 2015-2022 J.F.Dockes -# This file contains most of the data which determines how we -# handle the different mime types (also see the "mimeview" file). # -# This is the version specific to MS-WINDOWS +# MS-WINDOWS specific definitions for mimeconf # -# Sections: -# top-level: Decompression parameters. Should not be at top-level, historical. -# [index] : Associations of mime types to the filters that translate them -# to plain text or html. -# [icons] : Associations of mime types to result list icons (GUI) -# [categories] : groupings of mime types (media, text, message etc.) -# [guifilters] : defines the filtering checkboxes in the GUI. Uses the -# above categories by default -## ####################################### -# Decompression: these types need a first pass to create a temp file to -# work with. We use a script because uncompress utilities usually work in -# place, which is not suitable. -# -# Obviously this should be in a [decompress] section or such, but it was once -# forgotten and remained global for compatibility... -# -# The %t parameter will be substituted to the name of a temporary directory -# by recoll. This directory is guaranteed empty when calling the filter -# -# The %f parameter will be substituted with the input file. -# -# The script (ie: rcluncomp) must output the uncompressed file name on -# stdout. Note that the windows version will always use 7z, and ignore -# the decompressor parameter in the following lines +# Decompression: the windows version always uses 7z, no decompressor parameter is necessary application/gzip = uncompress rcluncomp.py 7z %f %t application/x-gzip = uncompress rcluncomp.py 7z %f %t application/x-compress = uncompress rcluncomp.py 7z %f %t application/x-bzip2 = uncompress rcluncomp.py 7z %f %t application/x-xz = uncompress rcluncomp.py 7z %f %t application/x-lzma = uncompress rcluncomp.py 7z %f %t +application/x-scribus = +application/x-tex = -## ################################### -# Filters for indexing and internal preview. -# The "internal" filters are hardwired in the c++ code. -# The external "exec" filters are typically scripts. By default, they output the -# document in simple html format, have a look at the scripts. -# A different format (ie text/plain), and a character set can be defined for -# each filter, see the exemples below (ie: msword) [index] - -application/msword = execm rcldoc.py -application/vnd.ms-excel = execm rclxls.py -application/vnd.ms-outlook = execm rclpst.py -application/vnd.ms-powerpoint = execm rclppt.py -# Also Handle the mime type returned by "file -i" for a suffix-less word -# file. This could probably just as well be an excel file, but we have to -# chose one. -application/vnd.ms-office = execm rcldoc.py - -application/vnd.oasis.opendocument.text = \ - internal xsltproc meta meta.xml opendoc-meta.xsl \ - body content.xml opendoc-body.xsl -application/vnd.oasis.opendocument.text-template = \ - internal xsltproc meta meta.xml opendoc-meta.xsl \ - body content.xml opendoc-body.xsl -application/vnd.oasis.opendocument.presentation = \ - internal xsltproc meta meta.xml opendoc-meta.xsl \ - body content.xml opendoc-body.xsl -application/vnd.oasis.opendocument.spreadsheet = \ - internal xsltproc meta meta.xml opendoc-meta.xsl \ - body content.xml opendoc-body.xsl -application/vnd.oasis.opendocument.graphics = \ - internal xsltproc meta meta.xml opendoc-meta.xsl \ - body content.xml opendoc-body.xsl -application/vnd.oasis.opendocument.presentation-flat-xml = \ - internal xsltproc opendoc-flat.xsl -application/vnd.oasis.opendocument.text-flat-xml = \ - internal xsltproc opendoc-flat.xsl -application/vnd.oasis.opendocument.spreadsheet-flat-xml = \ - internal xsltproc opendoc-flat.xsl - -application/vnd.openxmlformats-officedocument.wordprocessingml.document = \ - internal xsltproc meta docProps/core.xml openxml-meta.xsl \ - body word/document.xml openxml-word-body.xsl \ - body word/footnotes.xml openxml-word-body.xsl \ - body word/endnotes.xml openxml-word-body.xsl -application/vnd.openxmlformats-officedocument.wordprocessingml.template = \ - internal xsltproc meta docProps/core.xml openxml-meta.xsl \ - body word/document.xml openxml-word-body.xsl \ - body word/footnotes.xml openxml-word-body.xsl \ - body word/endnotes.xml openxml-word-body.xsl -application/vnd.openxmlformats-officedocument.presentationml.template = \ - execm rclopxml.py -application/vnd.openxmlformats-officedocument.presentationml.presentation = \ - execm rclopxml.py -application/vnd.openxmlformats-officedocument.spreadsheetml.sheet = \ - internal xsltproc meta docProps/core.xml openxml-meta.xsl \ - body xl/sharedStrings.xml openxml-xls-body.xsl -application/vnd.openxmlformats-officedocument.spreadsheetml.template =\ - internal xsltproc meta docProps/core.xml openxml-meta.xsl \ - body xl/sharedStrings.xml openxml-xls-body.xsl - -application/vnd.sun.xml.calc = \ - internal xsltproc meta meta.xml opendoc-meta.xsl \ - body content.xml opendoc-body.xsl -application/vnd.sun.xml.calc.template = \ - internal xsltproc meta meta.xml opendoc-meta.xsl \ - body content.xml opendoc-body.xsl -application/vnd.sun.xml.draw = \ - internal xsltproc meta meta.xml opendoc-meta.xsl \ - body content.xml opendoc-body.xsl -application/vnd.sun.xml.draw.template = \ - internal xsltproc meta meta.xml opendoc-meta.xsl \ - body content.xml opendoc-body.xsl -application/vnd.sun.xml.impress = \ - internal xsltproc meta meta.xml opendoc-meta.xsl \ - body content.xml opendoc-body.xsl -application/vnd.sun.xml.impress.template = \ - internal xsltproc meta meta.xml opendoc-meta.xsl \ - body content.xml opendoc-body.xsl -application/vnd.sun.xml.math = \ - internal xsltproc meta meta.xml opendoc-meta.xsl \ - body content.xml opendoc-body.xsl -application/vnd.sun.xml.writer = \ - internal xsltproc meta meta.xml opendoc-meta.xsl \ - body content.xml opendoc-body.xsl -application/vnd.sun.xml.writer.global = \ - internal xsltproc meta meta.xml opendoc-meta.xsl \ - body content.xml opendoc-body.xsl -application/vnd.sun.xml.writer.template = \ - internal xsltproc meta meta.xml opendoc-meta.xsl \ - body content.xml opendoc-body.xsl - -#application/postscript = exec rclps -#application/x-gnuinfo = execm rclinfo.py -#application/x-tar = execm rcltar.py - -application/epub+zip = execm rclepub.py -application/x-ipynb+json = execm rclipynb.py -application/javascript = internal text/plain -application/ogg = execm rclaudio.py -application/pdf = execm rclpdf.py -application/sql = internal text/plain +application/postscript = application/vnd.wordperfect = exec wpd/wpd2html;mimetype=text/html -application/x-7z-compressed = execm rcl7z.py -application/x-abiword = internal xsltproc abiword.xsl -application/x-awk = internal text/plain -application/x-chm = execm rclchm.py -application/x-dia-diagram = execm rcldia.py;mimetype=text/plain -application/x-flac = execm rclaudio.py -application/x-gnote = execm rclxml.py -application/x-hwp = execm rclhwp.py -application/x-mimehtml = internal message/rfc822 -application/x-perl = internal text/plain -application/x-php = internal text/plain -application/x-rar = execm rclrar.py;charset=default -application/x-shellscript = internal text/plain -application/x-webarchive = execm rclwar.py -application/x-zerosize = internal -application/zip = execm rclzip.py;charset=default -audio/aac = execm rclaudio.py -audio/mp4 = execm rclaudio.py -audio/mpeg = execm rclaudio.py -audio/x-karaoke = execm rclkar.py +application/x-dvi = +application/x-gnuinfo = +application/x-ipynb+json = execm rclipynb.py +application/x-tar = image/gif = execm rclimg.exe image/jp2 = execm rclimg.exe image/jpeg = execm rclimg.exe image/png = execm rclimg.exe -image/svg+xml = internal xsltproc svg.xsl image/tiff = execm rclimg.exe -image/vnd.djvu = execm rcldjvu.py -inode/symlink = internal -inode/x-empty = internal application/x-zerosize -message/rfc822 = internal -text/calendar = execm rclics.py;mimetype=text/plain -text/css = internal text/plain -text/html = internal -text/plain = internal -text/plain1 = internal -#text/rtf = execm rclrtf.py -text/rtf = exec unrtf --nopict --html;mimetype=text/html -text/x-c = internal -text/x-c+ = internal -text/x-c++ = internal -text/x-chm-html = internal text/html -text/x-csharp = internal text/plain -text/x-csv = internal text/plain -text/x-fictionbook = internal xsltproc fb2.xsl -text/x-ini = internal text/plain -text/x-mail = internal -text/x-orgmode = execm rclorgmode.py -text/x-perl = internal text/plain -text/x-python = execm rclpython.py -text/x-shellscript = internal text/plain -text/x-srt = internal text/plain +image/x-nikon-nef = execm rclimg.exe image/x-xcf = execm rclimg.exe - -# Generic XML is best indexed as text, else it generates too many errors -# All parameter and tag names, attribute values etc, are indexed as -# text. rclxml.py tries to just index the text content. -#application/xml = execm rclxml.py -#text/xml = execm rclxml.py -application/xml = internal text/plain -text/xml = internal text/plain - -## ############################################# -# Icons to be used in the result list if required by gui config -[icons] -application/epub+zip = book -application/javascript = source -application/msword = wordprocessing -application/ogg = sownd -application/pdf = pdf -application/postscript = postscript -application/vnd.ms-excel = spreadsheet -application/vnd.ms-powerpoint = presentation -application/vnd.oasis.opendocument.presentation = presentation -application/vnd.oasis.opendocument.spreadsheet = spreadsheet -application/vnd.oasis.opendocument.text = wordprocessing -application/vnd.openxmlformats-officedocument.presentationml.presentation = presentation -application/vnd.openxmlformats-officedocument.presentationml.template = presentation -application/vnd.openxmlformats-officedocument.spreadsheetml.sheet = spreadsheet -application/vnd.openxmlformats-officedocument.spreadsheetml.template = spreadsheet -application/vnd.openxmlformats-officedocument.wordprocessingml.document = wordprocessing -application/vnd.openxmlformats-officedocument.wordprocessingml.template = wordprocessing -application/vnd.sun.xml.calc = spreadsheet -application/vnd.sun.xml.calc.template = spreadsheet -application/vnd.sun.xml.draw = drawing -application/vnd.sun.xml.draw.template = drawing -application/vnd.sun.xml.impress = presentation -application/vnd.sun.xml.impress.template = presentation -application/vnd.sun.xml.math = wordprocessing -application/vnd.sun.xml.writer = wordprocessing -application/vnd.sun.xml.writer.global = wordprocessing -application/vnd.sun.xml.writer.template = wordprocessing -application/vnd.wordperfect = wordprocessing -application/x-abiword = wordprocessing -application/x-awk = source -application/x-chm = book -application/x-dia-diagram = drawing -application/x-dvi = document -application/x-flac = sownd -application/x-fsdirectory = folder -application/x-gnote = document -#application/x-gnuinfo = book -application/x-gnumeric = spreadsheet -application/x-ipynb+json = document -application/x-kword = wordprocessing -application/x-lyx = wordprocessing -application/x-mimehtml = message -application/x-mobipocket-ebook = document -application/x-okular-notes = document -application/x-perl = source -application/x-php = source -application/x-rar = archive -application/x-scribus = document -application/x-scribus = wordprocessing -application/x-shellscript = source -application/x-tar = archive -application/x-tex = wordprocessing -application/x-webarchive = archive -application/xml = document -application/zip = archive -application/x-7z-compressed = archive -audio/mpeg = sownd -audio/x-karaoke = sownd -image/bmp = image -image/gif = image -image/jp2 = image -image/jpeg = image -image/png = image -image/svg+xml = drawing -image/tiff = image -image/vnd.djvu = document -image/x-xcf = image -image/x-xpmi = image -inode/directory = folder -inode/symlink = emblem-symbolic-link -message/rfc822 = message -text/html = html -text/html|chm = bookchap -text/html|epub = bookchap -#text/html|gnuinfo = bookchap -text/plain = txt -text/rtf = wordprocessing -text/x-c = source -text/x-c+ = source -text/x-c++ = source -text/x-csv = txt -text/x-fictionbook = document -text/x-html-aptosid-man = aptosid-book -text/x-html-sidux-man = sidux-book -text/x-ini = txt -text/x-mail = message -text/x-man = document -text/x-orgmode = document -text/x-perl = source -text/x-purple-html-log = pidgin -text/x-purple-log = pidgin -text/x-python = text-x-python -text/x-shellscript = source -text/x-tex = wordprocessing -text/xml = document -video/3gpp = video -video/mp2p = video -video/mp2t = video -video/mp4 = video -video/mpeg = video -video/quicktime = video -video/x-matroska = video -video/x-ms-asf = video -video/x-msvideo = video - -[categories] -# Categories group mime types by "kind". They can be used from the query -# language as an "rclcat" clause. This is fully dynamic, you can change the -# names and groups as you wish, only the mime types are stored in the index. -# -# If you add/remove categories, you may also want to change the -# "guifilters" section below. -text = \ - application/epub+zip \ - application/msword \ - application/pdf \ - application/postscript \ - application/vnd.oasis.opendocument.text \ - application/vnd.openxmlformats-officedocument.wordprocessingml.document \ - application/vnd.openxmlformats-officedocument.wordprocessingml.template \ - application/vnd.sun.xml.writer \ - application/vnd.sun.xml.writer.global \ - application/vnd.sun.xml.writer.template \ - application/vnd.wordperfect \ - application/x-abiword \ - application/x-awk \ - application/x-chm \ - application/x-dvi \ - application/x-gnote \ - application/x-gnuinfo \ - application/x-ipynb+json \ - application/x-kword \ - application/x-lyx \ - application/x-mobipocket-ebook \ - application/x-okular-notes \ - application/x-perl \ - application/x-scribus \ - application/x-shellscript \ - application/x-tex \ - application/xml \ - text/xml \ - text/x-csv \ - text/x-tex \ - image/vnd.djvu \ - text/calendar \ - text/html \ - text/plain \ - text/rtf \ - text/x-c \ - text/x-c++ \ - text/x-c+ \ - text/x-fictionbook \ - text/x-html-aptosid-man \ - text/x-html-sidux-man \ - text/x-ini \ - text/x-man \ - text/x-orgmode \ - text/x-perl \ - text/x-python \ - text/x-shellscript - -spreadsheet = \ - application/vnd.ms-excel \ - application/vnd.oasis.opendocument.spreadsheet \ - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet \ - application/vnd.openxmlformats-officedocument.spreadsheetml.template \ - application/vnd.sun.xml.calc \ - application/vnd.sun.xml.calc.template \ - application/x-gnumeric - -presentation = \ - application/vnd.ms-powerpoint \ - application/vnd.oasis.opendocument.presentation \ - application/vnd.openxmlformats-officedocument.presentationml.presentation \ - application/vnd.openxmlformats-officedocument.presentationml.template \ - application/vnd.sun.xml.impress \ - application/vnd.sun.xml.impress.template - -media = \ - application/ogg \ - application/x-flac \ - audio/* \ - image/* \ - video/* \ - -message = message/rfc822 \ - text/x-gaim-log \ - text/x-mail \ - text/x-purple-log \ - text/x-purple-html-log \ - -other = application/vnd.sun.xml.draw \ - application/vnd.sun.xml.draw.template \ - application/vnd.sun.xml.math \ - application/x-dia-diagram \ - application/x-fsdirectory \ - application/x-mimehtml \ - application/x-rar \ - application/x-tar \ - application/x-webarchive \ - application/zip \ - application/x-7z-compressed \ - inode/directory \ - inode/symlink \ - -[guifilters] -# This defines the top level filters in the GUI (accessed by the the -# radiobuttons above the results area, or a toolbar combobox). -# Each entry defines a label and a query language fragment that will be -# applied to filter the current query if the option is activated. -# -# This does not really belong in mimeconf, but it does belong in the index -# config (not the GUI one), because it's not necessarily the same in all -# configs, it has to go somewhere, and it's not worth a separate config -# file... -# -# By default this filters by document category (see above), but any -# language fragment should be ok. Be aware though that the "document -# history" queries only know about simple "rclcat" filtering. -# -# If you don't want the filter names to be displayed in alphabetic order, -# you can define them with a colon. The part before the colon is not -# displayed but used for ordering, ie: a:zzbutshouldbefirst b:aacomeslast -# -text = rclcat:text -spreadsheet = rclcat:spreadsheet -presentation = rclcat:presentation -media = rclcat:media -message = rclcat:message -other = rclcat:other - +text/x-bibtex = +text/x-gaim-log = +text/x-html-aptosid-man = +text/x-man = +text/x-purple-log = +text/x-tex = +video/x-msvideo = execm rclimg.exe diff --git a/src/windows/mimeview b/src/windows/mimeview index dcf97fe3..72dc53f8 100644 --- a/src/windows/mimeview +++ b/src/windows/mimeview @@ -1,21 +1,5 @@ -## ########################################## -# External viewers, launched by the recoll GUI when you click on a result -# 'edit' link -# -# MS WINDOWS VERSION -# -# Mime types which we should not uncompress if they are found gzipped or -# bzipped because the native viewer knows how to handle. These would be -# exceptions and the list is normally empty -#nouncompforviewmts = +# MS WINDOWS system changes for mimeview -# For releases 1.18 and later: exceptions when using the x-all entry: these -# types will use their local definition. This is useful, e.g.: -# -# - for pdf, where we can pass additional parameters like page to open and -# search string -# - For pages of CHM and EPUB documents where we can choose to open the -# parent document instead of a temporary html file. xallexcepts = \ text/html|epub \ application/x-fsdirectory|parentopen inode/directory|parentopen @@ -44,157 +28,6 @@ application/pdf = C:/users/bill/appdata/local/apps/evince-2.32.0.145/bin/evince #application/pdf = "C:/Program Files/SumatraPDF/SumatraPDF.exe" -page %p %f #application/pdf = "C:/Program Files (x86)/Foxit Software/Foxit Reader/FoxitReader.exe" %f /A page=%p -###### THE FOLLOWING ARE NOT USED AT ALL ON WINDOWS, but the types need to -###### be listed for an "Open" link to appear in the result list -application/epub+zip = ebook-viewer %f - -application/x-gnote = gnote %f - -application/x-mobipocket-ebook = ebook-viewer %f - -application/x-kword = kword %f -application/x-abiword = abiword %f - - -application/postscript = evince --page-index=%p --find=%s %f -application/x-dvi = evince --page-index=%p --find=%s %f - -application/x-lyx = lyx %f -application/x-scribus = scribus %f - -#application/msword = libreoffice %f -application/msword = \ - "C:/Program Files (x86)/LibreOffice 5/program/soffice.exe" %f - -application/x-hwp = hanword %f - -application/vnd.ms-excel = libreoffice %f -application/vnd.ms-powerpoint = libreoffice %f - -application/vnd.oasis.opendocument.text = libreoffice %f -application/vnd.oasis.opendocument.presentation = libreoffice %f -application/vnd.oasis.opendocument.spreadsheet = libreoffice %f - -application/vnd.openxmlformats-officedocument.wordprocessingml.document = \ - libreoffice %f -application/vnd.openxmlformats-officedocument.wordprocessingml.template = \ - libreoffice %f -application/vnd.openxmlformats-officedocument.presentationml.template = \ - libreoffice %f -application/vnd.openxmlformats-officedocument.presentationml.presentation = \ - libreoffice %f -application/vnd.openxmlformats-officedocument.spreadsheetml.sheet = \ - libreoffice %f -application/vnd.openxmlformats-officedocument.spreadsheetml.template =\ - libreoffice %f -application/vnd.sun.xml.calc = libreoffice %f -application/vnd.sun.xml.calc.template = libreoffice %f -application/vnd.sun.xml.draw = libreoffice %f -application/vnd.sun.xml.draw.template = libreoffice %f -application/vnd.sun.xml.impress = libreoffice %f -application/vnd.sun.xml.impress.template = libreoffice %f -application/vnd.sun.xml.math = libreoffice %f -application/vnd.sun.xml.writer = libreoffice %f -application/vnd.sun.xml.writer.global = libreoffice %f -application/vnd.sun.xml.writer.template = libreoffice %f -application/vnd.wordperfect = libreoffice %f -text/rtf = libreoffice %f - -application/x-dia-diagram = dia %f - -application/x-fsdirectory = dolphin %f -inode/directory = dolphin %f - -application/x-gnuinfo = xterm -e "info -f %f" -application/x-gnumeric = gnumeric %f - -application/x-flac = rhythmbox %f -audio/mpeg = rhythmbox %f -application/ogg = rhythmbox %f -audio/x-karaoke = kmid %f - -image/jpeg = gwenview %f -image/png = gwenview %f -image/tiff = gwenview %f -image/gif = gwenview %f -image/svg+xml = inkview %f -image/vnd.djvu = djview %f -image/x-xcf = gimp %f -image/bmp = gwenview %f -image/x-ms-bmp = gwenview %f -image/x-xpmi = gwenview %f - -# Opening mail messages not always works. -# - Thunderbird will only open a single-message file if it has an .emf -# extension -# - "sylpheed %f" seems to work ok as of version 3.3 -# - "kmail --view %u" works -message/rfc822 = thunderbird -file %f -text/x-mail = thunderbird -file %f -application/x-mimehtml = thunderbird -file %f - -text/calendar = evolution %f - -application/x-okular-notes = okular %f - -application/x-rar = ark %f -application/x-tar = ark %f -application/zip = ark %f -application/x-7z-compressed = ark %f - -application/x-awk = emacsclient --no-wait %f -application/x-perl = emacsclient --no-wait %f -text/x-perl = emacsclient --no-wait %f -application/x-shellscript = emacsclient --no-wait %f -text/x-shellscript = emacsclient --no-wait %f -text/x-srt = emacsclient --no-wait %f - -# Or firefox -remote "openFile(%u)" -text/html = firefox %u - -# gnu info nodes are translated to html with a "gnuinfo" -# rclaptg. rclshowinfo knows how to start the info command on the right -# node -text/html|gnuinfo = rclshowinfo %F %(title);ignoreipath=1 - -application/x-webarchive = konqueror %f -text/x-fictionbook = ebook-viewer %f -application/x-tex = emacsclient --no-wait %f -application/xml = emacsclient --no-wait %f -text/xml = emacsclient --no-wait %f -text/x-tex = emacsclient --no-wait %f -text/plain = emacsclient --no-wait %f -text/x-awk = emacsclient --no-wait %f -text/x-c = emacsclient --no-wait %f -text/x-c+ = emacsclient --no-wait %f -text/x-c++ = emacsclient --no-wait %f -text/x-csv = libreoffice %f -text/x-html-sidux-man = konqueror %f -text/x-html-aptosid-man = iceweasel %f - -application/x-chm = kchmviewer %f -# Html pages inside a chm have a chm rclaptg set by the filter. Kchmviewer -# knows how to use the ipath (which is the internal chm path) to open the -# file at the right place -text/html|chm = kchmviewer --url %i %F - -text/x-ini = emacsclient --no-wait %f -text/x-man = xterm -u8 -e "groff -T ascii -man %f | more" -text/x-python = idle %f -text/x-gaim-log = emacsclient --no-wait %f -text/x-purple-html-log = emacsclient --no-wait %f -text/x-purple-log = emacsclient --no-wait %f - -# The video types will usually be handled by the desktop default, but they -# need entries here to get an "Open" link -video/3gpp = vlc %f -video/mp2p = vlc %f -video/mp2t = vlc %f -video/mp4 = vlc %f -video/mpeg = vlc %f -video/quicktime = vlc %f -video/x-matroska = vlc %f -video/x-ms-asf = vlc %f -video/x-msvideo = vlc %f - - +########## +# Other MIME types have no specializations on Windows, but the types need to be listed for an "Open" +# link to appear in the result list, the listing is in the generic file diff --git a/src/windows/mkinstdir.sh b/src/windows/mkinstdir.sh index f37654c7..f01001ad 100644 --- a/src/windows/mkinstdir.sh +++ b/src/windows/mkinstdir.sh @@ -171,13 +171,15 @@ copyrecoll() chkcp $RCL/doc/user/docbook-xsl.css $DESTDIR/Share/doc mkdir -p $DESTDIR/Share/doc/webhelp rsync -av $RCL/doc/user/webhelp/docs/* $DESTDIR/Share/doc/webhelp || exit 1 - chkcp $RCL/sampleconf/fields $DESTDIR/Share/examples + chkcp $RCL/sampleconf/fields $DESTDIR/Share/examples chkcp $RCL/sampleconf/fragment-buttons.xml $DESTDIR/Share/examples - chkcp $RCL/windows/mimeconf $DESTDIR/Share/examples - chkcp $RCL/sampleconf/mimemap $DESTDIR/Share/examples - chkcp $RCL/windows/mimeview $DESTDIR/Share/examples - chkcp $RCL/sampleconf/recoll.conf $DESTDIR/Share/examples - chkcp $RCL/sampleconf/recoll.qss $DESTDIR/Share/examples + chkcp $RCL/sampleconf/mimeconf $DESTDIR/Share/examples + chkcp $RCL/sampleconf/mimeview $DESTDIR/Share/examples + chkcp $RCL/sampleconf/mimemap $DESTDIR/Share/examples + chkcp $RCL/windows/mimeconf $DESTDIR/Share/examples/windows + chkcp $RCL/windows/mimeview $DESTDIR/Share/examples/windows + chkcp $RCL/sampleconf/recoll.conf $DESTDIR/Share/examples + chkcp $RCL/sampleconf/recoll.qss $DESTDIR/Share/examples chkcp $RCL/sampleconf/recoll-dark.qss $DESTDIR/Share/examples chkcp $RCL/sampleconf/recoll-dark.css $DESTDIR/Share/examples @@ -349,7 +351,7 @@ test "$VERSION" = "$CFVERS" || echo Packaging version $CFVERS -for d in doc examples filters images translations; do +for d in doc examples examples/windows filters images translations; do test -d $DESTDIR/Share/$d || mkdir -p $DESTDIR/Share/$d || \ fatal mkdir $d failed done