修订版 | c601e64270e3463a53b446ec0837d0bd956e6fff (tree) |
---|---|
时间 | 2010-02-13 07:32:49 |
作者 | nogu <nogu@user...> |
Commiter | nogu |
Use record' instead of enroll'
@@ -149,13 +149,13 @@ bool BBSView::downloadBoardList() | ||
149 | 149 | QString boardName = category.boardNameList[ count ]; |
150 | 150 | QString oldUrl; |
151 | 151 | BoardDatabase db(boardUrl); |
152 | - int ret = db.enrollBoard( | |
152 | + int ret = db.recordBoard( | |
153 | 153 | boardName, oldUrl, Board_Unknown, true /* test only */); |
154 | - if (ret == Board_enrollNew) { | |
154 | + if (ret == Board_recordNew) { | |
155 | 155 | newBoards += boardName + " ( " + category.category_name |
156 | 156 | + " ) " + boardUrl + '\n'; |
157 | 157 | } |
158 | - if (ret == Board_enrollMoved) { | |
158 | + if (ret == Board_recordMoved) { | |
159 | 159 | oldBoards += boardName + " ( " + category.category_name |
160 | 160 | + " ) " + oldUrl + " -> " + boardUrl + '\n'; |
161 | 161 | } |
@@ -313,7 +313,7 @@ void BBSView::showBoardList() | ||
313 | 313 | } |
314 | 314 | QString oldUrl; |
315 | 315 | BoardDatabase db(boardUrl); |
316 | - db.enrollBoard(boardName, oldUrl); | |
316 | + db.recordBoard(boardName, oldUrl); | |
317 | 317 | db.loadBBSHistory(); |
318 | 318 | previousBoard = new ListViewItem(categoryItem, previousBoard, |
319 | 319 | QStringList() << boardName << boardUrl); |
@@ -326,7 +326,7 @@ void BBSView::showBoardList() | ||
326 | 326 | QString oldUrl; |
327 | 327 | new ListViewItem(m_boardList, 0, QStringList() << boardName << boardUrl); |
328 | 328 | BoardDatabase db(boardUrl); |
329 | - db.enrollBoard(boardName, oldUrl); | |
329 | + db.recordBoard(boardName, oldUrl); | |
330 | 330 | |
331 | 331 | loadExtBoard(); |
332 | 332 | refreshFavoriteBoards(); |
@@ -363,7 +363,7 @@ void BBSView::loadExtBoard() | ||
363 | 363 | int type = Board_Unknown; |
364 | 364 | if (list.size() == 3) type = list[ 2 ].toInt(); |
365 | 365 | BoardDatabase db(board_url); |
366 | - db.enrollBoard(board_title, oldUrl, type); | |
366 | + db.recordBoard(board_title, oldUrl, type); | |
367 | 367 | } |
368 | 368 | } |
369 | 369 | } |
@@ -27,12 +27,12 @@ namespace Kita | ||
27 | 27 | }; |
28 | 28 | |
29 | 29 | |
30 | - /* return value of BoardManager::enrollBoard */ | |
30 | + /* return value of BoardManager::recordBoard */ | |
31 | 31 | enum { |
32 | - Board_enrollNew, | |
33 | - Board_enrollEnrolled, | |
34 | - Board_enrollMoved, | |
35 | - Board_enrollFailed | |
32 | + Board_recordNew, | |
33 | + Board_recordRecorded, | |
34 | + Board_recordMoved, | |
35 | + Board_recordFailed | |
36 | 36 | }; |
37 | 37 | |
38 | 38 | /*---------------------------------*/ |
@@ -345,20 +345,20 @@ void BoardDatabase::clearBoardData() | ||
345 | 345 | * |
346 | 346 | * @param[out] oldURL |
347 | 347 | * |
348 | - * @retval Board_enrollEnrolled if board is already enrolled. oldURL is QString(). | |
349 | - * @retval Board_enrollNew if board is new board. oldURL is QString(). | |
350 | - * @retval Board_enrollMoved if board is moved. oldURL is old URL. | |
348 | + * @retval Board_recordRecorded if board is already recorded. oldURL is QString(). | |
349 | + * @retval Board_recordNew if board is new board. oldURL is QString(). | |
350 | + * @retval Board_recordMoved if board is moved. oldURL is old URL. | |
351 | 351 | * |
352 | - * @note board is NOT enrolled when board is moved. | |
353 | - * To enroll new URL, call BoardDatabase::moveBoard(). | |
352 | + * @note board is NOT recorded when board is moved. | |
353 | + * To record new URL, call BoardDatabase::moveBoard(). | |
354 | 354 | * |
355 | 355 | * "int type" is type of board. It could be "Board_Unknown". See also parseBoardURL(). |
356 | 356 | * |
357 | - * If "bool test" is true, this function just checks if the board is enrolled (never enroll board). | |
357 | + * If "bool test" is true, this function just checks if the board is recorded (never record board). | |
358 | 358 | * |
359 | 359 | */ |
360 | 360 | /* public */ |
361 | -int BoardDatabase::enrollBoard(const QString& boardName, QString& oldUrl, int type, bool test) | |
361 | +int BoardDatabase::recordBoard(const QString& boardName, QString& oldUrl, int type, bool test) | |
362 | 362 | { |
363 | 363 | QString hostname; |
364 | 364 | QString rootPath; |
@@ -368,9 +368,9 @@ int BoardDatabase::enrollBoard(const QString& boardName, QString& oldUrl, int ty | ||
368 | 368 | type = parseBoardUrl(type, hostname, rootPath, delimiter, bbsPath, ext); |
369 | 369 | oldUrl.clear(); |
370 | 370 | |
371 | - if (type == Board_Unknown) return Board_enrollFailed; | |
371 | + if (type == Board_Unknown) return Board_recordFailed; | |
372 | 372 | |
373 | - /* check if the board is enrolled or moved. */ | |
373 | + /* check if the board is recorded or moved. */ | |
374 | 374 | BoardData *data; |
375 | 375 | foreach (data, m_boardDataList) { |
376 | 376 |
@@ -379,24 +379,24 @@ int BoardDatabase::enrollBoard(const QString& boardName, QString& oldUrl, int ty | ||
379 | 379 | && data->bbsPath() == bbsPath) { |
380 | 380 | |
381 | 381 | if (data->hostName() == hostname |
382 | - && data->rootPath() == rootPath) { /* enrolled */ | |
383 | - return Board_enrollEnrolled; | |
382 | + && data->rootPath() == rootPath) { /* recorded */ | |
383 | + return Board_recordRecorded; | |
384 | 384 | } else { /* moved */ |
385 | 385 | oldUrl = data->basePath(); |
386 | - return Board_enrollMoved; | |
386 | + return Board_recordMoved; | |
387 | 387 | } |
388 | 388 | } |
389 | 389 | } |
390 | 390 | |
391 | 391 | /* test only */ |
392 | 392 | if (test) |
393 | - return Board_enrollNew; | |
393 | + return Board_recordNew; | |
394 | 394 | |
395 | - /* enroll 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 | |
399 | - return Board_enrollNew; | |
399 | + return Board_recordNew; | |
400 | 400 | } |
401 | 401 | |
402 | 402 | /* parse board URL */ |
@@ -483,7 +483,7 @@ int BoardDatabase::parseBoardUrl( | ||
483 | 483 | } |
484 | 484 | |
485 | 485 | /* public */ |
486 | -bool BoardDatabase::isEnrolled() | |
486 | +bool BoardDatabase::isRecorded() | |
487 | 487 | { |
488 | 488 | return getBoardData() != 0; |
489 | 489 | } |
@@ -529,7 +529,7 @@ BoardData* BoardDatabase::getBoardData() | ||
529 | 529 | |
530 | 530 | |
531 | 531 | /* load the bbs history file (BBSHISTORY), and create keys of Data Base. */ |
532 | -/* Before calling this, enroll the board by enrollBoard(). */ | |
532 | +/* Before calling this, record the board by recordBoard(). */ | |
533 | 533 | /* |
534 | 534 | ex) If the host of board moved like : |
535 | 535 |
@@ -588,11 +588,11 @@ bool BoardDatabase::moveBoard(const KUrl& fromUrl, const KUrl& toUrl) | ||
588 | 588 | |
589 | 589 | if (oldUrl == newUrl) return false; |
590 | 590 | |
591 | - /* Is oldURL enrolled? */ | |
591 | + /* Is oldURL recorded? */ | |
592 | 592 | BoardData* bdata = getBoardData(oldUrl); |
593 | 593 | if (bdata == 0) { |
594 | 594 | |
595 | - /* Is newURL enrolled? */ | |
595 | + /* Is newURL recorded? */ | |
596 | 596 | bdata = getBoardData(newUrl); |
597 | 597 | if (bdata == 0) return false; |
598 | 598 | } |
@@ -44,9 +44,9 @@ namespace Kita { | ||
44 | 44 | |
45 | 45 | /* BoardData */ |
46 | 46 | void clearBoardData(); |
47 | - int enrollBoard(const QString& boardName, QString& oldUrl, | |
47 | + int recordBoard(const QString& boardName, QString& oldUrl, | |
48 | 48 | int type = Board_Unknown, bool test = false); |
49 | - bool isEnrolled(); | |
49 | + bool isRecorded(); | |
50 | 50 | BoardData* getBoardData(); |
51 | 51 | |
52 | 52 | /* BBSHISTORY */ |
@@ -32,7 +32,7 @@ QString Cache::baseDir() | ||
32 | 32 | |
33 | 33 | QString Cache::serverDir() const |
34 | 34 | { |
35 | - /* Is board enrolled ? */ | |
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 enrolled ? */ | |
48 | + /* Is board recorded ? */ | |
49 | 49 | BoardDatabase db(m_url); |
50 | 50 | BoardData * bdata = db.getBoardData(); |
51 | 51 | if (bdata == 0) return QString(); |
@@ -77,9 +77,9 @@ DatInfo * DatManager::getDatInfoPointer() const | ||
77 | 77 | DatInfo* DatManager::getDatInfo(bool checkCached) const |
78 | 78 | { |
79 | 79 | /* search */ |
80 | - /* create and enroll instance */ | |
80 | + /* create and record instance */ | |
81 | 81 | return (m_searchDatInfo != 0) |
82 | - ? m_searchDatInfo : enrollDatInfo(checkCached); | |
82 | + ? m_searchDatInfo : recordDatInfo(checkCached); | |
83 | 83 | } |
84 | 84 | |
85 | 85 |
@@ -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 enrolled in BoardManager. */ | |
91 | + return 0; /* This url is not recorded in BoardManager. */ | |
92 | 92 | if (m_datInfoList.isEmpty()) |
93 | 93 | return 0; |
94 | 94 |
@@ -116,13 +116,13 @@ DatInfo* DatManager::searchDatInfo() const | ||
116 | 116 | } |
117 | 117 | |
118 | 118 | |
119 | -/* create and enroll the instance of DatInfo and delete old instances. | |
119 | +/* create and record the instance of DatInfo and delete old instances. | |
120 | 120 | Note that DatInfo::DatInfo() opens cached data and reads it. */ |
121 | 121 | /* private */ |
122 | -DatInfo* DatManager::enrollDatInfo(bool checkCached) const | |
122 | +DatInfo* DatManager::recordDatInfo(bool checkCached) const | |
123 | 123 | { |
124 | 124 | if (m_datUrl.isEmpty()) |
125 | - return 0; /* This url is not enrolled in BoardManager. */ | |
125 | + return 0; /* This url is not recorded in BoardManager. */ | |
126 | 126 | |
127 | 127 | /* create DatInfo & read cached data */ |
128 | 128 | DatInfo* datInfo = new DatInfo(m_datUrl); |
@@ -374,7 +374,7 @@ int DatManager::getNumById(const QString& strid) const | ||
374 | 374 | |
375 | 375 | |
376 | 376 | /* public */ |
377 | -bool DatManager::isThreadEnrolled() const | |
377 | +bool DatManager::isThreadRecorded() const | |
378 | 378 | { |
379 | 379 | return !m_datUrl.isEmpty(); |
380 | 380 | } |
@@ -69,7 +69,7 @@ namespace Kita | ||
69 | 69 | |
70 | 70 | |
71 | 71 | /* another information */ |
72 | - bool isThreadEnrolled() const; | |
72 | + bool isThreadRecorded() const; | |
73 | 73 | bool is2chThread() const; |
74 | 74 | bool isResValid(int num) const; |
75 | 75 | bool isBroken() const; |
@@ -95,7 +95,7 @@ namespace Kita | ||
95 | 95 | private: |
96 | 96 | DatInfo* getDatInfo(bool checkCached = true) const; |
97 | 97 | DatInfo* searchDatInfo() const; |
98 | - DatInfo* enrollDatInfo(bool checkCached) const; | |
98 | + DatInfo* recordDatInfo(bool checkCached) const; | |
99 | 99 | |
100 | 100 | KUrl m_url; |
101 | 101 | KUrl m_datUrl; |
@@ -98,7 +98,7 @@ QString Kita::getWriteUrl(const KUrl& m_datUrl) | ||
98 | 98 | If mode = URLMODE_DAT, output is URL of dat file. |
99 | 99 | If mode = URLMODE_THREAD, output is URL of read.cgi . |
100 | 100 | |
101 | - If url is NOT enrolled, return QString(). | |
101 | + If url is NOT recorded, return QString(). | |
102 | 102 | |
103 | 103 | (ex.1) |
104 | 104 |
@@ -145,7 +145,7 @@ QString Kita::convertUrl( | ||
145 | 145 | return m_prevConvNewUrl; |
146 | 146 | } |
147 | 147 | |
148 | - /* Is board enrolled ? */ | |
148 | + /* Is board recorded ? */ | |
149 | 149 | BoardDatabase db(url); |
150 | 150 | BoardData* bdata = db.getBoardData(); |
151 | 151 | if (bdata == 0) return QString(); |
@@ -137,7 +137,7 @@ void ViewMediator::updateFavoriteListView() | ||
137 | 137 | void ViewMediator::openUrl(const KUrl& url) |
138 | 138 | { |
139 | 139 | // open thread. |
140 | - if (DatManager(url).isThreadEnrolled()) { | |
140 | + if (DatManager(url).isThreadRecorded()) { | |
141 | 141 | m_threadTabWidget->slotShowMainThread(url); |
142 | 142 | return; |
143 | 143 | } |