It is currently called on hundreds of files: settings, layouts, icons, cached
graphics files (incl. graphics from files that are not opened on startup).
According to callgrind, fixing the FIXME comments could speed up startup by more
than 30%.
A static local variable is guaranteed to be initialized only once, and in time.
Lambda expressions can be used to perform complex initialization of those static
variables on the spot.
(starting from: gcc >= 4.8, msvc >= 2015)
for possible thread conflicts, of the sort Georg resolved at
6a30211f. I have made static variables const where possible,
and marked cases that looked potentially problematic with the
comment:
// FIXME THREAD
Many of these definitely are vulnerable to concurrent access, such
as the static variables declared at the start of output_latex.cpp.
Suppose, e.g., we were outputting latex and also displaying the
source of a different document.
I'd appreciate it if others could grep for "FIXME THREAD" and see
if some of these are harmless, or what.
each failure.
There are several places I was not sure what to do. These are marked
by comments beginning "LASSERT:" so they can be found easily. At the
moment, they are at:
Author.cpp:105: // LASSERT: What should we do here?
Author.cpp:121: // LASSERT: What should we do here?
Buffer.cpp:4525: // LASSERT: Is it safe to continue here, or should we just return?
Cursor.cpp:345: // LASSERT: Is it safe to continue here, or should we return?
Cursor.cpp:403: // LASSERT: Is it safe to continue here, or should we return?
Cursor.cpp:1143: // LASSERT: There have been several bugs around this code, that seem
CursorSlice.cpp:83: // LASSERT: This should only ever be called from an InsetMath.
CursorSlice.cpp:92: // LASSERT: This should only ever be called from an InsetMath.
LayoutFile.cpp:303: // LASSERT: Why would this fail?
Text.cpp:995: // LASSERT: Is it safe to continue here?
Previously, the format used for included pdf files was the same as for
document export via ps2pdf. This caused unwanted conversion routes, e.g.
export via odt->pdf instead of dvi->ps->pdf.
I renamed the format for included graphics and not for exported documents,
since otherwise the command line syntax for export would change. This would
require more adaptions for the users, since with the chosen solution the
custom converters are almost always changed correctly in prefs2prefs(),
so that only custom external templates need manual adjustement.
A problem occurs when we write the ConverterCache index file. This action is instantiated in the destructor of the 'static ConverterCache' object. The use of QFileInfo at that point leads to a crash.
It is maybe not a good idea at all to put part of the functionality in a destructor, especially not when we do not delete the object ourselves and when this functionality uses external libraries etc.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29602 a592a061-630c-0410-9148-cb99ea01b6c8
the deleted functions was never actually used, and it hasn't been for a very
long time. So the comment about the "other version" of Mover::copy() was way
out of date.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26683 a592a061-630c-0410-9148-cb99ea01b6c8
Now support/* should have no dependencies on src/* anymore.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21851 a592a061-630c-0410-9148-cb99ea01b6c8
- Modifier on return type ignored
- Ambigous else
- Ambigous logical operators
- Semi-colon instead of empty block
- Missing header files
- Missing using std::XX
- Initialization out of order
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20304 a592a061-630c-0410-9148-cb99ea01b6c8
Delete cached conversions if the converter changes.
* src/frontends/qt4/QPrefs.cpp
(PrefConverters::update_converter): delete cached files since the
new converter might create different ones
(PrefConverters::remove_converter): ditto
* src/support/convert.cpp
(unsigned long convert<unsigned long>): New template specialization
* src/ConverterCache.h
(ConverterCache::remove_all): New method, removes all cached
conversions of a particular converter
* src/ConverterCache.cpp
(CacheType): Also store source file format
(ConverterCache::Impl::readIndex): Handle files with spaces correctly
(ConverterCache::Impl::writeIndex): ditto
(various): adapt to changed CacheType
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18378 a592a061-630c-0410-9148-cb99ea01b6c8
(ConverterCache::Impl::readIndex): prevent assertion in
fs::last_write_time for corrupted cache index
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18341 a592a061-630c-0410-9148-cb99ea01b6c8