ApplicationProperties, singleton


Because of some JUCE updates, I cannot set my storage parameters the way I used to in some old projects. Whereas I was using:

[i]PropertiesFile::Options myOption;
myOption.applicationName = JucePlugin_Desc;
myOption.filenameSuffix = “settings”;
myOption.folderName = “Library/Preferences/grmPref”;
myOption.osxLibrarySubFolder = “Library/Preferences”;
myOption.commonToAllUsers = true;
myOption.ignoreCaseOfKeyNames = true;
myOption.millisecondsBeforeSaving = 10;
myOption.storageFormat = PropertiesFile::storeAsXML;

    ApplicationProperties::getInstance()->setStorageParameters (myOption);[/i]

Now I get “No member named ‘getInstance’ in ‘juce::ApplicationProperties’”.

Could someone please explain what I should do?

Thank you

It has changed and is no longer a singleton:


Yeah I’ve seen this but I don’t get what JULES mean by “use your own singleton to hold an ApplicationProperties object”

You can just inherit ApplicationProperties and then add juce_DeclareSingleton.

Thank you!

Do you know why I get “No matching constructor for initialization of ‘StandaloneFilterWindow’” when I use juce_DeclareSingleton(StandaloneFilterWindow, false) in my class (class StandaloneFilterWindow : public ApplicationProperties) ?

Maybe you didn’t added “public:” where you should have or maybe you declared none-empty constructor without explicitly adding also an empty constructor.

Remember guys, singletons should only be used as a last resort. If you can find any other possible way of handling ownership of that object, then you should do so.