Skip to content

Commit

Permalink
Do not leak build env paths into public headers
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Feb 22, 2024
1 parent dc73608 commit b105226
Show file tree
Hide file tree
Showing 77 changed files with 364 additions and 205 deletions.
4 changes: 0 additions & 4 deletions cmake_templates/qgsconfig.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
#define QGIS_LIBEXEC_SUBDIR "${QGIS_LIBEXEC_SUBDIR}"
#define QGIS_LIB_SUBDIR "${QGIS_LIB_SUBDIR}"
#define QGIS_QML_SUBDIR "${QGIS_QML_SUBDIR}"
#define CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}"
#define CMAKE_SOURCE_DIR "${CMAKE_SOURCE_DIR}"

#define QGIS_SERVER_MODULE_SUBDIR "${QGIS_SERVER_MODULE_SUBDIR}"

Expand All @@ -44,8 +42,6 @@
#define QGIS_MACAPP_BUNDLE ${QGIS_MACAPP_BUNDLE}
#endif

#define QT_PLUGINS_DIR "${QT_PLUGINS_DIR}"

#define PYTHON_VERSION "${Python_VERSION}"
#define PYTHON_VERSION_MAJOR "${Python_VERSION_MAJOR}"
#define PYTHON_VERSION_MINOR "${Python_VERSION_MINOR}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@




class QgsNetworkRequestParameters
{
%Docstring(signature="appended")
Expand Down
1 change: 0 additions & 1 deletion python/PyQt6/core/auto_generated/qgsdbquerylog.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ Constructor for QgsDatabaseQueryLogEntry.
};



