Sounds like a great trip. I may chime in w/more suggestions, but you can find a lot of ideas - especially for someplace like Barcelona - on this forum.
I would make one suggestion: instead of 2 days in Malaga, make Tarifa your home base for beaches over there. It's a great beach town, not uber-touristy, mainly a kitesurfing/artsy town with good bars to go out and places to eat. I highly recommend staying at Arte Vida Hotel, a 12-14 room place right on the beach that offers kitesurfing lessons and has its own chiringuito (beach bar). You'll want a car there and can go to great beaches such as Zahara de Los Atunes, Caņos de Meca, Bolonia or over to Cadiz. It's also 20-30 minutes from Gibraltar (stay in Tarifa rather than overnight in Tarifa). Or if you want, you can take the ferry to Tangers, Morocco.