Skip to content

Commit a7870af

Browse files
authoredFeb 12, 2018
Merge pull request #6303 from alexbruy/help-logging
log requested help URLs
2 parents e5d7733 + 52f83b3 commit a7870af

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed
 

‎resources/qgis_global_settings.ini

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,8 @@ connections-xyz\OpenStreetMap\url=http://a.tile.openstreetmap.org/{z}/{x}/{y}.pn
2828
connections-xyz\OpenStreetMap\username=
2929
connections-xyz\OpenStreetMap\zmax=19
3030
connections-xyz\OpenStreetMap\zmin=0
31+
32+
[help]
33+
# Default help location to include
34+
# for now this is online version of the User Guide for latest (LTR) release
35+
helpSearchPath=https://docs.qgis.org/$qgis_short_version/$qgis_locale/docs/user_manual/

‎src/gui/qgshelp.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "qgssettings.h"
2020
#include "qgsapplication.h"
2121
#include "qgsexpressioncontext.h"
22+
#include "qgsmessagelog.h"
2223

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

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

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

78+
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 );
79+
7680
if ( helpPath.startsWith( QStringLiteral( "http" ) ) )
7781
{
7882
if ( !QgsHelp::urlExists( helpPath ) )

0 commit comments

Comments
 (0)
Please sign in to comment.