diff options
Diffstat (limited to 'Source/QtDialog/CMakeSetup.cxx')
-rw-r--r-- | Source/QtDialog/CMakeSetup.cxx | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/Source/QtDialog/CMakeSetup.cxx b/Source/QtDialog/CMakeSetup.cxx index 8ffa3e728d..fb12b7d9f4 100644 --- a/Source/QtDialog/CMakeSetup.cxx +++ b/Source/QtDialog/CMakeSetup.cxx @@ -132,7 +132,7 @@ int main(int argc, char** argv) // pick up translation files if they exists in the data directory QDir translationsDir = cmExecDir; - translationsDir.cd(QString::fromLocal8Bit(".." CMAKE_DATA_DIR)); + translationsDir.cd(".." CMAKE_DATA_DIR); translationsDir.cd("i18n"); QTranslator translator; if (translator.load(QLocale(), "cmake", "_", translationsDir.path())) { @@ -171,8 +171,7 @@ int main(int argc, char** argv) } } - sourceDirectory = - cmSystemTools::CollapseFullPath(path.toLocal8Bit().data()); + sourceDirectory = cmSystemTools::CollapseFullPath(path.toStdString()); cmSystemTools::ConvertToUnixSlashes(sourceDirectory); } else if (arg.startsWith("-B")) { QString path = arg.mid(2); @@ -189,8 +188,7 @@ int main(int argc, char** argv) } } - binaryDirectory = - cmSystemTools::CollapseFullPath(path.toLocal8Bit().data()); + binaryDirectory = cmSystemTools::CollapseFullPath(path.toStdString()); cmSystemTools::ConvertToUnixSlashes(binaryDirectory); } else if (arg.startsWith("--preset=")) { QString preset = arg.mid(cmStrLen("--preset=")); @@ -198,7 +196,7 @@ int main(int argc, char** argv) std::cerr << "No preset specified for --preset" << std::endl; return 1; } - presetName = preset.toLocal8Bit().data(); + presetName = preset.toStdString(); } else if (arg == "--browse-manual") { OpenReferenceManual(); return 0; @@ -206,21 +204,20 @@ int main(int argc, char** argv) } if (!sourceDirectory.empty() && (!binaryDirectory.empty() || !presetName.empty())) { - dialog.setSourceDirectory(QString::fromLocal8Bit(sourceDirectory.c_str())); + dialog.setSourceDirectory(QString::fromStdString(sourceDirectory)); if (!binaryDirectory.empty()) { - dialog.setBinaryDirectory( - QString::fromLocal8Bit(binaryDirectory.c_str())); + dialog.setBinaryDirectory(QString::fromStdString(binaryDirectory)); if (!presetName.empty()) { dialog.setStartupBinaryDirectory(true); } } if (!presetName.empty()) { - dialog.setDeferredPreset(QString::fromLocal8Bit(presetName.c_str())); + dialog.setDeferredPreset(QString::fromStdString(presetName)); } } else { if (args.count() == 2) { std::string filePath = - cmSystemTools::CollapseFullPath(args[1].toLocal8Bit().data()); + cmSystemTools::CollapseFullPath(args[1].toStdString()); // check if argument is a directory containing CMakeCache.txt std::string buildFilePath = cmStrCat(filePath, "/CMakeCache.txt"); @@ -235,12 +232,12 @@ int main(int argc, char** argv) std::string srcFilePath = cmStrCat(filePath, "/CMakeLists.txt"); if (cmSystemTools::FileExists(buildFilePath.c_str())) { - dialog.setBinaryDirectory(QString::fromLocal8Bit( - cmSystemTools::GetFilenamePath(buildFilePath).c_str())); + dialog.setBinaryDirectory(QString::fromStdString( + cmSystemTools::GetFilenamePath(buildFilePath))); } else if (cmSystemTools::FileExists(srcFilePath.c_str())) { - dialog.setSourceDirectory(QString::fromLocal8Bit(filePath.c_str())); - dialog.setBinaryDirectory(QString::fromLocal8Bit( - cmSystemTools::CollapseFullPath(".").c_str())); + dialog.setSourceDirectory(QString::fromStdString(filePath)); + dialog.setBinaryDirectory( + QString::fromStdString(cmSystemTools::CollapseFullPath("."))); } } } |