renamed the 'changed' variable in the OptionsContainer to the more descriptive 'touched';
removed the unused variable 'isChanged' from the OptionsWindow
This commit is contained in:
parent
29c3c2b045
commit
bf448e90e1
5 changed files with 12 additions and 19 deletions
|
@ -97,9 +97,9 @@ class OptionsContainer
|
|||
Ptr<const Glib::ustring>::Ref configFileName;
|
||||
|
||||
/**
|
||||
* Remember if we have been changed.
|
||||
* Remember if we have been touched.
|
||||
*/
|
||||
bool changed;
|
||||
bool touched;
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
|
@ -172,17 +172,17 @@ class OptionsContainer
|
|||
throw ();
|
||||
|
||||
/**
|
||||
* Report if the object has been changed.
|
||||
* Report if the object has been touched.
|
||||
*
|
||||
* It returns true if there has been any calls to setOptionItem()
|
||||
* since its construction or the last call to writeToFile().
|
||||
*
|
||||
* @return whether the options have been changed
|
||||
* @return whether the options have been touched
|
||||
*/
|
||||
bool
|
||||
isChanged(void) throw ()
|
||||
isTouched(void) throw ()
|
||||
{
|
||||
return changed;
|
||||
return touched;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -61,7 +61,7 @@ OptionsContainer :: OptionsContainer(
|
|||
Ptr<const Glib::ustring>::Ref configFileName)
|
||||
throw ()
|
||||
: configFileName(configFileName),
|
||||
changed(false)
|
||||
touched(false)
|
||||
{
|
||||
optionsDocument.create_root_node_by_import(&optionsElement, true);
|
||||
// true == recursive
|
||||
|
@ -83,14 +83,14 @@ OptionsContainer :: setOptionItem(OptionItemString optionItem,
|
|||
xmlpp::Attribute * attr = dynamic_cast<xmlpp::Attribute*>(targetNode);
|
||||
if (attr != 0) {
|
||||
attr->set_value(*value);
|
||||
changed = true;
|
||||
touched = true;
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
xmlpp::TextNode * text = dynamic_cast<xmlpp::TextNode*>(targetNode);
|
||||
if (text != 0) {
|
||||
text->set_content(*value);
|
||||
changed = true;
|
||||
touched = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -147,7 +147,7 @@ OptionsContainer :: setKeyboardShortcutItem(
|
|||
xmlpp::Attribute * attr = dynamic_cast<xmlpp::Attribute*>(targetNode);
|
||||
if (attr != 0) {
|
||||
attr->set_value(*value);
|
||||
changed = true;
|
||||
touched = true;
|
||||
return;
|
||||
|
||||
} else {
|
||||
|
@ -274,7 +274,7 @@ OptionsContainer :: writeToFile(void) throw ()
|
|||
std::ofstream file(configFileName->c_str());
|
||||
if (file.good()) {
|
||||
optionsDocument.write_to_stream_formatted(file, "utf-8");
|
||||
changed = false;
|
||||
touched = false;
|
||||
}
|
||||
file.close();
|
||||
}
|
||||
|
|
|
@ -570,7 +570,7 @@ GLiveSupport :: logout(void) throw ()
|
|||
authentication->logout(sessionId);
|
||||
sessionId.reset();
|
||||
|
||||
if (optionsContainer->isChanged()) {
|
||||
if (optionsContainer->isTouched()) {
|
||||
optionsContainer->writeToFile();
|
||||
}
|
||||
|
||||
|
|
|
@ -75,8 +75,6 @@ OptionsWindow :: OptionsWindow (Ptr<GLiveSupport>::Ref gLiveSupport,
|
|||
LocalizedObject(bundle),
|
||||
gLiveSupport(gLiveSupport)
|
||||
{
|
||||
isChanged = false;
|
||||
|
||||
Ptr<WidgetFactory>::Ref wf = WidgetFactory::getInstance();
|
||||
|
||||
try {
|
||||
|
|
|
@ -137,11 +137,6 @@ class OptionsWindow : public WhiteWindow, public LocalizedObject
|
|||
*/
|
||||
Ptr<GLiveSupport>::Ref gLiveSupport;
|
||||
|
||||
/**
|
||||
* Signals if any changes have been made.
|
||||
*/
|
||||
bool isChanged;
|
||||
|
||||
/**
|
||||
* Create a new user entry field item.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue