Commit ea3e04f827e39c715532a757b2e2c9c81a3aa23d
- Diff rendering mode:
- inline
- side by side
logger/src/logger.cpp
(13 / 1)
|   | |||
| 4 | 4 | #include <qutim/debug.h> | |
| 5 | 5 | #include <fstream> | |
| 6 | 6 | #include <QTime> | |
| 7 | #include <qutim/settingslayer.h> | ||
| 8 | #include <qutim/icon.h> | ||
| 7 | 9 | ||
| 8 | 10 | namespace Logger | |
| 9 | 11 | { | |
| … | … | ||
| 43 | 43 | ||
| 44 | 44 | bool LoggerPlugin::load() | |
| 45 | 45 | { | |
| 46 | Config config("logger"); | ||
| 46 | Config config = Config().group("Logger"); | ||
| 47 | 47 | QString path = config.value("path",SystemInfo::getPath(SystemInfo::ConfigDir).append("/qutim.log")); | |
| 48 | 48 | logfile.open(path.toLocal8Bit(), ios::app); | |
| 49 | 49 | qInstallMsgHandler(SimpleLoggingHandler); | |
| 50 | 50 | debug() << tr("New session started, happy debuging ^_^"); | |
| 51 | |||
| 52 | AutoSettingsItem *settingsItem = new AutoSettingsItem(Settings::Plugin, | ||
| 53 | Icon("view-choose"), | ||
| 54 | QT_TRANSLATE_NOOP("Plugin", "Logger")); | ||
| 55 | settingsItem->setConfig(QString(),"Logger"); | ||
| 56 | ObjectGenerator *gen = new GeneralGenerator<AutoSettingsFileChooser>(); | ||
| 57 | AutoSettingsItem::Entry *entryItem = settingsItem->addEntry(QT_TRANSLATE_NOOP("Plugin", "Select log path"), gen); | ||
| 58 | entryItem->setProperty("path",path); | ||
| 59 | entryItem->setName("path"); | ||
| 60 | Settings::registerItem(settingsItem); | ||
| 51 | 61 | return true; | |
| 52 | 62 | } | |
| 53 | 63 | bool LoggerPlugin::unload() |

