Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tobias Hunger
qt-creator
Commits
d8035bca
Commit
d8035bca
authored
Jan 11, 2011
by
kh1
Browse files
In case of network error print the error string.
Task-number: QTCREATORBUG-3378
parent
80cd57a9
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/plugins/help/helpplugin.cpp
View file @
d8035bca
...
...
@@ -868,10 +868,10 @@ void HelpPlugin::activateContext()
if
(
HelpViewer
*
viewer
=
viewerForContextMode
())
{
if
(
links
.
isEmpty
())
{
// No link found or no context object
viewer
->
setSource
(
QUrl
(
Help
::
Constants
::
AboutBlank
));
viewer
->
setHtml
(
tr
(
"<html><head><title>No Documentation</title>"
"</head><body><br/><center><b>%1</b><br/>No documentation "
"available.</center></body></html>"
).
arg
(
m_idFromContext
));
viewer
->
setSource
(
QUrl
());
}
else
{
int
version
=
0
;
const
QRegExp
exp
(
"(
\\
d+)"
);
...
...
src/plugins/help/helpviewer.h
View file @
d8035bca
...
...
@@ -129,6 +129,9 @@ private slots:
void
actionChanged
();
void
slotLoadStarted
();
void
slotLoadFinished
(
bool
ok
);
#if !defined(QT_NO_WEBKIT)
void
slotNetworkReplyFinished
(
QNetworkReply
*
reply
);
#endif
private:
bool
eventFilter
(
QObject
*
obj
,
QEvent
*
event
);
...
...
src/plugins/help/helpviewer_qwv.cpp
View file @
d8035bca
...
...
@@ -239,7 +239,10 @@ HelpViewer::HelpViewer(qreal zoom, QWidget *parent)
settings
()
->
setAttribute
(
QWebSettings
::
PluginsEnabled
,
false
);
setPage
(
new
HelpPage
(
this
));
page
()
->
setNetworkAccessManager
(
new
HelpNetworkAccessManager
(
this
));
HelpNetworkAccessManager
*
manager
=
new
HelpNetworkAccessManager
(
this
);
page
()
->
setNetworkAccessManager
(
manager
);
connect
(
manager
,
SIGNAL
(
finished
(
QNetworkReply
*
)),
this
,
SLOT
(
slotNetworkReplyFinished
(
QNetworkReply
*
)));
QAction
*
action
=
pageAction
(
QWebPage
::
OpenLinkInNewWindow
);
action
->
setText
(
tr
(
"Open Link as New Page"
));
...
...
@@ -433,6 +436,15 @@ void HelpViewer::actionChanged()
emit
forwardAvailable
(
a
->
isEnabled
());
}
void
HelpViewer
::
slotNetworkReplyFinished
(
QNetworkReply
*
reply
)
{
if
(
reply
&&
reply
->
error
()
!=
QNetworkReply
::
NoError
)
{
setSource
(
QUrl
(
Help
::
Constants
::
AboutBlank
));
setHtml
(
HelpViewer
::
PageNotFoundMessage
.
arg
(
reply
->
url
().
toString
()
+
QString
::
fromLatin1
(
"<br><br>Error: %1"
).
arg
(
reply
->
errorString
())));
}
}
// -- private
bool
HelpViewer
::
eventFilter
(
QObject
*
obj
,
QEvent
*
event
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment