diff options
| author | 2011-04-12 23:28:57 +0000 | |
|---|---|---|
| committer | 2011-04-12 23:28:57 +0000 | |
| commit | 31b45f75d310a760d3035aeb304a92fcca53b9d4 (patch) | |
| tree | eca3477257e7d8f6de2c3cd8efacf71768438e55 /src/modules/logview | |
| parent | fixed #1131 (diff) | |
| download | KVIrc-31b45f75d310a760d3035aeb304a92fcca53b9d4.tar.gz KVIrc-31b45f75d310a760d3035aeb304a92fcca53b9d4.tar.bz2 KVIrc-31b45f75d310a760d3035aeb304a92fcca53b9d4.zip | |
fixed paragraph formatting;
fixed icons names;
make exported XHTML 1.1 W3C compliant;
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@5779 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/logview')
| -rw-r--r-- | src/modules/logview/LogViewWindow.cpp | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/modules/logview/LogViewWindow.cpp b/src/modules/logview/LogViewWindow.cpp index 6b428f2d3..449c78ffa 100644 --- a/src/modules/logview/LogViewWindow.cpp +++ b/src/modules/logview/LogViewWindow.cpp @@ -668,14 +668,14 @@ void LogViewWindow::createLog(LogFile * pLog, int iId) return; QRegExp rx; - QString szBuffer, szLine, szTmp; + QString szLog, szLogDir, szBuffer, szLine, szTmp; QString szDate = pLog->date().toString("yyyy.MM.dd"); // The fresh new log - QString szLog = QDir::homePath(); - KviQString::ensureLastCharIs(szLog,QChar(KVI_PATH_SEPARATOR_CHAR)); - szLog += "temp"; - szLog += KVI_PATH_SEPARATOR_CHAR; + g_pApp->getLocalKvircDirectory(szLogDir,KviApplication::Tmp); + KviFileUtils::adjustFilePath(szLogDir); + szLogDir += KVI_PATH_SEPARATOR_CHAR; + szLog += szLogDir; szLog += QString("%1_%2.%3_%4").arg(pLog->typeString(),pLog->name(),pLog->network(),szDate); // Open file for reading @@ -734,7 +734,7 @@ void LogViewWindow::createLog(LogFile * pLog, int iId) szLog += ".html"; szTmp = QString("KVIrc %1 %2").arg(KVI_VERSION).arg(KVI_RELEASE_NAME); QString szNick = ""; - static bool bFirstLine = true; + bool bFirstLine = true; QString szTitle; switch(pLog->type()) @@ -773,6 +773,8 @@ void LogViewWindow::createLog(LogFile * pLog, int iId) // Find who has talked QString szTmpNick = szTmp.section(" ",2,2); + if((szTmpNick.left(1) != "<") && (szTmpNick.right(1) != ">")) + szTmpNick = ""; // locate msgtype QString szNum = szTmp.section(' ',0,0); @@ -786,12 +788,12 @@ void LogViewWindow::createLog(LogFile * pLog, int iId) // remove msgtype tag szTmp = szTmp.remove(0,szNum.length()+1); - szTmp = KviHtmlGenerator::convertToHtml(szTmp); + szTmp = KviHtmlGenerator::convertToHtml(szTmp,true); // 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()); - szTmp.prepend("<img src=\"" + szIcon + "\">"); + szTmp.prepend("<img src=\"" + szIcon + "\" alt=\"\" /> "); /* * Check if the nick who has talked is the same of the above line. @@ -809,13 +811,13 @@ void LogViewWindow::createLog(LogFile * pLog, int iId) szTmp.prepend("<p>"); szNick = szTmpNick; - bFirstLine = false; } else { // Break the line - szTmp += "<br />\n"; + szTmp.prepend("<br />\n"); } szBuffer += szTmp; + bFirstLine = false; } // Close the last paragraph @@ -859,7 +861,7 @@ void LogViewWindow::createLog(LogFile * pLog, int iId) for(int i=0; i < szImagesList.count(); i++) { QString szSourceFile = szCurrentThemePath + szImagesList.at(i); - QString szDestFile = szLog + szImagesList.at(i); + QString szDestFile = szLogDir + szImagesList.at(i); KviFileUtils::copyFile(szSourceFile,szDestFile); } |
