示例#1
0
CGnomeSettingsStore::CGnomeSettingsStore() {
  the_gconf_client = gconf_client_get_default();

  gconf_client_add_dir(the_gconf_client, "/apps/dasher4", GCONF_CLIENT_PRELOAD_RECURSIVE, NULL);

  LoadPersistent();
}
示例#2
0
void XmlSettingsStore::Load() {
  fileutils_->ScanFiles(this, filename_);
  // Load all the settings or create defaults for the ones that don't exist.
  // The superclass 'ParseFile' saves default settings if not found.
  mode_ = EXPLICIT_SAVE;
  LoadPersistent();
  mode_ = SAVE_IMMEDIATELY;
}
示例#3
0
bool XmlSettingsStore::Load() {
  bool result = true;
  std::ifstream f(widen(filename_));
  if (f.good()) {
    f.close();
    if (!ParseFile(filename_, true /* user */)) {
      m_pMsgs->Message("Failed to load the XML settings", true /* interrupt */);
      result = false;
    }
  } else {
    m_pMsgs->FormatMessageWithString("XML File not found: ", filename_.c_str());
    result = false;
  }
  // Load all the settings or create defaults for the ones that don't exist.
  // The superclass 'ParseFile' saves default settings if not found.
  mode_ = EXPLICIT_SAVE;
  LoadPersistent();
  mode_ = SAVE_IMMEDIATELY;
  return result;
}