File tree Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ email : tim@linfiniti.com
27
27
#include " plugin.h"
28
28
#include " qgsproject.h"
29
29
#include " qgsmapcanvas.h"
30
+ #include " ../../src/qgsapplication.h"
30
31
31
32
// qt includes
32
33
#include < QPainter>
@@ -161,11 +162,10 @@ void QgsNorthArrowPlugin::renderNorthArrow(QPainter * theQPainter)
161
162
if (mEnable )
162
163
{
163
164
QPixmap myQPixmap; // to store the north arrow image in
164
- #if defined(WIN32) || defined(Q_OS_MACX)
165
- QString PKGDATAPATH = qApp->applicationDirPath () + " /share/qgis" ;
166
- #endif
167
- QString myFileNameQString = QString (PKGDATAPATH) +
168
- QString (" /images/north_arrows/default.png" );
165
+
166
+ QString myFileNameQString = QgsApplication::pkgDataPath () +
167
+ " /images/north_arrows/default.png" ;
168
+
169
169
// std::cout << "Trying to load " << myFileNameQString << std::cout;
170
170
if (myQPixmap.load (myFileNameQString))
171
171
{
Original file line number Diff line number Diff line change 10
10
* (at your option) any later version. *
11
11
***************************************************************************/
12
12
#include " plugingui.h"
13
+ #include " ../../src/qgsapplication.h"
13
14
14
15
#include < QPainter>
15
16
#include < cmath>
@@ -95,10 +96,7 @@ void QgsNorthArrowPluginGui::on_sliderRotation_valueChanged( int theInt)
95
96
void QgsNorthArrowPluginGui::rotatePixmap (int theRotationInt)
96
97
{
97
98
QPixmap myQPixmap;
98
- #if defined(WIN32) || defined(Q_OS_MACX)
99
- QString PKGDATAPATH = qApp->applicationDirPath () + " /share/qgis" ;
100
- #endif
101
- QString myFileNameQString = QString (PKGDATAPATH) + QString (" /images/north_arrows/default.png" );
99
+ QString myFileNameQString = QgsApplication::pkgDataPath () + " /images/north_arrows/default.png" ;
102
100
// std::cout << "Trying to load " << myFileNameQString << std::cout;
103
101
if (myQPixmap.load (myFileNameQString))
104
102
{
You can’t perform that action at this time.
0 commit comments