diff options
| author | 2023-08-05 04:39:01 -0400 | |
|---|---|---|
| committer | 2023-08-05 10:39:01 +0200 | |
| commit | 2b021749ce4dc3ec8e160a5800e323f7a45047db (patch) | |
| tree | f81f7365808ca2c02efb847d7a3b61aad901ea4b /src/modules/logview/LogFile.h | |
| parent | kernel: We should read the default config on startup (bis) (#2548) (diff) | |
| download | KVIrc-2b021749ce4dc3ec8e160a5800e323f7a45047db.tar.gz KVIrc-2b021749ce4dc3ec8e160a5800e323f7a45047db.tar.bz2 KVIrc-2b021749ce4dc3ec8e160a5800e323f7a45047db.zip | |
Batch export logs (#2485)
* Implement most basic functional batch export
For the future:
* The loop still needs to be made asynchronous so the process doesn't hang.
* Ideally, there should be some sort of progress window.
* There is redundant code that should be reduced.
* Make batch export asynchronous
Reminder: The comment about overwrite protection no longer applies
Todo: Progress dialog
* Avoid possible dangling pointer, improve type safety and const correctness in the process
In reality, the log exporting code has no reason to be in the GUI class to begin with. `exportLog` makes sense as a Qt slot, but `createLog` should be a member function of the `LogFile` class and operate on `this` rather than a `LogFile` argument.
A future commit should amend this, but for now I will avoid changing anything unnecessary until a working progress dialog is in place and I have tested the finished feature thoroughly.
* Add progress dialog
* Make LogViewWindow::createLog a member function of LogFile
* Reduce memory usage by sharing `LogFile`s with the GUI thread
* Correct progress dialog modality
* Collect log files directly instead of reiterating through view items later
Also adds a little documentation
* Fix batch export for paths with reserved characters
* avoid sigsegv
* fix tags removal before nickname in html export
* Fix directory selection and output path for icons in html export
---------
Co-authored-by: ctrlaltca <ctrlaltca@gmail.com>
Diffstat (limited to 'src/modules/logview/LogFile.h')
| -rw-r--r-- | src/modules/logview/LogFile.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/modules/logview/LogFile.h b/src/modules/logview/LogFile.h index 9b4984aa7..eb0b4ce64 100644 --- a/src/modules/logview/LogFile.h +++ b/src/modules/logview/LogFile.h @@ -143,7 +143,16 @@ public: * \param szText The buffer where to save the contents of the log * \return void */ - void getText(QString & szText); + void getText(QString & szText) const; + + /** + * \brief Exports the log and creates the file in the selected format + * \param exportType The type of file to export the log as. Either PlainText or HTML. + * \param szLog The absolute path of the file to be created + * \param pszFile The buffer to store the exported log name + * \return void + */ + void createLog(ExportType exportType, QString szLog, QString * pszFile = nullptr) const; }; #endif // _LOGFILE_H_ |
