bool ltr_int_register_slave(int socket, message_t &msg)
{
    ltr_int_log_message("Trying to register slave!\n");
    pthread_mutex_lock(&send_mx);
    slaves.insert(std::pair<std::string, int>(msg.str, socket));
    ltr_int_log_message("Slave with profile '%s' @socket %d registered!\n", msg.str, socket);
    pthread_mutex_unlock(&send_mx);

    //Make sure the new section is created if needed...
    ltr_axes_t tmp_axes;
    tmp_axes = NULL;
    ltr_int_init_axes(&tmp_axes, msg.str);
    ltr_int_close_axes(&tmp_axes);

    if(save_prefs) {
        ltr_int_log_message("Checking for changed prefs...\n");
        if(ltr_int_need_saving()) {
            ltr_int_log_message("Master is about to save changed preferences.\n");
            ltr_int_save_prefs(NULL);
        }
    }

    if(new_slave_hook != NULL) {
        new_slave_hook(msg.str);
    }
    return true;
}
bool PrefProxy::savePrefs()
{
  bool res = ltr_int_save_prefs(NULL);
  return res;
}