Quantum computation with optical cavities and decaying trapped ions