aboutsummaryrefslogtreecommitdiff
path: root/src/core/loader/loader.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2018-08-06 14:12:57 -0400
committerLioncash <mathew1800@gmail.com>2018-08-06 14:17:13 -0400
commit0c6d371dd058abf9cbf05cca93e4c05011ad2172 (patch)
tree19a37e3239029a34164807362d16714edad34b0e /src/core/loader/loader.cpp
parentbca27da66bcaaf2d43a39e762afe34419ef73d7f (diff)
qt/main: Better file-existence checking within OnMenuRecentFile() and UpdateUITheme()
In OnMenuRecentFile() we don't need to construct a QFileInfo instance just to check if a file exists, we can just use the static member function to do that (which Qt's documentation also notes as quicker than constructing an instance). In UpdateUITheme(), we just want to try and open the file and check the success of that operation. Technically speaking, between the existence check and the open call, the file can be deleted or moved, but still appear to succeed in code. i.e. 1. Existence check -> Returns true 2. File is moved/deleted 3. Open is called, the return value of which isn't checked 4. Nonsense behavior This way we combine the existence check and the open into one.
Diffstat (limited to 'src/core/loader/loader.cpp')
0 files changed, 0 insertions, 0 deletions