Skip to content

Commit

Permalink
Compilation fix for new FLTK API break.
Browse files Browse the repository at this point in the history
  • Loading branch information
ggarra13 committed Oct 8, 2023
1 parent 5aad97f commit 8de3465
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions mrv2/lib/mrvFl/mrvPreferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ namespace fs = std::filesystem;
# include "mrvNetwork/mrvImageListener.h"
#endif

#ifndef __APPLE__
# define USE_FL_PREFERENCES_FOUR 1
#endif

#include "mrvFl/mrvPreferences.h"
#include "mrvFl/mrvHotkey.h"
#include "mrvFl/mrvLanguages.h"
Expand Down Expand Up @@ -130,8 +134,12 @@ namespace mrv

LOG_INFO(msg);

#ifdef USE_FL_PREFERENCES_FOUR
Fl_Preferences base(
prefspath().c_str(), "filmaura", "mrv2", Fl_Preferences::C_LOCALE);
#else
Fl_Preferences base(prefspath().c_str(), "filmaura", "mrv2");
#endif

base.get("version", version, 7);

Expand Down Expand Up @@ -689,9 +697,14 @@ namespace mrv
uiPrefs->uiPrefsMaxImagesApart->value(tmp);

char key[256];
#ifdef USE_FL_PREFERENCES_FOUR
Fl_Preferences path_mapping(
prefspath().c_str(), "filmaura", "mrv2.paths",
Fl_Preferences::C_LOCALE);
#else
Fl_Preferences path_mapping(
prefspath().c_str(), "filmaura", "mrv2.paths");
#endif
num = path_mapping.entries();
for (int i = 0; i < num; ++i)
{
Expand Down Expand Up @@ -914,10 +927,14 @@ namespace mrv
visible = 1;
settingsObject->setValue("gui/DockGroup/Visible", visible);

#ifdef USE_FL_PREFERENCES_FOUR
Fl_Preferences base(
prefspath().c_str(), "filmaura", "mrv2",
(Fl_Preferences::Root)(
(int)Fl_Preferences::C_LOCALE | (int)Fl_Preferences::CLEAR));
#else
Fl_Preferences base(prefspath().c_str(), "filmaura", "mrv2");
#endif
base.set("version", 7);

Fl_Preferences fltk_settings(base, "settings");
Expand Down Expand Up @@ -1237,10 +1254,15 @@ namespace mrv
"max_images_apart", (int)uiPrefs->uiPrefsMaxImagesApart->value());

char key[256];
#ifdef USE_FL_PREFERENCES_FOUR
Fl_Preferences path_mapping(
prefspath().c_str(), "filmaura", "mrv2.paths",
(Fl_Preferences::Root)(
(int)Fl_Preferences::C_LOCALE | (int)Fl_Preferences::CLEAR));
#else
Fl_Preferences path_mapping(
prefspath().c_str(), "filmaura", "mrv2.paths");
#endif
path_mapping.clear();
for (int i = 2; i <= uiPrefs->PathMappings->size(); ++i)
{
Expand Down Expand Up @@ -1287,11 +1309,16 @@ namespace mrv

{

#ifdef USE_FL_PREFERENCES_FOUR
Fl_Preferences keys(
prefspath().c_str(), "filmaura", hotkeys_file.c_str(),
(Fl_Preferences::Root)(
(int)Fl_Preferences::C_LOCALE |
(int)Fl_Preferences::CLEAR));
#else
Fl_Preferences keys(
prefspath().c_str(), "filmaura", hotkeys_file.c_str());
#endif
save_hotkeys(keys);

msg = tl::string::Format(
Expand Down Expand Up @@ -1721,8 +1748,12 @@ namespace mrv
}
}

#ifdef USE_FL_PREFERENCES_FOUR
Fl_Preferences base(
prefspath().c_str(), "filmaura", "mrv2", Fl_Preferences::C_LOCALE);
#else
Fl_Preferences base(prefspath().c_str(), "filmaura", "mrv2");
#endif
Fl_Preferences gui(base, "ui");
gui.set("single_instance", uiPrefs->uiPrefsSingleInstance->value());
gui.set(
Expand Down

0 comments on commit 8de3465

Please sign in to comment.