]> git.lyx.org Git - features.git/commitdiff
Could not convert file: don't warn me to death
authorPeter Kümmel <syntheticpp@gmx.net>
Sat, 13 Dec 2008 15:11:34 +0000 (15:11 +0000)
committerPeter Kümmel <syntheticpp@gmx.net>
Sat, 13 Dec 2008 15:11:34 +0000 (15:11 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27869 a592a061-630c-0410-9148-cb99ea01b6c8

src/Converter.cpp

index ab7e51f912e2c7fbe782207a52a8404dce1fe609..b9c31bd00e5ed4ac0f62a2fd7b87b2280939dd76 100644 (file)
@@ -302,6 +302,14 @@ bool Converters::convert(Buffer const * buffer,
                                return true;
                        }
                }
+
+               // only warn once per session and per file type
+               static std::map<string, string> warned;
+               if (warned.find(from_format) != warned.end() && warned.find(from_format)->second == to_format) {
+                       return false;
+               }
+               warned.insert(make_pair(from_format, to_format));
+
                Alert::error(_("Cannot convert file"),
                             bformat(_("No information for converting %1$s "
                                                    "format files to %2$s.\n"