aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Noldor2011-04-10 20:33:32 +0000
committerGravatar Noldor2011-04-10 20:33:32 +0000
commit601074cecea66b6a39abd933246d3017dd9fd418 (patch)
treef33c9ec898de928dbaedf07da4ff4543113d880e /src
parentMore work on #934 (html export) (diff)
downloadKVIrc-601074cecea66b6a39abd933246d3017dd9fd418.tar.gz
KVIrc-601074cecea66b6a39abd933246d3017dd9fd418.tar.bz2
KVIrc-601074cecea66b6a39abd933246d3017dd9fd418.zip
More internal filtering in html log export
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@5774 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src')
-rw-r--r--src/modules/logview/LogViewWindow.cpp16
-rw-r--r--src/modules/logview/LogViewWindow.h1
2 files changed, 9 insertions, 8 deletions
diff --git a/src/modules/logview/LogViewWindow.cpp b/src/modules/logview/LogViewWindow.cpp
index 716d34860..5a548593f 100644
--- a/src/modules/logview/LogViewWindow.cpp
+++ b/src/modules/logview/LogViewWindow.cpp
@@ -700,11 +700,12 @@ void LogViewWindow::createLog(LogFile * pLog, int iId)
szLine = KviControlCodes::stripControlBytes(szTmp);
// Remove icons' code
+ QRegExp rx;
rx.setPattern("^\\d{1,3}\\s");
szLine.replace(rx,"");
// Remove link from a user speaking
- // e.g.: <!ncHelLViS69> --> <HelLViS69>
+ // e.g.: <!ncHelLViS69> --> <HelLViS69>
rx.setPattern("\\s<!nc");
szLine.replace(rx," <");
@@ -776,7 +777,9 @@ void LogViewWindow::createLog(LogFile * pLog, int iId)
if(iMsgType!=24 && iMsgType!=26 && iMsgType!=25) continue;
// remove msgtype tag
szTmp = szTmp.remove(0,szNum.length()+1);
+
szTmp = KviHtmlGenerator::convertToHtml(szTmp);
+
// insert msgtype icon at start of the current text line
KviMessageTypeSettings msg(KVI_OPTION_MSGTYPE(iMsgType));
QString szIcon=g_pIconManager->getSmallIconResourceName((KviIconManager::SmallIcon)msg.pixId());
@@ -817,15 +820,13 @@ void LogViewWindow::createLog(LogFile * pLog, int iId)
{
QString szSourceFile=szCurrentThemePath+szImagesList.at(i);
QString szDestFile=szLogPath+szImagesList.at(i);
- qDebug ("copy from %s to %s",szSourceFile.toUtf8().data(),szDestFile.toUtf8().data());
KviFileUtils::copyFile(szSourceFile,szDestFile);
}
// remove internal tags
- szBuffer = szBuffer.replace("smallicons:","");
- szBuffer = szBuffer.replace("<qt>","");
- szBuffer = szBuffer.replace("</qt>","");
- szBuffer = szBuffer.replace("!nc","");
- szBuffer = szBuffer.replace("!n","");
+ szBuffer.replace(QRegExp("<qt>|</qt>|smallicons:"),"");
+ szBuffer.replace(">!nc",">");
+ szBuffer.replace("@!nc","@");
+ szBuffer.replace("%!nc","%");
// Close the document
szBuffer += "</body>\n</html>\n";
@@ -855,7 +856,6 @@ void LogViewWindow::createLog(LogFile * pLog, int iId)
log.close();
}
-
#ifndef COMPILE_USE_STANDALONE_MOC_SOURCES
#include "LogViewWindow.moc"
#endif //COMPILE_USE_STANDALONE_MOC_SOURCES
diff --git a/src/modules/logview/LogViewWindow.h b/src/modules/logview/LogViewWindow.h
index 839517d3f..0e65ad18a 100644
--- a/src/modules/logview/LogViewWindow.h
+++ b/src/modules/logview/LogViewWindow.h
@@ -199,6 +199,7 @@ protected:
void recurseDirectory(const QString & szDir);
void setupItemList();
+
/**
* \brief Exports the log and creates the file in the selected format
* \param pLog The log file associated to the item selected in the popup