Revision | fe841795e3a003e8c38d7535fcc892c242f62457 (tree) |
---|---|
Zeit | 2010-02-17 22:51:52 |
Autor | nogu <nogu@user...> |
Commiter | nogu |
Use //' style comments
@@ -54,7 +54,7 @@ struct Kita::Category | ||
54 | 54 | |
55 | 55 | BBSView::BBSView(QWidget *parent) : QWidget(parent), m_favorites(0) |
56 | 56 | { |
57 | - /* copied from Base class */ | |
57 | + // copied from Base class | |
58 | 58 | bbsViewBaseLayout = new QVBoxLayout(this); |
59 | 59 | |
60 | 60 | layout10 = new QHBoxLayout(0); |
@@ -72,7 +72,7 @@ BBSView::BBSView(QWidget *parent) : QWidget(parent), m_favorites(0) | ||
72 | 72 | m_boardList->setRootIsDecorated(true); |
73 | 73 | bbsViewBaseLayout->addWidget(m_boardList); |
74 | 74 | resize(QSize(600, 482).expandedTo(minimumSizeHint())); |
75 | - /* copy end */ | |
75 | + // copy end | |
76 | 76 | |
77 | 77 | m_boardList->setHeaderLabel(i18nc("@title:column", "Board Name")); |
78 | 78 | m_boardList->header()->setClickable(false); |
@@ -133,7 +133,7 @@ bool BBSView::downloadBoardList() | ||
133 | 133 | QList<Category> categoryList = getCategoryList(html); |
134 | 134 | QList<Category>::iterator it; |
135 | 135 | |
136 | - /* Are there new boards or moved boards ? */ | |
136 | + // Are there new boards or moved boards? | |
137 | 137 | QString newBoards; |
138 | 138 | QString oldBoards; |
139 | 139 | for (it = categoryList.begin(); it != categoryList.end(); ++it) { |
@@ -167,7 +167,7 @@ bool BBSView::downloadBoardList() | ||
167 | 167 | |
168 | 168 | const int maxNewBoard = 64; |
169 | 169 | |
170 | - /* show new board names */ | |
170 | + // show new board names | |
171 | 171 | if (!newBoards.isEmpty() && newBoards.count("\n") < maxNewBoard) { |
172 | 172 | |
173 | 173 | QStringList boardList = newBoards.split('\n'); |
@@ -176,7 +176,7 @@ bool BBSView::downloadBoardList() | ||
176 | 176 | boardList, "Kita"); |
177 | 177 | } |
178 | 178 | |
179 | - /* show moved board names */ | |
179 | + // show moved board names | |
180 | 180 | if (!oldBoards.isEmpty()) { |
181 | 181 | |
182 | 182 | QStringList boardList = oldBoards.split('\n'); |
@@ -218,7 +218,7 @@ bool BBSView::downloadBoardList() | ||
218 | 218 | db.moveBoard(oldUrl, newUrl); |
219 | 219 | } |
220 | 220 | |
221 | - /* save config */ | |
221 | + // save config | |
222 | 222 | QString configPath = KStandardDirs::locateLocal("appdata", "board_list"); |
223 | 223 | KConfig config(configPath); |
224 | 224 | for (it = categoryList.begin(); it != categoryList.end(); ++it) { |
@@ -119,7 +119,7 @@ void BoardView::loadBoard(const KUrl& url, bool online) | ||
119 | 119 | m_readNum = 0; |
120 | 120 | m_newNum = 0; |
121 | 121 | |
122 | - /* get list of pointers of Thread classes */ | |
122 | + // get list of pointers of Thread classes | |
123 | 123 | QList<Thread*> oldLogList; |
124 | 124 | QList<Thread*> threadList; |
125 | 125 | BoardDatabase db(m_boardUrl); |
@@ -168,7 +168,7 @@ void BoardView::loadBoard(const KUrl& url, bool online) | ||
168 | 168 | subjectList->setFocus(); |
169 | 169 | updateKindLabel(); |
170 | 170 | |
171 | - /* restore column size */ | |
171 | + // restore column size | |
172 | 172 | loadLayout(); |
173 | 173 | loadHeaderOnOff(); |
174 | 174 | m_enableSizeChange = true; |
@@ -273,26 +273,26 @@ void BoardView::updateRow(int row, const KUrl& datUrl, | ||
273 | 273 | subjectList->item(row, ColumnSpeed) |
274 | 274 | ->setText(QString(" %1 ").arg(speed, 0, 'f', 2)); |
275 | 275 | |
276 | - /* set mark order */ | |
276 | + // set mark order | |
277 | 277 | QTableWidgetItem *item = subjectList->item(row, ColumnMark); |
278 | 278 | int orderValue; |
279 | - if (!id) { /* old thread */ | |
279 | + if (!id) { // old thread | |
280 | 280 | orderValue = ThreadOld; |
281 | 281 | } else if (readNum > 0 && (resNum > readNum || resNum > viewPos)) { |
282 | - /* There are new responses. */ | |
282 | + // There are new responses. | |
283 | 283 | item->setIcon(QIcon(SmallIcon("unread"))); |
284 | 284 | m_unreadNum++; |
285 | 285 | orderValue = ThreadHasUnread; |
286 | - } else if (readNum > 0) { /* Cache exists */ | |
286 | + } else if (readNum > 0) { // Cache exists | |
287 | 287 | item->setIcon(QIcon(SmallIcon("read"))); |
288 | 288 | m_readNum++; |
289 | 289 | orderValue = (viewPos > 1000) ? ThreadReaded : ThreadRead; |
290 | 290 | } else if (since.secsTo(current) < 3600 * GlobalConfig::markTime()) { |
291 | - /* new thread */ | |
291 | + // new thread | |
292 | 292 | item->setIcon(QIcon(SmallIcon("newthread"))); |
293 | 293 | m_newNum++; |
294 | 294 | orderValue = ThreadNew; |
295 | - } else { /* normal */ | |
295 | + } else { // normal | |
296 | 296 | item->setIcon(QIcon()); |
297 | 297 | orderValue = ThreadNormal; |
298 | 298 | } |
@@ -300,7 +300,7 @@ void BoardView::updateRow(int row, const KUrl& datUrl, | ||
300 | 300 | |
301 | 301 | // no effect: m_unreadNum, m_readNum, m_newNum, markOrder |
302 | 302 | if (datManager.isMainThreadOpened() && resNum == readNum) { |
303 | - /* opened */ | |
303 | + // opened | |
304 | 304 | subjectList->item(row, ColumnMark)->setIcon(QIcon(SmallIcon("open"))); |
305 | 305 | } |
306 | 306 | } |
@@ -28,13 +28,13 @@ DomTree::DomTree(const DOM::HTMLDocument& hdoc, const KUrl& datUrl) | ||
28 | 28 | m_bufSize = 0; |
29 | 29 | m_bottomNum = 0; |
30 | 30 | |
31 | - /* create the nodes of footer, header, etc. */ | |
31 | + // create the nodes of footer, header, etc. | |
32 | 32 | createKokoyon(); |
33 | 33 | createFooter(); |
34 | 34 | createHeader(); |
35 | 35 | |
36 | - /* get pointer of DatInfo */ | |
37 | - /* Note that m_datURL is already locked in the HTMLPart. */ | |
36 | + // get pointer of DatInfo | |
37 | + // Note that m_datURL is already locked in the HTMLPart. | |
38 | 38 | m_datInfo = DatManager(datUrl).getDatInfoPointer(); |
39 | 39 | } |
40 | 40 |
@@ -50,12 +50,12 @@ bool DomTree::createResElement(int num) | ||
50 | 50 | Q_ASSERT(m_datInfo != 0); |
51 | 51 | |
52 | 52 | if (num < m_bufSize && m_resStatus[ num ] != HTML_NOTPARSED) { |
53 | - /* already parsed */ | |
53 | + // already parsed | |
54 | 54 | return true; |
55 | 55 | } |
56 | 56 | |
57 | 57 | if (num >= m_bufSize) { |
58 | - /* resize buffer size */ | |
58 | + // resize buffer size | |
59 | 59 | if (m_bufSize == 0) m_bufSize = 100; |
60 | 60 | while (num >= m_bufSize) m_bufSize += 500; |
61 | 61 |
@@ -73,7 +73,7 @@ bool DomTree::createResElement(int num) | ||
73 | 73 | } |
74 | 74 | } |
75 | 75 | |
76 | - /* cleate elements */ | |
76 | + // cleate elements | |
77 | 77 | QString titleHTML, bodyHTML; |
78 | 78 | m_resStatus[ num ] = m_datInfo->getHTML(num, true, titleHTML, bodyHTML); |
79 | 79 |
@@ -118,7 +118,7 @@ void DomTree::redraw(bool force) | ||
118 | 118 | |
119 | 119 | int readNum = m_datInfo->getReadNum(); |
120 | 120 | |
121 | - /* don't forget to reset abone here... */ | |
121 | + // don't forget to reset abone here... | |
122 | 122 | m_datInfo->resetAbone(); |
123 | 123 | |
124 | 124 | for (int i = 1; i <= readNum; i++) { |
@@ -226,16 +226,16 @@ void DomTree::updateHeader(DOM::Element& headerElement) | ||
226 | 226 | DOM::Element backupElement1, backupElement2, backupElement3; |
227 | 227 | int readNum = m_datInfo->getReadNum(); |
228 | 228 | |
229 | - /* remove <a href="#tosaigo"> and <BR> */ | |
230 | - backupElement1 = headerElement.removeChild(headerElement.lastChild()); /* BR */ | |
231 | - backupElement2 = headerElement.removeChild(headerElement.lastChild()); /* BR */ | |
232 | - backupElement3 = headerElement.removeChild(headerElement.lastChild()); /* "#tosaigo" */ | |
229 | + // remove <a href="#tosaigo"> and <BR> | |
230 | + backupElement1 = headerElement.removeChild(headerElement.lastChild()); // BR | |
231 | + backupElement2 = headerElement.removeChild(headerElement.lastChild()); // BR | |
232 | + backupElement3 = headerElement.removeChild(headerElement.lastChild()); // "#tosaigo" | |
233 | 233 | |
234 | - DOM::Node node = headerElement.firstChild(); /* node is now "#kokomade_yonda" */ | |
235 | - node = node.nextSibling(); /* " " */ | |
234 | + DOM::Node node = headerElement.firstChild(); // node is now "#kokomade_yonda" | |
235 | + node = node.nextSibling(); // " " | |
236 | 236 | node = node.nextSibling(); |
237 | 237 | |
238 | - /* '1-', '101-' などのリンクを作成 */ | |
238 | + // '1-', '101-' などのリンクを作成 | |
239 | 239 | for (int num = 1; num < readNum ; num += 100) { |
240 | 240 | if (node == 0) { |
241 | 241 | QString href = QString("#%1").arg(num); |
@@ -251,10 +251,10 @@ void DomTree::updateHeader(DOM::Element& headerElement) | ||
251 | 251 | } |
252 | 252 | } |
253 | 253 | |
254 | - /* restore <a href="#tosaigo"> and <BR> */ | |
255 | - headerElement.appendChild(backupElement3); /* "#tosaigo" */ | |
256 | - headerElement.appendChild(backupElement2); /* BR */ | |
257 | - headerElement.appendChild(backupElement1); /* BR */ | |
254 | + // restore <a href="#tosaigo"> and <BR> | |
255 | + headerElement.appendChild(backupElement3); // "#tosaigo" | |
256 | + headerElement.appendChild(backupElement2); // BR | |
257 | + headerElement.appendChild(backupElement1); // BR | |
258 | 258 | } |
259 | 259 | |
260 | 260 | /* |
@@ -271,13 +271,13 @@ void DomTree::updateFooter(DOM::Element& footerElement) | ||
271 | 271 | DOM::Element backupElement; |
272 | 272 | int readNum = m_datInfo->getReadNum(); |
273 | 273 | |
274 | - backupElement = footerElement.removeChild(footerElement.lastChild()); /* "#tosaigo" */ | |
274 | + backupElement = footerElement.removeChild(footerElement.lastChild()); // "#tosaigo" | |
275 | 275 | |
276 | - DOM::Node node = footerElement.firstChild(); /* node is now "#kokomade_yonda" */ | |
277 | - node = node.nextSibling(); /* " " */ | |
276 | + DOM::Node node = footerElement.firstChild(); // node is now "#kokomade_yonda" | |
277 | + node = node.nextSibling(); // " " | |
278 | 278 | node = node.nextSibling(); |
279 | 279 | |
280 | - /* '1-', '101-' などのリンクを作成 */ | |
280 | + // '1-', '101-' などのリンクを作成 | |
281 | 281 | for (int num = 1; num < readNum ; num += 100) { |
282 | 282 | if (node == 0) { |
283 | 283 | QString href = QString("#%1").arg(num); |
@@ -293,7 +293,7 @@ void DomTree::updateFooter(DOM::Element& footerElement) | ||
293 | 293 | } |
294 | 294 | } |
295 | 295 | |
296 | - footerElement.appendChild(backupElement); /* "#tosaigo" */ | |
296 | + footerElement.appendChild(backupElement); // "#tosaigo" | |
297 | 297 | } |
298 | 298 | |
299 | 299 | /* |
@@ -68,12 +68,12 @@ void HTMLPart::clearPart() | ||
68 | 68 | { |
69 | 69 | slotDeletePopup(); |
70 | 70 | |
71 | - /* delete DomTree */ | |
71 | + // delete DomTree | |
72 | 72 | delete m_domtree; |
73 | 73 | m_domtree = 0; |
74 | 74 | |
75 | 75 | DatManager datManager(m_datUrl); |
76 | - /* update ViewPos */ | |
76 | + // update ViewPos | |
77 | 77 | if (m_mode == HTMLPART_MODE_MAINPART && !m_updatedKokoyon |
78 | 78 | && !m_datUrl.isEmpty()) { |
79 | 79 | int readNum = datManager.getReadNum(); |
@@ -83,24 +83,24 @@ void HTMLPart::clearPart() | ||
83 | 83 | } |
84 | 84 | m_updatedKokoyon = false; |
85 | 85 | |
86 | - /* clear variables */ | |
86 | + // clear variables | |
87 | 87 | m_anchorStack.clear(); |
88 | 88 | m_centerNum = 0; |
89 | 89 | m_jumpNumAfterLoading = 0; |
90 | 90 | findTextInit(); |
91 | 91 | |
92 | - if (!m_datUrl.isEmpty()) { /* This part is opened. */ | |
93 | - /* This part is on the main thread view. */ | |
92 | + if (!m_datUrl.isEmpty()) { // This part is opened. | |
93 | + // This part is on the main thread view. | |
94 | 94 | if (m_mode == HTMLPART_MODE_MAINPART) { |
95 | 95 | |
96 | - /* tell Thread class that "thread is closed" */ | |
96 | + // tell Thread class that "thread is closed" | |
97 | 97 | datManager.setMainThreadOpened(false); |
98 | 98 | |
99 | - /* emit "deactivated all thread view" SIGNAL */ | |
99 | + // emit "deactivated all thread view" SIGNAL | |
100 | 100 | KUrl nullUrl(""); |
101 | 101 | ViewMediator::getInstance()->changeWriteTab(nullUrl); |
102 | 102 | |
103 | - /* update subject tab. */ | |
103 | + // update subject tab. | |
104 | 104 | } |
105 | 105 | } |
106 | 106 |
@@ -121,25 +121,25 @@ bool HTMLPart::setup(int mode, const KUrl& url) | ||
121 | 121 | m_mode = mode; |
122 | 122 | |
123 | 123 | if (m_mode == HTMLPART_MODE_MAINPART) { |
124 | - /* This part is on the main thread view. */ | |
124 | + // This part is on the main thread view. | |
125 | 125 | DatManager datManager(m_datUrl); |
126 | - /* create DatInfo explicitly to open new thread. */ | |
127 | - /* Usually, DatInfo is NOT created if ReadNum == 0.*/ | |
128 | - /* See also DatManager::createDatInfo() and */ | |
129 | - /* DatManager::getDatInfo(). */ | |
126 | + // create DatInfo explicitly to open new thread. | |
127 | + // Usually, DatInfo is NOT created if ReadNum == 0. | |
128 | + // See also DatManager::createDatInfo() and | |
129 | + // DatManager::getDatInfo(). | |
130 | 130 | datManager.createDatInfo(); |
131 | 131 | |
132 | - /* tell Thread class that "thread is opened" */ | |
132 | + // tell Thread class that "thread is opened" | |
133 | 133 | datManager.setMainThreadOpened(true); |
134 | 134 | |
135 | - /* reset abone */ | |
135 | + // reset abone | |
136 | 136 | datManager.resetAbone(); |
137 | 137 | } |
138 | 138 | |
139 | - /* create HTML Document */ | |
139 | + // create HTML Document | |
140 | 140 | createHTMLDocument(); |
141 | 141 | |
142 | - /* create DOM manager */ | |
142 | + // create DOM manager | |
143 | 143 | if (m_mode == HTMLPART_MODE_MAINPART) { |
144 | 144 | m_domtree = new DomTree(htmlDocument(), m_datUrl); |
145 | 145 | } |
@@ -151,7 +151,7 @@ bool HTMLPart::setup(int mode, const KUrl& url) | ||
151 | 151 | /* private */ |
152 | 152 | void HTMLPart::connectSignals() |
153 | 153 | { |
154 | - /* popup */ | |
154 | + // popup | |
155 | 155 | connect(this, SIGNAL(onURL(const QString&)), SLOT(slotOnUrl(const QString&))); |
156 | 156 | |
157 | 157 | connect(view(), SIGNAL(leave()), SLOT(slotLeave())); |
@@ -164,7 +164,7 @@ void HTMLPart::connectSignals() | ||
164 | 164 | /* private */ |
165 | 165 | void HTMLPart::createHTMLDocument() |
166 | 166 | { |
167 | - /* style */ | |
167 | + // style | |
168 | 168 | QString style = QString("body { font-size: %1pt; font-family: \"%2\"; color: %3; background-color: %4; }") |
169 | 169 | .arg(GlobalConfig::threadFont().pointSize()) |
170 | 170 | .arg(GlobalConfig::threadFont().family()) |
@@ -179,10 +179,9 @@ void HTMLPart::createHTMLDocument() | ||
179 | 179 | setJScriptEnabled(false); |
180 | 180 | setJavaEnabled(false); |
181 | 181 | |
182 | - /* Use dummy URL here, and protocol should be "file:". | |
183 | - If protocol is "http:", local image files are not shown | |
184 | - (for security reasons ?). | |
185 | - */ | |
182 | + // Use dummy URL here, and protocol should be "file:". | |
183 | + // If protocol is "http:", local image files are not shown | |
184 | + // (for security reasons?). | |
186 | 185 | begin(KUrl("file:/dummy.htm")); |
187 | 186 | write(text); |
188 | 187 | end(); |
@@ -248,19 +247,19 @@ void HTMLPart::updateScreen(bool showHeaderEtc, bool clock) | ||
248 | 247 | return ; |
249 | 248 | } |
250 | 249 | |
251 | - /* show clock cursor */ | |
250 | + // show clock cursor | |
252 | 251 | if (clock) { |
253 | 252 | QCursor qc; qc.setShape(Qt::WaitCursor); |
254 | 253 | QApplication::setOverrideCursor(qc); |
255 | 254 | } |
256 | 255 | |
257 | - /* show header, footer, and kokomadeyonda, etc. */ | |
256 | + // show header, footer, and kokomadeyonda, etc. | |
258 | 257 | if (showHeaderEtc) { |
259 | 258 | m_domtree->appendKokoyon(); |
260 | 259 | m_domtree->appendFooterAndHeader(); |
261 | 260 | } |
262 | 261 | |
263 | - /* change color of number of the res which is responsed. */ | |
262 | + // change color of number of the res which is responsed. | |
264 | 263 | if (m_mode == HTMLPART_MODE_MAINPART) { |
265 | 264 | |
266 | 265 | if (GlobalConfig::checkResponsed()) { |
@@ -268,13 +267,13 @@ void HTMLPart::updateScreen(bool showHeaderEtc, bool clock) | ||
268 | 267 | } |
269 | 268 | } |
270 | 269 | |
271 | - /* update display */ | |
270 | + // update display | |
272 | 271 | htmlDocument().applyChanges(); |
273 | 272 | view()->layout(); |
274 | 273 | view()->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); |
275 | 274 | view()->setFocus(); |
276 | 275 | |
277 | - /* restore cursor */ | |
276 | + // restore cursor | |
278 | 277 | if (clock) { |
279 | 278 | QApplication::restoreOverrideCursor(); |
280 | 279 | } |
@@ -360,7 +359,7 @@ bool HTMLPart::reload(int jumpNum) | ||
360 | 359 | { |
361 | 360 | if (!m_domtree) return false; |
362 | 361 | if (m_mode != HTMLPART_MODE_MAINPART) { |
363 | - /* If this is not MainPart, then open MainPart. */ | |
362 | + // If this is not MainPart, then open MainPart. | |
364 | 363 | ViewMediator::getInstance()->openUrl(m_datUrl); |
365 | 364 | return false; |
366 | 365 | } |
@@ -369,7 +368,7 @@ bool HTMLPart::reload(int jumpNum) | ||
369 | 368 | if (m_centerNum == 0) m_centerNum = m_domtree->getBottomResNumber(); |
370 | 369 | m_jumpNumAfterLoading = jumpNum; |
371 | 370 | |
372 | - /* DatManager will call back slotReceiveData and slotFinishLoad. */ | |
371 | + // DatManager will call back slotReceiveData and slotFinishLoad. | |
373 | 372 | DatManager(m_datUrl).updateCache(this); |
374 | 373 | view() ->setFocus(); |
375 | 374 |
@@ -391,10 +390,10 @@ void HTMLPart::slotReceiveData() | ||
391 | 390 | int readNum = DatManager(m_datUrl).getReadNum(); |
392 | 391 | int bottom = m_domtree->getBottomResNumber(); |
393 | 392 | |
394 | - /* parsing */ | |
393 | + // parsing | |
395 | 394 | parseResponses(bottom + 1, readNum); |
396 | 395 | |
397 | - /* rendering */ | |
396 | + // rendering | |
398 | 397 | if (m_firstReceive || bottom + delta < readNum) { |
399 | 398 | showResponses(bottom + 1, readNum); |
400 | 399 | updateScreen(true, false); |
@@ -455,7 +454,7 @@ bool HTMLPart::gotoAnchor(const QString& anc, bool pushPosition) | ||
455 | 454 | |
456 | 455 | if (res > 1) { |
457 | 456 | |
458 | - /* is target valid ? */ | |
457 | + // is target valid? | |
459 | 458 | if (!DatManager(m_datUrl).isResValid(res)) |
460 | 459 | return false; |
461 | 460 |
@@ -465,9 +464,9 @@ bool HTMLPart::gotoAnchor(const QString& anc, bool pushPosition) | ||
465 | 464 | if (res == 1) ancstr = "header"; |
466 | 465 | if (pushPosition) pushCurrentPosition(); |
467 | 466 | |
468 | - /* KHTMLPart::gotoAnchor() will fail if the thread is not shown. */ | |
469 | - /* So KHTMLPart::gotoAnchor() should be called via custom event. */ | |
470 | - /* See also HTMLPart::customEvent() */ | |
467 | + // KHTMLPart::gotoAnchor() will fail if the thread is not shown. | |
468 | + // So KHTMLPart::gotoAnchor() should be called via custom event. | |
469 | + // See also HTMLPart::customEvent() | |
471 | 470 | GotoAnchorEvent * e = new GotoAnchorEvent(ancstr); |
472 | 471 | QApplication::postEvent(this, e); // Qt will delete it when done |
473 | 472 |
@@ -562,13 +561,13 @@ bool HTMLPart::findText(const QString &query, bool reverse) | ||
562 | 561 | QRegExp regexp(query); |
563 | 562 | regexp.setCaseSensitivity(Qt::CaseInsensitive); |
564 | 563 | |
565 | - /* init */ | |
564 | + // init | |
566 | 565 | if (m_findNode.isNull()) { |
567 | 566 | |
568 | 567 | m_findNode = htmlDocument().body(); |
569 | 568 | m_find_y = 0; |
570 | 569 | |
571 | - /* move to the last child node */ | |
570 | + // move to the last child node | |
572 | 571 | if (reverse) { |
573 | 572 | while (!m_findNode.lastChild().isNull()) m_findNode = m_findNode.lastChild(); |
574 | 573 | m_find_y = view() ->contentsHeight(); |
@@ -580,7 +579,7 @@ bool HTMLPart::findText(const QString &query, bool reverse) | ||
580 | 579 | if (m_findNode.nodeType() == DOM::Node::TEXT_NODE |
581 | 580 | || m_findNode.nodeType() == DOM::Node::CDATA_SECTION_NODE) { |
582 | 581 | |
583 | - /* find the word in the current node */ | |
582 | + // find the word in the current node | |
584 | 583 | DOM::DOMString nodeText = m_findNode.nodeValue(); |
585 | 584 | QString nodestr = nodeText.string(); |
586 | 585 | if (reverse && m_findPos != -1) nodestr.resize(m_findPos); |
@@ -588,7 +587,7 @@ bool HTMLPart::findText(const QString &query, bool reverse) | ||
588 | 587 | if (reverse) m_findPos = nodestr.lastIndexOf(regexp, m_findPos); |
589 | 588 | else m_findPos = nodestr.indexOf(regexp, m_findPos + 1); |
590 | 589 | |
591 | - /* scroll & select & return */ | |
590 | + // scroll & select & return | |
592 | 591 | if (m_findPos != -1) { |
593 | 592 | int matchLen = regexp.matchedLength(); |
594 | 593 |
@@ -628,12 +627,12 @@ bool HTMLPart::findText(const QString &query, bool reverse) | ||
628 | 627 | } |
629 | 628 | } |
630 | 629 | |
631 | - /*------------------------*/ | |
630 | + //------------------------ | |
632 | 631 | |
633 | 632 | m_findPos = -1; |
634 | 633 | DOM::Node next; |
635 | 634 | |
636 | - /* move to the next node */ | |
635 | + // move to the next node | |
637 | 636 | if (!reverse) { |
638 | 637 | |
639 | 638 | next = m_findNode.firstChild(); |
@@ -646,7 +645,7 @@ bool HTMLPart::findText(const QString &query, bool reverse) | ||
646 | 645 | } |
647 | 646 | } |
648 | 647 | } |
649 | - /* revearse */ | |
648 | + // revearse | |
650 | 649 | else { |
651 | 650 | |
652 | 651 | next = m_findNode.lastChild(); |
@@ -688,18 +687,18 @@ void HTMLPart::showPopupMenu(const KUrl& kurl) | ||
688 | 687 | |
689 | 688 | QString str; |
690 | 689 | |
691 | - /* If selected Text is composed of only digits, then show res popup. */ | |
690 | + // If selected Text is composed of only digits, then show res popup. | |
692 | 691 | if (!m_pushctrl && showSelectedDigitPopup()) return ; |
693 | 692 | |
694 | - /*-----------------------------------*/ | |
695 | - /* create menu items */ | |
693 | + //----------------------------------- | |
694 | + // create menu items | |
696 | 695 | |
697 | 696 | KMenu popupMenu(view()); |
698 | 697 | KMenu* backSubMenu = 0; |
699 | 698 | KMenu* markSubMenu = 0; |
700 | 699 | |
701 | - /*------*/ | |
702 | - /* jump */ | |
700 | + //------ | |
701 | + // jump | |
703 | 702 | KAction* homeLinkAct = 0; |
704 | 703 | KAction* kokoLinkAct = 0; |
705 | 704 | KAction* endLinkAct = 0; |
@@ -880,7 +879,7 @@ void HTMLPart::customEvent(QEvent * e) | ||
880 | 879 | /* protected */ |
881 | 880 | void HTMLPart::khtmlMousePressEvent(khtml::MousePressEvent* e) |
882 | 881 | { |
883 | - emit mousePressed(); /* to ThreadView to focus this view. */ | |
882 | + emit mousePressed(); // to ThreadView to focus this view. | |
884 | 883 | |
885 | 884 | KUrl kurl; |
886 | 885 | if (!e->url().string().isEmpty()) { |
@@ -895,7 +894,7 @@ void HTMLPart::khtmlMousePressEvent(khtml::MousePressEvent* e) | ||
895 | 894 | |
896 | 895 | if (e->url() != 0) { |
897 | 896 | |
898 | - if (e->url().string().at(0) == '#') { /* anchor */ | |
897 | + if (e->url().string().at(0) == '#') { // anchor | |
899 | 898 | kurl = m_datUrl; |
900 | 899 | kurl.setRef(e->url().string().mid(1)) ; |
901 | 900 | } |
@@ -905,7 +904,7 @@ void HTMLPart::khtmlMousePressEvent(khtml::MousePressEvent* e) | ||
905 | 904 | return ; |
906 | 905 | } |
907 | 906 | |
908 | - /* popup menu */ | |
907 | + // popup menu | |
909 | 908 | if (m_pushrightbt) { |
910 | 909 | showPopupMenu(kurl); |
911 | 910 | m_pushctrl = m_pushmidbt = m_pushrightbt = false; |
@@ -939,28 +938,28 @@ void HTMLPart::clickAnchor(const KUrl& urlin) | ||
939 | 938 | QString refstr; |
940 | 939 | KUrl datUrl = getDatUrl(urlin , refstr); |
941 | 940 | |
942 | - /*--------------------*/ | |
943 | - /* Ctrl + right click */ | |
941 | + //-------------------- | |
942 | + // Ctrl + right click | |
944 | 943 | if (m_pushctrl && m_pushrightbt) { |
945 | 944 | showPopupMenu(urlin); |
946 | 945 | return ; |
947 | 946 | } |
948 | 947 | |
949 | - /*--------------------------------*/ | |
950 | - /* If this is not anchor, then */ | |
951 | - /* emit openURLRequest and return */ | |
948 | + //-------------------------------- | |
949 | + // If this is not anchor, then | |
950 | + // emit openURLRequest and return | |
952 | 951 | |
953 | 952 | if (datUrl.host() != m_datUrl.host() || datUrl.path() != m_datUrl.path()) { |
954 | 953 | |
955 | - /* right click */ | |
954 | + // right click | |
956 | 955 | if (m_pushrightbt) { |
957 | 956 | |
958 | - /* start multi-popup mode or show popup menu */ | |
957 | + // start multi-popup mode or show popup menu | |
959 | 958 | if (!startMultiPopup()) showPopupMenu(urlin); |
960 | 959 | |
961 | 960 | return ; |
962 | 961 | } |
963 | - /* right click */ | |
962 | + // right click | |
964 | 963 | |
965 | 964 | ViewMediator::getInstance()->openUrl(urlin); |
966 | 965 | return ; |
@@ -968,37 +967,37 @@ void HTMLPart::clickAnchor(const KUrl& urlin) | ||
968 | 967 | |
969 | 968 | if (refstr.isEmpty()) return ; |
970 | 969 | |
971 | - /*---------------------------*/ | |
972 | - /* show popupmenu for #write */ | |
970 | + //--------------------------- | |
971 | + // show popupmenu for #write | |
973 | 972 | |
974 | 973 | if (refstr.left(5) == "write") { |
975 | 974 | showWritePopupMenu(refstr); |
976 | 975 | return ; |
977 | 976 | } |
978 | 977 | |
979 | - /*----------------------------*/ | |
980 | - /* extract responses by ID */ | |
978 | + //---------------------------- | |
979 | + // extract responses by ID | |
981 | 980 | |
982 | 981 | if (refstr.left(5) == "idpop") { |
983 | 982 | showIdPopup(refstr); |
984 | 983 | return ; |
985 | 984 | } |
986 | 985 | |
987 | - /*---------------------------*/ | |
988 | - /* show popupmenu for #bepop */ | |
986 | + //--------------------------- | |
987 | + // show popupmenu for #bepop | |
989 | 988 | |
990 | 989 | if (refstr.left(5) == "bepop") { |
991 | 990 | showBePopupMenu(refstr); |
992 | 991 | return ; |
993 | 992 | } |
994 | 993 | |
995 | - /*-------------------------*/ | |
996 | - /* start multi-popup mdde */ | |
994 | + //------------------------- | |
995 | + // start multi-popup mdde | |
997 | 996 | if (m_pushrightbt && startMultiPopup()) return ; |
998 | 997 | |
999 | 998 | |
1000 | - /*----------------------------*/ | |
1001 | - /* next 100 ,before 100 ,etc. */ | |
999 | + //---------------------------- | |
1000 | + // next 100 ,before 100 ,etc. | |
1002 | 1001 | if (m_mode == HTMLPART_MODE_MAINPART) { |
1003 | 1002 | if (refstr.left(7) == "tosaigo") { |
1004 | 1003 | slotClickGotoFooter(); |
@@ -1006,8 +1005,8 @@ void HTMLPart::clickAnchor(const KUrl& urlin) | ||
1006 | 1005 | } |
1007 | 1006 | } |
1008 | 1007 | |
1009 | - /*-------------------------------*/ | |
1010 | - /* open Kita Navi or goto anchor */ | |
1008 | + //------------------------------- | |
1009 | + // open Kita Navi or goto anchor | |
1011 | 1010 | |
1012 | 1011 | int refNum, refNum2; |
1013 | 1012 |
@@ -1044,7 +1043,7 @@ void HTMLPart::showWritePopupMenu(const QString& refstr) | ||
1044 | 1043 | DatManager datManager(m_datUrl); |
1045 | 1044 | QString namestr = datManager.getPlainName(resNum); |
1046 | 1045 | |
1047 | - /* show res tree */ | |
1046 | + // show res tree | |
1048 | 1047 | if (m_pushrightbt) { |
1049 | 1048 | int num; |
1050 | 1049 | QString htmlstr = datManager.getTreeByRes(resNum, num); |
@@ -1056,8 +1055,8 @@ void HTMLPart::showWritePopupMenu(const QString& refstr) | ||
1056 | 1055 | return ; |
1057 | 1056 | } |
1058 | 1057 | |
1059 | - /*---------------------*/ | |
1060 | - /* create popup menu */ | |
1058 | + //--------------------- | |
1059 | + // create popup menu | |
1061 | 1060 | QString plainStr; |
1062 | 1061 | |
1063 | 1062 | KMenu popupMenu(view()); |
@@ -1205,7 +1204,7 @@ void HTMLPart::showIdPopup(const QString& refstr) | ||
1205 | 1204 | .replace("%2B", "+") |
1206 | 1205 | .replace("%2F", "/"); |
1207 | 1206 | |
1208 | - /* popup */ | |
1207 | + // popup | |
1209 | 1208 | if (m_pushrightbt) { |
1210 | 1209 | int num; |
1211 | 1210 | QString htmlstr = DatManager(m_datUrl).getHtmlById(strid, num); |
@@ -1399,7 +1398,7 @@ void HTMLPart::slotLeave() | ||
1399 | 1398 | |
1400 | 1399 | hidePopup(); |
1401 | 1400 | |
1402 | - /* emit signal to have parent hide this if this is popup . */ | |
1401 | + // emit signal to have parent hide this if this is popup. | |
1403 | 1402 | if (m_mode == HTMLPART_MODE_POPUP && !isUnderMouse(0, 0)) { |
1404 | 1403 | emit hideChildPopup(); |
1405 | 1404 | } |
@@ -1414,7 +1413,7 @@ void HTMLPart::slotVSliderReleased() | ||
1414 | 1413 | |
1415 | 1414 | hidePopup(); |
1416 | 1415 | |
1417 | - /* emit signal to have parent hide this if this is popup . */ | |
1416 | + // emit signal to have parent hide this if this is popup. | |
1418 | 1417 | if (m_mode == HTMLPART_MODE_POPUP && !isUnderMouse(mrg, 0)) { |
1419 | 1418 | emit hideChildPopup(); |
1420 | 1419 | } |
@@ -1430,7 +1429,7 @@ void HTMLPart::slotHSliderReleased() | ||
1430 | 1429 | |
1431 | 1430 | hidePopup(); |
1432 | 1431 | |
1433 | - /* emit signal to have parent hide this if this is popup . */ | |
1432 | + // emit signal to have parent hide this if this is popup. | |
1434 | 1433 | if (m_mode == HTMLPART_MODE_POPUP && !isUnderMouse(0, mrg)) { |
1435 | 1434 | emit hideChildPopup(); |
1436 | 1435 | } |
@@ -1443,7 +1442,7 @@ void HTMLPart::slotHideChildPopup() | ||
1443 | 1442 | { |
1444 | 1443 | hidePopup(); |
1445 | 1444 | |
1446 | - /* emit signal to have parent hide this if this is popup . */ | |
1445 | + // emit signal to have parent hide this if this is popup. | |
1447 | 1446 | if (m_mode == HTMLPART_MODE_POPUP && !isUnderMouse(0, 0)) { |
1448 | 1447 | emit hideChildPopup(); |
1449 | 1448 | } |
@@ -1454,11 +1453,11 @@ void HTMLPart::slotHideChildPopup() | ||
1454 | 1453 | /* This slot is called when mouse moves onto the URL */ /* private slot */ |
1455 | 1454 | void HTMLPart::slotOnUrl(const QString& url) |
1456 | 1455 | { |
1457 | - /* config */ | |
1456 | + // config | |
1458 | 1457 | |
1459 | - const int maxpopup = 10; /* max number of responses shown in the popup window */ | |
1458 | + const int maxpopup = 10; // max number of responses shown in the popup window | |
1460 | 1459 | |
1461 | - /*----------------------------*/ | |
1460 | + //---------------------------- | |
1462 | 1461 | |
1463 | 1462 | if (isMultiPopupMode()) return ; |
1464 | 1463 |
@@ -1467,10 +1466,10 @@ void HTMLPart::slotOnUrl(const QString& url) | ||
1467 | 1466 | if (url.isEmpty()) return ; |
1468 | 1467 | if (url.left(7) == "mailto:") return ; |
1469 | 1468 | |
1470 | - /* Is Kita active now ? */ | |
1469 | + // Is Kita active now? | |
1471 | 1470 | if(ViewMediator::getInstance()->isActive() == false) return; |
1472 | 1471 | |
1473 | - /* get reference */ | |
1472 | + // get reference | |
1474 | 1473 | QString refstr; |
1475 | 1474 | KUrl datUrl = m_datUrl; |
1476 | 1475 | if (url.at(0) == '#') { |
@@ -1480,8 +1479,8 @@ void HTMLPart::slotOnUrl(const QString& url) | ||
1480 | 1479 | } |
1481 | 1480 | |
1482 | 1481 | DatManager datManager(m_datUrl); |
1483 | - /*------------------------*/ | |
1484 | - /* id popup */ | |
1482 | + //------------------------ | |
1483 | + // id popup | |
1485 | 1484 | |
1486 | 1485 | if (url.left(6) == "#idpop") { |
1487 | 1486 | int num = datManager.getNumById(url.mid(6)); |
@@ -1498,8 +1497,8 @@ void HTMLPart::slotOnUrl(const QString& url) | ||
1498 | 1497 | } |
1499 | 1498 | |
1500 | 1499 | |
1501 | - /*------------------------*/ | |
1502 | - /* show reffered num */ | |
1500 | + //------------------------ | |
1501 | + // show reffered num | |
1503 | 1502 | |
1504 | 1503 | if (refstr.left(5) == "write") { |
1505 | 1504 | int no = refstr.mid(5).toInt(); |
@@ -1517,8 +1516,8 @@ void HTMLPart::slotOnUrl(const QString& url) | ||
1517 | 1516 | } |
1518 | 1517 | |
1519 | 1518 | |
1520 | - /*------------------------*/ | |
1521 | - /* abone */ | |
1519 | + //------------------------ | |
1520 | + // abone | |
1522 | 1521 | |
1523 | 1522 | if (url.left(6) == "#abone") { |
1524 | 1523 | int no = url.mid(6).toInt(); |
@@ -1527,15 +1526,15 @@ void HTMLPart::slotOnUrl(const QString& url) | ||
1527 | 1526 | return ; |
1528 | 1527 | } |
1529 | 1528 | |
1530 | - /*-------------------------*/ | |
1531 | - /* popup for anchor */ | |
1529 | + //------------------------- | |
1530 | + // popup for anchor | |
1532 | 1531 | |
1533 | 1532 | QString innerHTML; |
1534 | 1533 | int refNum; |
1535 | 1534 | int refNum2; |
1536 | 1535 | |
1537 | 1536 | int i = refstr.indexOf("-"); |
1538 | - if (i != -1) { /* >>refNum-refNum2 */ | |
1537 | + if (i != -1) { // >>refNum-refNum2 | |
1539 | 1538 | |
1540 | 1539 | refNum = refstr.left(i).toInt(); |
1541 | 1540 | refNum2 = refstr.mid(i + 1).toInt(); |
@@ -1545,32 +1544,32 @@ void HTMLPart::slotOnUrl(const QString& url) | ||
1545 | 1544 | if (refNum2 - refNum > maxpopup - 1) refNum2 = refNum + maxpopup - 1; |
1546 | 1545 | } |
1547 | 1546 | |
1548 | - } else { /* >>refNum */ | |
1547 | + } else { // >>refNum | |
1549 | 1548 | refNum = refstr.toInt(); |
1550 | 1549 | refNum2 = refNum; |
1551 | 1550 | } |
1552 | 1551 | |
1553 | 1552 | DatManager localDatManager(datUrl); |
1554 | - /* another thread ? */ | |
1553 | + // another thread? | |
1555 | 1554 | if (datUrl.host() != m_datUrl.host() || datUrl.path() != m_datUrl.path()) { |
1556 | 1555 | |
1557 | - /* get board name */ | |
1556 | + // get board name | |
1558 | 1557 | BoardDatabase db(datUrl); |
1559 | 1558 | QString boardName = db.boardName(); |
1560 | 1559 | if (!boardName.isEmpty()) innerHTML += '[' + boardName + "] "; |
1561 | 1560 | |
1562 | - /* If idx file of datURL is not read, thread name cannot be obtained. | |
1563 | - so, create DatInfo if cache exists, and read idx file in DatInfo::DatInfo(). */ | |
1561 | + // If idx file of datURL is not read, thread name cannot be obtained. | |
1562 | + // so, create DatInfo if cache exists, and read idx file in DatInfo::DatInfo(). | |
1564 | 1563 | localDatManager.getDatInfoPointer(); |
1565 | 1564 | |
1566 | - /* get thread Name */ | |
1565 | + // get thread Name | |
1567 | 1566 | QString subName = localDatManager.threadName(); |
1568 | 1567 | if (!subName.isEmpty()) innerHTML += subName + "<br><br>"; |
1569 | 1568 | |
1570 | 1569 | if (!refNum) refNum = refNum2 = 1; |
1571 | 1570 | } |
1572 | 1571 | |
1573 | - /* get HTML and show it */ | |
1572 | + // get HTML and show it | |
1574 | 1573 | if (!refNum) return ; |
1575 | 1574 | innerHTML += localDatManager.getHtml(refNum, refNum2); |
1576 | 1575 |
@@ -39,7 +39,7 @@ void HTMLView::keyPressEvent(QKeyEvent* e) | ||
39 | 39 | /* protected */ |
40 | 40 | void HTMLView::wheelEvent(QWheelEvent * e) |
41 | 41 | { |
42 | - if (e->delta() < 0) { /* scroll down */ | |
42 | + if (e->delta() < 0) { // scroll down | |
43 | 43 | if (emitPushDown()) return ; |
44 | 44 | } |
45 | 45 |
@@ -52,7 +52,7 @@ bool HTMLView::emitPushDown() | ||
52 | 52 | int y = contentsY(); |
53 | 53 | |
54 | 54 | if (y >= contentsHeight() - visibleHeight()) { |
55 | - emit pushDown(); /* to HTMLPart in order to call slotClickTugi100 */ | |
55 | + emit pushDown(); // to HTMLPart in order to call slotClickTugi100 | |
56 | 56 | return true; |
57 | 57 | } |
58 | 58 |
@@ -30,7 +30,7 @@ TabWidgetBase::TabWidgetBase(QWidget* parent) : KTabWidget(parent) | ||
30 | 30 | setupActions(); |
31 | 31 | |
32 | 32 | if (parent) { |
33 | - /* setup part manager */ | |
33 | + // setup part manager | |
34 | 34 | m_manager = new KParts::PartManager(parent, this); |
35 | 35 | m_manager->addManagedTopLevelWidget(parent); |
36 | 36 | } else { |
@@ -41,7 +41,7 @@ TabWidgetBase::TabWidgetBase(QWidget* parent) : KTabWidget(parent) | ||
41 | 41 | |
42 | 42 | TabWidgetBase::~TabWidgetBase() |
43 | 43 | { |
44 | - /* remove parts */ | |
44 | + // remove parts | |
45 | 45 | if (m_manager && !(m_manager->parts().isEmpty())) { |
46 | 46 | KParts::Part * part; |
47 | 47 | while ((part = m_manager->parts().first()) != 0) { |
@@ -53,7 +53,7 @@ TabWidgetBase::~TabWidgetBase() | ||
53 | 53 | delete m_manager; |
54 | 54 | m_manager = 0; |
55 | 55 | |
56 | - /* remove widgets which don't belong to parts */ | |
56 | + // remove widgets which don't belong to parts | |
57 | 57 | QWidget* view = currentWidget(); |
58 | 58 | while (count() > 0 && view) { |
59 | 59 | removePage(view); |
@@ -68,7 +68,7 @@ void Access::getcache() | ||
68 | 68 | switch (m_bbstype) { |
69 | 69 | |
70 | 70 | case Board_2ch: |
71 | - case Board_MachiBBS: /* Machi BBS's data is already parsed as 2ch dat. */ | |
71 | + case Board_MachiBBS: // Machi BBS's data is already parsed as 2ch dat. | |
72 | 72 | |
73 | 73 | { |
74 | 74 | QString tmpData = K2ch().datToUnicode(orgData); |
@@ -78,8 +78,8 @@ void Access::getcache() | ||
78 | 78 | break; |
79 | 79 | |
80 | 80 | default: |
81 | - /* convert data stream into 2ch dat. | |
82 | - and emit receiveData SIGNAL. */ | |
81 | + // convert data stream into 2ch dat. | |
82 | + // and emit receiveData SIGNAL. | |
83 | 83 | emitDatLineList(orgData); |
84 | 84 | break; |
85 | 85 | } |
@@ -102,7 +102,7 @@ void Access::writeCacheData() | ||
102 | 102 | QDataStream out(&file); |
103 | 103 | out << m_threadData; |
104 | 104 | } |
105 | - m_threadData.clear(); /* clear baffer */ | |
105 | + m_threadData.clear(); // clear baffer | |
106 | 106 | |
107 | 107 | return ; |
108 | 108 | } |
@@ -110,14 +110,14 @@ void Access::writeCacheData() | ||
110 | 110 | /* update cache file */ /* public */ |
111 | 111 | bool Access::getupdate(int readNum) |
112 | 112 | { |
113 | - /* init */ | |
113 | + // init | |
114 | 114 | m_readNum = readNum; |
115 | 115 | m_threadData.clear(); |
116 | 116 | m_firstReceive = false; |
117 | 117 | m_invalidDataReceived = false; |
118 | 118 | m_lastLine.clear(); |
119 | 119 | |
120 | - /* set URL of data */ | |
120 | + // set URL of data | |
121 | 121 | QString getUrl; |
122 | 122 | switch (m_bbstype) { |
123 | 123 |
@@ -130,7 +130,7 @@ bool Access::getupdate(int readNum) | ||
130 | 130 | |
131 | 131 | case Board_JBBS: |
132 | 132 | getUrl = getThreadUrl(m_datUrl); |
133 | - getUrl.replace("read.cgi", "rawmode.cgi"); /* adhoc... */ | |
133 | + getUrl.replace("read.cgi", "rawmode.cgi"); // adhoc... | |
134 | 134 | if (m_readNum > 0) |
135 | 135 | getUrl += '/' + QString::number(m_readNum + 1) + '-'; |
136 | 136 | break; |
@@ -139,13 +139,13 @@ bool Access::getupdate(int readNum) | ||
139 | 139 | getUrl = m_datUrl.prettyUrl(); |
140 | 140 | } |
141 | 141 | |
142 | - /* set UserAgent */ | |
142 | + // set UserAgent | |
143 | 143 | const QString useragent = QString("Monazilla/1.00 (Kita/%1)").arg(VERSION); |
144 | 144 | KIO::SlaveConfig::self() ->setConfigData("http", |
145 | 145 | KUrl(getUrl).host(), |
146 | 146 | "UserAgent", useragent); |
147 | 147 | |
148 | - /* create new job */ | |
148 | + // create new job | |
149 | 149 | KIO::TransferJob* job |
150 | 150 | = KIO::get(getUrl, KIO::Reload, KIO::HideProgressInfo); |
151 | 151 | m_currentJob = job; |
@@ -157,11 +157,11 @@ bool Access::getupdate(int readNum) | ||
157 | 157 | // use 'HTTP-Headers' metadata. |
158 | 158 | job->addMetaData("PropagateHttpHeader", "true"); |
159 | 159 | |
160 | - /* resume */ | |
160 | + // resume | |
161 | 161 | if (m_bbstype != Board_MachiBBS |
162 | 162 | && m_bbstype != Board_JBBS |
163 | 163 | && m_dataSize > 0) { |
164 | - m_firstReceive = true; /* remove first char (i.e. \n). see also slotReceiveThreadData() */ | |
164 | + m_firstReceive = true; // remove first char (i.e. \n). see also slotReceiveThreadData() | |
165 | 165 | job->addMetaData("resume", QString::number(m_dataSize - 1)); |
166 | 166 | job->addMetaData("AllowCompressedPage", "false"); |
167 | 167 | } |
@@ -203,7 +203,7 @@ void Access::slotReceiveThreadData(KIO::Job*, const QByteArray& data) | ||
203 | 203 | return ; |
204 | 204 | } |
205 | 205 | |
206 | - /* check if received data is invalid (or broken). */ | |
206 | + // check if received data is invalid (or broken). | |
207 | 207 | if ((m_dataSize > 0 && responseCode() != 206) |
208 | 208 | || (m_firstReceive && data_tmp[ 0 ] != '\n') |
209 | 209 | || (m_dataSize == 0 && responseCode() != 200)) |
@@ -211,7 +211,7 @@ void Access::slotReceiveThreadData(KIO::Job*, const QByteArray& data) | ||
211 | 211 | |
212 | 212 | if (m_invalidDataReceived) return ; |
213 | 213 | |
214 | - /* If this is the first call at resumption, remove LF(\n) at head. */ | |
214 | + // If this is the first call at resumption, remove LF(\n) at head. | |
215 | 215 | if (m_firstReceive) { |
216 | 216 | data_tmp = data_tmp.mid(1); |
217 | 217 | } |
@@ -232,12 +232,12 @@ void Access::emitDatLineList(const QByteArray& dataStream) | ||
232 | 232 | bool endIsLF = false; |
233 | 233 | if (dataStream.at(dataStream.length() - 1) == '\n') endIsLF = true; |
234 | 234 | |
235 | - /* split the stream */ | |
235 | + // split the stream | |
236 | 236 | m_lastLine += dataStream; |
237 | 237 | lineList = m_lastLine.split('\n'); |
238 | 238 | m_lastLine.clear(); |
239 | 239 | |
240 | - /* save the last line */ | |
240 | + // save the last line | |
241 | 241 | if (!endIsLF) { |
242 | 242 | |
243 | 243 | QList<QByteArray>::iterator lastit = lineList.end(); |
@@ -249,9 +249,9 @@ void Access::emitDatLineList(const QByteArray& dataStream) | ||
249 | 249 | } |
250 | 250 | } |
251 | 251 | |
252 | - /* filtering */ | |
252 | + // filtering | |
253 | 253 | |
254 | - /* convert lines into 2ch dat */ | |
254 | + // convert lines into 2ch dat | |
255 | 255 | int count = lineList.count(); |
256 | 256 | for (int i = 0; i < count ; ++i) { |
257 | 257 |
@@ -261,7 +261,7 @@ void Access::emitDatLineList(const QByteArray& dataStream) | ||
261 | 261 | QByteArray ba; |
262 | 262 | int nextNum = m_readNum + 1; |
263 | 263 | |
264 | - /* convert line */ | |
264 | + // convert line | |
265 | 265 | switch (m_bbstype) { |
266 | 266 | |
267 | 267 | case Board_MachiBBS: |
@@ -298,7 +298,7 @@ void Access::emitDatLineList(const QByteArray& dataStream) | ||
298 | 298 | |
299 | 299 | if (line2.isEmpty()) continue; |
300 | 300 | |
301 | - /* add abone lines */ | |
301 | + // add abone lines | |
302 | 302 | const char aboneStr[] = "abone<><><>abone<>"; |
303 | 303 | while (nextNum > m_readNum + 1) { |
304 | 304 | datLineList += aboneStr; |
@@ -306,7 +306,7 @@ void Access::emitDatLineList(const QByteArray& dataStream) | ||
306 | 306 | ++m_readNum; |
307 | 307 | } |
308 | 308 | |
309 | - /* save line */ | |
309 | + // save line | |
310 | 310 | if (m_bbstype == Board_MachiBBS) m_threadData += ba + '\n'; |
311 | 311 | else m_threadData += lineList[ i ] + '\n'; |
312 | 312 | ++m_readNum; |
@@ -315,7 +315,7 @@ void Access::emitDatLineList(const QByteArray& dataStream) | ||
315 | 315 | } |
316 | 316 | } |
317 | 317 | |
318 | - /* call DatInfo::slotReceiveData() */ | |
318 | + // call DatInfo::slotReceiveData() | |
319 | 319 | emit receiveData(datLineList); |
320 | 320 | } |
321 | 321 |
@@ -328,7 +328,7 @@ void Access::killJob() | ||
328 | 328 | |
329 | 329 | void Access::stopJob() |
330 | 330 | { |
331 | - if (m_currentJob) m_currentJob->kill(); /* emit result signal */ | |
331 | + if (m_currentJob) m_currentJob->kill(); // emit result signal | |
332 | 332 | } |
333 | 333 | |
334 | 334 | int Access::serverTime() |
@@ -357,7 +357,7 @@ int Access::responseCode() | ||
357 | 357 | QStringList dateStrList = headerList.filter(regexp); |
358 | 358 | if (dateStrList.isEmpty() || regexp.indexIn(dateStrList[0]) == -1) { |
359 | 359 | // invalid response |
360 | - if (m_bbstype == Board_JBBS) return 200; /* adhoc... */ | |
360 | + if (m_bbstype == Board_JBBS) return 200; // adhoc... | |
361 | 361 | return 0; |
362 | 362 | } else { |
363 | 363 | return regexp.cap(1).toInt(); |
@@ -404,7 +404,7 @@ QString OfflawAccess::get() | ||
404 | 404 | // use 'HTTP-Headers' metadata. |
405 | 405 | job->addMetaData("PropagateHttpHeader", "true"); |
406 | 406 | |
407 | - return QString(); /* dummy */ | |
407 | + return QString(); // dummy | |
408 | 408 | } |
409 | 409 | |
410 | 410 | void OfflawAccess::slotThreadResult(KIO::Job* job) |
@@ -26,14 +26,14 @@ BoardData::BoardData(const QString& boardName, | ||
26 | 26 | : m_boardName(boardName), m_readIdx(false), m_rootPath(rootPath), |
27 | 27 | m_delimiter(delimiter), m_bbsPath(bbsPath), m_ext(ext), m_type(boardtype) |
28 | 28 | { |
29 | - /* set hostname and create URL of board */ | |
29 | + // set hostname and create URL of board | |
30 | 30 | setHostName(hostname); |
31 | 31 | |
32 | - /* create default key */ | |
32 | + // create default key | |
33 | 33 | QStringList keyHosts(m_hostname); |
34 | 34 | createKeys(keyHosts); |
35 | 35 | |
36 | - /* reset SETTING.TXT */ | |
36 | + // reset SETTING.TXT | |
37 | 37 | setSettingLoaded(false); |
38 | 38 | } |
39 | 39 |
@@ -46,16 +46,16 @@ void BoardData::setHostName(const QString& hostName) | ||
46 | 46 | { |
47 | 47 | m_hostname = hostName; |
48 | 48 | |
49 | - /* m_basePath = (hostname)/(rootPath)/(bbsPath)/ */ | |
49 | + // m_basePath = (hostname)/(rootPath)/(bbsPath)/ | |
50 | 50 | m_basePath = m_hostname + m_rootPath + m_bbsPath + '/'; |
51 | 51 | |
52 | 52 | switch (m_type) { |
53 | 53 | |
54 | - case Board_MachiBBS: /* m_cgiBasePath = (hostname)/(rootPath)/(delimiter)?BBS=(bbsPath) */ | |
54 | + case Board_MachiBBS: // m_cgiBasePath = (hostname)/(rootPath)/(delimiter)?BBS=(bbsPath) | |
55 | 55 | m_cgiBasePath = m_hostname + m_rootPath + m_delimiter + "?BBS=" + m_bbsPath.mid(1); |
56 | 56 | break; |
57 | 57 | |
58 | - /* m_cgiBasePath = (hostname)/(rootPath)/(delimiter)/(bbsPath)/ */ | |
58 | + // m_cgiBasePath = (hostname)/(rootPath)/(delimiter)/(bbsPath)/ | |
59 | 59 | default: |
60 | 60 | m_cgiBasePath = m_hostname + m_rootPath + m_delimiter + m_bbsPath + '/'; |
61 | 61 | break; |
@@ -215,14 +215,14 @@ void BoardData::setTitleImgUrl(const KUrl& url) | ||
215 | 215 | /* create keys of DB */ /* public */ |
216 | 216 | void BoardData::createKeys(const QStringList& keyHostList) |
217 | 217 | { |
218 | - /* reset keys */ | |
218 | + // reset keys | |
219 | 219 | m_keyBasePathList.clear(); |
220 | 220 | m_keyCgiBasePathList.clear(); |
221 | 221 | m_keyHostList.clear(); |
222 | 222 | |
223 | 223 | m_keyHostList = keyHostList; |
224 | 224 | |
225 | - /* m_basePath = (hostname)/(rootPath)/(bbsPath)/ */ | |
225 | + // m_basePath = (hostname)/(rootPath)/(bbsPath)/ | |
226 | 226 | for (int i = 0; i < m_keyHostList.count(); ++i) { |
227 | 227 | if (m_keyHostList[ i ].length() > 0) |
228 | 228 | m_keyBasePathList += m_keyHostList[ i ] + m_rootPath + m_bbsPath + '/'; |
@@ -230,13 +230,13 @@ void BoardData::createKeys(const QStringList& keyHostList) | ||
230 | 230 | |
231 | 231 | switch (m_type) { |
232 | 232 | |
233 | - case Board_MachiBBS: /* m_cgiBasePath = (hostname)/(rootPath)/(delimiter)?BBS=(bbsPath) */ | |
233 | + case Board_MachiBBS: // m_cgiBasePath = (hostname)/(rootPath)/(delimiter)?BBS=(bbsPath) | |
234 | 234 | for (int i = 0; i < m_keyHostList.count(); ++i) |
235 | 235 | m_keyCgiBasePathList += m_keyHostList[ i ] + m_rootPath + m_delimiter |
236 | 236 | + "?BBS=" + m_bbsPath.mid(1); |
237 | 237 | break; |
238 | 238 | |
239 | - /* m_cgiBasePath = (hostname)/(rootPath)/(delimiter)/(bbsPath)/ */ | |
239 | + // m_cgiBasePath = (hostname)/(rootPath)/(delimiter)/(bbsPath)/ | |
240 | 240 | default: |
241 | 241 | for (int i = 0; i < m_keyHostList.count(); ++i) |
242 | 242 | m_keyCgiBasePathList += m_keyHostList[ i ] + m_rootPath + m_delimiter + m_bbsPath + '/'; |
@@ -86,7 +86,7 @@ QString BoardDatabase::ext() | ||
86 | 86 | QString BoardDatabase::boardId() |
87 | 87 | { |
88 | 88 | BoardData * bdata = getBoardData(); |
89 | - return (bdata == 0) ? QString() : bdata->bbsPath().mid(1); /* remove "/" */ | |
89 | + return (bdata == 0) ? QString() : bdata->bbsPath().mid(1); // remove "/" | |
90 | 90 | } |
91 | 91 | |
92 | 92 | /* (hostname)/(rootPath)/(bbsPath)/subject.txt */ /* public */ |
@@ -140,12 +140,12 @@ void BoardDatabase::getThreadList( | ||
140 | 140 | threadList.clear(); |
141 | 141 | oldLogList.clear(); |
142 | 142 | |
143 | - /* get all obtained threads list from cache */ | |
143 | + // get all obtained threads list from cache | |
144 | 144 | if (m_url.prettyUrl() == "http://virtual/obtained/") { |
145 | 145 | |
146 | 146 | QStringList bbslist = allBoardUrlList(); |
147 | 147 | |
148 | - /* search all cache dirs */ | |
148 | + // search all cache dirs | |
149 | 149 | QString thread; |
150 | 150 | foreach (thread, bbslist) { |
151 | 151 | getCachedThreadList(thread, threadList); |
@@ -154,15 +154,15 @@ void BoardDatabase::getThreadList( | ||
154 | 154 | return ; |
155 | 155 | } |
156 | 156 | |
157 | - /*-------------------------*/ | |
157 | + //------------------------- | |
158 | 158 | |
159 | 159 | BoardData* bdata = getBoardData(); |
160 | 160 | if (bdata == 0) return ; |
161 | 161 | |
162 | - /* download subject.txt */ | |
162 | + // download subject.txt | |
163 | 163 | if (online) { |
164 | 164 | |
165 | - /* make directory */ | |
165 | + // make directory | |
166 | 166 | Cache cache(m_url); |
167 | 167 | QString cacheDir = cache.getDirPath(); |
168 | 168 | if (!QDir::root().mkpath(cacheDir)) return; |
@@ -175,10 +175,10 @@ void BoardDatabase::getThreadList( | ||
175 | 175 | KIO::NetAccess::download(subjectUrl(), subjectPath, 0); |
176 | 176 | } |
177 | 177 | |
178 | - /* open and read subject.txt */ | |
178 | + // open and read subject.txt | |
179 | 179 | readSubjectTxt(bdata, threadList); |
180 | 180 | |
181 | - /* get old logs */ | |
181 | + // get old logs | |
182 | 182 | if (oldLogs) { |
183 | 183 | |
184 | 184 | QList<Thread*> tmpList; |
@@ -201,7 +201,7 @@ void BoardDatabase::getCachedThreadList(const KUrl& url, | ||
201 | 201 | QDir d(cacheDir); |
202 | 202 | if (d.exists()) { |
203 | 203 | |
204 | - /* get all file names */ | |
204 | + // get all file names | |
205 | 205 | QString ext = getBoardData(url)->ext(); |
206 | 206 | QString boardUrl = getBoardData(url)->basePath(); |
207 | 207 | QStringList filter('*' + ext); |
@@ -212,7 +212,7 @@ void BoardDatabase::getCachedThreadList(const KUrl& url, | ||
212 | 212 | |
213 | 213 | QString datUrl = boardUrl + "dat/" + file; |
214 | 214 | |
215 | - /* read idx file */ | |
215 | + // read idx file | |
216 | 216 | Thread* thread = Thread::getByUrlNew(datUrl); |
217 | 217 | if (thread == 0) { |
218 | 218 |
@@ -232,7 +232,7 @@ void BoardDatabase::getCachedThreadList(const KUrl& url, | ||
232 | 232 | /* open subject.txt and get list of Thread classes */ /* private */ |
233 | 233 | bool BoardDatabase::readSubjectTxt(BoardData* bdata, QList<Thread*>& threadList) |
234 | 234 | { |
235 | - /* get all names of cached files to read idx. */ | |
235 | + // get all names of cached files to read idx. | |
236 | 236 | QStringList cacheList; |
237 | 237 | if (!bdata->readIdx()) { |
238 | 238 | Cache cache(m_url); |
@@ -245,7 +245,7 @@ bool BoardDatabase::readSubjectTxt(BoardData* bdata, QList<Thread*>& threadList) | ||
245 | 245 | } |
246 | 246 | } |
247 | 247 | |
248 | - /* open subject.txt */ | |
248 | + // open subject.txt | |
249 | 249 | Cache cache(m_url); |
250 | 250 | QString subjectPath = cache.getSubjectPath(); |
251 | 251 | QIODevice * device = KFilterDev::deviceForFile(subjectPath, "application/x-gzip"); |
@@ -283,7 +283,7 @@ bool BoardDatabase::readSubjectTxt(BoardData* bdata, QList<Thread*>& threadList) | ||
283 | 283 | QString subject = regexp.cap(2); |
284 | 284 | QString num = regexp.cap(3); |
285 | 285 | |
286 | - /* get pointer of Thread class */ | |
286 | + // get pointer of Thread class | |
287 | 287 | QString datUrl = boardUrl() + "dat/" + fname; |
288 | 288 | Thread* thread = Thread::getByUrl(datUrl); |
289 | 289 | ThreadIndex threadIndex(datUrl); |
@@ -291,10 +291,10 @@ bool BoardDatabase::readSubjectTxt(BoardData* bdata, QList<Thread*>& threadList) | ||
291 | 291 | threadList.append(thread); |
292 | 292 | } |
293 | 293 | |
294 | - /* set thread name */ | |
294 | + // set thread name | |
295 | 295 | thread->setThreadName(subject); |
296 | 296 | |
297 | - /* load index file */ | |
297 | + // load index file | |
298 | 298 | if (!bdata->readIdx()) { |
299 | 299 | |
300 | 300 | if (cacheList.contains(fname)) { |
@@ -302,9 +302,9 @@ bool BoardDatabase::readSubjectTxt(BoardData* bdata, QList<Thread*>& threadList) | ||
302 | 302 | } |
303 | 303 | } |
304 | 304 | |
305 | - /* update res num */ | |
305 | + // update res num | |
306 | 306 | int newNum = num.toInt(); |
307 | - if (thread->readNum()) { /* cache exists */ | |
307 | + if (thread->readNum()) { // cache exists | |
308 | 308 | int oldNum = thread->resNum(); |
309 | 309 | |
310 | 310 | if (newNum > oldNum) { |
@@ -316,7 +316,7 @@ bool BoardDatabase::readSubjectTxt(BoardData* bdata, QList<Thread*>& threadList) | ||
316 | 316 | } |
317 | 317 | |
318 | 318 | device->close(); |
319 | - bdata->setReadIdx(true); /* never read idx files again */ | |
319 | + bdata->setReadIdx(true); // never read idx files again | |
320 | 320 | |
321 | 321 | return true; |
322 | 322 | } |
@@ -370,7 +370,7 @@ int BoardDatabase::recordBoard(const QString& boardName, QString& oldUrl, int ty | ||
370 | 370 | |
371 | 371 | if (type == Board_Unknown) return Board_recordFailed; |
372 | 372 | |
373 | - /* check if the board is recorded or moved. */ | |
373 | + // check if the board is recorded or moved. | |
374 | 374 | BoardData *data; |
375 | 375 | foreach (data, m_boardDataList) { |
376 | 376 |
@@ -379,20 +379,20 @@ int BoardDatabase::recordBoard(const QString& boardName, QString& oldUrl, int ty | ||
379 | 379 | && data->bbsPath() == bbsPath) { |
380 | 380 | |
381 | 381 | if (data->hostName() == hostname |
382 | - && data->rootPath() == rootPath) { /* recorded */ | |
382 | + && data->rootPath() == rootPath) { // recorded | |
383 | 383 | return Board_recordRecorded; |
384 | - } else { /* moved */ | |
384 | + } else { // moved | |
385 | 385 | oldUrl = data->basePath(); |
386 | 386 | return Board_recordMoved; |
387 | 387 | } |
388 | 388 | } |
389 | 389 | } |
390 | 390 | |
391 | - /* test only */ | |
391 | + // test only | |
392 | 392 | if (test) |
393 | 393 | return Board_recordNew; |
394 | 394 | |
395 | - /* record new board */ | |
395 | + // record new board | |
396 | 396 | BoardData* bdata = new BoardData(boardName, hostname, rootPath, delimiter, bbsPath, ext, type); |
397 | 397 | m_boardDataList.append(bdata); |
398 | 398 |
@@ -419,7 +419,7 @@ int BoardDatabase::parseBoardUrl( | ||
419 | 419 | bbsPath.clear(); |
420 | 420 | ext.clear(); |
421 | 421 | |
422 | - /* decide type */ | |
422 | + // decide type | |
423 | 423 | if (type == Board_Unknown) { |
424 | 424 | |
425 | 425 | if (m_url.host().contains("machi.to")) |
@@ -430,17 +430,17 @@ int BoardDatabase::parseBoardUrl( | ||
430 | 430 | type = Board_2ch; |
431 | 431 | } |
432 | 432 | |
433 | - /* parse */ | |
433 | + // parse | |
434 | 434 | switch (type) { |
435 | 435 | |
436 | - case Board_MachiBBS: /* MACHI : http:// *.machi.to/(bbsPath)/ */ | |
436 | + case Board_MachiBBS: // MACHI : http:// *.machi.to/(bbsPath)/ | |
437 | 437 | |
438 | 438 | delimiter = "/bbs/read.pl"; |
439 | 439 | bbsPath = m_url.fileName(); |
440 | 440 | ext = ".cgi"; |
441 | 441 | break; |
442 | 442 | |
443 | - case Board_JBBS: /* JBBS : http://jbbs.livedoor.jp/(bbsPath)/ */ | |
443 | + case Board_JBBS: // JBBS : http://jbbs.livedoor.jp/(bbsPath)/ | |
444 | 444 | |
445 | 445 | delimiter = "/bbs/read.cgi"; |
446 | 446 | bbsPath = m_url.prettyUrl().remove(hostname); |
@@ -448,7 +448,7 @@ int BoardDatabase::parseBoardUrl( | ||
448 | 448 | ext = ".cgi"; |
449 | 449 | break; |
450 | 450 | |
451 | - case Board_FlashCGI: /* test for Flash CGI/Mini Thread */ | |
451 | + case Board_FlashCGI: // test for Flash CGI/Mini Thread | |
452 | 452 | |
453 | 453 | delimiter = "/test/read.cgi"; |
454 | 454 | bbsPath = m_url.fileName(); |
@@ -458,7 +458,7 @@ int BoardDatabase::parseBoardUrl( | ||
458 | 458 | ext = ".dat"; |
459 | 459 | break; |
460 | 460 | |
461 | - default: /* 2ch : http://(hostname)/(rootPath)/(bbsPath)/ */ | |
461 | + default: // 2ch : http://(hostname)/(rootPath)/(bbsPath)/ | |
462 | 462 | |
463 | 463 | delimiter = "/test/read.cgi"; |
464 | 464 | bbsPath = m_url.fileName(); |
@@ -470,7 +470,7 @@ int BoardDatabase::parseBoardUrl( | ||
470 | 470 | break; |
471 | 471 | } |
472 | 472 | |
473 | - /* For example, if bbsPath = "linux/", then m_bbsPath = "/linux" */ | |
473 | + // For example, if bbsPath = "linux/", then m_bbsPath = "/linux" | |
474 | 474 | const QRegExp exp("/$"); |
475 | 475 | rootPath.remove(exp); |
476 | 476 | bbsPath.remove(exp); |
@@ -495,7 +495,7 @@ BoardData* BoardDatabase::getBoardData(const KUrl& url) | ||
495 | 495 | return 0; |
496 | 496 | QString urlstr = url.prettyUrl(); |
497 | 497 | |
498 | - /* cache */ | |
498 | + // cache | |
499 | 499 | if (m_previousBoardData != 0 && m_previousBoardUrl == urlstr) |
500 | 500 | return m_previousBoardData; |
501 | 501 |
@@ -507,7 +507,7 @@ BoardData* BoardDatabase::getBoardData(const KUrl& url) | ||
507 | 507 | if (urlstr.contains(data->keyBasePathList()[i]) |
508 | 508 | || urlstr.contains(data->keyCgiBasePathList()[i])) { |
509 | 509 | |
510 | - /* cache */ | |
510 | + // cache | |
511 | 511 | m_previousBoardData = data; |
512 | 512 | m_previousBoardUrl = urlstr; |
513 | 513 |
@@ -588,20 +588,20 @@ bool BoardDatabase::moveBoard(const KUrl& fromUrl, const KUrl& toUrl) | ||
588 | 588 | |
589 | 589 | if (oldUrl == newUrl) return false; |
590 | 590 | |
591 | - /* Is oldURL recorded? */ | |
591 | + // Is oldURL recorded? | |
592 | 592 | BoardData* bdata = getBoardData(oldUrl); |
593 | 593 | if (bdata == 0) { |
594 | 594 | |
595 | - /* Is newURL recorded? */ | |
595 | + // Is newURL recorded? | |
596 | 596 | bdata = getBoardData(newUrl); |
597 | 597 | if (bdata == 0) return false; |
598 | 598 | } |
599 | 599 | |
600 | 600 | |
601 | - /*---------------------------*/ | |
602 | - /* update BoardData */ | |
601 | + //--------------------------- | |
602 | + // update BoardData | |
603 | 603 | |
604 | - /* get the path of old cache */ | |
604 | + // get the path of old cache | |
605 | 605 | bdata->setHostName(oldhost); |
606 | 606 | QStringList keyHosts = bdata->keyHostList(); |
607 | 607 | keyHosts.removeOne(oldhost); |
@@ -610,18 +610,17 @@ bool BoardDatabase::moveBoard(const KUrl& fromUrl, const KUrl& toUrl) | ||
610 | 610 | Cache cache(bdata->basePath()); |
611 | 611 | QString oldCachePath = cache.getDirPath(); |
612 | 612 | |
613 | - /* update URL */ | |
613 | + // update URL | |
614 | 614 | bdata->setHostName(newhost); |
615 | 615 | |
616 | - /* update keys */ | |
617 | - /* The order of keyHosts will be like this: | |
618 | - | |
619 | - newhost | |
620 | - oldhost | |
621 | - foohost1 | |
622 | - foohost2 | |
623 | - | |
624 | - */ | |
616 | + // update keys | |
617 | + // The order of keyHosts will be like this: | |
618 | + // | |
619 | + // newhost | |
620 | + // oldhost | |
621 | + // foohost1 | |
622 | + // foohost2 | |
623 | + // | |
625 | 624 | keyHosts = bdata->keyHostList(); |
626 | 625 | keyHosts.removeOne(oldhost); |
627 | 626 | keyHosts.prepend(oldhost); |
@@ -629,42 +628,42 @@ bool BoardDatabase::moveBoard(const KUrl& fromUrl, const KUrl& toUrl) | ||
629 | 628 | keyHosts.prepend(newhost); |
630 | 629 | bdata->createKeys(keyHosts); |
631 | 630 | |
632 | - /* reset BoardData */ | |
631 | + // reset BoardData | |
633 | 632 | bdata->setReadIdx(false); |
634 | 633 | bdata->setSettingLoaded(false); |
635 | 634 | |
636 | 635 | |
637 | - /*---------------------------*/ | |
638 | - /* move cache dir */ | |
636 | + //--------------------------- | |
637 | + // move cache dir | |
639 | 638 | |
640 | 639 | QDir qdir; |
641 | 640 | if (! qdir.exists(oldCachePath)) return true; |
642 | 641 | |
643 | - /* mkdir new server dir */ | |
642 | + // mkdir new server dir | |
644 | 643 | Cache newCache(bdata->basePath()); |
645 | 644 | QString newCachePath = Cache::baseDir() + newCache.serverDir(); |
646 | 645 | QDir::root().mkpath(newCachePath); |
647 | 646 | |
648 | - /* backup old dir */ | |
647 | + // backup old dir | |
649 | 648 | newCachePath += newCache.boardDir(); |
650 | 649 | if (qdir.exists (newCachePath)) { |
651 | 650 | QString bkupPath = newCachePath; |
652 | - bkupPath.truncate(bkupPath.length() - 1); /* remove '/' */ | |
651 | + bkupPath.truncate(bkupPath.length() - 1); // remove '/' | |
653 | 652 | bkupPath += |
654 | 653 | '.' + QString::number(QDateTime::currentDateTime().toTime_t()); |
655 | 654 | qdir.rename(newCachePath, bkupPath); |
656 | 655 | } |
657 | 656 | |
658 | - /* move cache dir */ | |
657 | + // move cache dir | |
659 | 658 | if (qdir.exists(oldCachePath)) { |
660 | 659 | qdir.rename(oldCachePath, newCachePath); |
661 | 660 | } else |
662 | 661 | QDir::root().mkpath(newCachePath); |
663 | 662 | |
664 | - /* make old dir */ | |
663 | + // make old dir | |
665 | 664 | if (! qdir.exists(oldCachePath)) { |
666 | 665 | QDir::root().mkpath(oldCachePath); |
667 | - /* create BBS_MOVED */ | |
666 | + // create BBS_MOVED | |
668 | 667 | QString movedPath = oldCachePath + "/BBS_MOVED"; |
669 | 668 | QFile file(movedPath); |
670 | 669 | if (file.open(QIODevice::WriteOnly)) { |
@@ -674,8 +673,8 @@ bool BoardDatabase::moveBoard(const KUrl& fromUrl, const KUrl& toUrl) | ||
674 | 673 | file.close(); |
675 | 674 | } |
676 | 675 | |
677 | - /*---------------------------*/ | |
678 | - /* update BBSHISTRY */ | |
676 | + //--------------------------- | |
677 | + // update BBSHISTRY | |
679 | 678 | |
680 | 679 | Cache historyCache(bdata->basePath()); |
681 | 680 | QFile file(historyCache.getBBSHistoryPath()); |
@@ -693,8 +692,8 @@ bool BoardDatabase::moveBoard(const KUrl& fromUrl, const KUrl& toUrl) | ||
693 | 692 | } |
694 | 693 | |
695 | 694 | |
696 | - /*---------------------------*/ | |
697 | - /* update other information */ | |
695 | + //--------------------------- | |
696 | + // update other information | |
698 | 697 | FavoriteThreads::replace(oldUrl, newUrl); |
699 | 698 | Thread::replace(oldUrl, newUrl); |
700 | 699 | ThreadInfo::replace(oldUrl, newUrl); |
@@ -32,7 +32,7 @@ QString Cache::baseDir() | ||
32 | 32 | |
33 | 33 | QString Cache::serverDir() const |
34 | 34 | { |
35 | - /* Is board recorded ? */ | |
35 | + // Is board recorded? | |
36 | 36 | BoardDatabase db(m_url); |
37 | 37 | BoardData * bdata = db.getBoardData(); |
38 | 38 | if (bdata == 0) return QString(); |
@@ -45,7 +45,7 @@ QString Cache::serverDir() const | ||
45 | 45 | |
46 | 46 | QString Cache::boardDir() const |
47 | 47 | { |
48 | - /* Is board recorded ? */ | |
48 | + // Is board recorded? | |
49 | 49 | BoardDatabase db(m_url); |
50 | 50 | BoardData * bdata = db.getBoardData(); |
51 | 51 | if (bdata == 0) return QString(); |
@@ -42,33 +42,33 @@ DatInfo::DatInfo(const KUrl& url) : m_threadIndex(m_datUrl), | ||
42 | 42 | QString refstr; |
43 | 43 | m_datUrl = getDatUrl(url, refstr); |
44 | 44 | m_threadIndex = ThreadIndex(m_datUrl); |
45 | - /* get the pointer of Thread class */ | |
45 | + // get the pointer of Thread class | |
46 | 46 | m_thread = Thread::getByUrlNew(m_datUrl); |
47 | 47 | if (m_thread == 0) { |
48 | 48 | |
49 | - /* create Thread */ | |
49 | + // create Thread | |
50 | 50 | m_thread = Thread::getByUrl(m_datUrl); |
51 | 51 | if (m_thread == 0) return ; |
52 | 52 | |
53 | - /* read idx file */ | |
53 | + // read idx file | |
54 | 54 | m_threadIndex.loadIndex(m_thread); |
55 | 55 | } |
56 | 56 | |
57 | 57 | m_thread = Thread::getByUrl(m_datUrl); |
58 | 58 | |
59 | - /* japanese strings */ | |
59 | + // japanese strings | |
60 | 60 | m_spacestr = QString::fromUtf8(KITAUTF8_ZENSPACE); |
61 | - m_framestr1 = QString::fromUtf8(KITAUTF8_FRAME1); /* | */ | |
62 | - m_framestr2 = QString::fromUtf8(KITAUTF8_FRAME2); /* |- */ | |
63 | - m_framestr3 = QString::fromUtf8(KITAUTF8_FRAME3); /* L */ | |
61 | + m_framestr1 = QString::fromUtf8(KITAUTF8_FRAME1); // | | |
62 | + m_framestr2 = QString::fromUtf8(KITAUTF8_FRAME2); // |- | |
63 | + m_framestr3 = QString::fromUtf8(KITAUTF8_FRAME3); // L | |
64 | 64 | |
65 | - /* make directory */ | |
65 | + // make directory | |
66 | 66 | Cache cache(m_datUrl); |
67 | 67 | QString cacheDir = cache.getDirPath(); |
68 | 68 | if (!QDir::root().mkpath(cacheDir)) return ; |
69 | 69 | |
70 | 70 | initPrivate( |
71 | - true /* load cache */ | |
71 | + true // load cache | |
72 | 72 | ); |
73 | 73 | } |
74 | 74 |
@@ -88,22 +88,22 @@ void DatInfo::init() | ||
88 | 88 | /* Init. If loadCache = true, load data from cache. */ /* private */ |
89 | 89 | void DatInfo::initPrivate(bool loadCache) |
90 | 90 | { |
91 | - /* stop & delete dat loader */ | |
91 | + // stop & delete dat loader | |
92 | 92 | deleteAccessJob(); |
93 | 93 | |
94 | - /* init variables */ | |
94 | + // init variables | |
95 | 95 | m_broken = false; |
96 | 96 | m_nowLoading = false; |
97 | 97 | m_lastLine.clear(); |
98 | 98 | |
99 | - /* clear ResDatVec */ | |
99 | + // clear ResDatVec | |
100 | 100 | m_resDatVec.clear(); |
101 | 101 | increaseResDatVec(RESDAT_DEFAULTSIZE); |
102 | 102 | |
103 | - /* reset Abone */ | |
103 | + // reset Abone | |
104 | 104 | resetAbonePrivate(); |
105 | 105 | |
106 | - /* create dat loader */ | |
106 | + // create dat loader | |
107 | 107 | m_access = new Access(m_datUrl); |
108 | 108 | |
109 | 109 | connect(m_access, SIGNAL(receiveData(const QStringList&)), |
@@ -112,15 +112,15 @@ void DatInfo::initPrivate(bool loadCache) | ||
112 | 112 | |
113 | 113 | if (!loadCache) return ; |
114 | 114 | |
115 | - /* reset ReadNum before loading cache. */ | |
116 | - /* ReadNum & subject are updated by Access::getcache() */ | |
115 | + // reset ReadNum before loading cache. | |
116 | + // ReadNum & subject are updated by Access::getcache() | |
117 | 117 | m_thread->setReadNum(0); |
118 | 118 | |
119 | - /* get dat from cahce */ | |
120 | - /* slotReceiveData() is called from Access::getcache() */ | |
119 | + // get dat from cahce | |
120 | + // slotReceiveData() is called from Access::getcache() | |
121 | 121 | m_access->getcache(); |
122 | 122 | |
123 | - /* save up-to-date thread information */ | |
123 | + // save up-to-date thread information | |
124 | 124 | m_threadIndex.saveIndex(m_thread); |
125 | 125 | } |
126 | 126 |
@@ -216,7 +216,7 @@ void DatInfo::slotReceiveData(const QStringList& lineList) | ||
216 | 216 | |
217 | 217 | if (rescode != 200 && rescode != 206) return ; |
218 | 218 | |
219 | - /* copy lines to buffer */ | |
219 | + // copy lines to buffer | |
220 | 220 | int count = lineList.count(); |
221 | 221 | for (int i = 0; i < count ; ++i) |
222 | 222 | copyOneLineToResDat(lineList[ i ]); |
@@ -231,28 +231,28 @@ bool DatInfo::copyOneLineToResDat(const QString& line) | ||
231 | 231 | { |
232 | 232 | if (line.isEmpty()) return false; |
233 | 233 | |
234 | - /* update ReadNum */ | |
234 | + // update ReadNum | |
235 | 235 | const int num = m_thread->readNum() + 1; |
236 | 236 | m_thread->setReadNum(num); |
237 | 237 | |
238 | - /* If resdat vector is short, then resize the vector. */ | |
238 | + // If resdat vector is short, then resize the vector. | |
239 | 239 | while ((int) m_resDatVec.size() <= num) |
240 | 240 | increaseResDatVec(RESDAT_DELTA); |
241 | 241 | |
242 | - /* reset ResDat */ | |
242 | + // reset ResDat | |
243 | 243 | RESDAT& resdat = m_resDatVec[ num ]; |
244 | 244 | resetResDat(resdat); |
245 | 245 | |
246 | 246 | resdat.num = num; |
247 | 247 | resdat.linestr = line; |
248 | 248 | |
249 | - /* get subject */ | |
249 | + // get subject | |
250 | 250 | if (num == 1) parseDat(num); |
251 | 251 | |
252 | - /* search all responses which are responsed by this line. */ | |
252 | + // search all responses which are responsed by this line. | |
253 | 253 | if (GlobalConfig::checkResponsed()) { |
254 | 254 | |
255 | - if (parseDat(num) && !checkAbonePrivate(num)) { /* parse line here to get AncList */ | |
255 | + if (parseDat(num) && !checkAbonePrivate(num)) { // parse line here to get AncList | |
256 | 256 | |
257 | 257 | const int maxRange = 10; |
258 | 258 |
@@ -279,10 +279,10 @@ bool DatInfo::copyOneLineToResDat(const QString& line) | ||
279 | 279 | finished loading new dat */ /* private slot */ |
280 | 280 | void DatInfo::slotFinishLoad() |
281 | 281 | { |
282 | - /* save thread information */ | |
282 | + // save thread information | |
283 | 283 | m_threadIndex.saveIndex(m_thread); |
284 | 284 | |
285 | - /* re-try by offlaw.cgi */ | |
285 | + // re-try by offlaw.cgi | |
286 | 286 | DatManager datManager(m_datUrl); |
287 | 287 | if (m_thread->readNum() == 0 && m_access2 == 0 |
288 | 288 | && datManager.is2chThread()) { |
@@ -296,11 +296,11 @@ void DatInfo::slotFinishLoad() | ||
296 | 296 | return ; |
297 | 297 | } |
298 | 298 | } |
299 | - /* finish loading session & emit signal to the parent object */ | |
299 | + // finish loading session & emit signal to the parent object | |
300 | 300 | m_nowLoading = false; |
301 | 301 | emit finishLoad(); |
302 | 302 | |
303 | - /* disconnect signals */ | |
303 | + // disconnect signals | |
304 | 304 | disconnect(SIGNAL(receiveData())); |
305 | 305 | disconnect(SIGNAL(finishLoad())); |
306 | 306 | } |
@@ -344,10 +344,10 @@ bool DatInfo::isLoadingNow() const | ||
344 | 344 | void DatInfo::stopLoading() const |
345 | 345 | { |
346 | 346 | |
347 | - /* Don't lock the mutex here !!! | |
348 | - It will cause deadlock , because | |
349 | - Access::stopJob() calls HTMLPart::slotFinishLoad() back, | |
350 | - then HTMLPart::slotFinishLoad() calls another functions in DatInfo. */ | |
347 | + // Don't lock the mutex here !!! | |
348 | + // It will cause deadlock , because | |
349 | + // Access::stopJob() calls HTMLPart::slotFinishLoad() back, | |
350 | + // then HTMLPart::slotFinishLoad() calls another functions in DatInfo. | |
351 | 351 | if (m_access == 0) |
352 | 352 | return; |
353 | 353 | if (!m_nowLoading) |
@@ -586,7 +586,7 @@ QString DatInfo::getTreeByResCore(int rootnum, | ||
586 | 586 | |
587 | 587 | if (!reverse) { |
588 | 588 | |
589 | - /* collect responses that have anchor to rootnum */ | |
589 | + // collect responses that have anchor to rootnum | |
590 | 590 | for (int i = rootnum + 1; i <= m_thread->readNum(); i++) { |
591 | 591 | if (checkAbonePrivate(i)) continue; |
592 | 592 | if (checkRes(i, rootnum)) { |
@@ -595,7 +595,7 @@ QString DatInfo::getTreeByResCore(int rootnum, | ||
595 | 595 | } |
596 | 596 | } |
597 | 597 | |
598 | - } else { /* collect responses for which rootnum has anchors */ | |
598 | + } else { // collect responses for which rootnum has anchors | |
599 | 599 | |
600 | 600 | AncList& anclist = m_resDatVec[ rootnum ].anclist; |
601 | 601 | for (AncList::iterator it = anclist.begin(); it != anclist.end(); ++it) { |
@@ -607,21 +607,21 @@ QString DatInfo::getTreeByResCore(int rootnum, | ||
607 | 607 | } |
608 | 608 | } |
609 | 609 | |
610 | - /* make HTML document */ | |
610 | + // make HTML document | |
611 | 611 | if (count) { |
612 | 612 | |
613 | 613 | for (QStringList::iterator it = strlists.begin(); it != strlists.end(); ++it) { |
614 | 614 | QString tmpstr; |
615 | - if ((*it) == strlists.last()) tmpstr = m_framestr3; /* 'L' */ | |
616 | - else tmpstr = m_framestr2; /* '|-' */ | |
615 | + if ((*it) == strlists.last()) tmpstr = m_framestr3; // 'L' | |
616 | + else tmpstr = m_framestr2; // '|-' | |
617 | 617 | |
618 | 618 | retstr += prestr + tmpstr + "<a href=\"#" + (*it) + "\">>>" + (*it) + "</a><br>"; |
619 | 619 | |
620 | - /* call myself recursively */ | |
620 | + // call myself recursively | |
621 | 621 | int tmpnum; |
622 | 622 | tmpstr = prestr; |
623 | - if ((*it) == strlists.last()) tmpstr += m_spacestr + m_spacestr + m_spacestr; /* " " */ | |
624 | - else tmpstr += m_framestr1 + m_spacestr; /* "| " */ | |
623 | + if ((*it) == strlists.last()) tmpstr += m_spacestr + m_spacestr + m_spacestr; // " " | |
624 | + else tmpstr += m_framestr1 + m_spacestr; // "| " | |
625 | 625 | retstr += getTreeByResCore((*it).toInt(), reverse, tmpnum, tmpstr); |
626 | 626 | count += tmpnum; |
627 | 627 | } |
@@ -731,10 +731,10 @@ bool DatInfo::isBroken() const | ||
731 | 731 | int rescode = m_access->responseCode(); |
732 | 732 | bool invalid = m_access->invalidDataReceived(); |
733 | 733 | |
734 | - /* see also Access::slotReceiveThreadData() */ | |
734 | + // see also Access::slotReceiveThreadData() | |
735 | 735 | if (invalid && (rescode == 200 || rescode == 206)) return true; |
736 | 736 | |
737 | - /* maybe "Dat Ochi" */ | |
737 | + // maybe "Dat Ochi" | |
738 | 738 | return false; |
739 | 739 | } |
740 | 740 |
@@ -771,11 +771,11 @@ bool DatInfo::checkWord(const QStringList& stlist, /* list of keywords */ | ||
771 | 771 | QRegExp regexp((*it)); |
772 | 772 | regexp.setCaseSensitivity(Qt::CaseInsensitive); |
773 | 773 | |
774 | - if (checkOr) { /* OR */ | |
774 | + if (checkOr) { // OR | |
775 | 775 | if (str_text.indexOf(regexp, 0) != -1) { |
776 | 776 | return true; |
777 | 777 | } |
778 | - } else { /* AND */ | |
778 | + } else { // AND | |
779 | 779 | if (str_text.indexOf(regexp, 0) == -1) return false; |
780 | 780 | } |
781 | 781 | } |
@@ -858,7 +858,7 @@ bool DatInfo::checkAbonePrivate(int num) | ||
858 | 858 | int refNum = (*it).from; |
859 | 859 | int refNum2 = (*it).to; |
860 | 860 | |
861 | - /* I don't want to enter loop... */ | |
861 | + // I don't want to enter loop... | |
862 | 862 | if (refNum >= num) continue; |
863 | 863 | if (refNum2 >= num) refNum2 = num - 1; |
864 | 864 |
@@ -945,23 +945,23 @@ void DatInfo::createTitleHtml(RESDAT& resdat, QString& titleHtml) | ||
945 | 945 | |
946 | 946 | if (useTableTag) titleHtml += "<table class=\"res_title\"><tr>"; |
947 | 947 | |
948 | - /* res number */ | |
948 | + // res number | |
949 | 949 | if (useTableTag) titleHtml += "<td class=\"res_title_number\">"; |
950 | 950 | titleHtml += "<a href=\"#write" + QString::number(resdat.num) + "\">"; |
951 | 951 | titleHtml += QString::number(resdat.num); |
952 | 952 | titleHtml += "</a> "; |
953 | 953 | |
954 | - /* name & mail address */ | |
954 | + // name & mail address | |
955 | 955 | if (useTableTag) titleHtml += "<td class=\"res_title_name\">"; |
956 | 956 | titleHtml += "<b>" + QString::fromUtf8(KITAUTF8_NAME); |
957 | 957 | |
958 | - /* show name with mail address */ | |
958 | + // show name with mail address | |
959 | 959 | if (showMailAddress) { |
960 | 960 | |
961 | 961 | titleHtml += resdat.nameHTML; |
962 | 962 | if (!resdat.address.isEmpty()) titleHtml += " [" + resdat.address + ']'; |
963 | 963 | |
964 | - } else { /* don't show mail address */ | |
964 | + } else { // don't show mail address | |
965 | 965 | |
966 | 966 | if (resdat.address.isEmpty()) { |
967 | 967 |
@@ -980,12 +980,12 @@ void DatInfo::createTitleHtml(RESDAT& resdat, QString& titleHtml) | ||
980 | 980 | |
981 | 981 | titleHtml += "</b> "; |
982 | 982 | |
983 | - /* date */ | |
983 | + // date | |
984 | 984 | if (useTableTag) titleHtml += "<td class=\"res_title_date\">"; |
985 | 985 | titleHtml += QString::fromUtf8(KITAUTF8_COLON) + resdat.date; |
986 | 986 | if (useTableTag) titleHtml += "</td>"; |
987 | 987 | |
988 | - /* ID */ | |
988 | + // ID | |
989 | 989 | if (!resdat.id.isEmpty()) { |
990 | 990 | |
991 | 991 | if (useTableTag) titleHtml += "<td class=\"res_title_id\">"; |
@@ -994,7 +994,7 @@ void DatInfo::createTitleHtml(RESDAT& resdat, QString& titleHtml) | ||
994 | 994 | if (useTableTag) titleHtml += "</td>"; |
995 | 995 | } |
996 | 996 | |
997 | - /* BE */ | |
997 | + // BE | |
998 | 998 | if (!resdat.be.isEmpty()) { |
999 | 999 | |
1000 | 1000 | if (useTableTag) titleHtml += "<td class=\"res_title_be\">"; |
@@ -1002,7 +1002,7 @@ void DatInfo::createTitleHtml(RESDAT& resdat, QString& titleHtml) | ||
1002 | 1002 | if (useTableTag) titleHtml += "</td>"; |
1003 | 1003 | } |
1004 | 1004 | |
1005 | - /* host */ | |
1005 | + // host | |
1006 | 1006 | if (!resdat.host.isEmpty()) { |
1007 | 1007 | |
1008 | 1008 | if (useTableTag) titleHtml += "<td class=\"res_title_host\">"; |
@@ -76,8 +76,8 @@ DatInfo * DatManager::getDatInfoPointer() const | ||
76 | 76 | |
77 | 77 | DatInfo* DatManager::getDatInfo(bool checkCached) const |
78 | 78 | { |
79 | - /* search */ | |
80 | - /* create and record instance */ | |
79 | + // search | |
80 | + // create and record instance | |
81 | 81 | return (m_searchDatInfo != 0) |
82 | 82 | ? m_searchDatInfo : recordDatInfo(checkCached); |
83 | 83 | } |
@@ -88,7 +88,7 @@ DatInfo* DatManager::getDatInfo(bool checkCached) const | ||
88 | 88 | DatInfo* DatManager::searchDatInfo() const |
89 | 89 | { |
90 | 90 | if (m_datUrl.isEmpty()) |
91 | - return 0; /* This url is not recorded in BoardManager. */ | |
91 | + return 0; // This url is not recorded in BoardManager. | |
92 | 92 | if (m_datInfoList.isEmpty()) |
93 | 93 | return 0; |
94 | 94 |
@@ -102,7 +102,7 @@ DatInfo* DatManager::searchDatInfo() const | ||
102 | 102 | |
103 | 103 | if (m_datUrl == datInfo->url()) { |
104 | 104 | |
105 | - /* LRU */ | |
105 | + // LRU | |
106 | 106 | if (i) { |
107 | 107 | m_datInfoList.erase(it); |
108 | 108 | m_datInfoList.prepend(datInfo); |
@@ -122,13 +122,13 @@ DatInfo* DatManager::searchDatInfo() const | ||
122 | 122 | DatInfo* DatManager::recordDatInfo(bool checkCached) const |
123 | 123 | { |
124 | 124 | if (m_datUrl.isEmpty()) |
125 | - return 0; /* This url is not recorded in BoardManager. */ | |
125 | + return 0; // This url is not recorded in BoardManager. | |
126 | 126 | |
127 | - /* create DatInfo & read cached data */ | |
127 | + // create DatInfo & read cached data | |
128 | 128 | DatInfo* datInfo = new DatInfo(m_datUrl); |
129 | 129 | |
130 | - /* Does cache exist ? */ | |
131 | - /* If cache does not exist, delete DatInfo here. */ | |
130 | + // Does cache exist? | |
131 | + // If cache does not exist, delete DatInfo here. | |
132 | 132 | if (checkCached && datInfo->getReadNum() == 0) { |
133 | 133 | delete datInfo; |
134 | 134 | return 0; |
@@ -136,7 +136,7 @@ DatInfo* DatManager::recordDatInfo(bool checkCached) const | ||
136 | 136 | |
137 | 137 | m_datInfoList.prepend(datInfo); |
138 | 138 | |
139 | - /* delete the all old instances (LRU algorithm)*/ | |
139 | + // delete the all old instances (LRU algorithm) | |
140 | 140 | if (m_datInfoList.count() > DMANAGER_MAXQUEUE) { |
141 | 141 | for (int i = DMANAGER_MAXQUEUE; i < m_datInfoList.count(); i++) { |
142 | 142 | DatInfo* deleteInfo = m_datInfoList.at(i); |
@@ -194,23 +194,23 @@ bool DatManager::deleteCache() const | ||
194 | 194 | if (thread->readNum() == 0) |
195 | 195 | return false; |
196 | 196 | |
197 | - /* init DatInfo */ | |
197 | + // init DatInfo | |
198 | 198 | if (m_searchDatInfo && !m_searchDatInfo->deleteCache()) { |
199 | 199 | return false; |
200 | 200 | } |
201 | 201 | |
202 | - /* reset readNum & veiwPos */ | |
202 | + // reset readNum & veiwPos | |
203 | 203 | thread->setReadNum(0); |
204 | 204 | thread->setViewPos(0); |
205 | 205 | |
206 | - /* delete cache */ | |
206 | + // delete cache | |
207 | 207 | Cache cache(m_datUrl); |
208 | 208 | QString cachePath = cache.getPath(); |
209 | 209 | QString indexPath = cache.getIndexPath(); |
210 | 210 | QFile::remove(indexPath); |
211 | 211 | QFile::remove(cachePath); |
212 | 212 | |
213 | - /* delete log from "cache" */ | |
213 | + // delete log from "cache" | |
214 | 214 | ThreadInfo::removeThreadInfo(m_datUrl.prettyUrl()); |
215 | 215 | return true; |
216 | 216 | } |
@@ -351,11 +351,11 @@ void DatManager::setViewPos(int num) const | ||
351 | 351 | if (thread != 0) |
352 | 352 | thread->setViewPos(num); |
353 | 353 | |
354 | - /* save idx */ | |
354 | + // save idx | |
355 | 355 | ThreadIndex threadIndex(m_url); |
356 | 356 | threadIndex.setViewPos(num); |
357 | 357 | |
358 | - /* save "cache" */ | |
358 | + // save "cache" | |
359 | 359 | ThreadInfo::setReadNum(m_datUrl.prettyUrl(), num); |
360 | 360 | } |
361 | 361 |
@@ -21,7 +21,7 @@ QString FlashCGI::buildPostStr(const PostData& data) | ||
21 | 21 | QString ret; |
22 | 22 | int mib = m_writeCodec->mibEnum(); |
23 | 23 | |
24 | - (ret += "submit=") += "%8f%91%82%ab%8d%9e%82%de"; /* kakikomu */ | |
24 | + (ret += "submit=") += "%8f%91%82%ab%8d%9e%82%de"; // kakikomu | |
25 | 25 | (ret += "&FROM=") += encodeString(data.name(), mib); |
26 | 26 | (ret += "&mail=") += encodeString(data.mail(), mib); |
27 | 27 | (ret += "&MESSAGE=") += encodeString(data.body(), mib); |
@@ -26,7 +26,7 @@ QString JBBS::buildPostStr(const PostData& data) | ||
26 | 26 | QString ret; |
27 | 27 | int mib = m_writeCodec->mibEnum(); |
28 | 28 | |
29 | - ret += "submit=%8f%91%82%ab%8d%9e%82%de"; /* kakikomu */ | |
29 | + ret += "submit=%8f%91%82%ab%8d%9e%82%de"; // kakikomu | |
30 | 30 | ret += "&NAME=" + encodeString(data.name(), mib); |
31 | 31 | ret += "&MAIL=" + encodeString(data.mail(), mib); |
32 | 32 | ret += "&MESSAGE=" + encodeString(data.body(), mib).replace(';', "%3B"); |
@@ -22,22 +22,22 @@ QString K2ch::buildPostStr(const PostData& data) | ||
22 | 22 | |
23 | 23 | int mib = m_writeCodec->mibEnum(); |
24 | 24 | |
25 | - ret += "submit=%8f%91%82%ab%8d%9e%82%de"; /* kakikomu */ | |
25 | + ret += "submit=%8f%91%82%ab%8d%9e%82%de"; // kakikomu | |
26 | 26 | |
27 | - /* from, mail, message, bbs */ | |
27 | + // from, mail, message, bbs | |
28 | 28 | ret += "&FROM=" + encodeString(data.name(), mib); |
29 | 29 | ret += "&mail=" + encodeString(data.mail(), mib); |
30 | 30 | ret += "&MESSAGE=" + encodeString(data.body(), mib); |
31 | 31 | ret += "&bbs=" + data.boardId(); |
32 | 32 | ret += "&tepo=don"; |
33 | 33 | |
34 | - /* key */ | |
34 | + // key | |
35 | 35 | ret += "&key=" + data.threadId(); |
36 | 36 | |
37 | - /* time */ | |
37 | + // time | |
38 | 38 | ret += "&time=" + QString::number(data.serverTime()); |
39 | 39 | |
40 | - /* login */ | |
40 | + // login | |
41 | 41 | if (!data.sessionId().isEmpty()) { |
42 | 42 | ret += "&sid=" + data.sessionId(); |
43 | 43 | } |
@@ -64,7 +64,7 @@ QString Kita::getWriteUrl(const KUrl& m_datUrl) | ||
64 | 64 | int m_bbstype = db.type(); |
65 | 65 | QString m_bbscgi; |
66 | 66 | |
67 | - /* set path of bbs.cgi */ | |
67 | + // set path of bbs.cgi | |
68 | 68 | switch (m_bbstype) { |
69 | 69 | |
70 | 70 | case Board_JBBS: { |
@@ -138,27 +138,27 @@ QString Kita::convertUrl( | ||
138 | 138 | |
139 | 139 | if (url.isEmpty()) return QString(); |
140 | 140 | |
141 | - /* cache */ | |
141 | + // cache | |
142 | 142 | if (m_prevConvMode == mode && m_prevConvUrl == url.prettyUrl()) { |
143 | 143 | |
144 | 144 | refstr = m_prevConvRefstr; |
145 | 145 | return m_prevConvNewUrl; |
146 | 146 | } |
147 | 147 | |
148 | - /* Is board recorded ? */ | |
148 | + // Is board recorded? | |
149 | 149 | BoardDatabase db(url); |
150 | 150 | BoardData* bdata = db.getBoardData(); |
151 | 151 | if (bdata == 0) return QString(); |
152 | 152 | |
153 | 153 | QString urlstr = url.prettyUrl(); |
154 | 154 | |
155 | - /* get thread & reference */ | |
155 | + // get thread & reference | |
156 | 156 | QString thread; |
157 | 157 | QString refBase; |
158 | 158 | |
159 | 159 | if (urlstr.contains("/dat/")) { |
160 | 160 | |
161 | - /* url = (hostname)/(rootPath)/(bbsPath)/dat/(thread_ID).(ext)#(refBase) */ | |
161 | + // url = (hostname)/(rootPath)/(bbsPath)/dat/(thread_ID).(ext)#(refBase) | |
162 | 162 | thread = url.fileName().remove(bdata->ext()); |
163 | 163 | refBase = url.ref(); |
164 | 164 | } else if (urlstr.contains(bdata->delimiter())) { |
@@ -166,15 +166,15 @@ QString Kita::convertUrl( | ||
166 | 166 | QString tmpstr; |
167 | 167 | switch (bdata->type()) { |
168 | 168 | |
169 | - /* machi BBS */ | |
170 | - /* ex.) If url = http://kanto.machi.to/bbs/read.pl?BBS=kana&KEY=1096716679 , | |
171 | - then, thread = 1096716679 */ | |
169 | + // machi BBS | |
170 | + // ex.) If url = http://kanto.machi.to/bbs/read.pl?BBS=kana&KEY=1096716679 , | |
171 | + // then, thread = 1096716679 | |
172 | 172 | case Board_MachiBBS: |
173 | 173 | thread = url.queryItem("KEY"); |
174 | 174 | refBase.clear(); |
175 | 175 | break; |
176 | 176 | |
177 | - /* url = (hostname)/(rootPath)/(delimiter)/(bbsPath)/(thread_ID)/(refBase) */ | |
177 | + // url = (hostname)/(rootPath)/(delimiter)/(bbsPath)/(thread_ID)/(refBase) | |
178 | 178 | default: |
179 | 179 | tmpstr = urlstr.section(bdata->delimiter() + bdata->bbsPath(), 1, 1); |
180 | 180 | thread = tmpstr.section('/', 1, 1); |
@@ -191,7 +191,7 @@ QString Kita::convertUrl( | ||
191 | 191 | else refstr = refBase; |
192 | 192 | } |
193 | 193 | |
194 | - /* create new URL */ | |
194 | + // create new URL | |
195 | 195 | QString newUrl; |
196 | 196 | if (mode == URLMODE_DAT) newUrl = bdata->basePath() + "dat/" + thread + bdata->ext(); |
197 | 197 | else { |
@@ -209,7 +209,7 @@ QString Kita::convertUrl( | ||
209 | 209 | } |
210 | 210 | } |
211 | 211 | |
212 | - /* cache */ | |
212 | + // cache | |
213 | 213 | m_prevConvMode = mode; |
214 | 214 | m_prevConvUrl = url.prettyUrl(); |
215 | 215 | m_prevConvNewUrl = newUrl; |
@@ -226,7 +226,7 @@ QString Kita::convertUrl( | ||
226 | 226 | */ |
227 | 227 | QString Kita::datToOfflaw(const KUrl& datUrl) |
228 | 228 | { |
229 | - /* TODO: not tested. */ | |
229 | + // TODO: not tested. | |
230 | 230 | KUrl url(datUrl); |
231 | 231 | QString root = url.host(); |
232 | 232 |
@@ -338,7 +338,7 @@ QString Kita::ParseMachiBBSOneLine(const QString& inputLine, int& nextNum) | ||
338 | 338 | QRegExp regexp3("<dt>(\\d*) .*<font color=\"#......\"><b> (.*) </b></font> .* (..../../..).* (..:..:..) ID:([^<]*) <font size=.>\\[ ([^ ]*) \\]</font><br><dd>(.*)"); |
339 | 339 | QRegExp regexp4("<dt>(\\d*) .*<a href=\"mailto:(.*)\"><b> (.*) </B></a> .* (..../../..).* (..:..:..) ID:([^<]*) <font size=.>\\[ ([^ ]*) \\]</font><br><dd>(.*)"); |
340 | 340 | |
341 | - /* abone */ | |
341 | + // abone | |
342 | 342 | QRegExp regexp5("<dt>(\\d*) .*<br><dd>.*"); |
343 | 343 | |
344 | 344 |
@@ -382,14 +382,14 @@ QString Kita::ParseMachiBBSOneLine(const QString& inputLine, int& nextNum) | ||
382 | 382 | host = regexp4.cap(7); |
383 | 383 | message = regexp4.cap(8); |
384 | 384 | |
385 | - } else if (regexp5.indexIn(m_machiLine) != -1) { /* abone */ | |
385 | + } else if (regexp5.indexIn(m_machiLine) != -1) { // abone | |
386 | 386 | |
387 | 387 | num = regexp5.cap(1).toInt(); |
388 | 388 | m_machiLine.clear(); |
389 | 389 | if (num == nextNum) return "abone<><><>abone<>"; |
390 | 390 | else return QString(); |
391 | 391 | |
392 | - } else if (title_regexp.indexIn(m_machiLine) != -1) { /* get title */ | |
392 | + } else if (title_regexp.indexIn(m_machiLine) != -1) { // get title | |
393 | 393 | |
394 | 394 | m_machiSubject = title_regexp.cap(1); |
395 | 395 | m_machiLine.clear(); |
@@ -431,11 +431,11 @@ QString Kita::ParseJBBSOneLine(const QString& line, int& nextNum) | ||
431 | 431 | |
432 | 432 | if (num < nextNum) return QString(); |
433 | 433 | |
434 | - /* remove tag */ | |
434 | + // remove tag | |
435 | 435 | QRegExp rex("<[^<]*>"); |
436 | 436 | name.remove(rex); |
437 | 437 | |
438 | - /* remove week */ | |
438 | + // remove week | |
439 | 439 | rex = QRegExp("\\(.*\\)"); |
440 | 440 | date.remove(rex); |
441 | 441 |
@@ -464,7 +464,7 @@ QString Kita::ParseFlashCGIOneLine(const QString& line) | ||
464 | 464 | QString id = list[ 6 ]; |
465 | 465 | QString host = list[ 7 ]; |
466 | 466 | |
467 | - /* remove tag */ | |
467 | + // remove tag | |
468 | 468 | QRegExp rex("<[^<]*>"); |
469 | 469 | name.remove(rex); |
470 | 470 |
@@ -21,7 +21,7 @@ QString MachiBBS::buildPostStr(const PostData& data) | ||
21 | 21 | QString ret; |
22 | 22 | int mib = m_writeCodec->mibEnum(); |
23 | 23 | |
24 | - (ret += "submit=") += "%8f%91%82%ab%8d%9e%82%de"; /* kakikomu */ | |
24 | + (ret += "submit=") += "%8f%91%82%ab%8d%9e%82%de"; // kakikomu | |
25 | 25 | (ret += "&NAME=") += encodeString(data.name(), mib); |
26 | 26 | (ret += "&MAIL=") += encodeString(data.mail(), mib); |
27 | 27 | (ret += "&MESSAGE=") += encodeString(data.body(), mib); |
@@ -96,20 +96,20 @@ void Parser::datToText( | ||
96 | 96 | |
97 | 97 | case '<': |
98 | 98 | |
99 | - /* " <br> " */ | |
99 | + // " <br> " | |
100 | 100 | if (chpt[ i + 1 ] == 'b' && chpt[ i + 2 ] == 'r' && chpt[ i + 3 ] == '>') { |
101 | 101 | |
102 | 102 | unsigned int i2 = i - startPos; |
103 | - if (i > 0 && chpt[ i - 1 ] == ' ') i2--; /* remove space before <br> */ | |
103 | + if (i > 0 && chpt[ i - 1 ] == ' ') i2--; // remove space before <br> | |
104 | 104 | text += rawData.mid(startPos, i2) + '\n'; |
105 | 105 | startPos = i + 4; |
106 | - if (chpt[ startPos ] == ' ') startPos++; /* remove space after <br> */ | |
106 | + if (chpt[ startPos ] == ' ') startPos++; // remove space after <br> | |
107 | 107 | i = startPos - 1; |
108 | 108 | } |
109 | 109 | |
110 | - /*----------------------------------------*/ | |
110 | + //---------------------------------------- | |
111 | 111 | |
112 | - /* remove HTML tags <[^>]*> */ | |
112 | + // remove HTML tags <[^>]*> | |
113 | 113 | else { |
114 | 114 | |
115 | 115 | if (i - startPos) text += rawData.mid(startPos, i - startPos); |
@@ -119,11 +119,11 @@ void Parser::datToText( | ||
119 | 119 | |
120 | 120 | break; |
121 | 121 | |
122 | - /*----------------------------------*/ | |
122 | + //---------------------------------- | |
123 | 123 | |
124 | 124 | case '&': |
125 | 125 | |
126 | - /* special char */ | |
126 | + // special char | |
127 | 127 | { |
128 | 128 | QString tmpstr; |
129 | 129 | tmpstr = parseSpecialChar(chpt + i, pos); |
@@ -168,11 +168,11 @@ static bool parseResAnchor( | ||
168 | 168 | static bool isHYPHEN(unsigned short c) |
169 | 169 | { |
170 | 170 | |
171 | - /* UTF-16 */ | |
171 | + // UTF-16 | |
172 | 172 | if (c == '-' |
173 | 173 | || (c >= 0x2010 && c <= 0x2015) |
174 | 174 | || (c == 0x2212) |
175 | - || (c == 0xFF0D) /* UTF8: 0xEFBC8D */ | |
175 | + || (c == 0xFF0D) // UTF8: 0xEFBC8D | |
176 | 176 | ) { |
177 | 177 | return true; |
178 | 178 | } |
@@ -190,13 +190,13 @@ static bool parseResAnchor( | ||
190 | 190 | refNum[ 1 ] = 0; |
191 | 191 | pos = 0; |
192 | 192 | |
193 | - /* check '>' twice */ | |
193 | + // check '>' twice | |
194 | 194 | for (int i = 0; i < 2; i++) { |
195 | 195 | |
196 | 196 | if (cdat[ pos ].unicode() == UTF16_BRACKET) { |
197 | 197 | linkstr += cdat[ pos ]; |
198 | 198 | pos++; |
199 | - } else if (cdat[ pos ] == '&' && cdat[ pos + 1 ] == 'g' /* > */ | |
199 | + } else if (cdat[ pos ] == '&' && cdat[ pos + 1 ] == 'g' // > | |
200 | 200 | && cdat[ pos + 2 ] == 't' && cdat[ pos + 3 ] == ';') { |
201 | 201 | linkstr += '>'; |
202 | 202 | pos += 4; |
@@ -204,7 +204,7 @@ static bool parseResAnchor( | ||
204 | 204 | |
205 | 205 | } |
206 | 206 | |
207 | - /* check ',' */ | |
207 | + // check ',' | |
208 | 208 | if (!pos) { |
209 | 209 | if (cdat[ pos ] == ',' || cdat[ pos ].unicode() == UTF16_COMMA) { |
210 | 210 | linkstr += ','; |
@@ -212,7 +212,7 @@ static bool parseResAnchor( | ||
212 | 212 | } |
213 | 213 | } |
214 | 214 | |
215 | - /* check '=' */ | |
215 | + // check '=' | |
216 | 216 | if (!pos) { |
217 | 217 | if (cdat[ pos ] == '=' || cdat[ pos ].unicode() == UTF16_EQ) { |
218 | 218 | linkstr += '='; |
@@ -220,7 +220,7 @@ static bool parseResAnchor( | ||
220 | 220 | } |
221 | 221 | } |
222 | 222 | |
223 | - /* check digits */ | |
223 | + // check digits | |
224 | 224 | int hyphen = 0; |
225 | 225 | |
226 | 226 | for (int i = 0 ; i < KITA_RESDIGIT + 1 && pos < length ; i++, pos++) { |
@@ -271,7 +271,7 @@ static void parseName(const QString& rawStr, RESDAT& resdat) | ||
271 | 271 | unsigned int length = resdat.name.length(); |
272 | 272 | resdat.nameHTML.clear(); |
273 | 273 | |
274 | - /* anchor */ | |
274 | + // anchor | |
275 | 275 | while (parseResAnchor(chpt + i, length - i, linkstr, refNum, pos)) { |
276 | 276 | |
277 | 277 | linkurl = QString("#%1").arg(refNum[ 0 ]); |
@@ -290,7 +290,7 @@ static void parseName(const QString& rawStr, RESDAT& resdat) | ||
290 | 290 | i += pos; |
291 | 291 | } |
292 | 292 | |
293 | - /* non-digits strings */ | |
293 | + // non-digits strings | |
294 | 294 | if (i < length) { |
295 | 295 | |
296 | 296 | resdat.nameHTML += "<span class=\"name_noaddr\">"; |
@@ -329,7 +329,7 @@ static void parseDateId(const QString& rawStr, RESDAT& resdat) | ||
329 | 329 | } |
330 | 330 | resdat.date = rawStr.left(pos); |
331 | 331 | |
332 | - /* id */ | |
332 | + // id | |
333 | 333 | if (chpt[ pos ] == 'I' && chpt[ pos + 1 ] == 'D') { |
334 | 334 | pos += 3; |
335 | 335 | startpos = pos; |
@@ -342,7 +342,7 @@ static void parseDateId(const QString& rawStr, RESDAT& resdat) | ||
342 | 342 | |
343 | 343 | if (pos >= length) return ; |
344 | 344 | |
345 | - /* be */ | |
345 | + // be | |
346 | 346 | if (chpt[ pos ] == 'B' && chpt[ pos + 1 ] == 'E') { |
347 | 347 | pos += 3; |
348 | 348 | startpos = pos; |
@@ -358,7 +358,7 @@ static void parseDateId(const QString& rawStr, RESDAT& resdat) | ||
358 | 358 | |
359 | 359 | if (pos >= length) return ; |
360 | 360 | |
361 | - /* host */ | |
361 | + // host | |
362 | 362 | if (chpt[ pos ] == 'H' && chpt[ pos + 1 ] == 'O') { |
363 | 363 | pos += 5; |
364 | 364 | startpos = pos; |
@@ -393,7 +393,7 @@ static bool parseLink( | ||
393 | 393 | ) |
394 | 394 | { |
395 | 395 | |
396 | - /*-----------------------------*/ | |
396 | + //----------------------------- | |
397 | 397 | |
398 | 398 | linkstr.clear(); |
399 | 399 | linkurl.clear(); |
@@ -451,14 +451,14 @@ static bool createResAnchor(const QString &rawStr, RESDAT& resdat, | ||
451 | 451 | unsigned int pos; |
452 | 452 | unsigned int length = rawStr.length(); |
453 | 453 | |
454 | - /* parse anchor */ | |
454 | + // parse anchor | |
455 | 455 | if (!parseResAnchor(chpt + i, length - i, linkstr, refNum, pos)) { |
456 | 456 | |
457 | 457 | i += pos - 1; |
458 | 458 | return false; |
459 | 459 | } |
460 | 460 | |
461 | - /* create anchor */ | |
461 | + // create anchor | |
462 | 462 | resdat.bodyHTML += rawStr.mid(startPos, i - startPos); |
463 | 463 | linkurl = QString("#%1").arg(refNum[ 0 ]); |
464 | 464 | if (refNum[ 1 ]) linkurl += QString("-%1").arg(refNum[ 1 ]); |
@@ -467,7 +467,7 @@ static bool createResAnchor(const QString &rawStr, RESDAT& resdat, | ||
467 | 467 | resdat.bodyHTML += linkstr; |
468 | 468 | resdat.bodyHTML += "</a>"; |
469 | 469 | |
470 | - /* add anchor to ancList */ | |
470 | + // add anchor to ancList | |
471 | 471 | ANCNUM anctmp; |
472 | 472 | if (refNum[ 1 ] < refNum[ 0 ]) refNum[ 1 ] = refNum[ 0 ]; |
473 | 473 | anctmp.from = refNum[ 0 ]; |
@@ -498,42 +498,41 @@ static void parseBody(const QString &rawStr, RESDAT& resdat) | ||
498 | 498 | |
499 | 499 | bool ancChain = false; |
500 | 500 | |
501 | - /* ancChain is chain for anchor. For examle, if anchor ">2" | |
502 | - appeared, ancChain is set to true. Moreover, if next strings | |
503 | - are "=5", anchor for 5 is also set. Thus, we can obtain anchors | |
504 | - for strings ">2=5" as follows: | |
505 | - | |
506 | - <a href="#2">>2</a><a href="#5">=5</a> | |
507 | - */ | |
501 | + // ancChain is chain for anchor. For examle, if anchor ">2" | |
502 | + // appeared, ancChain is set to true. Moreover, if next strings | |
503 | + // are "=5", anchor for 5 is also set. Thus, we can obtain anchors | |
504 | + // for strings ">2=5" as follows: | |
505 | + // | |
506 | + // <a href="#2">>2</a><a href="#5">=5</a> | |
508 | 507 | |
509 | 508 | int offset = 0; |
510 | - if (chpt[ 0 ] == ' ') offset = 1; /* remove one space after <> */ | |
509 | + if (chpt[ 0 ] == ' ') offset = 1; // remove one space after <> | |
511 | 510 | for (unsigned int i = startPos = offset ; i < length ; i++) { |
512 | 511 | |
513 | 512 | switch (chpt[ i ].unicode()) { |
514 | 513 | |
515 | 514 | case '<': |
516 | 515 | |
517 | - /* " <br> " */ | |
516 | + // " <br> " | |
518 | 517 | if (chpt[ i + 1 ] == 'b' && chpt[ i + 2 ] == 'r' && chpt[ i + 3 ] == '>') { |
519 | 518 | |
520 | - /* reset anchor chain */ | |
519 | + // reset anchor chain | |
521 | 520 | ancChain = false; |
522 | 521 | |
523 | 522 | unsigned int i2 = i - startPos; |
524 | - if (i > 0 && chpt[ i - 1 ] == ' ') i2--; /* remove space before <br> */ | |
523 | + if (i > 0 && chpt[ i - 1 ] == ' ') i2--; // remove space before <br> | |
525 | 524 | resdat.bodyHTML += rawStr.mid(startPos, i2); |
526 | 525 | |
527 | 526 | resdat.bodyHTML += "<br>"; |
528 | 527 | |
529 | 528 | startPos = i + 4; |
530 | - if (chpt[ startPos ] == ' ') startPos++; /* remove space after <br> */ | |
529 | + if (chpt[ startPos ] == ' ') startPos++; // remove space after <br> | |
531 | 530 | i = startPos - 1; |
532 | 531 | } |
533 | 532 | |
534 | - /*----------------------------------------*/ | |
533 | + //---------------------------------------- | |
535 | 534 | |
536 | - /* remove HTML tags <[^>]*> */ | |
535 | + // remove HTML tags <[^>]*> | |
537 | 536 | else { |
538 | 537 | |
539 | 538 | if (i - startPos) resdat.bodyHTML += rawStr.mid(startPos, i - startPos); |
@@ -543,9 +542,9 @@ static void parseBody(const QString &rawStr, RESDAT& resdat) | ||
543 | 542 | |
544 | 543 | break; |
545 | 544 | |
546 | - /*----------------------------------------*/ | |
545 | + //---------------------------------------- | |
547 | 546 | |
548 | - case 'h': /* "http://" or "ttp://" or "tp:" */ | |
547 | + case 'h': // "http://" or "ttp://" or "tp:" | |
549 | 548 | case 't': |
550 | 549 | { |
551 | 550 | unsigned int pos = 0; |
@@ -562,25 +561,25 @@ static void parseBody(const QString &rawStr, RESDAT& resdat) | ||
562 | 561 | |
563 | 562 | break; |
564 | 563 | |
565 | - /*----------------------------------*/ | |
564 | + //---------------------------------- | |
566 | 565 | |
567 | 566 | case '&': |
568 | 567 | |
569 | - /* > */ | |
568 | + // > | |
570 | 569 | if (chpt[ i + 1 ] == 'g' && chpt[ i + 2 ] == 't' && chpt[ i + 3 ] == ';') |
571 | 570 | ancChain = createResAnchor(rawStr, resdat, chpt, i, startPos); |
572 | 571 | |
573 | 572 | break; |
574 | 573 | |
575 | - /*----------------------------------------*/ | |
574 | + //---------------------------------------- | |
576 | 575 | |
577 | - /* unicode '>' */ | |
576 | + // unicode '>' | |
578 | 577 | case UTF16_BRACKET: |
579 | 578 | |
580 | 579 | ancChain = createResAnchor(rawStr, resdat, chpt, i, startPos); |
581 | 580 | break; |
582 | 581 | |
583 | - /*----------------------------------*/ | |
582 | + //---------------------------------- | |
584 | 583 | |
585 | 584 | default: |
586 | 585 |
@@ -615,14 +614,14 @@ bool Parser::parseResDat(RESDAT& resdat, QString& subject) | ||
615 | 614 | resdat.broken = false; |
616 | 615 | resdat.anclist.clear(); |
617 | 616 | |
618 | - /* search the staring positions of each section to split raw data. */ | |
617 | + // search the staring positions of each section to split raw data. | |
619 | 618 | const QChar *chpt = resdat.linestr.unicode(); |
620 | 619 | unsigned int length = resdat.linestr.length(); |
621 | 620 | unsigned int section = 0; |
622 | 621 | unsigned int sectionPos[ 5 ]; |
623 | 622 | for (unsigned int i = 0 ; i < length ; i++) { |
624 | 623 | |
625 | - /* sections are splitted by "<>" */ | |
624 | + // sections are splitted by "<>" | |
626 | 625 | if (chpt[ i ] == '<' && chpt[ i + 1 ] == '>') { |
627 | 626 | section++; |
628 | 627 |
@@ -636,7 +635,7 @@ bool Parser::parseResDat(RESDAT& resdat, QString& subject) | ||
636 | 635 | } |
637 | 636 | } |
638 | 637 | |
639 | - /* broken data */ | |
638 | + // broken data | |
640 | 639 | if (section != 4) { |
641 | 640 | resdat.broken = true; |
642 | 641 | return true; |
@@ -644,23 +643,23 @@ bool Parser::parseResDat(RESDAT& resdat, QString& subject) | ||
644 | 643 | |
645 | 644 | // qDebug("[%d] %d %d %d %d",section, sectionPos[1],sectionPos[2],sectionPos[3],sectionPos[4]); |
646 | 645 | |
647 | - /* name */ | |
646 | + // name | |
648 | 647 | length = sectionPos[ 1 ] - 2 ; |
649 | 648 | parseName(resdat.linestr.mid(0, length), resdat); |
650 | 649 | |
651 | - /* mail */ | |
650 | ||
652 | 651 | length = sectionPos[ 2 ] - 2 - sectionPos[ 1 ]; |
653 | 652 | datToText(resdat.linestr.mid(sectionPos[ 1 ], length), resdat.address); |
654 | 653 | |
655 | - /* date, ID, host */ | |
654 | + // date, ID, host | |
656 | 655 | length = sectionPos[ 3 ] - 2 - sectionPos[ 2 ]; |
657 | 656 | parseDateId(resdat.linestr.mid(sectionPos[ 2 ], length), resdat); |
658 | 657 | |
659 | - /* body */ | |
658 | + // body | |
660 | 659 | length = sectionPos[ 4 ] - 2 - sectionPos[ 3 ]; |
661 | 660 | parseBody(resdat.linestr.mid(sectionPos[ 3 ], length), resdat); |
662 | 661 | |
663 | - /* subject */ | |
662 | + // subject | |
664 | 663 | subject = resdat.linestr.mid(sectionPos[ 4 ]); |
665 | 664 | |
666 | 665 | return true; |
@@ -25,7 +25,7 @@ PostData::PostData(const KUrl& datUrl, const QString& name, const QString& mail, | ||
25 | 25 | DatManager datManager(m_datUrl); |
26 | 26 | m_threadId = datManager.threadId(); |
27 | 27 | m_serverTime = datManager.getServerTime(); |
28 | - /* login */ | |
28 | + // login | |
29 | 29 | if (datManager.is2chThread() && Account::isLogged()) { |
30 | 30 | m_sessionId = KUrl::toPercentEncoding(Account::getSessionId()); |
31 | 31 | } |
@@ -38,11 +38,11 @@ const QString& Thread::threadName() const | ||
38 | 38 | void Thread::setThreadName(const QString& name) |
39 | 39 | { |
40 | 40 | QString threadName = name; |
41 | - /* remove space */ | |
41 | + // remove space | |
42 | 42 | QRegExp qrx(" +$"); |
43 | 43 | threadName.remove(qrx); |
44 | 44 | |
45 | - /* unescape */ | |
45 | + // unescape | |
46 | 46 | threadName.replace("<", "<").replace(">", ">").replace("&", "&"); |
47 | 47 | |
48 | 48 | m_threadName = threadName; |
@@ -91,12 +91,12 @@ void ThreadIndex::setMarkList(const QList<int>& markList) | ||
91 | 91 | void ThreadIndex::loadIndex(Thread* thread, bool checkCached) const |
92 | 92 | { |
93 | 93 | KConfig config(m_indexPath); |
94 | - /* load read number */ | |
94 | + // load read number | |
95 | 95 | int readNum = getReadNumPrivate(config, checkCached); |
96 | - if (readNum == 0) return ; /* cache does not exist. */ | |
96 | + if (readNum == 0) return ; // cache does not exist. | |
97 | 97 | thread->setReadNum(readNum); |
98 | 98 | |
99 | - /* load thread name */ | |
99 | + // load thread name | |
100 | 100 | QString subject = getSubjectPrivate(config); |
101 | 101 | if (subject.isEmpty() && !thread->threadName().isEmpty()) { |
102 | 102 | subject = thread->threadName(); |
@@ -106,15 +106,15 @@ void ThreadIndex::loadIndex(Thread* thread, bool checkCached) const | ||
106 | 106 | if (subject.isEmpty()) thread->setThreadName("?"); |
107 | 107 | else thread->setThreadName(subject); |
108 | 108 | |
109 | - /* load res number */ | |
109 | + // load res number | |
110 | 110 | thread->setResNum(getResNumPrivate(config)); |
111 | 111 | |
112 | - /* load view pos */ | |
112 | + // load view pos | |
113 | 113 | thread->setViewPos(getViewPosPrivate(config)); |
114 | 114 | if (thread->viewPos() > thread->readNum()) |
115 | 115 | thread->setReadNum(thread->viewPos()); |
116 | 116 | |
117 | - /* load mark */ | |
117 | + // load mark | |
118 | 118 | thread->setMarkList(getMarkListPrivate(config)); |
119 | 119 | } |
120 | 120 |
@@ -123,28 +123,28 @@ void ThreadIndex::loadIndex(Thread* thread, bool checkCached) const | ||
123 | 123 | /* save thread information */ /* public */ |
124 | 124 | void ThreadIndex::saveIndex(const Thread* thread) |
125 | 125 | { |
126 | - /* If readNum == 0, delete idx file */ | |
126 | + // If readNum == 0, delete idx file | |
127 | 127 | if (thread->readNum() == 0) { |
128 | 128 | QFile::remove(m_indexPath); |
129 | 129 | } |
130 | 130 | KConfig config(m_indexPath); |
131 | 131 | |
132 | - /* save thread name */ | |
132 | + // save thread name | |
133 | 133 | setSubjectPrivate(config, thread->threadName()); |
134 | 134 | |
135 | - /* save res number */ | |
135 | + // save res number | |
136 | 136 | setResNumPrivate(config, thread->resNum()); |
137 | 137 | |
138 | - /* save read number */ | |
138 | + // save read number | |
139 | 139 | setReadNumPrivate(config, thread->readNum()); |
140 | 140 | |
141 | - /* save view pos */ | |
141 | + // save view pos | |
142 | 142 | setViewPosPrivate(config, thread->viewPos()); |
143 | 143 | |
144 | - /* save mark */ | |
144 | + // save mark | |
145 | 145 | setMarkListPrivate(config, thread->markList()); |
146 | 146 | |
147 | - /* save "cache" */ | |
147 | + // save "cache" | |
148 | 148 | KUrl datUrl = getDatUrl(m_url); |
149 | 149 | int num = (thread->viewPos() ? thread->viewPos() : thread->readNum()); |
150 | 150 | ThreadInfo::setReadNum(datUrl.prettyUrl(), num); |
@@ -172,7 +172,7 @@ int ThreadIndex::getResNumPrivate(KConfig& config) const | ||
172 | 172 | { |
173 | 173 | int resNum = config.group("").readEntry("ResNum", 0); |
174 | 174 | |
175 | - /* use obsoleted "cache" file */ | |
175 | + // use obsoleted "cache" file | |
176 | 176 | if (!resNum) { |
177 | 177 | KUrl datUrl = getDatUrl(m_url); |
178 | 178 | resNum = ThreadInfo::readNum(datUrl.prettyUrl()); |
@@ -194,7 +194,7 @@ void ThreadIndex::setResNumPrivate(KConfig& config, int resNum) | ||
194 | 194 | /* private */ |
195 | 195 | int ThreadIndex::getReadNumPrivate(KConfig& config, bool checkCached) const |
196 | 196 | { |
197 | - /* If cache does not exist, return 0 */ | |
197 | + // If cache does not exist, return 0 | |
198 | 198 | if (checkCached) { |
199 | 199 | Cache cache(m_url); |
200 | 200 | QString path = cache.getPath(); |
@@ -207,10 +207,10 @@ int ThreadIndex::getReadNumPrivate(KConfig& config, bool checkCached) const | ||
207 | 207 | |
208 | 208 | if (!readNum) { |
209 | 209 | |
210 | - /* use ViewPos instead of ReadNum. */ | |
210 | + // use ViewPos instead of ReadNum. | |
211 | 211 | readNum = config.group("").readEntry("ViewPos", 0); |
212 | 212 | |
213 | - /* use obsoleted "cache" file */ | |
213 | + // use obsoleted "cache" file | |
214 | 214 | if (!readNum) { |
215 | 215 | KUrl datUrl = getDatUrl(m_url); |
216 | 216 | readNum = ThreadInfo::readNum(datUrl.prettyUrl()); |
@@ -360,7 +360,7 @@ void MainWindow::setupView() | ||
360 | 360 | |
361 | 361 | setCentralWidget(mainWidget); |
362 | 362 | |
363 | - /* write dock */ | |
363 | + // write dock | |
364 | 364 | m_writeTab = new WriteTabWidget(0); |
365 | 365 | ViewMediator::getInstance()->setWriteTabWidget(m_writeTab); |
366 | 366 | } |
@@ -102,14 +102,14 @@ void ResPopup::adjustSize() | ||
102 | 102 | QRect qr = curnode.getRect(); |
103 | 103 | int tmpwd = qr.right() - qr.left(); |
104 | 104 | |
105 | - /*----------------------------------*/ | |
105 | + //---------------------------------- | |
106 | 106 | |
107 | 107 | if (curnode.nodeType() == DOM::Node::TEXT_NODE) { |
108 | 108 | if (xx == 0) xx = qr.left(); |
109 | 109 | width += tmpwd; |
110 | 110 | } |
111 | 111 | |
112 | - /*----------------------------------*/ | |
112 | + //---------------------------------- | |
113 | 113 | |
114 | 114 | else if (curnode.nodeName().string() == "div") { |
115 | 115 | if (leftmrg == 0) leftmrg = qr.left(); |
@@ -117,7 +117,7 @@ void ResPopup::adjustSize() | ||
117 | 117 | xx = 0; |
118 | 118 | } |
119 | 119 | |
120 | - /*----------------------------------*/ | |
120 | + //---------------------------------- | |
121 | 121 | |
122 | 122 | else if (curnode.nodeName().string() == "br") { |
123 | 123 | width = 0; |
@@ -125,12 +125,12 @@ void ResPopup::adjustSize() | ||
125 | 125 | } |
126 | 126 | |
127 | 127 | |
128 | - /*----------------------------------*/ | |
128 | + //---------------------------------- | |
129 | 129 | |
130 | 130 | if (leftmrg + xx + width > maxwidth) maxwidth = leftmrg + xx + width; |
131 | 131 | if (qr.bottom() > maxheight) maxheight = qr.bottom(); |
132 | 132 | |
133 | - /* move to the next node */ | |
133 | + // move to the next node | |
134 | 134 | DOM::Node next = curnode.firstChild(); |
135 | 135 | |
136 | 136 | if (next.isNull()) next = curnode.nextSibling(); |
@@ -166,11 +166,11 @@ void ResPopup::adjustPos(const QPoint& point) | ||
166 | 166 | POS_RightDown |
167 | 167 | }; |
168 | 168 | |
169 | - /* config */ | |
169 | + // config | |
170 | 170 | |
171 | 171 | const int mrg = 16; |
172 | 172 | |
173 | - /*----------------------------*/ | |
173 | + //---------------------------- | |
174 | 174 | |
175 | 175 | if (!m_htmlPart) return ; |
176 | 176 |
@@ -276,11 +276,11 @@ void ResPopup::adjustPos(const QPoint& point) | ||
276 | 276 | /* move mouse pointer above the popup frame */ /* public */ |
277 | 277 | void ResPopup::moveMouseAbove() |
278 | 278 | { |
279 | - /* config */ | |
279 | + // config | |
280 | 280 | |
281 | 281 | const int mrg = 10; |
282 | 282 | |
283 | - /*-------------------------------*/ | |
283 | + //------------------------------- | |
284 | 284 | |
285 | 285 | QPoint pos = QCursor::pos(); |
286 | 286 | int cx = pos.x(), cy = pos.y(); |
@@ -37,7 +37,7 @@ ThreadTabWidget::ThreadTabWidget(QWidget* parent) : TabWidgetBase(parent) | ||
37 | 37 | |
38 | 38 | setupActions(); |
39 | 39 | |
40 | - /* default view */ | |
40 | + // default view | |
41 | 41 | createView(i18nc("@title:tab", "Thread")); |
42 | 42 | } |
43 | 43 |
@@ -69,11 +69,11 @@ void ThreadTabWidget::slotShowMainThread(const KUrl& url) | ||
69 | 69 | setCurrentWidget(view); |
70 | 70 | |
71 | 71 | if (view->threadUrl().isEmpty()) { |
72 | - /* Show on the default view */ | |
72 | + // Show on the default view | |
73 | 73 | view->showThread(datUrl, jumpNum); |
74 | 74 | } else { |
75 | - /* The view is already shown */ | |
76 | - /* TODO: jump to jumpNum after reloading */ | |
75 | + // The view is already shown | |
76 | + // TODO: jump to jumpNum after reloading | |
77 | 77 | |
78 | 78 | view->slotReloadButton(jumpNum); |
79 | 79 | } |
@@ -139,7 +139,7 @@ ThreadView* ThreadTabWidget::findMainView(const KUrl& url) | ||
139 | 139 | if (view->getViewMode() == VIEWMODE_MAINVIEW) { |
140 | 140 | |
141 | 141 | if (view->datUrl() == datUrl |
142 | - || view->datUrl().isEmpty() /* default view */ | |
142 | + || view->datUrl().isEmpty() // default view | |
143 | 143 | ) return view; |
144 | 144 | } |
145 | 145 | } |
@@ -187,7 +187,7 @@ void ThreadTabWidget::deleteWidget(QWidget* w) | ||
187 | 187 | ViewMediator::getInstance()->setMainStatus(QString()); |
188 | 188 | ViewMediator::getInstance()->setMainUrlLine(KUrl()); |
189 | 189 | |
190 | - /* default view */ | |
190 | + // default view | |
191 | 191 | ThreadView * threadView = createView(i18nc("@title:tab", "Thread")); |
192 | 192 | |
193 | 193 | if (threadView) { |
@@ -350,8 +350,8 @@ void ThreadTabWidget::contextMenuEvent(QContextMenuEvent* e) | ||
350 | 350 | popup.addAction(act); |
351 | 351 | } |
352 | 352 | popup.exec(e->globalPos()); |
353 | -/* KActionCollection * collection = client->actionCollection(); | |
354 | - KAction* action; | |
355 | - action = new KAction(i18n("goback anchor"), SmallIcon("idea"), KShortcut(), m_threadPart, SLOT(gobackAnchor()), collection, "goback_anchor"); | |
356 | - emit popupMenu(client, global, url, mimeType, mode);*/ // TODO | |
353 | +// KActionCollection * collection = client->actionCollection(); | |
354 | +// KAction* action; | |
355 | +// action = new KAction(i18n("goback anchor"), SmallIcon("idea"), KShortcut(), m_threadPart, SLOT(gobackAnchor()), collection, "goback_anchor"); | |
356 | +// emit popupMenu(client, global, url, mimeType, mode); // TODO | |
357 | 357 | } |
@@ -40,7 +40,7 @@ ThreadView::ThreadView(ThreadTabWidget* parent) | ||
40 | 40 | { |
41 | 41 | m_parent = parent; |
42 | 42 | |
43 | - /* copied from Base class */ | |
43 | + // copied from Base class | |
44 | 44 | setFocusPolicy(Qt::ClickFocus); |
45 | 45 | threadViewBaseLayout = new QVBoxLayout(this); |
46 | 46 |
@@ -98,7 +98,7 @@ ThreadView::ThreadView(ThreadTabWidget* parent) | ||
98 | 98 | threadViewBaseLayout->addWidget(threadFrame); |
99 | 99 | resize(QSize(870, 480).expandedTo(minimumSizeHint())); |
100 | 100 | setAttribute(Qt::WA_WState_Polished); |
101 | - /* copy end */ | |
101 | + // copy end | |
102 | 102 | |
103 | 103 | m_threadPart = new HTMLPart(threadFrame); |
104 | 104 | QHBoxLayout* aLayout = new QHBoxLayout(threadFrame); |
@@ -279,21 +279,21 @@ void ThreadView::setFocus() | ||
279 | 279 | /*-------*/ |
280 | 280 | void ThreadView::setup(const KUrl& datUrl, int mode) |
281 | 281 | { |
282 | - /* config. */ | |
282 | + // config. | |
283 | 283 | |
284 | - /*---------------------------------------*/ | |
285 | - /* setup */ | |
284 | + //--------------------------------------- | |
285 | + // setup | |
286 | 286 | |
287 | 287 | m_datUrl = getDatUrl(datUrl); |
288 | 288 | |
289 | - /* setup HTMLPart */ | |
289 | + // setup HTMLPart | |
290 | 290 | int partMode = HTMLPART_MODE_MAINPART; |
291 | 291 | m_threadPart->setup(partMode, m_datUrl); |
292 | 292 | |
293 | - /* mode. Mode is defined in threadview.h */ | |
293 | + // mode. Mode is defined in threadview.h | |
294 | 294 | m_viewmode = mode; |
295 | 295 | |
296 | - /* reset search direction */ | |
296 | + // reset search direction | |
297 | 297 | m_revsearch = false; |
298 | 298 | } |
299 | 299 |
@@ -304,7 +304,7 @@ void ThreadView::setup(const KUrl& datUrl, int mode) | ||
304 | 304 | /*--------------------------------------------------------*/ |
305 | 305 | void ThreadView::showThread(const KUrl& datUrl, int num) |
306 | 306 | { |
307 | - /* If this widget is not parent, then do nothing. */ | |
307 | + // If this widget is not parent, then do nothing. | |
308 | 308 | if (m_viewmode != VIEWMODE_MAINVIEW) return ; |
309 | 309 | |
310 | 310 | if (num == 0) num = DatManager(datUrl).getViewPos(); |
@@ -313,14 +313,14 @@ void ThreadView::showThread(const KUrl& datUrl, int num) | ||
313 | 313 | topLevelWidget() ->raise(); |
314 | 314 | activateWindow(); |
315 | 315 | |
316 | - /* setup */ | |
316 | + // setup | |
317 | 317 | setup(datUrl, VIEWMODE_MAINVIEW); |
318 | 318 | |
319 | - /* get log from cahce */ | |
319 | + // get log from cahce | |
320 | 320 | m_rescode = 200; |
321 | 321 | if (!m_threadPart->load(num)) showStatusBar(""); |
322 | 322 | |
323 | - /* update data */ | |
323 | + // update data | |
324 | 324 | slotUpdateInfo(); |
325 | 325 | slotReloadButton(); |
326 | 326 | } |
@@ -345,13 +345,13 @@ void ThreadView::slotReloadButton(int jumpNum) | ||
345 | 345 | /* stop loading the thread */ /* public slot */ |
346 | 346 | void ThreadView::slotStopLoading() |
347 | 347 | { |
348 | - /* hide popup */ | |
348 | + // hide popup | |
349 | 349 | if (m_threadPart->isPopupVisible()) { |
350 | 350 | m_threadPart->slotDeletePopup(); |
351 | 351 | return ; |
352 | 352 | } |
353 | 353 | |
354 | - /* unforcus search combo */ | |
354 | + // unforcus search combo | |
355 | 355 | if (searchCombo->hasFocus()) { |
356 | 356 | setFocus(); |
357 | 357 | return ; |
@@ -387,7 +387,7 @@ void ThreadView::showStatusBar(const QString &information) | ||
387 | 387 | if (broken) |
388 | 388 | info += " " + i18nc("@info:status", "This thread is broken."); |
389 | 389 | |
390 | - /* show status bar,caption, url */ | |
390 | + // show status bar,caption, url | |
391 | 391 | infostr = datManager.threadName() + |
392 | 392 | QString(" [Total: %1 New: %2] %3 k").arg(resNum) |
393 | 393 | .arg(resNum - viewPos).arg(datSize / 1024) |
@@ -419,7 +419,7 @@ void ThreadView::slotUpdateInfo() | ||
419 | 419 | m_rescode = datManager.getResponseCode(); |
420 | 420 | m_serverTime = datManager.getServerTime(); |
421 | 421 | |
422 | - /* uptate information */ | |
422 | + // uptate information | |
423 | 423 | BoardDatabase db(m_datUrl); |
424 | 424 | setSubjectLabel(db.boardName(), datManager.threadName() + QString(" (%1)") |
425 | 425 | .arg(datManager.getReadNum()), db.boardUrl()); |
@@ -439,7 +439,7 @@ void ThreadView::slotUpdateInfo() | ||
439 | 439 | |
440 | 440 | showStatusBar(""); |
441 | 441 | |
442 | - emit showThreadCompleted(); /* to ThreadPart */ | |
442 | + emit showThreadCompleted(); // to ThreadPart | |
443 | 443 | } |
444 | 444 | |
445 | 445 |
@@ -450,12 +450,12 @@ void ThreadView::slotUpdateInfo() | ||
450 | 450 | /*------------------------*/ /* private slots */ |
451 | 451 | void ThreadView::slotSearchButton() |
452 | 452 | { |
453 | - if (m_datUrl.isEmpty()) return ; /* Nothing is shown on the screen.*/ | |
453 | + if (m_datUrl.isEmpty()) return ; // Nothing is shown on the screen. | |
454 | 454 | |
455 | 455 | QString str = searchCombo->currentText(); |
456 | 456 | if (str.at(0) == ':') { |
457 | 457 | |
458 | - /* show res popup */ | |
458 | + // show res popup | |
459 | 459 | if (str.at(1) == 'p') { |
460 | 460 | int refNum = str.mid(2).toInt(); |
461 | 461 | QPoint pos = mapToGlobal(searchCombo->pos()); |
@@ -463,14 +463,14 @@ void ThreadView::slotSearchButton() | ||
463 | 463 | m_threadPart->slotShowResPopup(pos , refNum, refNum); |
464 | 464 | return ; |
465 | 465 | } |
466 | - /* find by find dialog */ | |
466 | + // find by find dialog | |
467 | 467 | else if (str.at(1) == 'f') { |
468 | 468 | KAction * act = static_cast< KAction* >(m_threadPart->action("find")); |
469 | 469 | if (act) act->trigger(); |
470 | 470 | return ; |
471 | 471 | } |
472 | 472 | |
473 | - /* jump */ | |
473 | + // jump | |
474 | 474 | QString anc = str.mid(1); |
475 | 475 | m_threadPart->gotoAnchor(anc, false); |
476 | 476 | searchCombo->setFocus(); |
@@ -487,9 +487,9 @@ void ThreadView::slotSearchPrev() { slotSearchPrivate(true); } | ||
487 | 487 | /* private */ |
488 | 488 | void ThreadView::slotSearchPrivate(bool rev) |
489 | 489 | { |
490 | - if (m_datUrl.isEmpty()) return ; /* Nothing is shown on the screen.*/ | |
490 | + if (m_datUrl.isEmpty()) return ; // Nothing is shown on the screen. | |
491 | 491 | |
492 | - /* jump */ | |
492 | + // jump | |
493 | 493 | QString str = searchCombo->currentText(); |
494 | 494 | if (str.isEmpty()) return ; |
495 | 495 | if (str.isEmpty()) return ; |
@@ -504,7 +504,7 @@ void ThreadView::slotSearchPrivate(bool rev) | ||
504 | 504 | |
505 | 505 | if (datManager.checkWord(query, i, false)) { |
506 | 506 | |
507 | - /* if this is parent, then show all responses, and search */ | |
507 | + // if this is parent, then show all responses, and search | |
508 | 508 | if (m_viewmode == VIEWMODE_MAINVIEW) m_threadPart->showAll(); |
509 | 509 | |
510 | 510 | insertSearchCombo(); |
@@ -55,7 +55,7 @@ void WriteTabWidget::openWriteView(const KUrl& url, | ||
55 | 55 | // return ; |
56 | 56 | } |
57 | 57 | |
58 | - /* view exists */ | |
58 | + // view exists | |
59 | 59 | WriteView* view = findWriteView(url); |
60 | 60 | if (view) { |
61 | 61 | if (view->body().length()) { |
@@ -64,17 +64,17 @@ void WriteTabWidget::openWriteView(const KUrl& url, | ||
64 | 64 | == KMessageBox::No) return; |
65 | 65 | } |
66 | 66 | |
67 | - /* clear */ | |
67 | + // clear | |
68 | 68 | view->setMessage(resStr); |
69 | 69 | setCurrentWidget(view); |
70 | 70 | return ; |
71 | 71 | } |
72 | 72 | |
73 | 73 | // TODO: refactoring. |
74 | - /* create new write view & add it to tab */ | |
74 | + // create new write view & add it to tab | |
75 | 75 | QString threadName; |
76 | 76 | |
77 | - /* write res */ | |
77 | + // write res | |
78 | 78 | WriteView* new_dlg; |
79 | 79 | threadName = DatManager(url).threadName(); |
80 | 80 | new_dlg = new WriteView(this, url); |
@@ -119,13 +119,13 @@ void WriteTabWidget::slotChangeWriteTab(const KUrl& url) | ||
119 | 119 | int max = count(); |
120 | 120 | if (max == 0) return ; |
121 | 121 | |
122 | - /* disable all ok buttons. */ | |
122 | + // disable all ok buttons. | |
123 | 123 | for(int i=0; i < max ; i++) { |
124 | 124 | view = isWriteView(widget(i)); |
125 | 125 | if (view) view->slotEnableWriting(false); |
126 | 126 | } |
127 | 127 | |
128 | - /* show current url page. */ | |
128 | + // show current url page. | |
129 | 129 | view = findWriteView(url); |
130 | 130 | if (view) { |
131 | 131 | if (currentWidget() != view) setCurrentWidget(view); |
@@ -59,7 +59,7 @@ WriteView::WriteView(WriteTabWidget* parent, const KUrl& url) | ||
59 | 59 | |
60 | 60 | void WriteView::initUI() |
61 | 61 | { |
62 | - /* connect signals */ | |
62 | + // connect signals | |
63 | 63 | connect(buttonOk, SIGNAL(clicked()), |
64 | 64 | SLOT(slotPostMessage())); |
65 | 65 |
@@ -72,10 +72,10 @@ void WriteView::initUI() | ||
72 | 72 | connect(bodyText, SIGNAL(textChanged()), |
73 | 73 | SLOT(slotBodyTextChanged())); |
74 | 74 | |
75 | - /* setup preview view */ | |
75 | + // setup preview view | |
76 | 76 | qtw->setCurrentIndex(0); |
77 | 77 | |
78 | - /* setup labels and edit lines */ | |
78 | + // setup labels and edit lines | |
79 | 79 | QFont font = GlobalConfig::threadFont(); |
80 | 80 | bodyText->setFont(font); |
81 | 81 | bodyText->setTabChangesFocus(true); |
@@ -105,7 +105,7 @@ void WriteView::initUI() | ||
105 | 105 | beBox->setChecked(true); |
106 | 106 | } |
107 | 107 | |
108 | - /* setup AA */ | |
108 | + // setup AA | |
109 | 109 | faceCombo->clear(); |
110 | 110 | faceCombo->setFont(GlobalConfig::threadFont()); |
111 | 111 | faceCombo->addItem(""); |
@@ -215,10 +215,10 @@ void WriteView::slotPostMessage() | ||
215 | 215 | list.append(name); |
216 | 216 | GlobalConfig::setNameCompletionList(list); |
217 | 217 | |
218 | - /* build post message */ | |
218 | + // build post message | |
219 | 219 | QString postStr = buildPostMessage(); |
220 | 220 | |
221 | - /* referrer */ | |
221 | + // referrer | |
222 | 222 | BoardDatabase db(m_datUrl); |
223 | 223 | QString refStr = db.boardUrl(); |
224 | 224 |
@@ -228,7 +228,7 @@ void WriteView::slotPostMessage() | ||
228 | 228 | job->addMetaData("content-type", "Content-type: application/x-www-form-urlencoded"); |
229 | 229 | job->addMetaData("referrer", refStr); |
230 | 230 | |
231 | - /* 2ch.net cookie modify */ | |
231 | + // 2ch.net cookie modify | |
232 | 232 | if (m_bbstype == Board_2ch && beBox->isChecked()) { |
233 | 233 | QString cookie = "Cookie: "; |
234 | 234 | QString BeMailAddress = AccountConfig::beMailAddress(); |
@@ -243,7 +243,7 @@ void WriteView::slotPostMessage() | ||
243 | 243 | connect(job, SIGNAL(data(KIO::Job*, const QByteArray&)), |
244 | 244 | this, SLOT(slotRecieveData(KIO::Job*, const QByteArray&))); |
245 | 245 | |
246 | - /* slotPostFinished() is called when done. */ | |
246 | + // slotPostFinished() is called when done. | |
247 | 247 | connect(job, SIGNAL(result(KJob*)), |
248 | 248 | this, SLOT(slotPostFinished(KJob*))); |
249 | 249 |
@@ -296,13 +296,13 @@ void WriteView::processPostFinished() | ||
296 | 296 | |
297 | 297 | case K2ch_True: |
298 | 298 | |
299 | - /* save log */ | |
299 | + // save log | |
300 | 300 | logPostMessage(); |
301 | 301 | |
302 | - /* clear message */ | |
302 | + // clear message | |
303 | 303 | setMessage(QString()); |
304 | 304 | |
305 | - /* reload thread */ | |
305 | + // reload thread | |
306 | 306 | ViewMediator::getInstance()->openThread(m_datUrl); |
307 | 307 | |
308 | 308 | m_parent->slotCloseCurrentTab(); |
@@ -318,7 +318,7 @@ void WriteView::processPostFinished() | ||
318 | 318 | |
319 | 319 | break; |
320 | 320 | |
321 | - /* eat cookie, then re-post message */ | |
321 | + // eat cookie, then re-post message | |
322 | 322 | case K2ch_Cookie: |
323 | 323 | |
324 | 324 | if (KMessageBox::questionYesNo(0, |
@@ -354,7 +354,7 @@ bool WriteView::slotBodyTextChanged() | ||
354 | 354 | int length |
355 | 355 | = QTextCodec::codecForName("Shift_JIS")->fromUnicode(body()).length(); |
356 | 356 | |
357 | - /* replace '\n' -> " <br> ", '>' -> "<", and etc. */ | |
357 | + // replace '\n' -> " <br> ", '>' -> "<", and etc. | |
358 | 358 | length += ((body().count('\n')) * 5 |
359 | 359 | + (body().count('>')) * 3 |
360 | 360 | + (body().count('<')) * 3 |
@@ -398,7 +398,7 @@ void WriteView::logPostMessage() | ||
398 | 398 | /* get result code from 2ch tag or title. */ /* private */ |
399 | 399 | int WriteView::resultCode(const QString& response) const |
400 | 400 | { |
401 | - /* see also libkita/kita-utf8.h */ | |
401 | + // see also libkita/kita-utf8.h | |
402 | 402 | QString errstr = QString::fromUtf8(KITAUTF8_WRITEERROR); |
403 | 403 | QString truestr = QString::fromUtf8(KITAUTF8_WRITETRUE); |
404 | 404 | QString ckstr = QString::fromUtf8(KITAUTF8_WRITECOOKIE); |
@@ -407,7 +407,7 @@ int WriteView::resultCode(const QString& response) const | ||
407 | 407 | int pos = regexp.indexIn(response); |
408 | 408 | |
409 | 409 | if (pos != -1) { |
410 | - /* get code from 2ch tag */ | |
410 | + // get code from 2ch tag | |
411 | 411 | QString k2ch_X = regexp.cap(1); |
412 | 412 | |
413 | 413 | if (k2ch_X == "true") return K2ch_True; |
@@ -418,7 +418,7 @@ int WriteView::resultCode(const QString& response) const | ||
418 | 418 | |
419 | 419 | return K2ch_Unknown; |
420 | 420 | } else { |
421 | - /* get code from title */ | |
421 | + // get code from title | |
422 | 422 | QString title = resultTitle(response); |
423 | 423 | if (title.isEmpty()) return K2ch_Unknown; |
424 | 424 |
@@ -426,7 +426,7 @@ int WriteView::resultCode(const QString& response) const | ||
426 | 426 | if (title.contains(truestr)) return K2ch_True; |
427 | 427 | if (title.contains(ckstr)) return K2ch_Cookie; |
428 | 428 | |
429 | - /* for Flash CGI */ | |
429 | + // for Flash CGI | |
430 | 430 | if (m_bbstype == Board_FlashCGI) { |
431 | 431 | if (title.contains("ERROR!!")) { |
432 | 432 | return K2ch_Error; |
@@ -435,7 +435,7 @@ int WriteView::resultCode(const QString& response) const | ||
435 | 435 | } |
436 | 436 | } |
437 | 437 | |
438 | - /* for JBBS. adhoc... */ | |
438 | + // for JBBS. adhoc... | |
439 | 439 | if (m_bbstype == Board_JBBS) { |
440 | 440 | |
441 | 441 | // x-euc-jp & euc-jp |