summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthias Melcher <github@matthiasm.com>2023-10-21 18:41:51 +0200
committerMatthias Melcher <github@matthiasm.com>2023-10-21 18:41:57 +0200
commitbbf0ea664dbc9d0b6faa29e3b9752fec6a094bba (patch)
tree4f7fa2f2f80ac75416e920420b313dbdc9e6841c /src
parent0c35212467f3b0d1aa632a1febb06c09f4b170f1 (diff)
Removes dependency on Fl_Preferences::get/set(.., Fl_String, ...)
Diffstat (limited to 'src')
-rw-r--r--src/Fl_Preferences.cxx88
1 files changed, 51 insertions, 37 deletions
diff --git a/src/Fl_Preferences.cxx b/src/Fl_Preferences.cxx
index 69a47089e..cca5e05cf 100644
--- a/src/Fl_Preferences.cxx
+++ b/src/Fl_Preferences.cxx
@@ -845,32 +845,46 @@ char Fl_Preferences::get( const char *key, char *&text, const char *defaultValue
return ( v != defaultValue );
}
-/**
- Reads an entry from the group. A default value must be
- supplied. The return value indicates if the value was available
- (non-zero) or the default was used (0).
+///**
+// Reads an entry from the group. A default value must be
+// supplied. The return value indicates if the value was available
+// (non-zero) or the default was used (0).
+//
+// \param[in] key name of entry
+// \param[out] value returned from preferences or default value if none was set
+// \param[in] defaultValue default value to be used if no preference was set
+// \return 0 if the default value was used
+// */
+//char Fl_Preferences::get( const char *key, Fl_String &value, const Fl_String &defaultValue ) {
+// const char *v = node->get( key );
+// if (v) {
+// if ( strchr( v, '\\' ) ) {
+// char *text = decodeText( v );
+// value = text;
+// ::free(text);
+// } else {
+// value = v;
+// }
+// return 1;
+// } else {
+// value = defaultValue;
+// return 0;
+// }
+//}
+
+///**
+// Sets an entry (name/value pair). The return value indicates if there
+// was a problem storing the data in memory. However it does not
+// reflect if the value was actually stored in the preference file.
+//
+// \param[in] entry name of entry
+// \param[in] value set this entry to value (stops at the first nul character).
+// \return 0 if setting the value failed
+// */
+//char Fl_Preferences::set( const char *entry, const Fl_String &value ) {
+// return set(entry, value.c_str());
+//}
- \param[in] key name of entry
- \param[out] value returned from preferences or default value if none was set
- \param[in] defaultValue default value to be used if no preference was set
- \return 0 if the default value was used
- */
-char Fl_Preferences::get( const char *key, Fl_String &value, const Fl_String &defaultValue ) {
- const char *v = node->get( key );
- if (v) {
- if ( strchr( v, '\\' ) ) {
- char *text = decodeText( v );
- value = text;
- ::free(text);
- } else {
- value = v;
- }
- return 1;
- } else {
- value = defaultValue;
- return 0;
- }
-}
/**
Sets an entry (name/value pair). The return value indicates if there
@@ -1042,18 +1056,18 @@ char Fl_Preferences::set( const char *key, const void *data, int dsize ) {
return 1;
}
-/**
- Sets an entry (name/value pair). The return value indicates if there
- was a problem storing the data in memory. However it does not
- reflect if the value was actually stored in the preference file.
-
- \param[in] entry name of entry
- \param[in] value set this entry to value (stops at the first nul character).
- \return 0 if setting the value failed
- */
-char Fl_Preferences::set( const char *entry, const Fl_String &value ) {
- return set(entry, value.c_str());
-}
+///**
+// Sets an entry (name/value pair). The return value indicates if there
+// was a problem storing the data in memory. However it does not
+// reflect if the value was actually stored in the preference file.
+//
+// \param[in] entry name of entry
+// \param[in] value set this entry to value (stops at the first nul character).
+// \return 0 if setting the value failed
+// */
+//char Fl_Preferences::set( const char *entry, const Fl_String &value ) {
+// return set(entry, value.c_str());
+//}
/**