23 #include "chatlogscfg.h" 25 #include "datapaths.h" 26 #include "irc/configuration/ircconfig.h" 39 ChatLogsCfg::~ChatLogsCfg()
43 QString ChatLogsCfg::chatLogsRootDir()
const 45 return value(
"ChatLogsRootDir", gDefaultDataPaths->localDataLocationPath(
46 DataPaths::CHATLOGS_DIR_NAME)).toString();
49 void ChatLogsCfg::setChatLogsRootDir(
const QString &val)
51 setValue(
"ChatLogsRootDir", val);
54 bool ChatLogsCfg::isStoreLogs()
const 56 return value(
"StoreLogs",
true).toBool();
59 void ChatLogsCfg::setStoreLogs(
bool b)
61 setValue(
"StoreLogs", b);
64 bool ChatLogsCfg::isRestoreChatFromLogs()
const 66 return value(
"RestoreChatFromLogs",
true).toBool();
69 void ChatLogsCfg::setRestoreChatFromLogs(
bool b)
71 setValue(
"RestoreChatFromLogs", b);
74 bool ChatLogsCfg::isRemoveOldLogs()
const 76 return value(
"RemoveOldLogs",
false).toBool();
78 void ChatLogsCfg::setRemoveOldLogs(
bool b)
80 setValue(
"RemoveOldLogs", b);
83 int ChatLogsCfg::oldLogsRemovalDaysThreshold()
const 85 int val = value(
"OldLogsRemovalDaysThreshold", 365).toInt();
89 void ChatLogsCfg::setOldLogsRemovalDaysThreshold(
int val)
91 setValue(
"OldlogsRemovalDaysThreshold", val);
94 void ChatLogsCfg::setValue(
const QString &key,
const QVariant &value)
96 gIRCConfig.ini()->section(
"Logs").setValue(key, value);
99 QVariant ChatLogsCfg::value(
const QString &key,
const QVariant &defValue)
const 101 return gIRCConfig.ini()->section(
"Logs").value(key, defValue);