This isn't a long term remedy, but I know a little trick to get rid of ALOT of them...
Get some Apple Cider Vinegar (has to be Apple Cider vinegar or it won't work). Put about 1/3 in a ceramic cup (i.e. coffee cup), cover the top with Plastic wrap and poke several tiny holes. The fruit flies...