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.
This commit is contained in:
Clinton Stimpson 2012-07-06 13:26:39 -06:00
parent 370c422def
commit ecfc53da7e
6 changed files with 90 additions and 86 deletions

View File

@ -15,7 +15,7 @@
#include <QCompleter> #include <QCompleter>
static const int NumTypes = 4; static const int NumTypes = 4;
static const QString TypeStrings[NumTypes] = static const QByteArray TypeStrings[NumTypes] =
{ "BOOL", "PATH", "FILEPATH", "STRING" }; { "BOOL", "PATH", "FILEPATH", "STRING" };
static const QCMakeProperty::PropertyType Types[NumTypes] = static const QCMakeProperty::PropertyType Types[NumTypes] =
{ QCMakeProperty::BOOL, QCMakeProperty::PATH, { QCMakeProperty::BOOL, QCMakeProperty::PATH,

View File

@ -125,7 +125,7 @@ int main(int argc, char** argv)
// pick up translation files if they exists in the data directory // pick up translation files if they exists in the data directory
QDir translationsDir = cmExecDir; QDir translationsDir = cmExecDir;
translationsDir.cd(".." CMAKE_DATA_DIR); translationsDir.cd(QString::fromLocal8Bit(".." CMAKE_DATA_DIR));
translationsDir.cd("i18n"); translationsDir.cd("i18n");
QTranslator translator; QTranslator translator;
QString transfile = QString("cmake_%1").arg(QLocale::system().name()); QString transfile = QString("cmake_%1").arg(QLocale::system().name());
@ -157,15 +157,15 @@ int main(int argc, char** argv)
arg.Parse(); arg.Parse();
if(!sourceDirectory.empty() && !binaryDirectory.empty()) if(!sourceDirectory.empty() && !binaryDirectory.empty())
{ {
dialog.setSourceDirectory(sourceDirectory.c_str()); dialog.setSourceDirectory(QString::fromLocal8Bit(sourceDirectory.c_str()));
dialog.setBinaryDirectory(binaryDirectory.c_str()); dialog.setBinaryDirectory(QString::fromLocal8Bit(binaryDirectory.c_str()));
} }
else else
{ {
QStringList args = app.arguments(); QStringList args = app.arguments();
if(args.count() == 2) 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 // check if argument is a directory containing CMakeCache.txt
cmsys_stl::string buildFilePath = cmsys_stl::string buildFilePath =
@ -184,12 +184,18 @@ int main(int argc, char** argv)
if(cmSystemTools::FileExists(buildFilePath.c_str())) 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())) else if(cmSystemTools::FileExists(srcFilePath.c_str()))
{ {
dialog.setSourceDirectory(filePath.c_str()); dialog.setSourceDirectory(QString::fromLocal8Bit(filePath.c_str()));
dialog.setBinaryDirectory(cmSystemTools::CollapseFullPath(".").c_str()); dialog.setBinaryDirectory(
QString::fromLocal8Bit(cmSystemTools::CollapseFullPath(".").c_str())
);
} }
} }
} }

View File

@ -299,9 +299,8 @@ bool CMakeSetupDialog::prepareConfigure()
if(!dir.exists()) if(!dir.exists())
{ {
QString msg = tr("Build directory does not exist, " QString msg = tr("Build directory does not exist, "
"should I create it?") "should I create it?\n\n"
+ "\n\n" "Directory: ");
+ tr("Directory: ");
msg += bindir; msg += bindir;
QString title = tr("Create Directory"); QString title = tr("Create Directory");
QMessageBox::StandardButton btn; QMessageBox::StandardButton btn;
@ -490,9 +489,9 @@ void CMakeSetupDialog::closeEvent(QCloseEvent* e)
// don't close if we're busy, unless the user really wants to // don't close if we're busy, unless the user really wants to
if(this->CurrentState == Configuring) if(this->CurrentState == Configuring)
{ {
QString msg = "You are in the middle of a Configure.\n" QString msg = tr("You are in the middle of a Configure.\n"
"If you Exit now the configure information will be lost.\n" "If you Exit now the configure information will be lost.\n"
"Are you sure you want to Exit?"; "Are you sure you want to Exit?");
QString title = tr("Confirm Exit"); QString title = tr("Confirm Exit");
QMessageBox::StandardButton btn; QMessageBox::StandardButton btn;
btn = QMessageBox::critical(this, title, msg, btn = QMessageBox::critical(this, title, msg,
@ -715,33 +714,33 @@ bool CMakeSetupDialog::setupFirstConfigure()
QString mode = dialog.getCrossIncludeMode(); QString mode = dialog.getCrossIncludeMode();
m->insertProperty(QCMakeProperty::STRING, "CMAKE_FIND_ROOT_PATH_MODE_INCLUDE", m->insertProperty(QCMakeProperty::STRING, "CMAKE_FIND_ROOT_PATH_MODE_INCLUDE",
"CMake Find Include Mode", mode, false); tr("CMake Find Include Mode"), mode, false);
mode = dialog.getCrossLibraryMode(); mode = dialog.getCrossLibraryMode();
m->insertProperty(QCMakeProperty::STRING, "CMAKE_FIND_ROOT_PATH_MODE_LIBRARY", m->insertProperty(QCMakeProperty::STRING, "CMAKE_FIND_ROOT_PATH_MODE_LIBRARY",
"CMake Find Library Mode", mode, false); tr("CMake Find Library Mode"), mode, false);
mode = dialog.getCrossProgramMode(); mode = dialog.getCrossProgramMode();
m->insertProperty(QCMakeProperty::STRING, "CMAKE_FIND_ROOT_PATH_MODE_PROGRAM", m->insertProperty(QCMakeProperty::STRING, "CMAKE_FIND_ROOT_PATH_MODE_PROGRAM",
"CMake Find Program Mode", mode, false); tr("CMake Find Program Mode"), mode, false);
QString rootPath = dialog.getCrossRoot(); QString rootPath = dialog.getCrossRoot();
m->insertProperty(QCMakeProperty::PATH, "CMAKE_FIND_ROOT_PATH", m->insertProperty(QCMakeProperty::PATH, "CMAKE_FIND_ROOT_PATH",
"CMake Find Root Path", rootPath, false); tr("CMake Find Root Path"), rootPath, false);
QString systemName = dialog.getSystemName(); QString systemName = dialog.getSystemName();
m->insertProperty(QCMakeProperty::STRING, "CMAKE_SYSTEM_NAME", m->insertProperty(QCMakeProperty::STRING, "CMAKE_SYSTEM_NAME",
"CMake System Name", systemName, false); tr("CMake System Name"), systemName, false);
QString cxxCompiler = dialog.getCXXCompiler(); QString cxxCompiler = dialog.getCXXCompiler();
m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_CXX_COMPILER", m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_CXX_COMPILER",
"CXX compiler.", cxxCompiler, false); tr("CXX compiler."), cxxCompiler, false);
QString cCompiler = dialog.getCCompiler(); QString cCompiler = dialog.getCCompiler();
m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_C_COMPILER", m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_C_COMPILER",
"C compiler.", cCompiler, false); tr("C compiler."), cCompiler, false);
} }
else if(dialog.crossCompilerToolChainFile()) else if(dialog.crossCompilerToolChainFile())
{ {
QString toolchainFile = dialog.getCrossCompilerToolChainFile(); QString toolchainFile = dialog.getCrossCompilerToolChainFile();
m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_TOOLCHAIN_FILE", m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_TOOLCHAIN_FILE",
"Cross Compile ToolChain File", toolchainFile, false); tr("Cross Compile ToolChain File"), toolchainFile, false);
} }
return true; return true;
} }
@ -772,7 +771,7 @@ void CMakeSetupDialog::doReloadCache()
void CMakeSetupDialog::doDeleteCache() void CMakeSetupDialog::doDeleteCache()
{ {
QString title = tr("Delete Cache"); QString title = tr("Delete Cache");
QString msg = "Are you sure you want to delete the cache?"; QString msg = tr("Are you sure you want to delete the cache?");
QMessageBox::StandardButton btn; QMessageBox::StandardButton btn;
btn = QMessageBox::information(this, title, msg, btn = QMessageBox::information(this, title, msg,
QMessageBox::Yes | QMessageBox::No); QMessageBox::Yes | QMessageBox::No);
@ -786,9 +785,9 @@ void CMakeSetupDialog::doDeleteCache()
void CMakeSetupDialog::doAbout() void CMakeSetupDialog::doAbout()
{ {
QString msg = "CMake %1\n" QString msg = tr("CMake %1\n"
"Using Qt %2\n" "Using Qt %2\n"
"www.cmake.org"; "www.cmake.org");
msg = msg.arg(cmVersion::GetCMakeVersion()); msg = msg.arg(cmVersion::GetCMakeVersion());
msg = msg.arg(qVersion()); msg = msg.arg(qVersion());

View File

@ -17,10 +17,10 @@ StartCompilerSetup::StartCompilerSetup(QWidget* p)
l->addWidget(this->GeneratorOptions); l->addWidget(this->GeneratorOptions);
l->addSpacing(6); l->addSpacing(6);
this->CompilerSetupOptions[0] = new QRadioButton("Use default native compilers", this); this->CompilerSetupOptions[0] = new QRadioButton(tr("Use default native compilers"), this);
this->CompilerSetupOptions[1] = new QRadioButton("Specify native compilers", this); this->CompilerSetupOptions[1] = new QRadioButton(tr("Specify native compilers"), this);
this->CompilerSetupOptions[2] = new QRadioButton("Specify toolchain file for cross-compiling", this); this->CompilerSetupOptions[2] = new QRadioButton(tr("Specify toolchain file for cross-compiling"), this);
this->CompilerSetupOptions[3] = new QRadioButton("Specify options for cross-compiling", this); this->CompilerSetupOptions[3] = new QRadioButton(tr("Specify options for cross-compiling"), this);
l->addWidget(this->CompilerSetupOptions[0]); l->addWidget(this->CompilerSetupOptions[0]);
l->addWidget(this->CompilerSetupOptions[1]); l->addWidget(this->CompilerSetupOptions[1]);
l->addWidget(this->CompilerSetupOptions[2]); l->addWidget(this->CompilerSetupOptions[2]);
@ -159,9 +159,9 @@ CrossCompilerSetup::CrossCompilerSetup(QWidget* p)
// fill in combo boxes // fill in combo boxes
QStringList modes; QStringList modes;
modes << "Search in Target Root, then native system"; modes << tr("Search in Target Root, then native system");
modes << "Search only in Target Root"; modes << tr("Search only in Target Root");
modes << "Search only in native system"; modes << tr("Search only in native system");
crossProgramMode->addItems(modes); crossProgramMode->addItems(modes);
crossLibraryMode->addItems(modes); crossLibraryMode->addItems(modes);
crossIncludeMode->addItems(modes); crossIncludeMode->addItems(modes);

View File

@ -46,16 +46,16 @@ QCMake::QCMake(QObject* p)
} }
#endif #endif
QString cmakeCommand = QString("cmake")+cmSystemTools::GetExecutableExtension(); QString cmakeCommand = QString("cmake")+QString::fromLocal8Bit(cmSystemTools::GetExecutableExtension());
cmakeCommand = execDir.filePath(cmakeCommand); cmakeCommand = execDir.filePath(cmakeCommand);
cmSystemTools::DisableRunCommandOutput(); cmSystemTools::DisableRunCommandOutput();
cmSystemTools::SetRunCommandHideConsole(true); cmSystemTools::SetRunCommandHideConsole(true);
cmSystemTools::SetErrorCallback(QCMake::errorCallback, this); cmSystemTools::SetErrorCallback(QCMake::errorCallback, this);
cmSystemTools::FindExecutableDirectory(cmakeCommand.toAscii().data()); cmSystemTools::FindExecutableDirectory(cmakeCommand.toLocal8Bit().data());
this->CMakeInstance = new cmake; this->CMakeInstance = new cmake;
this->CMakeInstance->SetCMakeCommand(cmakeCommand.toAscii().data()); this->CMakeInstance->SetCMakeCommand(cmakeCommand.toLocal8Bit().data());
#if defined(Q_OS_MAC) #if defined(Q_OS_MAC)
this->CMakeInstance->SetCMakeEditCommand("cmake-gui.app/Contents/MacOS/cmake-gui"); this->CMakeInstance->SetCMakeEditCommand("cmake-gui.app/Contents/MacOS/cmake-gui");
#else #else
@ -79,7 +79,7 @@ QCMake::QCMake(QObject* p)
{ {
continue; continue;
} }
this->AvailableGenerators.append(iter->c_str()); this->AvailableGenerators.append(QString::fromLocal8Bit(iter->c_str()));
} }
} }
@ -97,7 +97,7 @@ void QCMake::loadCache(const QString& dir)
void QCMake::setSourceDirectory(const QString& _dir) void QCMake::setSourceDirectory(const QString& _dir)
{ {
QString dir = QString dir =
cmSystemTools::GetActualCaseForPath(_dir.toAscii().data()).c_str(); QString::fromLocal8Bit(cmSystemTools::GetActualCaseForPath(_dir.toLocal8Bit().data()).c_str());
if(this->SourceDirectory != dir) if(this->SourceDirectory != dir)
{ {
this->SourceDirectory = QDir::fromNativeSeparators(dir); this->SourceDirectory = QDir::fromNativeSeparators(dir);
@ -108,7 +108,7 @@ void QCMake::setSourceDirectory(const QString& _dir)
void QCMake::setBinaryDirectory(const QString& _dir) void QCMake::setBinaryDirectory(const QString& _dir)
{ {
QString dir = QString dir =
cmSystemTools::GetActualCaseForPath(_dir.toAscii().data()).c_str(); QString::fromLocal8Bit(cmSystemTools::GetActualCaseForPath(_dir.toLocal8Bit().data()).c_str());
if(this->BinaryDirectory != dir) if(this->BinaryDirectory != dir)
{ {
this->BinaryDirectory = QDir::fromNativeSeparators(dir); this->BinaryDirectory = QDir::fromNativeSeparators(dir);
@ -132,14 +132,14 @@ void QCMake::setBinaryDirectory(const QString& _dir)
cmCacheManager::CacheIterator itm = cachem->NewIterator(); cmCacheManager::CacheIterator itm = cachem->NewIterator();
if ( itm.Find("CMAKE_HOME_DIRECTORY")) if ( itm.Find("CMAKE_HOME_DIRECTORY"))
{ {
setSourceDirectory(itm.GetValue()); setSourceDirectory(QString::fromLocal8Bit(itm.GetValue()));
} }
if ( itm.Find("CMAKE_GENERATOR")) if ( itm.Find("CMAKE_GENERATOR"))
{ {
const char* extraGen = cachem->GetCacheValue("CMAKE_EXTRA_GENERATOR"); const char* extraGen = cachem->GetCacheValue("CMAKE_EXTRA_GENERATOR");
std::string curGen = cmExternalMakefileProjectGenerator:: std::string curGen = cmExternalMakefileProjectGenerator::
CreateFullGeneratorName(itm.GetValue(), extraGen); CreateFullGeneratorName(itm.GetValue(), extraGen);
this->setGenerator(curGen.c_str()); this->setGenerator(QString::fromLocal8Bit(curGen.c_str()));
} }
} }
} }
@ -160,12 +160,12 @@ void QCMake::configure()
UINT lastErrorMode = SetErrorMode(0); UINT lastErrorMode = SetErrorMode(0);
#endif #endif
this->CMakeInstance->SetHomeDirectory(this->SourceDirectory.toAscii().data()); this->CMakeInstance->SetHomeDirectory(this->SourceDirectory.toLocal8Bit().data());
this->CMakeInstance->SetStartDirectory(this->SourceDirectory.toAscii().data()); this->CMakeInstance->SetStartDirectory(this->SourceDirectory.toLocal8Bit().data());
this->CMakeInstance->SetHomeOutputDirectory(this->BinaryDirectory.toAscii().data()); this->CMakeInstance->SetHomeOutputDirectory(this->BinaryDirectory.toLocal8Bit().data());
this->CMakeInstance->SetStartOutputDirectory(this->BinaryDirectory.toAscii().data()); this->CMakeInstance->SetStartOutputDirectory(this->BinaryDirectory.toLocal8Bit().data());
this->CMakeInstance->SetGlobalGenerator( this->CMakeInstance->SetGlobalGenerator(
this->CMakeInstance->CreateGlobalGenerator(this->Generator.toAscii().data())); this->CMakeInstance->CreateGlobalGenerator(this->Generator.toLocal8Bit().data()));
this->CMakeInstance->LoadCache(); this->CMakeInstance->LoadCache();
this->CMakeInstance->SetSuppressDevWarnings(this->SuppressDevWarnings); this->CMakeInstance->SetSuppressDevWarnings(this->SuppressDevWarnings);
this->CMakeInstance->SetWarnUninitialized(this->WarnUninitializedMode); this->CMakeInstance->SetWarnUninitialized(this->WarnUninitializedMode);
@ -222,11 +222,11 @@ void QCMake::setProperties(const QCMakePropertyList& newProps)
} }
QCMakeProperty prop; QCMakeProperty prop;
prop.Key = i.GetName(); prop.Key = QString::fromLocal8Bit(i.GetName());
int idx = props.indexOf(prop); int idx = props.indexOf(prop);
if(idx == -1) if(idx == -1)
{ {
toremove.append(i.GetName()); toremove.append(QString::fromLocal8Bit(i.GetName()));
} }
else else
{ {
@ -237,7 +237,7 @@ void QCMake::setProperties(const QCMakePropertyList& newProps)
} }
else else
{ {
i.SetValue(prop.Value.toString().toAscii().data()); i.SetValue(prop.Value.toString().toLocal8Bit().data());
} }
props.removeAt(idx); props.removeAt(idx);
} }
@ -247,47 +247,47 @@ void QCMake::setProperties(const QCMakePropertyList& newProps)
// remove some properites // remove some properites
foreach(QString s, toremove) foreach(QString s, toremove)
{ {
this->CMakeInstance->UnwatchUnusedCli(s.toAscii().data()); this->CMakeInstance->UnwatchUnusedCli(s.toLocal8Bit().data());
cachem->RemoveCacheEntry(s.toAscii().data()); cachem->RemoveCacheEntry(s.toLocal8Bit().data());
} }
// add some new properites // add some new properites
foreach(QCMakeProperty s, props) foreach(QCMakeProperty s, props)
{ {
this->CMakeInstance->WatchUnusedCli(s.Key.toAscii().data()); this->CMakeInstance->WatchUnusedCli(s.Key.toLocal8Bit().data());
if(s.Type == QCMakeProperty::BOOL) if(s.Type == QCMakeProperty::BOOL)
{ {
this->CMakeInstance->AddCacheEntry(s.Key.toAscii().data(), this->CMakeInstance->AddCacheEntry(s.Key.toLocal8Bit().data(),
s.Value.toBool() ? "ON" : "OFF", s.Value.toBool() ? "ON" : "OFF",
s.Help.toAscii().data(), s.Help.toLocal8Bit().data(),
cmCacheManager::BOOL); cmCacheManager::BOOL);
} }
else if(s.Type == QCMakeProperty::STRING) else if(s.Type == QCMakeProperty::STRING)
{ {
this->CMakeInstance->AddCacheEntry(s.Key.toAscii().data(), this->CMakeInstance->AddCacheEntry(s.Key.toLocal8Bit().data(),
s.Value.toString().toAscii().data(), s.Value.toString().toLocal8Bit().data(),
s.Help.toAscii().data(), s.Help.toLocal8Bit().data(),
cmCacheManager::STRING); cmCacheManager::STRING);
} }
else if(s.Type == QCMakeProperty::PATH) else if(s.Type == QCMakeProperty::PATH)
{ {
this->CMakeInstance->AddCacheEntry(s.Key.toAscii().data(), this->CMakeInstance->AddCacheEntry(s.Key.toLocal8Bit().data(),
s.Value.toString().toAscii().data(), s.Value.toString().toLocal8Bit().data(),
s.Help.toAscii().data(), s.Help.toLocal8Bit().data(),
cmCacheManager::PATH); cmCacheManager::PATH);
} }
else if(s.Type == QCMakeProperty::FILEPATH) else if(s.Type == QCMakeProperty::FILEPATH)
{ {
this->CMakeInstance->AddCacheEntry(s.Key.toAscii().data(), this->CMakeInstance->AddCacheEntry(s.Key.toLocal8Bit().data(),
s.Value.toString().toAscii().data(), s.Value.toString().toLocal8Bit().data(),
s.Help.toAscii().data(), s.Help.toLocal8Bit().data(),
cmCacheManager::FILEPATH); cmCacheManager::FILEPATH);
} }
} }
cachem->SaveCache(this->BinaryDirectory.toAscii().data()); cachem->SaveCache(this->BinaryDirectory.toLocal8Bit().data());
} }
QCMakePropertyList QCMake::properties() const QCMakePropertyList QCMake::properties() const
@ -307,9 +307,9 @@ QCMakePropertyList QCMake::properties() const
} }
QCMakeProperty prop; QCMakeProperty prop;
prop.Key = i.GetName(); prop.Key = QString::fromLocal8Bit(i.GetName());
prop.Help = i.GetProperty("HELPSTRING"); prop.Help = QString::fromLocal8Bit(i.GetProperty("HELPSTRING"));
prop.Value = i.GetValue(); prop.Value = QString::fromLocal8Bit(i.GetValue());
prop.Advanced = i.GetPropertyAsBool("ADVANCED"); prop.Advanced = i.GetPropertyAsBool("ADVANCED");
if(i.GetType() == cmCacheManager::BOOL) if(i.GetType() == cmCacheManager::BOOL)
@ -330,7 +330,7 @@ QCMakePropertyList QCMake::properties() const
prop.Type = QCMakeProperty::STRING; prop.Type = QCMakeProperty::STRING;
if (i.PropertyExists("STRINGS")) if (i.PropertyExists("STRINGS"))
{ {
prop.Strings = QString(i.GetProperty("STRINGS")).split(";"); prop.Strings = QString::fromLocal8Bit(i.GetProperty("STRINGS")).split(";");
} }
} }
@ -356,11 +356,11 @@ void QCMake::progressCallback(const char* msg, float percent, void* cd)
QCMake* self = reinterpret_cast<QCMake*>(cd); QCMake* self = reinterpret_cast<QCMake*>(cd);
if(percent >= 0) if(percent >= 0)
{ {
emit self->progressChanged(msg, percent); emit self->progressChanged(QString::fromLocal8Bit(msg), percent);
} }
else else
{ {
emit self->outputMessage(msg); emit self->outputMessage(QString::fromLocal8Bit(msg));
} }
QCoreApplication::processEvents(); QCoreApplication::processEvents();
} }
@ -369,7 +369,7 @@ void QCMake::errorCallback(const char* msg, const char* /*title*/,
bool& /*stop*/, void* cd) bool& /*stop*/, void* cd)
{ {
QCMake* self = reinterpret_cast<QCMake*>(cd); QCMake* self = reinterpret_cast<QCMake*>(cd);
emit self->errorMessage(msg); emit self->errorMessage(QString::fromLocal8Bit(msg));
QCoreApplication::processEvents(); QCoreApplication::processEvents();
} }
@ -396,9 +396,9 @@ QStringList QCMake::availableGenerators() const
void QCMake::deleteCache() void QCMake::deleteCache()
{ {
// delete cache // delete cache
this->CMakeInstance->GetCacheManager()->DeleteCache(this->BinaryDirectory.toAscii().data()); this->CMakeInstance->GetCacheManager()->DeleteCache(this->BinaryDirectory.toLocal8Bit().data());
// reload to make our cache empty // reload to make our cache empty
this->CMakeInstance->GetCacheManager()->LoadCache(this->BinaryDirectory.toAscii().data()); this->CMakeInstance->GetCacheManager()->LoadCache(this->BinaryDirectory.toLocal8Bit().data());
// emit no generator and no properties // emit no generator and no properties
this->setGenerator(QString()); this->setGenerator(QString());
QCMakePropertyList props = this->properties(); QCMakePropertyList props = this->properties();
@ -411,7 +411,7 @@ void QCMake::reloadCache()
QCMakePropertyList props; QCMakePropertyList props;
emit this->propertiesChanged(props); emit this->propertiesChanged(props);
// reload // reload
this->CMakeInstance->GetCacheManager()->LoadCache(this->BinaryDirectory.toAscii().data()); this->CMakeInstance->GetCacheManager()->LoadCache(this->BinaryDirectory.toLocal8Bit().data());
// emit new cache properties // emit new cache properties
props = this->properties(); props = this->properties();
emit this->propertiesChanged(props); emit this->propertiesChanged(props);

View File

@ -34,12 +34,11 @@ void QMacInstallDialog::DoInstall()
{ {
QDir installDir(this->Internals->InstallPrefix->text()); QDir installDir(this->Internals->InstallPrefix->text());
QString installTo = installDir.path(); QString installTo = installDir.path();
if(!cmSystemTools::FileExists(installTo.toAscii().data())) if(!cmSystemTools::FileExists(installTo.toLocal8Bit().data()))
{ {
QString message = tr("Build install does not exist, " QString message = tr("Build install does not exist, "
"should I create it?") "should I create it?\n\n"
+ "\n\n" "Directory: ");
+ tr("Directory: ");
message += installDir.path(); message += installDir.path();
QString title = tr("Create Directory"); QString title = tr("Create Directory");
QMessageBox::StandardButton btn; QMessageBox::StandardButton btn;
@ -47,7 +46,7 @@ void QMacInstallDialog::DoInstall()
QMessageBox::Yes | QMessageBox::No); QMessageBox::Yes | QMessageBox::No);
if(btn == QMessageBox::Yes) if(btn == QMessageBox::Yes)
{ {
cmSystemTools::MakeDirectory(installTo.toAscii().data()); cmSystemTools::MakeDirectory(installTo.toLocal8Bit().data());
} }
} }
QDir cmExecDir(QApplication::applicationDirPath()); QDir cmExecDir(QApplication::applicationDirPath());
@ -66,14 +65,14 @@ void QMacInstallDialog::DoInstall()
newName += "/"; newName += "/";
newName += filename; newName += filename;
// Remove the old files // Remove the old files
if(cmSystemTools::FileExists(newName.toAscii().data())) if(cmSystemTools::FileExists(newName.toLocal8Bit().data()))
{ {
std::cout << "rm [" << newName.toAscii().data() << "]\n"; std::cout << "rm [" << newName.toLocal8Bit().data() << "]\n";
if(!cmSystemTools::RemoveFile(newName.toAscii().data())) if(!cmSystemTools::RemoveFile(newName.toLocal8Bit().data()))
{ {
QString message = tr("Failed to remove file " QString message = tr("Failed to remove file "
"installation may be incomplete: "); "installation may be incomplete: ");
message += newName.toAscii().data(); message += newName;
QString title = tr("Error Removing file"); QString title = tr("Error Removing file");
QMessageBox::StandardButton btn = QMessageBox::StandardButton btn =
QMessageBox::critical(this, title, message, QMessageBox::critical(this, title, message,
@ -84,14 +83,14 @@ void QMacInstallDialog::DoInstall()
} }
} }
} }
std::cout << "ln -s [" << file.toAscii().data() << "] ["; std::cout << "ln -s [" << file.toLocal8Bit().data() << "] [";
std::cout << newName.toAscii().data() << "]\n"; std::cout << newName.toLocal8Bit().data() << "]\n";
if(!cmSystemTools::CreateSymlink(file.toAscii().data(), if(!cmSystemTools::CreateSymlink(file.toLocal8Bit().data(),
newName.toAscii().data())) newName.toLocal8Bit().data()))
{ {
QString message = tr("Failed create symlink " QString message = tr("Failed create symlink "
"installation may be incomplete: "); "installation may be incomplete: ");
message += newName.toAscii().data(); message += newName;
QString title = tr("Error Creating Symlink"); QString title = tr("Error Creating Symlink");
QMessageBox::StandardButton btn = QMessageBox::StandardButton btn =
QMessageBox::critical(this, title, message, QMessageBox::critical(this, title, message,