Skip to content

Commit 73fbecb

Browse files
author
timlinux
committed
Added show settings to show application var state when debugging
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@8484 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent e59d060 commit 73fbecb

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

src/core/qgsapplication.cpp

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,21 +51,16 @@ QString QgsApplication::mThemePath;
5151
QgsApplication::QgsApplication(int & argc, char ** argv, bool GUIenabled)
5252
: QApplication(argc, argv, GUIenabled)
5353
{
54-
QgsDebugMsg("\n**********************************");
55-
QgsDebugMsg("\nInitialising QgsApplication...");
5654
#if defined(Q_WS_MACX) || defined(Q_WS_WIN32) || defined(WIN32)
5755
setPrefixPath(applicationDirPath(), true);
5856
#else
5957
QDir myDir(applicationDirPath());
6058
myDir.cdUp();
6159
QString myPrefix = myDir.absolutePath();
62-
QgsDebugMsg("Prefix: " + myPrefix.toLocal8Bit());
6360
setPrefixPath(myPrefix, true);
6461
#endif
65-
QgsDebugMsg("\nPlugin Path:" + mPluginPath);
66-
QgsDebugMsg("\nPkgData Path:" + mPkgDataPath);
67-
QgsDebugMsg("\nTheme Path:" + mThemePath);
68-
QgsDebugMsg("\n**********************************\n");
62+
//for debuggin
63+
showSettings();
6964
}
7065

7166
QgsApplication::~QgsApplication()
@@ -84,7 +79,6 @@ void QgsApplication::setPrefixPath(const QString thePrefixPath, bool useDefaultP
8479
void QgsApplication::setPluginPath(const QString thePluginPath)
8580
{
8681
mPluginPath = thePluginPath;
87-
QgsDebugMsg("\n\n\n\n\n +++++++++++++++++++++++\n plugin path changed\n" + mPluginPath + "\n +++++++++++++++++ \n\n\n\n");
8882
}
8983

9084
void QgsApplication::setPkgDataPath(const QString thePkgDataPath)
@@ -248,6 +242,17 @@ void QgsApplication::exitQgis()
248242
delete QgsProviderRegistry::instance();
249243
}
250244

245+
void QgsApplication::showSettings()
246+
{
247+
qDebug("\n**********************************");
248+
qDebug("QgsApplication state:");
249+
qDebug("Prefix :" + mPrefixPath.toLocal8Bit());
250+
qDebug("Plugin Path :" + mPluginPath.toLocal8Bit());
251+
qDebug("PkgData Path :" + mPkgDataPath.toLocal8Bit());
252+
qDebug("Theme Path :" + mThemePath.toLocal8Bit());
253+
qDebug("**********************************\n");
254+
}
255+
251256
QString QgsApplication::reportStyleSheet()
252257
{
253258
QString myStyle;
@@ -295,3 +300,5 @@ QString QgsApplication::reportStyleSheet()
295300
"}";
296301
return myStyle;
297302
}
303+
304+

src/core/qgsapplication.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ class CORE_EXPORT QgsApplication: public QApplication
113113
* the gradient fills for backgrounds.
114114
*/
115115
static QString reportStyleSheet();
116+
/** Print to stdout the paths used in this application instance.
117+
* useful for debugging mainly.*/
118+
static void showSettings();
116119
private:
117120
static QString mPrefixPath;
118121
static QString mPluginPath;

0 commit comments

Comments
 (0)