I wasn’t aware myself there were issues with using sudo when using graphical applications, however a commenter refered me to an artical on Running Sudo Graphically. After reading over the article it’s points seem to be pretty clear, that when you use a command like:

sudo gedit /etc/apt/sources.list

issues can occur by running the application as root but with the user’s configuration file. It explains that you should use gksudo (gnome) or kdesu (kde) in place of sudo if you need to use X applications. Also an easy command line editor to use is nano in place of gedit when you need to edit files with sudo.

sudo nano /etc/apt/sources.list

Anyway, I recommend reading the article as it does a more thorough job explaining it than I do