mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Picture handling: cleaning up the mess
We had pointers to data structures on the stack which we frequently reallocated. These data structure contain basically a filename and an offset. We then create a hash of the pointers to those datastructures with the filename being the key. And then we passed those pointers around through a Qt model(!!!) only in order to then later look up by filename what the offset might be. I am at a loss for words for the lunacy behind this design. How about we just remember the offsets and pass the integers around? Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
3adbff2320
commit
4583cd8e09
5 changed files with 10 additions and 11 deletions
|
|
@ -5,10 +5,9 @@
|
|||
#include <QListView>
|
||||
#include <QThread>
|
||||
|
||||
struct picture;
|
||||
struct PhotoHelper {
|
||||
QImage image;
|
||||
struct picture *picture;
|
||||
int offsetSeconds;
|
||||
};
|
||||
|
||||
class DivePictureModel : public QAbstractTableModel {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue