summaryrefslogtreecommitdiffstats
path: root/Source/QtDialog/CMakeSetup.cxx
diff options
context:
space:
mode:
authorClinton Stimpson <clinton@elemtech.com>2012-07-06 19:26:39 (GMT)
committerClinton Stimpson <clinton@elemtech.com>2012-07-06 19:26:39 (GMT)
commitecfc53da7e93a3c9081d31b25cc7950aa5b780f7 (patch)
treee421bbb76d5f4a5b05e7c0ef97087f338fda0f18 /Source/QtDialog/CMakeSetup.cxx
parent370c422def60c84dc54da9c92cacf9b6ff7522ac (diff)
downloadCMake-ecfc53da7e93a3c9081d31b25cc7950aa5b780f7.zip
CMake-ecfc53da7e93a3c9081d31b25cc7950aa5b780f7.tar.gz
CMake-ecfc53da7e93a3c9081d31b25cc7950aa5b780f7.tar.bz2
cmake-gui: Fix code to respect current locale.
This means non-ascii characters now work correctly on systems that have a non-ascii 8 bit encoding as the current locale.
Diffstat (limited to 'Source/QtDialog/CMakeSetup.cxx')
-rw-r--r--Source/QtDialog/CMakeSetup.cxx20
1 files changed, 13 insertions, 7 deletions
diff --git a/Source/QtDialog/CMakeSetup.cxx b/Source/QtDialog/CMakeSetup.cxx
index b4f3d72..c942bc4 100644
--- a/Source/QtDialog/CMakeSetup.cxx
+++ b/Source/QtDialog/CMakeSetup.cxx
@@ -125,7 +125,7 @@ int main(int argc, char** argv)
// pick up translation files if they exists in the data directory
QDir translationsDir = cmExecDir;
- translationsDir.cd(".." CMAKE_DATA_DIR);
+ translationsDir.cd(QString::fromLocal8Bit(".." CMAKE_DATA_DIR));
translationsDir.cd("i18n");
QTranslator translator;
QString transfile = QString("cmake_%1").arg(QLocale::system().name());
@@ -157,15 +157,15 @@ int main(int argc, char** argv)
arg.Parse();
if(!sourceDirectory.empty() && !binaryDirectory.empty())
{
- dialog.setSourceDirectory(sourceDirectory.c_str());
- dialog.setBinaryDirectory(binaryDirectory.c_str());
+ dialog.setSourceDirectory(QString::fromLocal8Bit(sourceDirectory.c_str()));
+ dialog.setBinaryDirectory(QString::fromLocal8Bit(binaryDirectory.c_str()));
}
else
{
QStringList args = app.arguments();
if(args.count() == 2)
{
- cmsys_stl::string filePath = cmSystemTools::CollapseFullPath(args[1].toAscii().data());
+ cmsys_stl::string filePath = cmSystemTools::CollapseFullPath(args[1].toLocal8Bit().data());
// check if argument is a directory containing CMakeCache.txt
cmsys_stl::string buildFilePath =
@@ -184,12 +184,18 @@ int main(int argc, char** argv)
if(cmSystemTools::FileExists(buildFilePath.c_str()))
{
- dialog.setBinaryDirectory(cmSystemTools::GetFilenamePath(buildFilePath).c_str());
+ dialog.setBinaryDirectory(
+ QString::fromLocal8Bit(
+ cmSystemTools::GetFilenamePath(buildFilePath).c_str()
+ )
+ );
}
else if(cmSystemTools::FileExists(srcFilePath.c_str()))
{
- dialog.setSourceDirectory(filePath.c_str());
- dialog.setBinaryDirectory(cmSystemTools::CollapseFullPath(".").c_str());
+ dialog.setSourceDirectory(QString::fromLocal8Bit(filePath.c_str()));
+ dialog.setBinaryDirectory(
+ QString::fromLocal8Bit(cmSystemTools::CollapseFullPath(".").c_str())
+ );
}
}
}