Skip to content

Commit

Permalink
update .qgis to .qgis2 (to be updated on release and some more utf8 f…
Browse files Browse the repository at this point in the history
…ixes

(fixes #7537)
  • Loading branch information
jef-n committed Apr 7, 2013
1 parent 2db0f62 commit dbe0c9e
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 9 deletions.
6 changes: 3 additions & 3 deletions python/console/console_sci.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@
import os
import code

from qgis.core import QgsApplication

_init_commands = ["from qgis.core import *", "import qgis.utils",
"from qgis.utils import iface"]
_historyFile = os.path.join(str(QDir.homePath()),".qgis","console_history.txt")
_historyFile = unicode( QgsApplication.qgisSettingsDirPath() + "console_history.txt" )

class PythonEdit(QsciScintilla, code.InteractiveInterpreter):
def __init__(self, parent=None):
Expand Down Expand Up @@ -144,8 +146,6 @@ def commandConsole(self, command):
self.setFocus()

def setLexers(self):
from qgis.core import QgsApplication

self.lexer = QsciLexerPython()
settings = QSettings()
loadFont = settings.value("pythonConsole/fontfamilytext", "Monospace").toString()
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/GdalTools/GdalTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
# if the plugin is shipped with QGis catch the exception and
# display an error message
import os.path
qgisUserPluginPath = os.path.abspath( os.path.join( str( QgsApplication.qgisSettingsDirPath() ), "python") )
qgisUserPluginPath = os.path.abspath( os.path.join( unicode( QgsApplication.qgisSettingsDirPath() ), "python") )
if not os.path.dirname(__file__).startswith( qgisUserPluginPath ):
title = QCoreApplication.translate( "GdalTools", "Plugin error" )
message = QCoreApplication.translate( "GdalTools", u'Unable to load %1 plugin. \nThe required "%2" module is missing. \nInstall it and try again.' )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@

import os, sys
import otbApplication
from qgis.core import QgsApplication

outputpath= os.path.join( os.environ["HOME"], ".qgis/python/plugins/sextante/otb/description" )
outputpath = unicode( QgsApplication.qgisSettingsDirPath() + "python/plugins/sextante/otb/description" )
endl = os.linesep

def convertendl(s):
Expand Down
2 changes: 1 addition & 1 deletion src/app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ int main( int argc, char *argv[] )
#if defined(ANDROID)
QgsDebugMsg( QString( "Android: All params stripped" ) );// Param %1" ).arg( argv[0] ) );
//put all QGIS settings in the same place
configpath = QDir::homePath() + QString( "/.qgis/" );
configpath = QgsApplication::qgisSettingsPath();
QgsDebugMsg( QString( "Android: configpath set to %1" ).arg( configpath ) );
#elif defined(Q_WS_WIN)
for ( int i = 1; i < argc; i++ )
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsapplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ void QgsApplication::init( QString customConfigPath )
{
if ( customConfigPath.isEmpty() )
{
customConfigPath = QDir::homePath() + QString( "/.qgis2/" );
customConfigPath = QDir::homePath() + QString( "/.qgis%1/" ).arg( 2 /* FIXME QGis::QGIS_VERSION_INT / 10000 */ );
}

qRegisterMetaType<QgsGeometry::Error>( "QgsGeometry::Error" );
Expand Down
4 changes: 2 additions & 2 deletions src/python/qgspythonutilsimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -451,9 +451,9 @@ QString QgsPythonUtilsImpl::pluginsPath()
QString QgsPythonUtilsImpl::homePythonPath()
{
QString settingsDir = QgsApplication::qgisSettingsDirPath();
if ( QDir::cleanPath( settingsDir ) == QDir::homePath() + "/.qgis" )
if ( QDir::cleanPath( settingsDir ) == QDir::homePath() + QString( "/.qgis%1" ).arg( 2 /* FIXME QGis::QGIS_VERSION_INT / 10000 */ ) )
{
return "os.path.expanduser(\"~/.qgis/python\")";
return QString( "os.path.expanduser(\"~/.qgis%1/python\")" ).arg( 2 /* FIXME: QGis::QGIS_VERSION_INT / 10000 */ );
}
else
{
Expand Down

0 comments on commit dbe0c9e

Please sign in to comment.