aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/logview/LogViewWidget.cpp
diff options
context:
space:
mode:
authorGravatar Chris MacLeod2023-08-05 04:39:01 -0400
committerGravatar GitHub2023-08-05 10:39:01 +0200
commit2b021749ce4dc3ec8e160a5800e323f7a45047db (patch)
treef81f7365808ca2c02efb847d7a3b61aad901ea4b /src/modules/logview/LogViewWidget.cpp
parentkernel: We should read the default config on startup (bis) (#2548) (diff)
downloadKVIrc-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/LogViewWidget.cpp')
-rw-r--r--src/modules/logview/LogViewWidget.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/modules/logview/LogViewWidget.cpp b/src/modules/logview/LogViewWidget.cpp
index cf90ffa74..ed190a324 100644
--- a/src/modules/logview/LogViewWidget.cpp
+++ b/src/modules/logview/LogViewWidget.cpp
@@ -38,14 +38,18 @@
#include <zlib.h>
#endif
-LogListViewItem::LogListViewItem(QTreeWidgetItem * pPar, LogFile::Type eType, LogFile * pLog)
- : QTreeWidgetItem(pPar), m_eType(eType), m_pFileData(pLog)
+LogListViewItem::LogListViewItem(QTreeWidgetItem * pPar, LogFile::Type eType, std::shared_ptr<LogFile> pLog)
+ : QTreeWidgetItem(pPar)
+ , m_eType(eType)
+ , m_pFileData(pLog)
{
setText(0, m_pFileData ? m_pFileData->name() : QString());
}
-LogListViewItem::LogListViewItem(QTreeWidget * pPar, LogFile::Type eType, LogFile * pLog)
- : QTreeWidgetItem(pPar), m_eType(eType), m_pFileData(pLog)
+LogListViewItem::LogListViewItem(QTreeWidget * pPar, LogFile::Type eType, std::shared_ptr<LogFile> pLog)
+ : QTreeWidgetItem(pPar)
+ , m_eType(eType)
+ , m_pFileData(pLog)
{
setText(0, m_pFileData ? m_pFileData->name() : QString());
}
@@ -89,7 +93,7 @@ LogListViewItemType::LogListViewItemType(QTreeWidget * pPar, LogFile::Type eType
setText(0, szText);
}
-LogListViewLog::LogListViewLog(QTreeWidgetItem * pPar, LogFile::Type eType, LogFile * pLog)
+LogListViewLog::LogListViewLog(QTreeWidgetItem * pPar, LogFile::Type eType, std::shared_ptr<LogFile> pLog)
: LogListViewItem(pPar, eType, pLog)
{
setText(0, m_pFileData->date().toString("yyyy-MM-dd"));