File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 40
40
#include < QDebug>
41
41
#include < QPushButton>
42
42
#include < QGraphicsProxyWidget>
43
+ #include < nsCOMPtr.h>
44
+ #include < nsIIOService.h>
45
+ #include < nsNetUtil.h>
43
46
44
47
#include " test.h"
45
48
49
+ static nsresult ForceOnline ()
50
+ {
51
+ nsCOMPtr<nsIIOService> ioService = do_GetService (NS_IOSERVICE_CONTRACTID);
52
+ if (!ioService)
53
+ return NS_ERROR_FAILURE;
54
+
55
+ ioService->SetOffline (PR_FALSE);
56
+ return NS_OK;
57
+ }
58
+
46
59
MyQGraphicsView::MyQGraphicsView (QGraphicsScene* scene, QWidget* parent)
47
60
: QGraphicsView(scene, parent)
48
61
{
@@ -102,6 +115,9 @@ void MyQGraphicsView::resizeEvent(QResizeEvent* event)
102
115
103
116
void MyQGraphicsView::loadUri (const QString& uri)
104
117
{
118
+ // ForceOnline() must be called before any network call
119
+ // in order to get connectivity working
120
+ ForceOnline ();
105
121
mozView->loadUri (uri);
106
122
}
107
123
You can’t perform that action at this time.
0 commit comments