Commit Graph

67 Commits

Author SHA1 Message Date
Andrew Burks
bad2989b7b #25474 Added read-only warnings when saving documents (#25532)
* #25474 Added read-only warnings when saving documents

Block saving a file and notify user if windows is unable to save to the file for any reason, or the read-only attribute is checked. Also check std::filesystem::perms for write permission and other checks in FileInfo::isWritable(), although it doesn't seem to matter on windows.

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2025-11-23 05:09:32 +00:00
pre-commit-ci[bot]
25c3ba7338 All: Reformat according to new standard 2025-11-11 13:49:01 +01:00
PhoneDroid
2a56489feb [ Base ]: Updated SPDX 2025-10-14 10:00:04 -05:00
Chris Hennes
465bd7ef5c Base: Refine directory permissions test 2025-09-21 13:16:35 -05:00
Markus Reitböck
f0eca551b3 Base: use CMake to generate precompiled headers on all platforms
"Professional CMake" book suggest the following:

"Targets should build successfully with or without compiler support for precompiled headers. It
should be considered an optimization, not a requirement. In particular, do not explicitly include a
precompile header (e.g. stdafx.h) in the source code, let CMake force-include an automatically
generated precompile header on the compiler command line instead. This is more portable across
the major compilers and is likely to be easier to maintain. It will also avoid warnings being
generated from certain code checking tools like iwyu (include what you use)."

