wahjam/wahjam — pull request #51 by stefanha (2012-05-27 16:10:41+00:00)
Title: Make QNetworkAccessManager global

The ServerBrowser uses QNetworkAccessManager for HTTP requests.
Normally an application uses a single QNetworkAccessManager instance so
that cookies and other state are shared.

This patch moves QNetworkAccessManager out of ServerBrowser and gives it
a global variable that is initialized in main().

The ConnectDialog and ServerBrowser constructors need to take the
QNetworkAccessManager as an argument. They do not take advantage of the
global so to keep the classes decoupled and easily reusable.

Note that the comment in ServerBrowser about deleting reply objects is
outdated - we already connect the finish() signal to
reply->deleteLater(). It is safe to drop the comment, the reply object
will be freed.

Signed-off-by: Stefan Hajnoczi