Bug fix: Collections and unmounted drives
authorColin Clark <colin.clark@cclark.uk>
Tue, 9 Apr 2024 09:48:01 +0000 (10:48 +0100)
committerColin Clark <colin.clark@cclark.uk>
Tue, 9 Apr 2024 09:48:01 +0000 (10:48 +0100)
commitcf67a444c22d11074c15db77909f5e9145561ace
treef74ec3364ae776975d8f54b61b003e593ccc7506
parent43f2b53ba8d01648f55a44d807a9125607c916fa
Bug fix: Collections and unmounted drives

The bug:
If a collection file is on the local filesystem
The collection file contains references to files on a mounted drive
The drive is unmounted
The collection file is opened

Geeqie sees that the files do not exist and deletes them from the
collection file.

The fix:
If Geeqie does not find the file-

If the file path prefix contains /home, /tmp or /usr it is assumed that
the file was on the local drive and has been deleted by the user. It is
ignored.

If the file path prefix contains a mount path, it is assumed that the
file was on a currently mounted drive and has been deleted.

Otherwise it is assumed that the file is on a removable drive that is
not currently mounted. The collection will not be opened.

If this is not the case the user may need to use a text editor to remove
the offending line from the collection file.

Created problem:
When a collection window contents have not been changed, but its
geometry has, the geometry changes will not be saved. The user must make
a minor positional change to any thumbnail to trigger a save.
src/collect-io.cc
src/collect-table.cc