Skip to content
Permalink
Browse files

update .qgis to .qgis2 (to be updated on release and some more utf8 f…

…ixes

(fixes #7537)
  • Loading branch information
jef-n committed Apr 7, 2013
1 parent 2db0f62 commit dbe0c9e9ec7de8fd4b24fee5a2c36f2f693273c4
@@ -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):
@@ -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()
@@ -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.' )
@@ -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):
@@ -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++ )
@@ -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" );
@@ -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
{

0 comments on commit dbe0c9e

Please sign in to comment.
You can’t perform that action at this time.