small string optimizations
parent
923d2894af
commit
607b3f0bc9
|
@ -71,7 +71,7 @@ void Activities::slotRemoved(const QString &activity)
|
|||
client->setOnActivity(activity, false);
|
||||
}
|
||||
//toss out any session data for it
|
||||
KConfigGroup cg(KSharedConfig::openConfig(), QString("SubSession: ") + activity);
|
||||
KConfigGroup cg(KSharedConfig::openConfig(), QByteArray("SubSession: ").append(activity.toUtf8()).constData());
|
||||
cg.deleteGroup();
|
||||
}
|
||||
|
||||
|
|
|
@ -188,7 +188,7 @@ QString CompositorDBusInterface::compositingType() const
|
|||
return QStringLiteral("gl2");
|
||||
#endif
|
||||
case QPainterCompositing:
|
||||
return "qpainter";
|
||||
return QStringLiteral("qpainter");
|
||||
case NoCompositing:
|
||||
default:
|
||||
return QStringLiteral("none");
|
||||
|
|
|
@ -78,21 +78,22 @@ EglWaylandBackend::~EglWaylandBackend()
|
|||
bool EglWaylandBackend::initializeEgl()
|
||||
{
|
||||
// Get the list of client extensions
|
||||
const QByteArray clientExtensionString = eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS);
|
||||
if (clientExtensionString.isEmpty()) {
|
||||
const char* clientExtensionsCString = eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS);
|
||||
const QByteArray clientExtensionsString = QByteArray::fromRawData(clientExtensionsCString, qstrlen(clientExtensionsCString));
|
||||
if (clientExtensionsString.isEmpty()) {
|
||||
// If eglQueryString() returned NULL, the implementation doesn't support
|
||||
// EGL_EXT_client_extensions. Expect an EGL_BAD_DISPLAY error.
|
||||
(void) eglGetError();
|
||||
}
|
||||
|
||||
const QList<QByteArray> clientExtensions = clientExtensionString.split(' ');
|
||||
const QList<QByteArray> clientExtensions = clientExtensionsString.split(' ');
|
||||
|
||||
// Use eglGetPlatformDisplayEXT() to get the display pointer
|
||||
// if the implementation supports it.
|
||||
m_havePlatformBase = clientExtensions.contains("EGL_EXT_platform_base");
|
||||
m_havePlatformBase = clientExtensions.contains(QByteArrayLiteral("EGL_EXT_platform_base"));
|
||||
if (m_havePlatformBase) {
|
||||
// Make sure that the wayland platform is supported
|
||||
if (!clientExtensions.contains("EGL_EXT_platform_wayland"))
|
||||
if (!clientExtensions.contains(QByteArrayLiteral("EGL_EXT_platform_wayland")))
|
||||
return false;
|
||||
|
||||
m_display = eglGetPlatformDisplayEXT(EGL_PLATFORM_WAYLAND_EXT, m_wayland->display(), nullptr);
|
||||
|
@ -171,11 +172,11 @@ bool EglWaylandBackend::initRenderingContext()
|
|||
EGL_NONE
|
||||
};
|
||||
|
||||
const QByteArray eglExtensions = eglQueryString(m_display, EGL_EXTENSIONS);
|
||||
const QList<QByteArray> extensions = eglExtensions.split(' ');
|
||||
const char* eglExtensionsCString = eglQueryString(m_display, EGL_EXTENSIONS);
|
||||
const QList<QByteArray> extensions = QByteArray::fromRawData(eglExtensionsCString, qstrlen(eglExtensionsCString)).split(' ');
|
||||
|
||||
// Try to create a 3.1 core context
|
||||
if (options->glCoreProfile() && extensions.contains("EGL_KHR_create_context"))
|
||||
if (options->glCoreProfile() && extensions.contains(QByteArrayLiteral("EGL_KHR_create_context")))
|
||||
m_context = eglCreateContext(m_display, m_config, EGL_NO_CONTEXT, context_attribs_31_core);
|
||||
|
||||
if (m_context == EGL_NO_CONTEXT)
|
||||
|
|
|
@ -404,3 +404,4 @@ void ConfigurationModule::updateColors()
|
|||
}
|
||||
|
||||
#include "kcm.moc"
|
||||
`
|
|
@ -173,14 +173,14 @@ KWIN_EXPORT int kdemain(int argc, char * argv[])
|
|||
QByteArray xDisplay;
|
||||
QByteArray xServer;
|
||||
for (int i = 1; i < argc; ++i) {
|
||||
QByteArray arg = argv[i];
|
||||
QByteArray arg = QByteArray::fromRawData(argv[i], qstrlen(argv[i]));
|
||||
if (arg == "-x" || arg == "--x-server") {
|
||||
if (++i < argc) {
|
||||
xServer = argv[i];
|
||||
xServer = QByteArray::fromRawData(argv[i], qstrlen(argv[i]));
|
||||
}
|
||||
startXephyr = (xServer == QStringLiteral("xephyr"));
|
||||
startXvfb = (xServer == QStringLiteral("xvfb"));
|
||||
startXwayland = (xServer == QStringLiteral("xwayland"));
|
||||
startXephyr = (xServer == "xephyr");
|
||||
startXvfb = (xServer == "xvfb");
|
||||
startXwayland = (xServer == "xwayland");
|
||||
if (!startXephyr && !startXvfb && !startXwayland) {
|
||||
fprintf(stderr, "%s: FATAL ERROR unknown X-Server %s specified to start\n",
|
||||
argv[0], qPrintable(xServer));
|
||||
|
@ -190,7 +190,7 @@ KWIN_EXPORT int kdemain(int argc, char * argv[])
|
|||
}
|
||||
if (arg == "--display") {
|
||||
if (++i < argc) {
|
||||
xDisplay = argv[i];
|
||||
xDisplay = QByteArray::fromRawData(argv[i], qstrlen(argv[i]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -257,7 +257,7 @@ KWIN_EXPORT int kdemain(int argc, char * argv[])
|
|||
|
||||
// perform sanity checks
|
||||
// TODO: remove those two
|
||||
if (a.platformName().toLower() != QStringLiteral("xcb")) {
|
||||
if (a.platformName().toLower() != QLatin1String("xcb")) {
|
||||
fprintf(stderr, "%s: FATAL ERROR expecting platform xcb but got platform %s\n",
|
||||
argv[0], qPrintable(a.platformName()));
|
||||
exit(1);
|
||||
|
|
Loading…
Reference in New Issue