Therefore, removed the "#include <PreCompiled.h>" from sources, also
there is no need for the "#ifdef _PreComp_" anymore
2025-09-14 09:47:01 +02:00
wmayer
12acd1da6c Base: Modernize FileInfo 2025-08-22 15:20:25 +02:00
Benjamin Nauck
ae686942a7 Base: Use std::numeric_limits and std::numbers instead of defines 2025-03-29 13:32:37 +01:00
bofdahof
77689e3bb1 Base: apply std::ranges 2025-03-16 17:14:51 -05:00
Kacper Donat
12a69fe296 Base: Add isNullOrEmpty string helper
This adds isNullOrEmpty string helper that cheks if string is... well
null or empty. It is done to improve readability of the code and better
express intent.
2025-02-21 15:04:43 +01:00
Benjamin Bræstrup Sayoc
dda05369c4 Base: remove unneeded includes 2025-02-18 11:07:57 -06:00
tritao
e94d1cf872 Base: Remove Boost-based filesystem and switch to standard <filesystem> 2025-02-10 10:48:54 -06:00
pre-commit-ci[bot]
9caa6d2c7b [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2024-12-09 17:29:33 -05:00
ii8
19dae94f01 Base: fix build on musl libc 2024-05-30 08:49:25 +02:00
wmayer
1775991b50 Base: Implement FileInfo::size() 2024-03-11 16:05:30 +01:00
wmayer
08b10cd287 fix cppcoreguidelines-*
* cppcoreguidelines-init-variables
* cppcoreguidelines-c-copy-assignment-signature
* cppcoreguidelines-macro-usage
* cppcoreguidelines-non-private-member-variables-in-classes
* cppcoreguidelines-pro-type-member-init
* cppcoreguidelines-slicing
* cppcoreguidelines-special-member-functions
* cppcoreguidelines-virtual-class-destructor
2023-11-16 01:22:09 +01:00
wmayer
39337ea12e fix bugprone-*
* bugprone-throw-keyword-missing
* bugprone-unhandled-self-assignment
* bugprone-suspicious-string-compare
* bugprone-reserved-identifier
* bugprone-narrowing-conversions
* bugprone-macro-parentheses
* bugprone-implicit-widening-of-multiplication-result
* bugprone-exception-escape
* bugprone-copy-constructor-init
2023-11-16 01:22:09 +01:00
wmayer
f539138dd9 fix readability-*:
* readability-const-return-type
* readability-container-data-pointer
* readability-container-size-empty
* readability-delete-null-pointer
* readability-else-after-return
* readability-inconsistent-declaration-parameter-name
* readability-redundant-member-init
* readability-redundant-smartptr-get
* readability-redundant-string-cstr
* readability-use-anyofallof
* readability-static-definition-in-anonymous-namespace
* readability-static-accessed-through-instance
* readability-simplify-boolean-expr
2023-11-16 01:22:08 +01:00
wmayer
73a1e90e45 fix readability-identifier-length 2023-11-16 01:22:08 +01:00
wmayer
e85c383bff Base: apply clang format 2023-11-13 12:01:26 -05:00
wmayer
010dca8303 Base: C++ core guidelines: init variables 2023-08-24 18:48:52 +02:00
wmayer
2bc90e6090 Base: modernize C++: return braced init list 2023-08-18 00:36:24 +02:00
wmayer
367cdb36ed Base: modernize C++: use range-based for loop 2023-08-14 14:09:29 +02:00
Benjamin Bræstrup Sayoc
33384cff9c [Everywhere] FileInfo::hasExtension for multiple values (#9774)
* [Base] Add hasExtension for multiple values

* [Gui] Use hasExtension for multiple values

* [Drawing] Use hasExtension for multiple values

* [Fem] Use hasExtension for multiple values

* [Import] Use hasExtension for multiple values

* [Mesh] Use hasExtension for multiple values

* [Part] Use hasExtension for multiple values

* [TechDraw] Use hasExtension for multiple values
2023-08-07 09:55:19 -06:00
0penBrain
566ae39519 [Bugfix]Base: fix implementation of isFile() so it is safe to use
Current implementation can freeze the app if called on specific files
2023-07-23 17:19:31 +00:00
Uwe
67c75dad2f [FEM] Elmer: add missing deformation info
- also some formatting changes done by clang
2023-03-26 09:32:56 +02:00
Uwe
53571f7196 [Base] remove superfluous nullptr checks 2022-07-18 03:16:22 +02:00
Uwe
6b09da9ab6 [Base] remove unnecessary Boolean comparisons 2022-06-19 15:17:50 +02:00
wmayer
741fdc53c7 Base: unset flag to skip leading whitespaces when copying a file 2022-06-13 08:43:58 +02:00
wmayer
fc7f3f4e3d Base: avoid const_cast in FileInfo 2022-06-04 13:13:36 +02:00
wmayer
79f8798011 Base: fixes #6802: Raise an exception when using FileInfo::toStdWString() for other platforms than Windows 2022-05-09 14:21:10 +02:00
Zheng, Lei
3ef438eaf0 Fix mixed line endings 2022-04-26 12:52:55 -05:00
Chris Hennes
3b42d4afac Base: PR6497 move return statement to new line 2022-03-29 12:34:34 -05:00
Uwe
c1ba1545a7 [Base] a compile for for MSVC 2022-03-19 15:02:19 +01:00
wmayer
a817a68c17 Base: add method FileInfo::createDirectories() to also create parent directories of a given path 2022-03-19 13:56:06 +01:00
wmayer
e4435cdcba Base/App: fix warnings from code analysers:
* convert old-style-casts to explicit C++ casts where possible
* make some implicit conversions explicit
2022-03-06 23:49:30 +01:00
wmayer
f24fe8157a Base: [skip ci] fix build failure with MSYS/clang 2022-02-26 11:16:57 +01:00
Uwe
89b37a5110 [Base] Exception and FileInfo: remove unused includes 2022-02-23 19:13:13 +01:00
wmayer
4d87039635 Base: modernize C++11
* remove redundant void-arg
* use nullptr
* replace deprecated headers
2022-01-25 20:21:30 +01:00
luz paz
d5f6c096b8 Base: Fix header uniformity, whitespace, and doxygen
[skip ci]
2020-11-22 18:12:16 +01:00
wmayer
410e65ce2f Coverity: Suppress false-positives 2020-07-20 17:34:28 +02:00
plgarcia
d222f7b55f Change backup policy
1 - Reports the error to the user in a popup.
2 - Names of the backups include the timstamp instead of a number. Names have more sense and the files can be sorted by names what is also the age order.
3 - Behaviors when changing configuration improved, the number of files present on the system was not reduced when reducing the number of backups or backups deactivated.
2020-02-24 23:06:26 +01:00
luz.paz
6f11ed298a src/Base: [skip ci] fix header uniformity
This PR fixes header uniformity across all `src/Base` files
2019-12-25 11:38:58 +01:00
asapelkin
e951094af9 use emplace_back instead of push_back where justified 2019-11-21 14:48:09 +01:00
Zheng, Lei
aa7d780f5d Base::FileInfo: fix left overs in transient directory
Setting ReadWrite permssion removes executable permission, causing
error when removing directory on Linux.
2019-08-17 14:52:08 +02:00
luz.paz
505488c4f9 Misc. typos
Found via `codespell`
2018-04-25 09:41:33 -03:00
wmayer
16e6d887e7 implement FileInfo::completeExtension 2017-10-24 19:38:01 +02:00
wmayer
5f12a043fa fix several gcc warnings 2016-11-08 14:31:08 +01:00
wmayer
848a685c53 fx wrong cast 2016-09-03 14:58:03 +02:00
wmayer
3c88edd007 fix Coverity issues 2016-09-03 14:51:28 +02:00
wmayer
d7d347b2d6 + if getcwd fails then use '.' 2016-05-11 09:24:29 +02:00