QString refstr;
m_datUrl = getDatUrl(url, refstr);
m_threadIndex = ThreadIndex(m_datUrl);
- /* get the pointer of Thread class */
+ // get the pointer of Thread class
m_thread = Thread::getByUrlNew(m_datUrl);
if (m_thread == 0) {
- /* create Thread */
+ // create Thread
m_thread = Thread::getByUrl(m_datUrl);
if (m_thread == 0) return ;
- /* read idx file */
+ // read idx file
m_threadIndex.loadIndex(m_thread);
}
m_thread = Thread::getByUrl(m_datUrl);
- /* japanese strings */
+ // japanese strings
m_spacestr = QString::fromUtf8(KITAUTF8_ZENSPACE);
- m_framestr1 = QString::fromUtf8(KITAUTF8_FRAME1); /* | */
- m_framestr2 = QString::fromUtf8(KITAUTF8_FRAME2); /* |- */
- m_framestr3 = QString::fromUtf8(KITAUTF8_FRAME3); /* L */
+ m_framestr1 = QString::fromUtf8(KITAUTF8_FRAME1); // |
+ m_framestr2 = QString::fromUtf8(KITAUTF8_FRAME2); // |-
+ m_framestr3 = QString::fromUtf8(KITAUTF8_FRAME3); // L
- /* make directory */
+ // make directory
Cache cache(m_datUrl);
QString cacheDir = cache.getDirPath();
if (!QDir::root().mkpath(cacheDir)) return ;
initPrivate(
- true /* load cache */
+ true // load cache
);
}
/* Init. If loadCache = true, load data from cache. */ /* private */
void DatInfo::initPrivate(bool loadCache)
{
- /* stop & delete dat loader */
+ // stop & delete dat loader
deleteAccessJob();
- /* init variables */
+ // init variables
m_broken = false;
m_nowLoading = false;
m_lastLine.clear();
- /* clear ResDatVec */
+ // clear ResDatVec
m_resDatVec.clear();
increaseResDatVec(RESDAT_DEFAULTSIZE);
- /* reset Abone */
+ // reset Abone
resetAbonePrivate();
- /* create dat loader */
+ // create dat loader
m_access = new Access(m_datUrl);
connect(m_access, SIGNAL(receiveData(const QStringList&)),
if (!loadCache) return ;
- /* reset ReadNum before loading cache. */
- /* ReadNum & subject are updated by Access::getcache() */
+ // reset ReadNum before loading cache.
+ // ReadNum & subject are updated by Access::getcache()
m_thread->setReadNum(0);
- /* get dat from cahce */
- /* slotReceiveData() is called from Access::getcache() */
+ // get dat from cahce
+ // slotReceiveData() is called from Access::getcache()
m_access->getcache();
- /* save up-to-date thread information */
+ // save up-to-date thread information
m_threadIndex.saveIndex(m_thread);
}
if (rescode != 200 && rescode != 206) return ;
- /* copy lines to buffer */
+ // copy lines to buffer
int count = lineList.count();
for (int i = 0; i < count ; ++i)
copyOneLineToResDat(lineList[ i ]);
{
if (line.isEmpty()) return false;
- /* update ReadNum */
+ // update ReadNum
const int num = m_thread->readNum() + 1;
m_thread->setReadNum(num);
- /* If resdat vector is short, then resize the vector. */
+ // If resdat vector is short, then resize the vector.
while ((int) m_resDatVec.size() <= num)
increaseResDatVec(RESDAT_DELTA);
- /* reset ResDat */
+ // reset ResDat
RESDAT& resdat = m_resDatVec[ num ];
resetResDat(resdat);
resdat.num = num;
resdat.linestr = line;
- /* get subject */
+ // get subject
if (num == 1) parseDat(num);
- /* search all responses which are responsed by this line. */
+ // search all responses which are responsed by this line.
if (GlobalConfig::checkResponsed()) {
- if (parseDat(num) && !checkAbonePrivate(num)) { /* parse line here to get AncList */
+ if (parseDat(num) && !checkAbonePrivate(num)) { // parse line here to get AncList
const int maxRange = 10;
finished loading new dat */ /* private slot */
void DatInfo::slotFinishLoad()
{
- /* save thread information */
+ // save thread information
m_threadIndex.saveIndex(m_thread);
- /* re-try by offlaw.cgi */
+ // re-try by offlaw.cgi
DatManager datManager(m_datUrl);
if (m_thread->readNum() == 0 && m_access2 == 0
&& datManager.is2chThread()) {
return ;
}
}
- /* finish loading session & emit signal to the parent object */
+ // finish loading session & emit signal to the parent object
m_nowLoading = false;
emit finishLoad();
- /* disconnect signals */
+ // disconnect signals
disconnect(SIGNAL(receiveData()));
disconnect(SIGNAL(finishLoad()));
}
void DatInfo::stopLoading() const
{
- /* Don't lock the mutex here !!!
- It will cause deadlock , because
- Access::stopJob() calls HTMLPart::slotFinishLoad() back,
- then HTMLPart::slotFinishLoad() calls another functions in DatInfo. */
+ // Don't lock the mutex here !!!
+ // It will cause deadlock , because
+ // Access::stopJob() calls HTMLPart::slotFinishLoad() back,
+ // then HTMLPart::slotFinishLoad() calls another functions in DatInfo.
if (m_access == 0)
return;
if (!m_nowLoading)
if (!reverse) {
- /* collect responses that have anchor to rootnum */
+ // collect responses that have anchor to rootnum
for (int i = rootnum + 1; i <= m_thread->readNum(); i++) {
if (checkAbonePrivate(i)) continue;
if (checkRes(i, rootnum)) {
}
}
- } else { /* collect responses for which rootnum has anchors */
+ } else { // collect responses for which rootnum has anchors
AncList& anclist = m_resDatVec[ rootnum ].anclist;
for (AncList::iterator it = anclist.begin(); it != anclist.end(); ++it) {
}
}
- /* make HTML document */
+ // make HTML document
if (count) {
for (QStringList::iterator it = strlists.begin(); it != strlists.end(); ++it) {
QString tmpstr;
- if ((*it) == strlists.last()) tmpstr = m_framestr3; /* 'L' */
- else tmpstr = m_framestr2; /* '|-' */
+ if ((*it) == strlists.last()) tmpstr = m_framestr3; // 'L'
+ else tmpstr = m_framestr2; // '|-'
retstr += prestr + tmpstr + "<a href=\"#" + (*it) + "\">>>" + (*it) + "</a><br>";
- /* call myself recursively */
+ // call myself recursively
int tmpnum;
tmpstr = prestr;
- if ((*it) == strlists.last()) tmpstr += m_spacestr + m_spacestr + m_spacestr; /* " " */
- else tmpstr += m_framestr1 + m_spacestr; /* "| " */
+ if ((*it) == strlists.last()) tmpstr += m_spacestr + m_spacestr + m_spacestr; // " "
+ else tmpstr += m_framestr1 + m_spacestr; // "| "
retstr += getTreeByResCore((*it).toInt(), reverse, tmpnum, tmpstr);
count += tmpnum;
}
int rescode = m_access->responseCode();
bool invalid = m_access->invalidDataReceived();
- /* see also Access::slotReceiveThreadData() */
+ // see also Access::slotReceiveThreadData()
if (invalid && (rescode == 200 || rescode == 206)) return true;
- /* maybe "Dat Ochi" */
+ // maybe "Dat Ochi"
return false;
}
QRegExp regexp((*it));
regexp.setCaseSensitivity(Qt::CaseInsensitive);
- if (checkOr) { /* OR */
+ if (checkOr) { // OR
if (str_text.indexOf(regexp, 0) != -1) {
return true;
}
- } else { /* AND */
+ } else { // AND
if (str_text.indexOf(regexp, 0) == -1) return false;
}
}
int refNum = (*it).from;
int refNum2 = (*it).to;
- /* I don't want to enter loop... */
+ // I don't want to enter loop...
if (refNum >= num) continue;
if (refNum2 >= num) refNum2 = num - 1;
if (useTableTag) titleHtml += "<table class=\"res_title\"><tr>";
- /* res number */
+ // res number
if (useTableTag) titleHtml += "<td class=\"res_title_number\">";
titleHtml += "<a href=\"#write" + QString::number(resdat.num) + "\">";
titleHtml += QString::number(resdat.num);
titleHtml += "</a> ";
- /* name & mail address */
+ // name & mail address
if (useTableTag) titleHtml += "<td class=\"res_title_name\">";
titleHtml += "<b>" + QString::fromUtf8(KITAUTF8_NAME);
- /* show name with mail address */
+ // show name with mail address
if (showMailAddress) {
titleHtml += resdat.nameHTML;
if (!resdat.address.isEmpty()) titleHtml += " [" + resdat.address + ']';
- } else { /* don't show mail address */
+ } else { // don't show mail address
if (resdat.address.isEmpty()) {
titleHtml += "</b> ";
- /* date */
+ // date
if (useTableTag) titleHtml += "<td class=\"res_title_date\">";
titleHtml += QString::fromUtf8(KITAUTF8_COLON) + resdat.date;
if (useTableTag) titleHtml += "</td>";
- /* ID */
+ // ID
if (!resdat.id.isEmpty()) {
if (useTableTag) titleHtml += "<td class=\"res_title_id\">";
if (useTableTag) titleHtml += "</td>";
}
- /* BE */
+ // BE
if (!resdat.be.isEmpty()) {
if (useTableTag) titleHtml += "<td class=\"res_title_be\">";
if (useTableTag) titleHtml += "</td>";
}
- /* host */
+ // host
if (!resdat.host.isEmpty()) {
if (useTableTag) titleHtml += "<td class=\"res_title_host\">";