Commit bb760c77 authored by Laurent Montel's avatar Laurent Montel 😁

Make it compile with strict compile flags

parent 5824f086
......@@ -145,6 +145,12 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})
set(KSLD_INCLUDEDIR "${CMAKE_INSTALL_INCLUDEDIR}/KScreenLocker")
add_definitions(-DQT_NO_CAST_FROM_ASCII)
add_definitions(-DQT_NO_CAST_TO_ASCII)
add_definitions(-DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT)
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
add_definitions(-DQT_USE_QSTRINGBUILDER)
add_subdirectory(kcheckpass)
add_subdirectory(greeter)
add_subdirectory(kcm)
......
......@@ -64,9 +64,9 @@ void BackgroundWindow::paintEvent(QPaintEvent* )
"Afterwards switch back to the running session (Ctrl+Alt+F%2).");
auto haveService = [](QString service){return QDBusConnection::systemBus().interface()->isServiceRegistered(service);};
if (haveService("org.freedesktop.ConsoleKit")) {
if (haveService(QStringLiteral("org.freedesktop.ConsoleKit"))) {
text = text_ck;
} else if (haveService("org.freedesktop.login1")) {
} else if (haveService(QStringLiteral("org.freedesktop.login1"))) {
text = text_ld;
text = text.subs(QString::fromLocal8Bit(qgetenv("XDG_SESSION_ID")));
text = text.subs(QString::fromLocal8Bit(qgetenv("XDG_VTNR")));
......@@ -119,6 +119,7 @@ void AbstractLocker::emergencyShow()
void AbstractLocker::addAllowedWindow(quint32 windows)
{
Q_UNUSED(windows);
}
}
......
......@@ -73,7 +73,7 @@ void NoScreensTest::initTestCase()
ScreenLocker::KSldApp::self();
ScreenLocker::KSldApp::self()->setWaylandDisplay(m_display);
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
env.insert("QT_QPA_PLATFORM", "wayland");
env.insert(QStringLiteral("QT_QPA_PLATFORM"), QStringLiteral("wayland"));
ScreenLocker::KSldApp::self()->setGreeterEnvironment(env);
ScreenLocker::KSldApp::self()->initialize();
connect(m_shell, &ShellInterface::surfaceCreated, this,
......
......@@ -89,10 +89,10 @@ ScreenLockerKcm::ScreenLockerKcm(QWidget *parent, const QVariantList &args)
auto proxy = new ScreenLockerProxy(this);
m_ui->wallpaperConfigWidget->setClearColor(m_ui->palette().color(QPalette::Active, QPalette::Window));
m_ui->wallpaperConfigWidget->rootContext()->setContextProperty("configDialog", proxy);
m_ui->wallpaperConfigWidget->rootContext()->setContextProperty(QStringLiteral("configDialog"), proxy);
m_ui->lnfConfigWidget->setClearColor(m_ui->palette().color(QPalette::Active, QPalette::Window));
m_ui->lnfConfigWidget->rootContext()->setContextProperty("configDialog", proxy);
m_ui->lnfConfigWidget->rootContext()->setContextProperty(QStringLiteral("configDialog"), proxy);
......@@ -154,7 +154,7 @@ void ScreenLockerKcm::test(const QString &plugin)
QProcess proc;
QStringList arguments;
arguments << plugin << QStringLiteral("--testing");
if (proc.execute(KSCREENLOCKER_GREET_BIN, arguments)) {
if (proc.execute(QString::fromLatin1(KSCREENLOCKER_GREET_BIN), arguments)) {
QMessageBox::critical(this, i18n("Error"), i18n("Failed to successfully test the screen locker."));
}
}
......
......@@ -567,7 +567,7 @@ void KSldApp::startLockProcess(EstablishLock establishLock)
int socket = dup(sx[1]);
if (socket >= 0) {
QProcessEnvironment env = m_greeterEnv;
env.insert("WAYLAND_SOCKET", QByteArray::number(socket));
env.insert(QStringLiteral("WAYLAND_SOCKET"), QString::number(socket));
m_lockProcess->setProcessEnvironment(env);
}
}
......
......@@ -45,7 +45,7 @@ int main(int argc, char *argv[])
Authenticator authenticator(mode);
QQuickView view;
view.rootContext()->setContextProperty("authenticator", &authenticator);
view.rootContext()->setContextProperty(QStringLiteral("authenticator"), &authenticator);
view.setResizeMode(QQuickView::SizeRootObjectToView);
view.setSource(QUrl::fromLocalFile(QStringLiteral(QML_FILE)));
view.show();
......
......@@ -27,7 +27,7 @@ int main(int argc, char **argv)
QGuiApplication app(argc, argv);
QQuickView view;
view.rootContext()->setContextProperty("powerManagement", PowerManagement::instance());
view.rootContext()->setContextProperty(QStringLiteral("powerManagement"), PowerManagement::instance());
view.setSource(QUrl::fromLocalFile(QStringLiteral(QML_PATH)));
view.show();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment