Use g_signal_query to get signal infomation

Remove duplicate code about signal in the source file.