Skip to content

Commit

Permalink
Added show settings to show application var state when debugging
Browse files Browse the repository at this point in the history
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 73fbecb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
23 changes: 15 additions & 8 deletions src/core/qgsapplication.cpp
Expand Up @@ -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()
Expand All @@ -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)
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -295,3 +300,5 @@ QString QgsApplication::reportStyleSheet()
"}";
return myStyle;
}


3 changes: 3 additions & 0 deletions src/core/qgsapplication.h
Expand Up @@ -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;
Expand Down

0 comments on commit 73fbecb

Please sign in to comment.