class QgsDatabaseQueryLog: QObject
{
%Docstring(signature="appended")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@




class QgsNetworkRequestParameters
{
%Docstring(signature="appended")
Expand Down
1 change: 0 additions & 1 deletion python/core/auto_generated/qgsdbquerylog.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ Constructor for QgsDatabaseQueryLogEntry.
};



class QgsDatabaseQueryLog: QObject
{
%Docstring(signature="appended")
Expand Down
2 changes: 2 additions & 0 deletions src/app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,8 @@ add_library(qgis_app ${LIBRARY_TYPE} ${QGIS_APP_SRCS})
# require c++17
target_compile_features(qgis_app PRIVATE cxx_std_17)

target_compile_definitions(qgis_app PRIVATE "QT_PLUGINS_DIR=\"${QT_PLUGINS_DIR}\"")

target_include_directories(qgis_app PUBLIC
${CMAKE_SOURCE_DIR}/external/nmea

Expand Down
2 changes: 2 additions & 0 deletions src/auth/oauth2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ target_include_directories(authmethod_oauth2_a PUBLIC ${CMAKE_SOURCE_DIR}/src/au

# require c++17
target_compile_features(authmethod_oauth2_a PRIVATE cxx_std_17)
target_compile_definitions(authmethod_oauth2_a PRIVATE "CMAKE_SOURCE_DIR=\"${CMAKE_SOURCE_DIR}\"")

target_link_libraries(authmethod_oauth2_a qgis_core)

Expand Down Expand Up @@ -146,6 +147,7 @@ else()

# require c++17
target_compile_features(authmethod_oauth2 PRIVATE cxx_std_17)
target_compile_definitions(authmethod_oauth2 PRIVATE "CMAKE_SOURCE_DIR=\"${CMAKE_SOURCE_DIR}\"")

target_link_libraries(authmethod_oauth2 qgis_core)

Expand Down
1 change: 1 addition & 0 deletions src/auth/oauth2/core/qgso2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "qgsauthoauth2config.h"
#include "qgslogger.h"
#include "qgsnetworkaccessmanager.h"
#include "qgssetrequestinitiator_p.h"
#include "qgsblockingnetworkrequest.h"

#include <QDir>
Expand Down
1 change: 1 addition & 0 deletions src/auth/oauth2/gui/qgsauthoauth2edit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "qgsauthconfigedit.h"
#include "qgsmessagelog.h"
#include "qgsnetworkaccessmanager.h"
#include "qgssetrequestinitiator_p.h"

QgsAuthOAuth2Edit::QgsAuthOAuth2Edit( QWidget *parent )
: QgsAuthMethodEdit( parent )
Expand Down
1 change: 1 addition & 0 deletions src/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2573,6 +2573,7 @@ if (${QT_VERSION_BASE}Positioning_FOUND)
endif()

target_compile_definitions(qgis_core PRIVATE "-DQT_NO_FOREACH")
target_compile_definitions(qgis_core PRIVATE "CMAKE_SOURCE_DIR=\"${CMAKE_SOURCE_DIR}\"")

# clang-tidy
if(CLANG_TIDY_EXE)
Expand Down
1 change: 1 addition & 0 deletions src/core/externalstorage/qgshttpexternalstorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "qgsnetworkcontentfetcherregistry.h"
#include "qgsblockingnetworkrequest.h"
#include "qgsnetworkaccessmanager.h"
#include "qgssetrequestinitiator_p.h"
#include "qgsapplication.h"
#include "qgsfeedback.h"

Expand Down
1 change: 1 addition & 0 deletions src/core/geocoding/qgsgooglemapsgeocoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "qgsgeocodercontext.h"
#include "qgslogger.h"
#include "qgsnetworkaccessmanager.h"
#include "qgssetrequestinitiator_p.h"
#include "qgsblockingnetworkrequest.h"
#include "qgsreadwritelocker.h"
#include "qgscoordinatetransform.h"
Expand Down
1 change: 1 addition & 0 deletions src/core/geocoding/qgsnominatimgeocoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "qgsgeocodercontext.h"
#include "qgslogger.h"
#include "qgsnetworkaccessmanager.h"
#include "qgssetrequestinitiator_p.h"
#include "qgscoordinatetransform.h"
#include <QDateTime>
#include <QUrl>
Expand Down
1 change: 1 addition & 0 deletions src/core/network/qgsfiledownloader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

#include "qgsfiledownloader.h"
#include "qgsnetworkaccessmanager.h"
#include "qgssetrequestinitiator_p.h"
#include "qgsapplication.h"
#include "qgsauthmanager.h"
#include "qgsvariantutils.h"
Expand Down
8 changes: 0 additions & 8 deletions src/core/network/qgsnetworkaccessmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,6 @@
class QgsFeedback;
class QgsSettingsEntryInteger;

#ifndef SIP_RUN
#include "qgsconfig.h"
constexpr int sFilePrefixLength = CMAKE_SOURCE_DIR[sizeof( CMAKE_SOURCE_DIR ) - 1] == '/' ? sizeof( CMAKE_SOURCE_DIR ) + 1 : sizeof( CMAKE_SOURCE_DIR );

#define QgsSetRequestInitiatorClass(request, _class) request.setAttribute( static_cast< QNetworkRequest::Attribute >( QgsNetworkRequestParameters::AttributeInitiatorClass ), _class ); request.setAttribute( static_cast< QNetworkRequest::Attribute >( QgsNetworkRequestParameters::AttributeInitiatorRequestId ), QString(QString( __FILE__ ).mid( sFilePrefixLength ) + ':' + QString::number( __LINE__ ) + " (" + __FUNCTION__ + ")") );
#define QgsSetRequestInitiatorId(request, str) request.setAttribute( static_cast< QNetworkRequest::Attribute >( QgsNetworkRequestParameters::AttributeInitiatorRequestId ), QString(QString( __FILE__ ).mid( sFilePrefixLength ) + ':' + QString::number( __LINE__ ) + " (" + __FUNCTION__ + "): " + str) );
#endif

/**
* \class QgsNetworkRequestParameters
* \ingroup core
Expand Down
1 change: 1 addition & 0 deletions src/core/network/qgsnetworkcontentfetcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

#include "qgsnetworkcontentfetcher.h"
#include "qgsnetworkaccessmanager.h"
#include "qgssetrequestinitiator_p.h"
#include "qgsmessagelog.h"
#include "qgsapplication.h"
#include "qgsauthmanager.h"
Expand Down
1 change: 1 addition & 0 deletions src/core/network/qgsnewsfeedparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "qgsnetworkcontentfetchertask.h"
#include "qgsnetworkcontentfetcher.h"
#include "qgsnetworkaccessmanager.h"
#include "qgssetrequestinitiator_p.h"
#include "qgsjsonutils.h"
#include "qgsmessagelog.h"
#include "qgsapplication.h"
Expand Down
29 changes: 29 additions & 0 deletions src/core/network/qgssetrequestinitiator_p.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/***************************************************************************
qgssetrequestinitiator.h - description
-------------------
begin : 2024-02-10
copyright : (C) 2024 by Matthias Kuhn
email : matthias@opengis.ch
***************************************************************************/

/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/

#ifndef QGSSETREQUESTINITIATOR_P_H
#define QGSSETREQUESTINITIATOR_P_H

#include "qgsnetworkaccessmanager.h"

constexpr int sFilePrefixLength = CMAKE_SOURCE_DIR[sizeof( CMAKE_SOURCE_DIR ) - 1] == '/' ? sizeof( CMAKE_SOURCE_DIR ) + 1 : sizeof( CMAKE_SOURCE_DIR );

#define QgsSetRequestInitiatorClass(request, _class) request.setAttribute( static_cast< QNetworkRequest::Attribute >( QgsNetworkRequestParameters::AttributeInitiatorClass ), _class ); request.setAttribute( static_cast< QNetworkRequest::Attribute >( QgsNetworkRequestParameters::AttributeInitiatorRequestId ), QString(QString( __FILE__ ).mid( sFilePrefixLength ) + ':' + QString::number( __LINE__ ) + " (" + __FUNCTION__ + ")") );
#define QgsSetRequestInitiatorId(request, str) request.setAttribute( static_cast< QNetworkRequest::Attribute >( QgsNetworkRequestParameters::AttributeInitiatorRequestId ), QString(QString( __FILE__ ).mid( sFilePrefixLength ) + ':' + QString::number( __LINE__ ) + " (" + __FUNCTION__ + "): " + str) );

#define QgsSetCPLHTTPFetchOverriderInitiatorClass(overrider, _class) QgsSetRequestInitiatorClass((overrider), _class)
#endif // QGSSETREQUESTINITIATOR_P_H
1 change: 1 addition & 0 deletions src/core/pointcloud/qgscopcpointcloudblockrequest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "qgslazdecoder.h"
#include "qgsapplication.h"
#include "qgsnetworkaccessmanager.h"
#include "qgssetrequestinitiator_p.h"

//
// QgsCopcPointCloudBlockRequest
Expand Down
1 change: 1 addition & 0 deletions src/core/pointcloud/qgseptpointcloudblockrequest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "qgslazdecoder.h"
#include "qgsapplication.h"
#include "qgsnetworkaccessmanager.h"
#include "qgssetrequestinitiator_p.h"

//
// QgsEptPointCloudBlockRequest
Expand Down
1 change: 1 addition & 0 deletions src/core/pointcloud/qgslazinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "qgslogger.h"
#include "qgsblockingnetworkrequest.h"
#include "qgsnetworkaccessmanager.h"
#include "qgssetrequestinitiator_p.h"

#include "lazperf/readers.hpp"

Expand Down
1 change: 1 addition & 0 deletions src/core/pointcloud/qgsremotecopcpointcloudindex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include "qgscachedpointcloudblockrequest.h"
#include "qgspointcloudexpression.h"
#include "qgsnetworkaccessmanager.h"
#include "qgssetrequestinitiator_p.h"

///@cond PRIVATE

Expand Down
1 change: 1 addition & 0 deletions src/core/pointcloud/qgsremoteeptpointcloudindex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include "qgscachedpointcloudblockrequest.h"
#include "qgspointcloudexpression.h"
#include "qgsnetworkaccessmanager.h"
#include "qgssetrequestinitiator_p.h"

///@cond PRIVATE

Expand Down
1 change: 1 addition & 0 deletions src/core/providers/arcgis/qgsarcgisrestquery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "qgsarcgisrestutils.h"
#include "qgsblockingnetworkrequest.h"
#include "qgsnetworkaccessmanager.h"
#include "qgssetrequestinitiator_p.h"
#include "qgslogger.h"
#include "qgsapplication.h"
#include "qgsmessagelog.h"
Expand Down
2 changes: 2 additions & 0 deletions src/core/providers/ogr/qgsogrfeatureiterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#include "qgssymbol.h"
#include "qgsgeometryengine.h"
#include "qgsdbquerylog.h"
#include "qgsdbquerylog_p.h"
#include "qgssetrequestinitiator_p.h"

#include <sqlite3.h>

Expand Down
2 changes: 2 additions & 0 deletions src/core/providers/ogr/qgsogrprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ email : sherman at mrcc.com
#include "qgsproviderregistry.h"
#include "qgsvariantutils.h"
#include "qgsjsonutils.h"
#include "qgssetrequestinitiator_p.h"

#include <nlohmann/json.hpp>

#define CPL_SUPRESS_CPLUSPLUS //#spellok
Expand Down
1 change: 1 addition & 0 deletions src/core/providers/ogr/qgsogrproviderconnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "qgsfielddomain.h"
#include "qgsogrproviderutils.h"
#include "qgsdbquerylog.h"
#include "qgsdbquerylog_p.h"
#include "qgsprovidersublayerdetails.h"
#include "qgsweakrelation.h"
#if GDAL_VERSION_NUM < GDAL_COMPUTE_VERSION(3,4,0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "qgssensorthingsutils.h"
#include "qgsapplication.h"
#include "qgsnetworkaccessmanager.h"
#include "qgssetrequestinitiator_p.h"
#include "qgsblockingnetworkrequest.h"
#include "qgsthreadingutils.h"
#include "qgsreadwritelocker.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "qgslogger.h"
#include "qgsreadwritelocker.h"
#include "qgsblockingnetworkrequest.h"
#include "qgssetrequestinitiator_p.h"
#include "qgsnetworkaccessmanager.h"
#include "qgsjsonutils.h"

Expand Down
1 change: 1 addition & 0 deletions src/core/providers/sensorthings/qgssensorthingsutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "qgsfield.h"
#include "qgsfields.h"
#include "qgswkbtypes.h"
#include "qgssetrequestinitiator_p.h"
#include "qgsnetworkaccessmanager.h"
#include "qgsblockingnetworkrequest.h"
#include "qgslogger.h"
Expand Down
6 changes: 1 addition & 5 deletions src/core/qgsabstractcontentcache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
***************************************************************************/

#include "qgsabstractcontentcache.h"
#include "qgssetrequestinitiator_p.h"

//
// QgsAbstractContentCacheEntry
Expand All @@ -39,8 +40,3 @@ void QgsAbstractContentCacheBase::onRemoteContentFetched( const QString &, bool
{

}





Loading

0 comments on commit b105226

Please sign in to comment.