Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

Qt6: work around QByteArrayBuilder by using QString

Halla Rempt4d145f2a5486
diff --git a/krita/main.cc b/krita/main.cc
index 61f0384843..6f6dbfd202 100644
--- a/krita/main.cc
+++ b/krita/main.cc
@@ -332,15 +332,15 @@ extern "C" MAIN_EXPORT int MAIN_FN(int argc, char **argv)
// enough to filter out this step for non-appimage krita builds.
const bool isInAppimage = qEnvironmentVariableIsSet("APPIMAGE");
if (isInAppimage) {
- QByteArray appimageMountDir = qgetenv("APPDIR");
+ QString appimageMountDir = qgetenv("APPDIR");
{ // MLT
//Plugins Path is where mlt should expect to find its plugin libraries.
- qputenv("MLT_REPOSITORY", appimageMountDir + QFile::encodeName("/usr/lib/mlt-7/"));
- qputenv("MLT_DATA", appimageMountDir + QFile::encodeName("/usr/share/mlt-7/"));
- qputenv("MLT_ROOT_DIR", appimageMountDir + QFile::encodeName("/usr/"));
- qputenv("MLT_PROFILES_PATH", appimageMountDir + QFile::encodeName("/usr/share/mlt-7/profiles/"));
- qputenv("MLT_PRESETS_PATH", appimageMountDir + QFile::encodeName("/usr/share/mlt-7/presets/"));
+ qputenv("MLT_REPOSITORY", appimageMountDir.append(QFile::encodeName("/usr/lib/mlt-7/")).toUtf8());
+ qputenv("MLT_DATA", appimageMountDir.append(QFile::encodeName("/usr/share/mlt-7/")).toUtf8());
+ qputenv("MLT_ROOT_DIR", appimageMountDir.append(QFile::encodeName("/usr/")).toUtf8());
+ qputenv("MLT_PROFILES_PATH", appimageMountDir.append(QFile::encodeName("/usr/share/mlt-7/profiles/")).toUtf8());
+ qputenv("MLT_PRESETS_PATH", appimageMountDir.append(QFile::encodeName("/usr/share/mlt-7/presets/")).toUtf8());
}
{
@@ -441,7 +441,7 @@ extern "C" MAIN_EXPORT int MAIN_FN(int argc, char **argv)
}
// NOTE: This line helps also fontconfig have a user-accessible location on Android (see the commit).
- qputenv("XDG_DATA_DIRS", QFile::encodeName(root + "share") + ":" + originalXdgDataDirs);
+ qputenv("XDG_DATA_DIRS", QString(QFile::encodeName(root + "share") + ":" + originalXdgDataDirs).toUtf8());
}
#elif defined(Q_OS_HAIKU)
qputenv("KRITA_PLUGIN_PATH", QFile::encodeName(root + "lib"));
@@ -668,6 +668,7 @@ extern "C" MAIN_EXPORT int MAIN_FN(int argc, char **argv)
// Icons in menus are ugly and distracting
KisApplication::setAttribute(Qt::AA_DontShowIconsInMenus);
}
+
KisApplication::setAttribute(Qt::AA_DisableWindowContextHelpButton);
app.installEventFilter(KisQtWidgetsTweaker::instance());