Skip to content
Permalink
Browse files
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
  • Loading branch information
timlinux committed May 21, 2008
1 parent e59d060 commit 73fbecbc1dbfb6d2c371edf715f03f5e1e223e20
Showing with 18 additions and 8 deletions.
  1. +15 −8 src/core/qgsapplication.cpp
  2. +3 −0 src/core/qgsapplication.h
@@ -51,21 +51,16 @@ QString QgsApplication::mThemePath;
QgsApplication::QgsApplication(int & argc, char ** argv, bool GUIenabled)
: QApplication(argc, argv, GUIenabled)
{
QgsDebugMsg("\n**********************************");
QgsDebugMsg("\nInitialising QgsApplication...");
#if defined(Q_WS_MACX) || defined(Q_WS_WIN32) || defined(WIN32)
setPrefixPath(applicationDirPath(), true);
#else
QDir myDir(applicationDirPath());
myDir.cdUp();
QString myPrefix = myDir.absolutePath();
QgsDebugMsg("Prefix: " + myPrefix.toLocal8Bit());
setPrefixPath(myPrefix, true);
#endif
QgsDebugMsg("\nPlugin Path:" + mPluginPath);
QgsDebugMsg("\nPkgData Path:" + mPkgDataPath);
QgsDebugMsg("\nTheme Path:" + mThemePath);
QgsDebugMsg("\n**********************************\n");
//for debuggin
showSettings();
}

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

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

void QgsApplication::showSettings()
{
qDebug("\n**********************************");
qDebug("QgsApplication state:");
qDebug("Prefix :" + mPrefixPath.toLocal8Bit());
qDebug("Plugin Path :" + mPluginPath.toLocal8Bit());
qDebug("PkgData Path :" + mPkgDataPath.toLocal8Bit());
qDebug("Theme Path :" + mThemePath.toLocal8Bit());
qDebug("**********************************\n");
}

QString QgsApplication::reportStyleSheet()
{
QString myStyle;
@@ -295,3 +300,5 @@ QString QgsApplication::reportStyleSheet()
"}";
return myStyle;
}


@@ -113,6 +113,9 @@ class CORE_EXPORT QgsApplication: public QApplication
* the gradient fills for backgrounds.
*/
static QString reportStyleSheet();
/** Print to stdout the paths used in this application instance.
* useful for debugging mainly.*/
static void showSettings();
private:
static QString mPrefixPath;
static QString mPluginPath;

0 comments on commit 73fbecb

Please sign in to comment.