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:
committed by
Tobias Fella
parent
26fd26f9fd
commit
83b7e7d121
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user