Skip to content

Commit

Permalink
Merge pull request #6303 from alexbruy/help-logging
Browse files Browse the repository at this point in the history
log requested help URLs
  • Loading branch information
alexbruy committed Feb 12, 2018
2 parents e5d7733 + 52f83b3 commit a7870af
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions resources/qgis_global_settings.ini
Expand Up @@ -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/
4 changes: 4 additions & 0 deletions src/gui/qgshelp.cpp
Expand Up @@ -19,6 +19,7 @@
#include "qgssettings.h"
#include "qgsapplication.h"
#include "qgsexpressioncontext.h"
#include "qgsmessagelog.h"

#include <QUrl>
#include <QFileInfo>
Expand All @@ -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;
}

Expand Down Expand Up @@ -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 ) )
Expand Down

0 comments on commit a7870af

Please sign in to comment.