Skip to content

Commit dbe0c9e

Browse files
committedApr 7, 2013
update .qgis to .qgis2 (to be updated on release and some more utf8 fixes
(fixes #7537)
1 parent 2db0f62 commit dbe0c9e

File tree

6 files changed

+10
-9
lines changed

6 files changed

+10
-9
lines changed
 

‎python/console/console_sci.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,11 @@
3030
import os
3131
import code
3232

33+
from qgis.core import QgsApplication
34+
3335
_init_commands = ["from qgis.core import *", "import qgis.utils",
3436
"from qgis.utils import iface"]
35-
_historyFile = os.path.join(str(QDir.homePath()),".qgis","console_history.txt")
37+
_historyFile = unicode( QgsApplication.qgisSettingsDirPath() + "console_history.txt" )
3638

3739
class PythonEdit(QsciScintilla, code.InteractiveInterpreter):
3840
def __init__(self, parent=None):
@@ -144,8 +146,6 @@ def commandConsole(self, command):
144146
self.setFocus()
145147

146148
def setLexers(self):
147-
from qgis.core import QgsApplication
148-
149149
self.lexer = QsciLexerPython()
150150
settings = QSettings()
151151
loadFont = settings.value("pythonConsole/fontfamilytext", "Monospace").toString()

‎python/plugins/GdalTools/GdalTools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
# if the plugin is shipped with QGis catch the exception and
4040
# display an error message
4141
import os.path
42-
qgisUserPluginPath = os.path.abspath( os.path.join( str( QgsApplication.qgisSettingsDirPath() ), "python") )
42+
qgisUserPluginPath = os.path.abspath( os.path.join( unicode( QgsApplication.qgisSettingsDirPath() ), "python") )
4343
if not os.path.dirname(__file__).startswith( qgisUserPluginPath ):
4444
title = QCoreApplication.translate( "GdalTools", "Plugin error" )
4545
message = QCoreApplication.translate( "GdalTools", u'Unable to load %1 plugin. \nThe required "%2" module is missing. \nInstall it and try again.' )

‎python/plugins/sextante/otb/helper/generate_application_descriptors.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@
2727

2828
import os, sys
2929
import otbApplication
30+
from qgis.core import QgsApplication
3031

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

3435
def convertendl(s):

‎src/app/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ int main( int argc, char *argv[] )
276276
#if defined(ANDROID)
277277
QgsDebugMsg( QString( "Android: All params stripped" ) );// Param %1" ).arg( argv[0] ) );
278278
//put all QGIS settings in the same place
279-
configpath = QDir::homePath() + QString( "/.qgis/" );
279+
configpath = QgsApplication::qgisSettingsPath();
280280
QgsDebugMsg( QString( "Android: configpath set to %1" ).arg( configpath ) );
281281
#elif defined(Q_WS_WIN)
282282
for ( int i = 1; i < argc; i++ )

‎src/core/qgsapplication.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ void QgsApplication::init( QString customConfigPath )
8484
{
8585
if ( customConfigPath.isEmpty() )
8686
{
87-
customConfigPath = QDir::homePath() + QString( "/.qgis2/" );
87+
customConfigPath = QDir::homePath() + QString( "/.qgis%1/" ).arg( 2 /* FIXME QGis::QGIS_VERSION_INT / 10000 */ );
8888
}
8989

9090
qRegisterMetaType<QgsGeometry::Error>( "QgsGeometry::Error" );

‎src/python/qgspythonutilsimpl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -451,9 +451,9 @@ QString QgsPythonUtilsImpl::pluginsPath()
451451
QString QgsPythonUtilsImpl::homePythonPath()
452452
{
453453
QString settingsDir = QgsApplication::qgisSettingsDirPath();
454-
if ( QDir::cleanPath( settingsDir ) == QDir::homePath() + "/.qgis" )
454+
if ( QDir::cleanPath( settingsDir ) == QDir::homePath() + QString( "/.qgis%1" ).arg( 2 /* FIXME QGis::QGIS_VERSION_INT / 10000 */ ) )
455455
{
456-
return "os.path.expanduser(\"~/.qgis/python\")";
456+
return QString( "os.path.expanduser(\"~/.qgis%1/python\")" ).arg( 2 /* FIXME: QGis::QGIS_VERSION_INT / 10000 */ );
457457
}
458458
else
459459
{

0 commit comments

Comments
 (0)
Please sign in to comment.