Commit Graph

2066 Commits

Author SHA1 Message Date
Richard Kimberly Heck
bd0bf2125c Fix nullptr warnings 2020-03-01 15:31:58 -05:00
Richard Kimberly Heck
99bf96c56b Fix warnings in support/. 2020-02-29 00:06:35 -05:00
Richard Kimberly Heck
4460df3292 Fix header. 2020-02-29 00:06:35 -05:00
Richard Kimberly Heck
56a5a8280e Null pointers. 2020-02-29 00:06:35 -05:00
Enrico Forestieri
5873a382de Fix FileName::realPath() on Windows
The realPath() implementation on Windows works only for files and
not for directories. By using an API available starting from Vista
it is possible to fix it in a simple way.

I also took into account using the Qt QFileInfo::canonicalFilePath(),
but it turns out to not work when a path component is a junction
(tested with Qt 5.14.1).

Due to this, it is not possible compiling or using LyX on Windows
versions earlier than Vista.
2020-02-23 22:59:03 +01:00
Pavel Sanda
4e4bba441d gcc 4.7 leftover 2020-02-20 09:25:00 +01:00
Juergen Spitzmueller
4debbdd6b6 Restore custom tmp directory
Fixes #1174
2020-02-17 09:00:08 +01:00
Juergen Spitzmueller
e31364fdcb whitespace 2020-02-15 09:26:43 +01:00
Juergen Spitzmueller
195393f401 Fix Python detection on windows
Patch by Eugene Chornyi
2020-02-15 09:26:08 +01:00
Richard Kimberly Heck
b175f5a315 Fix bug #11737.
We need to use the FileName methods when moving or removing a file,
so that refresh() gets called.

(cherry picked from commit d930913898)
2020-02-13 00:11:23 -05:00
Juergen Spitzmueller
40b1a6f9b1 Revert "Fix bug #11712."
This breaks on Linux

This reverts commit fdf81a9bab.
2020-02-12 16:11:01 +01:00
Richard Kimberly Heck
fdf81a9bab Fix bug #11712.
Fixes some escaping issues on Windows especially

Patch from Eugene.
2020-02-12 09:25:13 -05:00
Stephan Witt
a50e07db46 update canAutoOpenFile/autoOpenFile implementation to new MacOSX API, avoid deprecated calls 2020-02-06 21:52:46 +01:00
Richard Kimberly Heck
5188f0fcff Don't need to remove the file if it doesn't exist. (This would cause a five second delay in that case.) 2020-02-03 11:37:12 -05:00
Jean-Marc Lasgouttes
4f4d52e8c0 Fix warning with --disable-nls 2020-01-27 15:34:27 +01:00
Jean-Marc Lasgouttes
09130d7a62 Update to boost 1.72
This requires to add a assertion_failed_msg handler. Take this
occasion to cleanup and uniformize the various boost.cpp files that we
have.

This adds 50k line of whatever to the source code.
2020-01-07 16:27:23 +01:00
Jean-Marc Lasgouttes
68c88bc427 Use unsigned values for enum
Otherwise 1 << 31 overflows.

Spotted by cppcheck.
2019-10-27 00:05:41 +02:00
Jean-Marc Lasgouttes
a7c6940f14 Get rid of useless affectation
Spotted by cppcheck.
2019-09-16 00:03:56 +02:00
Jean-Marc Lasgouttes
c6d8592ffb Mark constructors with only one parameter as explicit
Spotted by cppcheck
2019-09-16 00:01:48 +02:00
Jean-Marc Lasgouttes
17c827d177 Various fixes suggested by cppcheck
Rename local variables the hide other ones: get_binary_path, find_python_binary

Use unsigned int for conversion from hex using sscanf().

FileName::checksum(), parsecmd (SystemCall): use explcit values rather
than variable which value is known.
2019-09-13 22:37:16 +02:00
Jean-Marc Lasgouttes
714113655a Follow some of the performance advice from cppcheck
Most of that is changing string to string const &.
2019-09-13 16:23:49 +02:00
Patrick de Visschere
b70c3796a1 #6961 correct the big-endian conversion of UInt32
This is a patch from Patrick de Visschere. Thanks.
2019-09-08 11:11:17 +02:00
Jean-Marc Lasgouttes
5e33e4fc2c Catch improbable exception
We know that the exception is correct, but coverity does not.
It would be much better to check that at compile time...
2019-07-13 00:24:21 +02:00
Juergen Spitzmueller
623f7b4795 Truncate long citation label in the middle rather than the end.
Fixes: #10769
2019-07-09 14:48:11 +02:00
Richard Kimberly Heck
d96a9aa37f Fix bug #10091.
See the discussion. The decision was just to keep re-trying for a
bit, since the lock preventing us from removing the old file seems
to clear after a bit.
2019-07-07 13:13:52 -04:00
Jean-Marc Lasgouttes
e485102ef2 For python 3 require at least 3.5
This handles configure.ac and os::python23. What remains to be done is cmake.
2019-06-28 00:06:28 +02:00
Jean-Marc Lasgouttes
938463b5d6 Fixup 3dc54d4a: fix string encoding issues with Qt4
The culprit here is the constructor QString(QByteArray const &): in
Qt4, it would interpret the byte array as latin1, and in Qt5 as utf8.

Therefore it is safer to use explicitly QString::fromUtf8 instead of
this constructor.

