gui: complete KF5 build with full feature parity

- Add chatblockmodel.cpp and thememanager.cpp to KF5 GUI target
- Link KF5::ConfigCore and KF5::SyntaxHighlighting to GUI
- Strip Qt6-only grouped palette syntax from QML at configure time
  (ThemeManager::applyPalette handles palette via QGuiApplication)
- Fix QStringList brace-init ambiguity in Qt5
- Fix QList::remove(pos,count) not available in Qt5 (use erase)
This commit is contained in:
Levi Neely 2026-08-03 09:03:12 +02:00
parent 7cb809fad2
commit 34d4a97b3d
3 changed files with 16 additions and 2 deletions

View File

@ -75,13 +75,21 @@ if(OLLIE_KF5)
endif() endif()
# --- GUI App (9P-based) --- # --- GUI App (9P-based) ---
configure_file(gui/main.qml ${CMAKE_CURRENT_BINARY_DIR}/gui-kf5/main.qml COPYONLY) # Strip Qt6-only grouped palette syntax (palette.active.*, palette.inactive.*,
# palette.disabled.*) — Qt5 QML doesn't support color-group qualifiers.
# ThemeManager::applyPalette() sets the application palette which Qt Quick
# Controls 2 picks up automatically.
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/gui/main.qml _QML_SRC)
string(REGEX REPLACE "[ \t]*(//[^\n]*palette[^\n]*\n|palette\\.(active|inactive|disabled)\\.[^\n]*\n)" "" _QML_SRC "${_QML_SRC}")
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/gui-kf5/main.qml "${_QML_SRC}")
configure_file(gui/qml.qrc ${CMAKE_CURRENT_BINARY_DIR}/gui-kf5/qml.qrc COPYONLY) configure_file(gui/qml.qrc ${CMAKE_CURRENT_BINARY_DIR}/gui-kf5/qml.qrc COPYONLY)
qt5_add_resources(GUI_KF5_QRC ${CMAKE_CURRENT_BINARY_DIR}/gui-kf5/qml.qrc) qt5_add_resources(GUI_KF5_QRC ${CMAKE_CURRENT_BINARY_DIR}/gui-kf5/qml.qrc)
add_executable(ollie-gui add_executable(ollie-gui
gui/main.cpp gui/main.cpp
gui/ollie9pclient.cpp gui/ollie9pclient.cpp
gui/ninepconnection.cpp gui/ninepconnection.cpp
gui/chatblockmodel.cpp
gui/thememanager.cpp
gui/streamfsm.cpp gui/streamfsm.cpp
${GUI_KF5_QRC} ${GUI_KF5_QRC}
) )
@ -91,6 +99,8 @@ if(OLLIE_KF5)
Qt5::Widgets Qt5::Widgets
Qt5::Quick Qt5::Quick
Qt5::QuickControls2 Qt5::QuickControls2
KF5::ConfigCore
KF5::SyntaxHighlighting
) )
# --- Install --- # --- Install ---

View File

@ -157,7 +157,11 @@ void ChatBlockModel::trimFront(int keepCount)
return; return;
int removeCount = m_blocks.size() - keepCount; int removeCount = m_blocks.size() - keepCount;
beginRemoveRows(QModelIndex(), 0, removeCount - 1); beginRemoveRows(QModelIndex(), 0, removeCount - 1);
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
m_blocks.remove(0, removeCount); m_blocks.remove(0, removeCount);
#else
m_blocks.erase(m_blocks.begin(), m_blocks.begin() + removeCount);
#endif
endRemoveRows(); endRemoveRows();
emit countChanged(); emit countChanged();
} }

View File

@ -502,7 +502,7 @@ void Ollie9pClient::loadRootAgents()
m_rootAgentsLoaded = true; m_rootAgentsLoaded = true;
emit availableAgentsChanged(); emit availableAgentsChanged();
} else { } else {
m_availableAgents = {"default"}; m_availableAgents = QStringList() << QStringLiteral("default");
m_rootAgentsLoaded = true; m_rootAgentsLoaded = true;
emit availableAgentsChanged(); emit availableAgentsChanged();
} }