Changeset View
Changeset View
Standalone View
Standalone View
plugins/qthelp/qthelpdocumentation.cpp
Show First 20 Lines • Show All 294 Lines • ▼ Show 20 Line(s) | 291 | { | |||
---|---|---|---|---|---|
295 | lastView->load(newUrl); | 295 | lastView->load(newUrl); | ||
296 | } | 296 | } | ||
297 | 297 | | |||
298 | IDocumentationProvider* QtHelpDocumentation::provider() const | 298 | IDocumentationProvider* QtHelpDocumentation::provider() const | ||
299 | { | 299 | { | ||
300 | return m_provider; | 300 | return m_provider; | ||
301 | } | 301 | } | ||
302 | 302 | | |||
303 | bool QtHelpDocumentation::viewInExternalBrowser() | ||||
304 | { | ||||
305 | if (m_provider->useExternalViewer()) { | ||||
306 | const QUrl url(m_current.value()); | ||||
kfunk: This would be way cleaner if you would just call `QtHelpExternalViewer::setSource(QUrl)` where… | |||||
rjvbb: Indeed, that should be trivial. | |||||
Done, but called openUrl following QDesktopServices. setSource would suggest there should be a getter, and I don't think there's a point to that (we can only know which address was last set programmatically, not what the user did afterwards). rjvbb: Done, but called `openUrl` following QDesktopServices. `setSource` would suggest there should… | |||||
307 | const QByteArray command = QByteArrayLiteral("setSource ") | ||||
308 | + url.toString().toUtf8() + QByteArrayLiteral("\n"); | ||||
309 | m_provider->externalViewerCommand(command); | ||||
310 | m_provider->externalViewerCommand("show contents\n"); | ||||
311 | m_provider->externalViewerCommand("syncContents\n"); | ||||
312 | return true; | ||||
313 | } | ||||
314 | return false; | ||||
315 | } | ||||
316 | | ||||
303 | QtHelpAlternativeLink::QtHelpAlternativeLink(const QString& name, const QtHelpDocumentation* doc, QObject* parent) | 317 | QtHelpAlternativeLink::QtHelpAlternativeLink(const QString& name, const QtHelpDocumentation* doc, QObject* parent) | ||
304 | : QAction(name, parent), mDoc(doc), mName(name) | 318 | : QAction(name, parent), mDoc(doc), mName(name) | ||
305 | { | 319 | { | ||
306 | connect(this, &QtHelpAlternativeLink::triggered, this, &QtHelpAlternativeLink::showUrl); | 320 | connect(this, &QtHelpAlternativeLink::triggered, this, &QtHelpAlternativeLink::showUrl); | ||
307 | } | 321 | } | ||
308 | 322 | | |||
309 | void QtHelpAlternativeLink::showUrl() | 323 | void QtHelpAlternativeLink::showUrl() | ||
310 | { | 324 | { | ||
Show All 38 Lines |
This would be way cleaner if you would just call QtHelpExternalViewer::setSource(QUrl) where QtHelpExternalViewer::setSource(...) would wrap the IPC interface to assistant (i.e. move below code there).