remove redundant code in sourcedialog plugin