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
Marco Bubke
flatpak-qt-creator
Commits
7d4bbf49
Commit
7d4bbf49
authored
Jun 14, 2010
by
kh1
Browse files
Allow http request to be opened in the help plugin.
Reviewed-by: ck
parent
dc91a094
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/plugins/help/helpplugin.cpp
View file @
7d4bbf49
...
...
@@ -818,16 +818,8 @@ void HelpPlugin::handleHelpRequest(const QUrl &url)
if
(
HelpViewer
::
launchWithExternalApp
(
url
))
return
;
if
(
Core
::
HelpManager
::
instance
()
->
findFile
(
url
).
isValid
())
{
if
(
url
.
queryItemValue
(
QLatin1String
(
"view"
))
==
QLatin1String
(
"split"
))
{
if
(
HelpViewer
*
viewer
=
viewerForContextMode
())
viewer
->
setSource
(
url
);
}
else
{
activateHelpMode
();
m_centralWidget
->
setSource
(
url
);
}
}
else
{
QString
address
=
url
.
toString
();
QString
address
=
url
.
toString
();
if
(
!
Core
::
HelpManager
::
instance
()
->
findFile
(
url
).
isValid
())
{
if
(
address
.
startsWith
(
HelpViewer
::
NsNokia
)
||
address
.
startsWith
(
HelpViewer
::
NsTrolltech
))
{
// local help not installed, resort to external web help
...
...
@@ -839,7 +831,15 @@ void HelpPlugin::handleHelpRequest(const QUrl &url)
}
address
=
urlPrefix
+
address
.
mid
(
address
.
lastIndexOf
(
QLatin1Char
(
'/'
)));
}
QDesktopServices
::
openUrl
(
address
);
}
const
QUrl
newUrl
(
address
);
if
(
newUrl
.
queryItemValue
(
QLatin1String
(
"view"
))
==
QLatin1String
(
"split"
))
{
if
(
HelpViewer
*
viewer
=
viewerForContextMode
())
viewer
->
setSource
(
newUrl
);
}
else
{
activateHelpMode
();
m_centralWidget
->
setSource
(
newUrl
);
}
}
...
...
src/plugins/help/helpviewer.cpp
View file @
7d4bbf49
...
...
@@ -147,8 +147,6 @@ bool HelpViewer::launchWithExternalApp(const QUrl &url)
actualTmpFile
.
close
();
return
QDesktopServices
::
openUrl
(
QUrl
(
actualTmpFile
.
fileName
()));
}
}
else
if
(
url
.
scheme
()
==
QLatin1String
(
"http"
))
{
return
QDesktopServices
::
openUrl
(
url
);
}
return
false
;
}
...
...
src/plugins/help/helpviewer_qtb.cpp
View file @
7d4bbf49
...
...
@@ -144,6 +144,13 @@ QUrl HelpViewer::source() const
void
HelpViewer
::
setSource
(
const
QUrl
&
url
)
{
const
QString
&
scheme
=
url
.
scheme
();
if
(
scheme
!=
QLatin1String
(
"qthelp"
)
&&
scheme
!=
QLatin1String
(
"about"
))
{
QTextBrowser
::
setSource
(
resolvedUrl
);
emit
loadFinished
(
true
);
return
;
}
const
QString
&
string
=
url
.
toString
();
if
(
url
.
isValid
()
&&
string
!=
QLatin1String
(
"help"
))
{
if
(
launchWithExternalApp
(
url
))
...
...
src/plugins/help/helpviewer_qwv.cpp
View file @
7d4bbf49
...
...
@@ -121,9 +121,13 @@ HelpNetworkAccessManager::HelpNetworkAccessManager(QObject *parent)
{
}
QNetworkReply
*
HelpNetworkAccessManager
::
createRequest
(
Operation
/*op*/
,
const
QNetworkRequest
&
request
,
QIODevice
*
/*
outgoingData
*/
)
QNetworkReply
*
HelpNetworkAccessManager
::
createRequest
(
Operation
op
,
const
QNetworkRequest
&
request
,
QIODevice
*
outgoingData
)
{
const
QString
&
scheme
=
request
.
url
().
scheme
();
if
(
scheme
!=
QLatin1String
(
"qthelp"
)
&&
scheme
!=
QLatin1String
(
"about"
))
return
QNetworkAccessManager
::
createRequest
(
op
,
request
,
outgoingData
);
QString
url
=
request
.
url
().
toString
();
const
QHelpEngineCore
&
engine
=
LocalHelpManager
::
helpEngine
();
// TODO: For some reason the url to load is already wrong (passed from webkit)
...
...
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