Saute onion in half of the olive oil. Add garlic, saute briefly. Add tomatoes saute 6 minutes. Add canned tomatoes, salt, pepper, sugar, and cumin. Cook uncovered until soft and pulpy. Push the sauce through a sieve, then season with vinegar. Toss ham in flour. Fry in remaining oil for 4 minutes. Add sauce and heat gently for 10 minutes.