Skip to content

Commit f67a049

Browse files
author
mhugent
committedMay 15, 2010
Move setWindowIcon from qgsapplication.cpp to main.cpp. Because QGIS mapserver uses qgsapplication, but it does not have access to an x-server instance
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@13494 c8812cc2-4d05-0410-92ff-de0c093fc19c

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed
 

‎src/app/main.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@ typedef SInt32 SRefCon;
7373
#include "qgsrectangle.h"
7474
#include "qgslogger.h"
7575

76+
// (if Windows/Mac, use icon from resource)
77+
#if ! defined(Q_WS_WIN) && ! defined(Q_WS_MAC)
78+
#include "../../images/themes/default/qgis.xpm" // Linux
79+
#include <QIcon>
80+
#endif
81+
7682
static const char * const ident_ = "$Id$";
7783

7884
/** print usage text
@@ -469,6 +475,12 @@ int main( int argc, char *argv[] )
469475
exit( 1 ); //exit for now until a version of qgis is capabable of running non interactive
470476
}
471477
QgsApplication myApp( argc, argv, myUseGuiFlag );
478+
479+
// (if Windows/Mac, use icon from resource)
480+
#if ! defined(Q_WS_WIN) && ! defined(Q_WS_MAC)
481+
myApp.setWindowIcon( QPixmap( qgis_xpm ) ); // Linux
482+
#endif
483+
472484
//
473485
// Set up the QSettings environment must be done after qapp is created
474486
QCoreApplication::setOrganizationName( "QuantumGIS" );

‎src/core/qgsapplication.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,6 @@
2424
#include <QPalette>
2525
#include <QSettings>
2626

27-
// (if Windows/Mac, use icon from resource)
28-
#if ! defined(Q_WS_WIN) && ! defined(Q_WS_MAC)
29-
#include "../../images/themes/default/qgis.xpm" // Linux
30-
#include <QIcon>
31-
#endif
3227
#ifndef Q_WS_WIN
3328
#include <netinet/in.h>
3429
#else
@@ -70,11 +65,6 @@ QgsApplication::QgsApplication( int & argc, char ** argv, bool GUIenabled )
7065
setPrefixPath( myPrefix, true );
7166
#endif
7267

73-
// set application's icon (if Windows/Mac, use icon from resource)
74-
#if ! defined(Q_WS_WIN) && ! defined(Q_WS_MAC)
75-
setWindowIcon( QPixmap( qgis_xpm ) ); // Linux
76-
#endif
77-
7868
mDefaultSvgPaths << mPkgDataPath + QString( "/svg/" );
7969
mDefaultSvgPaths << qgisSettingsDirPath() + QString( "svg/" );
8070
}

0 commit comments

Comments
 (0)
Please sign in to comment.