use a static initialization of the list of lensfun cameras and lenses

This commit is contained in:
Alberto Griggio
2017-09-10 00:49:06 +02:00
parent 07dfda5d73
commit 376cb09f06
2 changed files with 105 additions and 80 deletions

View File

@@ -51,32 +51,39 @@ protected:
MyComboBox *lensfunCameras;
MyComboBox *lensfunLenses;
class LFModelCam: public Gtk::TreeModel::ColumnRecord {
class LFDbHelper {
public:
LFModelCam() { add(make); add(model); }
Gtk::TreeModelColumn<Glib::ustring> make;
Gtk::TreeModelColumn<Glib::ustring> model;
};
class LFModelCam: public Gtk::TreeModel::ColumnRecord {
public:
LFModelCam() { add(make); add(model); }
Gtk::TreeModelColumn<Glib::ustring> make;
Gtk::TreeModelColumn<Glib::ustring> model;
};
class LFModelLens: public Gtk::TreeModel::ColumnRecord {
public:
LFModelLens() { add(lens); }
Gtk::TreeModelColumn<Glib::ustring> lens;
};
class LFModelLens: public Gtk::TreeModel::ColumnRecord {
public:
LFModelLens() { add(lens); add(prettylens); }
Gtk::TreeModelColumn<Glib::ustring> lens;
Gtk::TreeModelColumn<Glib::ustring> prettylens;
};
LFModelCam lensfunModelCam;
LFModelLens lensfunModelLens;
LFModelCam lensfunModelCam;
LFModelLens lensfunModelLens;
Glib::RefPtr<Gtk::TreeStore> lensfunCameraModel;
Glib::RefPtr<Gtk::TreeStore> lensfunLensModel;
Glib::RefPtr<Gtk::TreeStore> lensfunCameraModel;
Glib::RefPtr<Gtk::TreeStore> lensfunLensModel;
LFDbHelper();
void fillLensfunCameras();
void fillLensfunLenses();
};
static LFDbHelper *lf;
bool useLensfunChanged;
bool lensfunAutoChanged;
bool lensfunCameraChanged;
bool lensfunLensChanged;
void fillLensfunCameras();
void fillLensfunLenses();
bool setLensfunCamera(const Glib::ustring &make, const Glib::ustring &model);
bool setLensfunLens(const Glib::ustring &lens);
bool checkLensfunCanCorrect(bool automatch);