Several places where additionally simplified, in order to avoid some
extra conversions.
2019-06-20 11:27:15 +02:00
Jean-Marc Lasgouttes
5249eaaa60 Use <cstdint> instead of <boost/cstdint.hpp>
This is mandated by C++11.
2019-06-17 16:19:31 +02:00
Jean-Marc Lasgouttes
fbe0caa483 Do not use BOOST_CURRENT_FUNCTION
There is no need to use that, since __func__ is standard in C++11.

Anyway, this code is unused unless one defines USE__func__ to something.
2019-06-17 15:57:03 +02:00
Jean-Marc Lasgouttes
22f599250e Remove support for gcc 4.6
This was kept so long because of Ubuntu 12.04 LTS, but having a
not-really-c++11 compiler is not nice.
2019-06-12 15:03:18 +02:00
José Matos
ad96fd835b Divide the python detection in three functions, with a clear delegation of responsibilities
python23_call: determines if the binary given is appropriate and adds the necessary calling options

find_python_binary: get a list of candidates and choose the right one using python23_call

python: returns the name of the python interpreter that can be found on PATH, using find_python_binary
2019-06-08 12:49:30 +01:00
José Matos
02ee471d9d Move python related functions together to make it easy to read the code. 2019-06-08 12:22:26 +01:00
José Matos
35c299f86d Remove alternative operator representations (and,or) and improve comments for python binary detection. 2019-06-08 09:15:03 +01:00
José Matos
adb779a692 Change python run time detection to privilege python 3 over python 2.
This should work as before but now we also control the python version and ignore it if it is not in the supported range.
2019-06-07 15:27:25 +01:00
Enrico Forestieri
d5567ac36f Compile fix for mingw
This was probably overlooked at [7bb08f10/lyxgit].
2019-04-27 12:53:05 +02:00
Jean-Marc Lasgouttes
26817e9347 remove dummy LyXRC class that was forgotten 2019-04-24 14:54:49 +02:00
Kornel Benko
ef285cb7c4 Amend 7d021a93: Use interprocedural optimization if possible
Discard test programs using dummy_fuctions from the optimization.
This omits warnings about multiple method definitions.
2019-04-24 14:47:44 +02:00
Jean-Marc Lasgouttes
7bb08f10b1 Move initial values of LyXRC members to the header
We use a C++11 construct that puts initial values of members along
with their definition. It is a good construct and now the out of line
constructor and the setDefaults() method can go.

This removes the need to define a dummy constructor in tex2lyx and
client.

The only needed change to the rest of code is a change of signature
for the user_(name|email) to return std::string. They are now called
explicitely from the constructor. We now have to include userinfo.h in
LyXRC.h, but this should not be too expensive.
2019-04-19 14:46:12 +02:00
Juergen Spitzmueller
414db90a5c Indentation 2019-03-25 16:46:03 +01:00
Juergen Spitzmueller
3dc54d4aac Display URL-encoded chars decoded in display path 2019-03-23 15:15:08 +01:00
Jean-Marc Lasgouttes
601244ba92 Use HAVE_LONG_LONG_INT instead of LYX_USE_LONG_LONG
It seems that the extra complication hurts more than it helps (for
example with OpenBSD).

Some adaptation will be needed for cmake.
2019-03-21 14:18:17 +01:00
Günter Milde
dae90c6161 Warn user, if input encodings of master and child document differ. 2019-03-18 18:17:39 +01:00
Jean-Marc Lasgouttes
bdf3924fc7 Update poor man's profiler to use C++11 std::chrono
This is more portable, and the old code prevented in windows to use
instrument several classes at the same time (several .obj files,
actually).

No new feature here, bu the code is nicely slower. It might be less
efficient, I am not really at ease with how std::chrono works.
2019-03-17 14:01:02 +01:00
Jean-Marc Lasgouttes
e203bf519b Fix algorithm for finding localized files
Now we search in priority with the GUI language, and then the
language(s) specified in the LANGUAGES environment variable.
Preoviously, the GUI language would only be considered when
LANGUAGES was not set (which was a bug).

Take this opportunity to remove old compatibility code from 2007.
2019-02-06 15:53:47 +01:00
Enrico Forestieri
ad0c9a548b Remove PYTHONPATH from the environment on Windows
This make sure to use the the modules distributed with LyX,
avoiding reconfigure failures.
2019-01-12 18:37:41 +01:00
Enrico Forestieri
69726b832b Fix bug #4269
Call gunzip with quoted filenames as they may contain spaces or
other special characters.
2018-12-29 20:11:56 +01:00
Pavel Sanda
9547e0b765 typo 2018-12-08 00:04:04 +01:00
Pavel Sanda
04fe818b22 Keep permissions of the saved files intact.
Previously the permission were destroyed by the newly created
temporary file -- which is later used as new saved file.
Tested on symlinks as well but only on Linux.
2018-12-07 23:10:46 +01:00
Guillaume MM
131f4b92ba Fix segfault after deleting monitor
The boost signal was sent synchronously, and so made the Qt signal to be posted
in FileMonitor::changed after the boost signal returned, so after the sender was
possibly destroyed.

The solution is to make the boost signal asynchronous using the Qt event loop.

Thanks to Scott Kostyshak for the report and MWE.
2018-12-04 00:05:01 -05:00
Jean-Marc Lasgouttes
76e99e9a20 Remove old workaround that is not needed anymore
This causes a compilation error with boost 1.69.

Fixes bug #11349.
2018-11-04 08:23:49 +00:00