Make FileLayout_XXX elements of an enum

Slight improvement to the previous commit: make FileLayout_Classic and
FileLayout_XDG elements of an enum instead of using an untyped "int" for them
which didn't really make any sense because these values are not bit masks but
exclusive choices for the layout.

Also rewrite the checks for them to use "switch" instead of "if" to be warned
by the compiler if we ever add another enum value but forget to update the
code to handle it.

Finally, improve the documentation (add missing "@since") and comments.
This commit is contained in:
Vadim Zeitlin
2017-03-09 17:23:20 +01:00
parent d56d127d3f
commit 4bf6ae8d7c
4 changed files with 160 additions and 95 deletions

View File

@@ -97,6 +97,8 @@ wxStandardPathsBase::wxStandardPathsBase()
// Derived classes can call this in their constructors
// to set the platform-specific settings
UseAppInfo(AppInfo_AppName);
// Default for compatibility with the existing config files.
SetFileLayout(FileLayout_Classic);
}