diff --git a/src/lib/deskflow/IKeyState.cpp b/src/lib/deskflow/IKeyState.cpp index 8c65a5687..7c69c7db0 100644 --- a/src/lib/deskflow/IKeyState.cpp +++ b/src/lib/deskflow/IKeyState.cpp @@ -134,7 +134,7 @@ void IKeyState::KeyInfo::split(const char *screens, std::set &dst) const char *i = screens + 1; while (*i != '\0') { const char *j = strchr(i, ':'); - dst.emplace(std::string(i, j - i)); + dst.emplace(i, j - i); i = j + 1; } } diff --git a/src/lib/gui/ServerConfig.cpp b/src/lib/gui/ServerConfig.cpp index e666f0d59..b16b45ed7 100644 --- a/src/lib/gui/ServerConfig.cpp +++ b/src/lib/gui/ServerConfig.cpp @@ -247,15 +247,13 @@ QTextStream &operator<<(QTextStream &outStream, const ServerConfig &config) outStream << "section: links" << Qt::endl; for (int i = 0; const auto &screen : config.screens()) { - if (screen.isNull()) { - i++; - continue; - } - outStream << "\t" << screen.name() << ":\n"; - for (const auto &neighbour : std::as_const(neighbourDirs)) { - int idx = config.adjacentScreenIndex(i, neighbour.x, neighbour.y); - if (idx != -1 && !config.screens()[idx].isNull()) - outStream << "\t\t" << neighbour.name << " = " << config.screens()[idx].name() << Qt::endl; + if (!screen.isNull()) { + outStream << "\t" << screen.name() << ":\n"; + for (const auto &neighbour : std::as_const(neighbourDirs)) { + int idx = config.adjacentScreenIndex(i, neighbour.x, neighbour.y); + if (idx != -1 && !config.screens()[idx].isNull()) + outStream << "\t\t" << neighbour.name << " = " << config.screens()[idx].name() << Qt::endl; + } } i++; }