Skip to content
Permalink
Browse files

Merge pull request #6303 from alexbruy/help-logging

log requested help URLs
  • Loading branch information
alexbruy committed Feb 12, 2018
2 parents e5d7733 + 52f83b3 commit a7870afab15f73a2fd0ca92ea669c203c2ed738e
Showing with 9 additions and 0 deletions.
  1. +5 −0 resources/qgis_global_settings.ini
  2. +4 −0 src/gui/qgshelp.cpp
@@ -28,3 +28,8 @@ connections-xyz\OpenStreetMap\url=http://a.tile.openstreetmap.org/{z}/{x}/{y}.pn
connections-xyz\OpenStreetMap\username=
connections-xyz\OpenStreetMap\zmax=19
connections-xyz\OpenStreetMap\zmin=0

[help]
# Default help location to include
# for now this is online version of the User Guide for latest (LTR) release
helpSearchPath=https://docs.qgis.org/$qgis_short_version/$qgis_locale/docs/user_manual/
@@ -19,6 +19,7 @@
#include "qgssettings.h"
#include "qgsapplication.h"
#include "qgsexpressioncontext.h"
#include "qgsmessagelog.h"

#include <QUrl>
#include <QFileInfo>
@@ -44,6 +45,7 @@ QUrl QgsHelp::helpUrl( const QString &key )
QStringList paths = settings.value( QStringLiteral( "help/helpSearchPath" ) ).toStringList();
if ( paths.isEmpty() )
{
QgsMessageLog::logMessage( QObject::tr( "Help location is not configured!" ), QObject::tr( "QGIS Help" ) );
return helpNotFound;
}

@@ -73,6 +75,8 @@ QUrl QgsHelp::helpUrl( const QString &key )

helpPath = QStringLiteral( "%1/%2" ).arg( fullPath, key );

QgsMessageLog::logMessage( QObject::tr( "Trying to open help using key '%1'. Full URI is '%2'…" ).arg( key ).arg( helpPath ), QObject::tr( "QGIS Help" ), Qgis::Info );

if ( helpPath.startsWith( QStringLiteral( "http" ) ) )
{
if ( !QgsHelp::urlExists( helpPath ) )

0 comments on commit a7870af

Please sign in to comment.
You can’t perform that action at this time.