[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    extragear/utils/krecipes/src/exporters
From:       Jason Kivlighn <jkivlighn () gmail ! com>
Date:       2006-07-10 20:04:03
Message-ID: 1152561843.109808.16909.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 560628 by jkivlighn:

Fix exporting mmf and rezkonv with ing subs.  These pass the automated checks now.

 M  +12 -6     mmfexporter.cpp  
 M  +12 -6     rezkonvexporter.cpp  


--- trunk/extragear/utils/krecipes/src/exporters/mmfexporter.cpp #560627:560628
@@ -95,10 +95,13 @@
 	//this format requires ingredients without a group to be written first
 	for ( IngredientList::const_iterator ing_it = recipe.ingList.begin(); ing_it != \
recipe.ingList.end(); ++ing_it ) {  if ( ( *ing_it ).groupID == -1 ) {
-			writeSingleIngredient( content, *ing_it );
+			writeSingleIngredient( content, *ing_it, (*ing_it).substitutes.count() > 0 );
 
-			for ( QValueList<IngredientData>::const_iterator sub_it = \
                (*ing_it).substitutes.begin(); sub_it != (*ing_it).substitutes.end(); \
                ++sub_it ) {
-				writeSingleIngredient( content, *sub_it, true );
+			for ( QValueList<IngredientData>::const_iterator sub_it = \
(*ing_it).substitutes.begin(); sub_it != (*ing_it).substitutes.end(); ) { \
+				QValueList<IngredientData>::const_iterator save_it = sub_it; +
+				 ++sub_it;
+				writeSingleIngredient( content, *save_it, sub_it != (*ing_it).substitutes.end() \
);  }
 		}
 	}
@@ -117,10 +120,13 @@
 		}
 
 		for ( IngredientList::const_iterator ing_it = group_list.begin(); ing_it != \
                group_list.end(); ++ing_it ) {
-			writeSingleIngredient( content, *ing_it );
+			writeSingleIngredient( content, *ing_it, (*ing_it).substitutes.count() > 0  );
 
-			for ( QValueList<IngredientData>::const_iterator sub_it = \
                (*ing_it).substitutes.begin(); sub_it != (*ing_it).substitutes.end(); \
                ++sub_it ) {
-				writeSingleIngredient( content, *sub_it, true );
+			for ( QValueList<IngredientData>::const_iterator sub_it = \
(*ing_it).substitutes.begin(); sub_it != (*ing_it).substitutes.end(); ) { \
+				QValueList<IngredientData>::const_iterator save_it = sub_it; +
+				 ++sub_it;
+				writeSingleIngredient( content, *save_it, sub_it != (*ing_it).substitutes.end() \
);  }
 		}
 	}
--- trunk/extragear/utils/krecipes/src/exporters/rezkonvexporter.cpp #560627:560628
@@ -162,10 +162,13 @@
 	//this format requires ingredients without a group to be written first
 	for ( IngredientList::const_iterator ing_it = recipe.ingList.begin(); ing_it != \
recipe.ingList.end(); ++ing_it ) {  if ( ( *ing_it ).groupID == -1 ) {
-			writeSingleIngredient( content, *ing_it );
+			writeSingleIngredient( content, *ing_it, (*ing_it).substitutes.count() > 0 );
 
-			for ( QValueList<IngredientData>::const_iterator sub_it = \
                (*ing_it).substitutes.begin(); sub_it != (*ing_it).substitutes.end(); \
                ++sub_it ) {
-				writeSingleIngredient( content, *sub_it, true );
+			for ( QValueList<IngredientData>::const_iterator sub_it = \
(*ing_it).substitutes.begin(); sub_it != (*ing_it).substitutes.end(); ) { \
+				QValueList<IngredientData>::const_iterator save_it = sub_it; +
+				 ++sub_it;
+				writeSingleIngredient( content, *save_it, sub_it != (*ing_it).substitutes.end() \
);  }
 		}
 	}
@@ -184,10 +187,13 @@
 		}
 
 		for ( IngredientList::const_iterator ing_it = group_list.begin(); ing_it != \
                group_list.end(); ++ing_it ) {
-			writeSingleIngredient( content, *ing_it );
+			writeSingleIngredient( content, *ing_it, (*ing_it).substitutes.count() > 0 );
 
-			for ( QValueList<IngredientData>::const_iterator sub_it = \
                (*ing_it).substitutes.begin(); sub_it != (*ing_it).substitutes.end(); \
                ++sub_it ) {
-				writeSingleIngredient( content, *sub_it, true );
+			for ( QValueList<IngredientData>::const_iterator sub_it = \
(*ing_it).substitutes.begin(); sub_it != (*ing_it).substitutes.end(); ) { \
+				QValueList<IngredientData>::const_iterator save_it = sub_it; +
+				 ++sub_it;
+				writeSingleIngredient( content, *save_it, sub_it != (*ing_it).substitutes.end() \
);  }
 		}
 	}


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic