summaryrefslogtreecommitdiffstats
path: root/Source/QtDialog
diff options
context:
space:
mode:
Diffstat (limited to 'Source/QtDialog')
-rw-r--r--Source/QtDialog/CMakeSetup.cxx6
-rw-r--r--Source/QtDialog/CMakeSetupDialog.cxx6
-rw-r--r--Source/QtDialog/QCMake.cxx14
-rw-r--r--Source/QtDialog/QCMakeWidgets.cxx6
4 files changed, 21 insertions, 11 deletions
diff --git a/Source/QtDialog/CMakeSetup.cxx b/Source/QtDialog/CMakeSetup.cxx
index 821121e..82fa3a3 100644
--- a/Source/QtDialog/CMakeSetup.cxx
+++ b/Source/QtDialog/CMakeSetup.cxx
@@ -14,6 +14,7 @@
#include <QDir>
#include <QTranslator>
#include <QLocale>
+#include <QTextCodec>
#include "QMacInstallDialog.h"
#include "CMakeSetupDialog.h"
#include "cmDocumentation.h"
@@ -78,6 +79,11 @@ int main(int argc, char** argv)
QApplication app(argc, argv);
+#if defined(CMAKE_ENCODING_UTF8)
+ QTextCodec* utf8_codec = QTextCodec::codecForName("UTF-8");
+ QTextCodec::setCodecForLocale(utf8_codec);
+#endif
+
// clean out standard Qt paths for plugins, which we don't use anyway
// when creating Mac bundles, it potentially causes problems
foreach(QString p, QApplication::libraryPaths())
diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx
index f62afd6..1a98cea 100644
--- a/Source/QtDialog/CMakeSetupDialog.cxx
+++ b/Source/QtDialog/CMakeSetupDialog.cxx
@@ -578,7 +578,8 @@ void CMakeSetupDialog::doInterrupt()
void CMakeSetupDialog::doSourceBrowse()
{
QString dir = QFileDialog::getExistingDirectory(this,
- tr("Enter Path to Source"), this->SourceDirectory->text());
+ tr("Enter Path to Source"), this->SourceDirectory->text(),
+ QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
if(!dir.isEmpty())
{
this->setSourceDirectory(dir);
@@ -608,7 +609,8 @@ void CMakeSetupDialog::updateBinaryDirectory(const QString& dir)
void CMakeSetupDialog::doBinaryBrowse()
{
QString dir = QFileDialog::getExistingDirectory(this,
- tr("Enter Path to Build"), this->BinaryDirectory->currentText());
+ tr("Enter Path to Build"), this->BinaryDirectory->currentText(),
+ QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
if(!dir.isEmpty() && dir != this->BinaryDirectory->currentText())
{
this->setBinaryDirectory(dir);
diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx
index 0fe5f8c..5f9ebaf 100644
--- a/Source/QtDialog/QCMake.cxx
+++ b/Source/QtDialog/QCMake.cxx
@@ -111,13 +111,13 @@ void QCMake::setBinaryDirectory(const QString& _dir)
cmCacheManager::CacheIterator itm = cachem->NewIterator();
if ( itm.Find("CMAKE_HOME_DIRECTORY"))
{
- setSourceDirectory(QString::fromLocal8Bit(itm.GetValue()));
+ setSourceDirectory(QString::fromLocal8Bit(itm.GetValue().c_str()));
}
if ( itm.Find("CMAKE_GENERATOR"))
{
const char* extraGen = cachem->GetCacheValue("CMAKE_EXTRA_GENERATOR");
std::string curGen = cmExternalMakefileProjectGenerator::
- CreateFullGeneratorName(itm.GetValue(), extraGen);
+ CreateFullGeneratorName(itm.GetValue(), extraGen? extraGen : "");
this->setGenerator(QString::fromLocal8Bit(curGen.c_str()));
}
}
@@ -201,11 +201,11 @@ void QCMake::setProperties(const QCMakePropertyList& newProps)
}
QCMakeProperty prop;
- prop.Key = QString::fromLocal8Bit(i.GetName());
+ prop.Key = QString::fromLocal8Bit(i.GetName().c_str());
int idx = props.indexOf(prop);
if(idx == -1)
{
- toremove.append(QString::fromLocal8Bit(i.GetName()));
+ toremove.append(QString::fromLocal8Bit(i.GetName().c_str()));
}
else
{
@@ -286,15 +286,15 @@ QCMakePropertyList QCMake::properties() const
}
QCMakeProperty prop;
- prop.Key = QString::fromLocal8Bit(i.GetName());
+ prop.Key = QString::fromLocal8Bit(i.GetName().c_str());
prop.Help = QString::fromLocal8Bit(i.GetProperty("HELPSTRING"));
- prop.Value = QString::fromLocal8Bit(i.GetValue());
+ prop.Value = QString::fromLocal8Bit(i.GetValue().c_str());
prop.Advanced = i.GetPropertyAsBool("ADVANCED");
if(i.GetType() == cmCacheManager::BOOL)
{
prop.Type = QCMakeProperty::BOOL;
- prop.Value = cmSystemTools::IsOn(i.GetValue());
+ prop.Value = cmSystemTools::IsOn(i.GetValue().c_str());
}
else if(i.GetType() == cmCacheManager::PATH)
{
diff --git a/Source/QtDialog/QCMakeWidgets.cxx b/Source/QtDialog/QCMakeWidgets.cxx
index a0c5e17..41f98b5 100644
--- a/Source/QtDialog/QCMakeWidgets.cxx
+++ b/Source/QtDialog/QCMakeWidgets.cxx
@@ -67,7 +67,8 @@ void QCMakeFilePathEditor::chooseFile()
title = title.arg(this->Variable);
}
this->fileDialogExists(true);
- path = QFileDialog::getOpenFileName(this, title, info.absolutePath());
+ path = QFileDialog::getOpenFileName(this, title, info.absolutePath(),
+ QString(), NULL, QFileDialog::DontResolveSymlinks);
this->fileDialogExists(false);
if(!path.isEmpty())
@@ -91,7 +92,8 @@ void QCMakePathEditor::chooseFile()
title = title.arg(this->Variable);
}
this->fileDialogExists(true);
- path = QFileDialog::getExistingDirectory(this, title, this->text());
+ path = QFileDialog::getExistingDirectory(this, title, this->text(),
+ QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
this->fileDialogExists(false);
if(!path.isEmpty())
{