Commit Graph

7 Commits

Author SHA1 Message Date
Seth Hillbrand 32930319ea Check for directory locking not file
When creating a new file lock, we need to check if the containing
directory can be written, not if the file (which may not yet exist) can
be written

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14942

(cherry picked from commit 6896148a10)
2023-06-21 14:53:33 +02:00
Seth Hillbrand 2e54232181 Fix LOCKFILE fallback
`throw` needs to provide an actual std::exception or it will not be
caught

(cherry picked from commit 844226e6b9)
2023-06-21 14:53:33 +02:00
Seth Hillbrand 8648017b42 Prevent ro directories from showing lockfile error
(cherry picked from commit d94fd5f979)
2023-06-21 14:53:33 +02:00
Seth Hillbrand 6fc393c7db Upgrade file locking
wxSingleInstanceChecker is meant for running programs, not file locking.
This implements an RAII class for file locking that stores the lock
files next to the file being locked, allowing it to be easily found and
removed.  Also includes the ability to override the lock, with
information about the original owner

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14734

(cherry picked from commit 122be418bb)
2023-06-18 01:06:40 +02:00
Wayne Stambaugh f06a5894b3 Header clean up round 3. 2020-12-19 18:29:10 -05:00
Wayne Stambaugh 66e97fa905 Doxygen comment improvements.
Fix lots of Doxygen warnings.

Fix Doxygen comment for IO_MGR::FootprintEnumerate() which was recently
changed.
2017-06-13 19:47:46 -04:00
John Beard 27374c0aa3 Move file locking utilities to a separate file
The global ::LockFile() function is used in a single place, but it's in
common.h, so visible to all files.

The GetKicadLockFilePath function is used in only two places, and one of
them is LockFile.

This commit puts them both in a separate header, so they're only visible
to code using them.

The implementation of GetKicadLockFilePath is moved to lockfile.cpp,
where LockFile already was.

Also removed a (large) handful of wxT macros, which aren't needed any
more and make code less readable.
2017-03-23 09:23:45 -04:00