Skip to content

Commit 3f1da2a

Browse files
committed
Merge remote-tracking branch 'remotes/lassoan/fix-utf8-args'
2 parents ee56705 + 9998a7d commit 3f1da2a

5 files changed

+14
-10
lines changed

Base/Testing/Cpp/ctkAppLauncherEnvironmentTest.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,24 +52,24 @@ void ctkAppLauncherEnvironmentTester::cleanup()
5252
QStringList originalEnvKeys = ctkAppLauncherEnvironment::envKeys(this->OriginalEnv);
5353
foreach(const QString& varName, originalEnvKeys)
5454
{
55-
qputenv(varName.toLatin1(), this->OriginalEnv.value(varName).toLatin1());
55+
qputenv(varName.toLocal8Bit(), this->OriginalEnv.value(varName).toLocal8Bit());
5656
}
5757
}
5858

5959
// ----------------------------------------------------------------------------
6060
void ctkAppLauncherEnvironmentTester::setEnv(const QString& name, const QString& value)
6161
{
62-
qputenv(name.toLatin1(), value.toLatin1());
62+
qputenv(name.toLocal8Bit(), value.toLocal8Bit());
6363
this->VariableNames.insert(name);
6464
}
6565

6666
// ----------------------------------------------------------------------------
6767
void ctkAppLauncherEnvironmentTester::unsetEnv(const QString& name)
6868
{
6969
#if defined(_MSC_VER)
70-
qputenv(name.toLatin1(), QString("").toLatin1());
70+
qputenv(name.toLocal8Bit(), QString().toLocal8Bit());
7171
#else
72-
unsetenv(name.toLatin1());
72+
unsetenv(name.toLocal8Bit());
7373
#endif
7474
}
7575

Base/ctkAppArguments.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ void ctkChar2DArray::setValues(const QStringList& list)
5858
{
5959
QString item = d->List.at(index);
6060
d->Values[index] = new char[item.size() + 1];
61-
qstrcpy(d->Values[index], item.toLatin1().data());
61+
qstrcpy(d->Values[index], item.toLocal8Bit().data());
6262
}
6363
}
6464

Base/ctkAppLauncherEnvironment.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,9 @@ void ctkAppLauncherEnvironment::updateCurrentEnvironment(const QProcessEnvironme
166166
foreach(const QString& varName, variablesToUnset)
167167
{
168168
#if defined(Q_OS_WIN32)
169-
bool success = qputenv(varName.toLatin1(), QString("").toLatin1());
169+
bool success = qputenv(varName.toLocal8Bit(), QString().toLocal8Bit());
170170
#else
171-
bool success = unsetenv(varName.toLatin1()) == EXIT_SUCCESS;
171+
bool success = unsetenv(varName.toLocal8Bit()) == EXIT_SUCCESS;
172172
#endif
173173
if (!success)
174174
{
@@ -180,7 +180,7 @@ void ctkAppLauncherEnvironment::updateCurrentEnvironment(const QProcessEnvironme
180180
foreach(const QString& varName, envKeys)
181181
{
182182
QString varValue = environment.value(varName);
183-
bool success = qputenv(varName.toLatin1(), varValue.toLatin1());
183+
bool success = qputenv(varName.toLocal8Bit(), varValue.toLocal8Bit());
184184
if (!success)
185185
{
186186
qWarning() << "Failed to set environment variable"

Base/ctkTest.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ static void mouseEvent(QTest::MouseAction action, QWidget *widget, Qt::MouseButt
9797
{
9898
static const char *mouseActionNames[] =
9999
{ "MousePress", "MouseRelease", "MouseClick", "MouseDClick", "MouseMove" };
100-
QString warning = QString::fromLatin1("Mouse event \"%1\" not accepted by receiving widget");
101-
QTest::qWarn(warning.arg(QString::fromLatin1(mouseActionNames[static_cast<int>(action)])).toLatin1());
100+
QString warning = QLatin1String("Mouse event \"%1\" not accepted by receiving widget");
101+
QTest::qWarn(warning.arg(QLatin1String(mouseActionNames[static_cast<int>(action)])).toLocal8Bit());
102102
}
103103
}
104104

msvc-static-configure.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ elseif ("$ENV{APPLAUNCHER_CMAKE_GENERATOR}" STREQUAL "Visual Studio 16 2019")
2929
# For local build with Visual Studio 2019 with modern CMake
3030
set(APPLAUNCHER_CMAKE_GENERATOR -G "Visual Studio 16 2019" -T v141 -A Win32)
3131
set(APPLAUNCHER_USE_NINJA OFF)
32+
elseif ("$ENV{APPLAUNCHER_CMAKE_GENERATOR}" STREQUAL "Visual Studio 17 2022")
33+
# For local build with Visual Studio 2019 with modern CMake
34+
set(APPLAUNCHER_CMAKE_GENERATOR -G "Visual Studio 17 2022" -T v143 -A Win32)
35+
set(APPLAUNCHER_USE_NINJA OFF)
3236
else()
3337
message(FATAL_ERROR "Env. variable APPLAUNCHER_CMAKE_GENERATOR is expected to match 'Ninja' or 'Visual Studio 15 2017' or 'Visual Studio 16 2019' [$ENV{APPLAUNCHER_CMAKE_GENERATOR}]")
3438
endif()

0 commit comments

Comments
 (0)