From ce236c5fc0a7877bb59eeac18c1c3980d2c7bf2c Mon Sep 17 00:00:00 2001 From: dockes Date: Thu, 9 Nov 2006 19:04:28 +0000 Subject: [PATCH] better handle the situation of mbox file name matching search --- src/qtgui/preview_w.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/qtgui/preview_w.cpp b/src/qtgui/preview_w.cpp index d2b2f9b8..2e2b2d27 100644 --- a/src/qtgui/preview_w.cpp +++ b/src/qtgui/preview_w.cpp @@ -1,5 +1,5 @@ #ifndef lint -static char rcsid[] = "@(#$Id: preview_w.cpp,v 1.4 2006-09-23 07:39:55 dockes Exp $ (C) 2005 J.F.Dockes"; +static char rcsid[] = "@(#$Id: preview_w.cpp,v 1.5 2006-11-09 19:04:28 dockes Exp $ (C) 2005 J.F.Dockes"; #endif /* * This program is free software; you can redistribute it and/or modify @@ -427,10 +427,17 @@ class LoadThread : public QThread { } FileInterner interner(filename, rclconfig, tmpdir, mtype); try { - if (interner.internfile(*out, ipath) != FileInterner::FIDone) { - *statusp = -1; - } else { + FileInterner::Status ret = interner.internfile(*out, ipath); + if (ret == FileInterner::FIDone || ret == FileInterner::FIAgain) { + // FIAgain is actually not nice here. It means that the record + // for the *file* of a multidoc was selected. Actually this + // shouldn't have had a preview link at all, but we don't know + // how to handle it now. Better to show the first doc than + // a mysterious error. Happens when the file name matches a + // a search term of course. *statusp = 0; + } else { + *statusp = -1; } } catch (CancelExcept) { *statusp = -1;