summaryrefslogtreecommitdiff
path: root/fluid/app/Snap_Action.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'fluid/app/Snap_Action.cxx')
-rw-r--r--fluid/app/Snap_Action.cxx22
1 files changed, 12 insertions, 10 deletions
diff --git a/fluid/app/Snap_Action.cxx b/fluid/app/Snap_Action.cxx
index 51cdb9817..2e30853d4 100644
--- a/fluid/app/Snap_Action.cxx
+++ b/fluid/app/Snap_Action.cxx
@@ -38,6 +38,7 @@
#define MAX(a,b) ((a)>=(b) ? (a) : (b))
#endif
+
using namespace fld;
using namespace fld::app;
@@ -663,9 +664,9 @@ void Layout_List::update_menu_labels() {
/**
Load all user layouts from the FLUID user preferences.
*/
-int Layout_List::load(const std::string &filename) {
+int Layout_List::load(const char *filename) {
remove_all(FLD_TOOL_STORE_FILE);
- Fl_Preferences prefs(filename.c_str(), "layout.fluid.fltk.org", 0, Fl_Preferences::C_LOCALE);
+ Fl_Preferences prefs(filename, "layout.fluid.fltk.org", 0, Fl_Preferences::C_LOCALE);
read(prefs, FLD_TOOL_STORE_FILE);
return 0;
}
@@ -673,9 +674,9 @@ int Layout_List::load(const std::string &filename) {
/**
Save all user layouts to the FLUID user preferences.
*/
-int Layout_List::save(const std::string &filename) {
+int Layout_List::save(const char *filename) {
assert(this);
- Fl_Preferences prefs(filename.c_str(), "layout.fluid.fltk.org", 0, (Fl_Preferences::Root)(Fl_Preferences::C_LOCALE|Fl_Preferences::CLEAR));
+ Fl_Preferences prefs(filename, "layout.fluid.fltk.org", 0, (Fl_Preferences::Root)(Fl_Preferences::C_LOCALE|Fl_Preferences::CLEAR));
prefs.clear();
write(prefs, FLD_TOOL_STORE_FILE);
return 0;
@@ -721,7 +722,7 @@ void Layout_List::read(Fl_Preferences &prefs, fld::Tool_Store storage) {
}
}
if (cs_ptr) {
- current_suite(std::string(cs_ptr));
+ current_suite(cs_ptr);
::free(cs_ptr);
}
current_preset(cp);
@@ -758,7 +759,7 @@ void Layout_List::read(fld::io::Project_Reader *in) {
const char *key;
key = in->read_word(1);
if (key && !strcmp(key, "{")) {
- std::string cs;
+ const char *cs = 0;
int cp = 0;
for (;;) {
key = in->read_word();
@@ -803,11 +804,12 @@ void Layout_List::current_suite(int ix) {
\param[in] arg_name name of the selected suite
\return if no name is given or the name is not found, keep the current suite selected
*/
-void Layout_List::current_suite(std::string arg_name) {
- if (arg_name.empty()) return;
- for (int i = 0; i < list_size_; ++i) {
+void Layout_List::current_suite(const char *arg_name) {
+ if (!arg_name || !arg_name[0]) return;
+ int i;
+ for (i = 0; i < list_size_; ++i) {
Layout_Suite &suite = list_[i];
- if (suite.name_ && (strcmp(suite.name_, arg_name.c_str()) == 0)) {
+ if (suite.name_ && (strcmp(suite.name_, arg_name) == 0)) {
current_suite(i);
break;
}