Update of /cvsroot/ufraw/ufraw In directory vz-cvs-3.sog:/tmp/cvs-serv13810
Modified Files: uf_gtk.cc ufobject.cc ufobject.h Log Message: Keep auto lensfun setting on startup. Make UFGroupList public. Index: ufobject.h =================================================================== RCS file: /cvsroot/ufraw/ufraw/ufobject.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- ufobject.h 27 Jul 2011 13:50:45 -0000 1.11 +++ ufobject.h 11 Aug 2011 02:39:03 -0000 1.12 @@ -308,6 +308,9 @@ bool IsEqual(const char *string) const; }; +/// A list of UFObjects returned by UFGroup or UFArray. +typedef std::list<UFObject *> UFGroupList; + /** * UFGroup is a UFObject that contain a group of UFObject elements. This * object is considered the Patent() of these elements. @@ -336,6 +339,8 @@ /// \exception UFException is thrown if an element with the given name /// does not exist. This can be avoided with the use of the Has() method. const UFObject &operator[](UFName name) const; + /// Return a list of all UFObjects in the group. + const UFGroupList List() const; /// Add (append) a UFObject to a UFGroup. If the object belonged to /// another group before, it will be detached from the original group. /// \exception UFException is thrown if UFGroup already contains Index: ufobject.cc =================================================================== RCS file: /cvsroot/ufraw/ufraw/ufobject.cc,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- ufobject.cc 4 Aug 2011 03:57:26 -0000 1.14 +++ ufobject.cc 11 Aug 2011 02:39:03 -0000 1.15 @@ -613,12 +613,11 @@ }; typedef std::map<const char *, UFObject *, _UFNameCompare> _UFGroupMap; typedef std::pair<const char *, UFObject *> _UFObjectPair; -typedef std::list<UFObject *> _UFGroupList; class _UFGroup : public _UFObject { public: _UFGroupMap Map; - _UFGroupList List; + UFGroupList List; UFGroup *const This; bool GroupChanging; // Index and Default Index are only used by UFArray @@ -675,7 +674,7 @@ UFGroup::~UFGroup() { - for (_UFGroupList::iterator iter = ufgroup->List.begin(); + for (UFGroupList::iterator iter = ufgroup->List.begin(); iter != ufgroup->List.end(); iter++) { _UFGROUP_PARENT(*iter) = NULL; delete *iter; @@ -683,7 +682,7 @@ g_free(ufgroup->DefaultIndex); } -static std::string _UFGroup_XML(const UFGroup &group, _UFGroupList &list, +static std::string _UFGroup_XML(const UFGroup &group, UFGroupList &list, const char *indent, const char *attribute) { if (group.IsDefault()) @@ -717,7 +716,7 @@ newIndent[i + 0] = ' '; newIndent[i + 1] = ' '; newIndent[i + 2] = '\0'; - for (_UFGroupList::iterator iter = list.begin(); iter != list.end(); iter++) + for (UFGroupList::iterator iter = list.begin(); iter != list.end(); iter++) xml += (*iter)->XML(newIndent); if (strlen(indent) != 0) xml += (std::string)indent + "</" + group.Name() + ">\n"; @@ -737,7 +736,7 @@ if (Name() != object.Name()) Throw("Object name mismatch with '%s'", object.Name()); const UFGroup &group = object; - for (_UFGroupList::iterator iter = ufgroup->List.begin(); + for (UFGroupList::iterator iter = ufgroup->List.begin(); iter != ufgroup->List.end(); iter++) { if (group.Has((*iter)->Name())) (*iter)->Set(group[(*iter)->Name()]); @@ -751,7 +750,7 @@ bool UFGroup::IsDefault() const { - for (_UFGroupList::iterator iter = ufgroup->List.begin(); + for (UFGroupList::iterator iter = ufgroup->List.begin(); iter != ufgroup->List.end(); iter++) { if (!(*iter)->IsDefault()) return false; @@ -761,7 +760,7 @@ void UFGroup::SetDefault() { - for (_UFGroupList::iterator iter = ufgroup->List.begin(); + for (UFGroupList::iterator iter = ufgroup->List.begin(); iter != ufgroup->List.end(); iter++) { (*iter)->SetDefault(); } @@ -770,7 +769,7 @@ void UFGroup::Reset() { - for (_UFGroupList::iterator iter = ufgroup->List.begin(); + for (UFGroupList::iterator iter = ufgroup->List.begin(); iter != ufgroup->List.end(); iter++) { (*iter)->Reset(); } @@ -799,6 +798,11 @@ return *ufgroup->Map[name]; } +const UFGroupList UFGroup::List() const +{ + return ufgroup->List; +} + UFGroup &UFGroup::operator<<(UFObject *object) { _UFGroupMap::iterator iter = ufgroup->Map.find(object->Name()); @@ -811,7 +815,7 @@ //_UFGroup *parent = static_cast<_UFGroup *>(object->ufobject->Parent); _UFGroup *parent = static_cast<_UFGroup *>(object->Parent().ufobject); parent->Map.erase(object->Name()); - for (_UFGroupList::iterator iter = parent->List.begin(); + for (UFGroupList::iterator iter = parent->List.begin(); iter != parent->List.end(); iter++) { if (*iter == object) { parent->List.erase(iter); @@ -831,7 +835,7 @@ Throw("index '%s' does not exists", name); UFObject *dropObject = (*iter).second; ufgroup->Map.erase(name); - for (_UFGroupList::iterator iter = ufgroup->List.begin(); + for (UFGroupList::iterator iter = ufgroup->List.begin(); iter != ufgroup->List.end(); iter++) { if (*iter == dropObject) { ufgroup->List.erase(iter); @@ -876,7 +880,7 @@ if (Name() != object.Name()) Throw("Object name mismatch with '%s'", object.Name()); const UFArray &array = object; - for (_UFGroupList::iterator iter = ufgroup->List.begin(); + for (UFGroupList::iterator iter = ufgroup->List.begin(); iter != ufgroup->List.end(); iter++) { if (array.Has((*iter)->StringValue())) (*iter)->Set(array[(*iter)->StringValue()]); @@ -893,7 +897,7 @@ ufgroup->Index = -1; int i = 0; - for (_UFGroupList::iterator iter = ufgroup->List.begin(); + for (UFGroupList::iterator iter = ufgroup->List.begin(); iter != ufgroup->List.end(); iter++, i++) { if (IsEqual((*iter)->StringValue())) { ufgroup->Index = i; @@ -936,7 +940,7 @@ bool UFArray::SetIndex(int index) { - _UFGroupList::iterator iter = ufgroup->List.begin(); + UFGroupList::iterator iter = ufgroup->List.begin(); std::advance(iter, index); if (iter == ufgroup->List.end()) return false; @@ -974,7 +978,7 @@ _UFGroup *parent = static_cast<UFArray *>(object)->ufobject->Parent; // We assume that the previous parent was also a UFArray. parent->Map.erase(object->StringValue()); - for (_UFGroupList::iterator iter = parent->List.begin(); + for (UFGroupList::iterator iter = parent->List.begin(); iter != parent->List.end(); iter++) { if (*iter == object) { parent->List.erase(iter); Index: uf_gtk.cc =================================================================== RCS file: /cvsroot/ufraw/ufraw/uf_gtk.cc,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- uf_gtk.cc 4 Aug 2011 03:57:26 -0000 1.26 +++ uf_gtk.cc 11 Aug 2011 02:39:03 -0000 1.27 @@ -578,16 +578,13 @@ _UFWidgetData &data = _ufarray_widget_data(array); gtk_widget_set_size_request(combo, 50, -1); data.gobject[0] = G_OBJECT(combo); - char *saveIndex = g_strdup(array.StringValue()); - int i = 0; - while (array.SetIndex(i)) { - gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _(array.StringValue())); - i++; + UFGroupList list = array.List(); + for (UFGroupList::iterator iter = list.begin(); + iter != list.end(); iter++) { + gtk_combo_box_append_text(GTK_COMBO_BOX(combo), + _((*iter)->StringValue())); } - array.Set(saveIndex); - g_free(saveIndex); _ufarray_object_event(object, uf_value_changed); - gtk_widget_set_sensitive(combo, i > 0); return combo; } ------------------------------------------------------------------------------ Get a FREE DOWNLOAD! and learn more about uberSVN rich system, user administration capabilities and model configuration. Take the hassle out of deploying and managing Subversion and the tools developers use with it. http://p.sf.net/sfu/wandisco-dev2dev _______________________________________________ ufraw-cvs mailing list ufraw-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ufraw-cvs