Restore active project and file from in-memory data structures. Note: Projects are Folders with is_project = true. This will set this.active_project and this.active_file, deactivate previous items, update the database, and emit signals.