Use KSharedConfig::openStateConfig() instead of using a "data" file

This function will automatically create a "neochatstarerc" for us, and
KConfig will decide the best place for us to place our state. It won't
always be in AppDataLocation.
This commit is contained in:
Joshua Goins
2023-10-19 16:35:05 -04:00
committed by Tobias Fella
parent 26fd26f9fd
commit 83b7e7d121
5 changed files with 27 additions and 17 deletions

View File

@@ -28,12 +28,12 @@ RoomManager::RoomManager(QObject *parent)
: QObject(parent)
, m_currentRoom(nullptr)
, m_lastCurrentRoom(nullptr)
, m_config(KConfig(QStringLiteral("data"), KConfig::SimpleConfig, QStandardPaths::AppDataLocation))
, m_config(KSharedConfig::openStateConfig())
, m_messageEventModel(new MessageEventModel(this))
, m_messageFilterModel(new MessageFilterModel(this, m_messageEventModel))
, m_mediaMessageFilterModel(new MediaMessageFilterModel(this, m_messageFilterModel))
{
m_lastRoomConfig = m_config.group(QStringLiteral("LastOpenRoom"));
m_lastRoomConfig = m_config->group(QStringLiteral("LastOpenRoom"));
connect(this, &RoomManager::currentRoomChanged, this, [this]() {
m_messageEventModel->setRoom(m_currentRoom);