Commit f9e86a1c authored by Michael Reeves's avatar Michael Reeves

Rename logging catagory add messages

parent ed6b18ca
......@@ -19,4 +19,4 @@
#include "Logging.h"
Q_LOGGING_CATEGORY(kdeMain, "org.kde.kdiff3")
Q_LOGGING_CATEGORY(kdiffMain, "org.kde.kdiff3")
......@@ -21,5 +21,5 @@
#define LOGGING_H
#include <QLoggingCategory>
Q_DECLARE_LOGGING_CATEGORY(kdeMain)
Q_DECLARE_LOGGING_CATEGORY(kdiffMain)
#endif // !LOGGING_H
......@@ -34,6 +34,7 @@ Optimizations: Skip unneeded steps.
#include "Utils.h"
#include "diff.h"
#include "Logging.h"
#include <QProcess>
#include <QString>
......@@ -774,9 +775,12 @@ void SourceData::FileData::removeComments()
const QChar* p = m_unicodeBuf.unicode();
bool bWithinComment = false;
int size = m_unicodeBuf.length();
qDebug(kdiffMain) << "m_v.size() = " << m_v.size() << ", size = " << size;
Q_ASSERT(m_v.size() > 0);
for(int i = 0; i < size; ++i)
{
// std::cout << "2 " << std::string(&p[i], m_v[line].size) << std::endl;
qDebug(kdiffMain) << " line= " << QString(&p[i], m_v[line].size());
bool bWhite = true;
bool bCommentInLine = false;
......
......@@ -109,7 +109,8 @@ void calcDiff3LineListUsingAB(
LineRef::LineType lineB = 0;
Diff d(0, 0, 0);
for(;;)
qDebug(kdiffMain) << "Enter: calcDiff3LineListUsingAB" ;
for(;;)
{
if(d.nofEquals == 0 && d.diff1 == 0 && d.diff2 == 0)
{
......@@ -156,8 +157,10 @@ void calcDiff3LineListUsingAB(
Q_ASSERT(d.nofEquals >= 0);
qDebug(kdiffMain) << "lineA = " << d3l.getLineA() << "lineB = " << d3l.getLineB() ;
d3ll.push_back(d3l);
}
qDebug(kdiffMain) << "Leave: calcDiff3LineListUsingAB" ;
}
// Second step
......
......@@ -236,7 +236,7 @@ class Diff3LineList : public std::list<Diff3Line>
int size() const {
if(std::list<Diff3Line>::size() > std::numeric_limits<int>::max())
{
qCDebug(kdeMain) << "Diff3Line: List too large. size=" << std::list<Diff3Line>::size();
qCDebug(kdiffMain) << "Diff3Line: List too large. size=" << std::list<Diff3Line>::size();
Q_ASSERT(false);//Unsupported size
return 0;
}
......
......@@ -128,7 +128,7 @@ void KDiff3Part::getNameAndVersion(const QString& str, const QString& lineStart,
while(pos2 > pos && str[pos2] != ' ' && str[pos2] != '\t') --pos2;
fileName = str.mid(pos, pos2 - pos);
//fprintf(stderr, "KDiff3: %s\n", fileName.toLatin1().constData());
qCDebug(kdeMain) << "KDiff3Part::getNameAndVersion: fileName = " << fileName << "\n";
qCDebug(kdiffMain) << "KDiff3Part::getNameAndVersion: fileName = " << fileName << "\n";
if(FileAccess(fileName).exists()) break;
--pos2;
}
......@@ -147,7 +147,7 @@ bool KDiff3Part::openFile()
{
// m_file is always local so we can use QFile on it
//fprintf(stderr, "KDiff3: %s\n", localFilePath().toLatin1().constData());
qCDebug(kdeMain) << "KDiff3Part::openFile(): localFilePath() == " << localFilePath() << "\n";
qCDebug(kdiffMain) << "KDiff3Part::openFile(): localFilePath() == " << localFilePath() << "\n";
QFile file(localFilePath());
if(!file.open(QIODevice::ReadOnly))
return false;
......@@ -219,7 +219,7 @@ bool KDiff3Part::openFile()
}
else if(!version1.isEmpty() && !version2.isEmpty())
{
qCDebug(kdeMain) << "KDiff3Part::openFile():" << fileName1 << "<->" << fileName2 << "\n";
qCDebug(kdiffMain) << "KDiff3Part::openFile():" << fileName1 << "<->" << fileName2 << "\n";
//fprintf(stderr, "KDiff3: f1/2:%s<->%s\n", fileName1.toLatin1().constData(), fileName2.toLatin1().constData());
// FIXME: Why must this be cvs?
// Assuming that files are on CVS: Try to get them
......
......@@ -79,7 +79,7 @@ static void debugLineCheck(Diff3LineList& d3ll, LineRef size, e_SrcSelector idx)
"If it is reproducible please contact the author.\n"),
i18n("Severe Internal Error"));
qCritical(kdeMain) << "Severe Internal Error. Line not set for idx=" << idx << "\n";
qCritical(kdiffMain) << "Severe Internal Error. Line not set for idx=" << idx << "\n";
::exit(-1);
}
++i;
......@@ -93,7 +93,7 @@ static void debugLineCheck(Diff3LineList& d3ll, LineRef size, e_SrcSelector idx)
"If it is reproducible please contact the author.\n"),
i18n("Severe Internal Error"));
qCritical(kdeMain) << "Severe Internal Error.: " << size << " != " << i << "\n";
qCritical(kdiffMain) << "Severe Internal Error.: " << size << " != " << i << "\n";
::exit(-1);
}
}
......@@ -156,6 +156,7 @@ void KDiff3App::mainInit(TotalDiffStatus* pTotalDiffStatus, bool bLoadFiles, boo
// First get all input data.
pp.setInformation(i18n("Loading A"));
qInfo(kdiffMain) << i18n("Loading A: ") << m_sd1.getFilename() ;
if(bUseCurrentEncoding)
errors = m_sd1.readAndPreprocess(m_sd1.getEncoding(), false);
......@@ -170,6 +171,8 @@ void KDiff3App::mainInit(TotalDiffStatus* pTotalDiffStatus, bool bLoadFiles, boo
pp.step();
pp.setInformation(i18n("Loading B"));
qInfo(kdiffMain) << i18n("Loading B: ") << m_sd2.getFilename() ;
if(bUseCurrentEncoding)
errors = m_sd2.readAndPreprocess(m_sd2.getEncoding(), false);
else
......@@ -200,12 +203,14 @@ void KDiff3App::mainInit(TotalDiffStatus* pTotalDiffStatus, bool bLoadFiles, boo
if(m_sd1.isText() && m_sd2.isText())
{
pp.setInformation(i18n("Diff: A <-> B"));
qInfo(kdiffMain) << i18n("Diff: A <-> B") ;
m_manualDiffHelpList.runDiff(m_sd1.getLineDataForDiff(), m_sd1.getSizeLines(), m_sd2.getLineDataForDiff(), m_sd2.getSizeLines(), m_diffList12, A, B,
&m_pOptionDialog->m_options);
pp.step();
pp.setInformation(i18n("Linediff: A <-> B"));
qInfo(kdiffMain) << i18n("Linediff: A <-> B") ;
calcDiff3LineListUsingAB(&m_diffList12, m_diff3LineList);
pTotalDiffStatus->bTextAEqB = m_diff3LineList.fineDiff(A, m_sd1.getLineDataForDisplay(), m_sd2.getLineDataForDisplay());
if(m_sd1.getSizeBytes() == 0) pTotalDiffStatus->bTextAEqB = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment