diff options
author | scw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-01-04 21:20:49 +0800 |
---|---|---|
committer | scw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-01-04 21:20:49 +0800 |
commit | 8ebd4ec688619339213673f257428c54f181df47 (patch) | |
tree | 1582acd327ecda1d9fa22e9831414f7c7e968a12 /mbbsd/fav.c | |
parent | c2a031cc43cf3da1500b0bc084a21f436a41a94d (diff) | |
download | pttbbs-8ebd4ec688619339213673f257428c54f181df47.tar pttbbs-8ebd4ec688619339213673f257428c54f181df47.tar.gz pttbbs-8ebd4ec688619339213673f257428c54f181df47.tar.bz2 pttbbs-8ebd4ec688619339213673f257428c54f181df47.tar.lz pttbbs-8ebd4ec688619339213673f257428c54f181df47.tar.xz pttbbs-8ebd4ec688619339213673f257428c54f181df47.tar.zst pttbbs-8ebd4ec688619339213673f257428c54f181df47.zip |
Make K,1 under favorite (cleaning invisible boards) rework.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1461 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/fav.c')
-rw-r--r-- | mbbsd/fav.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/mbbsd/fav.c b/mbbsd/fav.c index 338375f7..25584c6f 100644 --- a/mbbsd/fav.c +++ b/mbbsd/fav.c @@ -218,7 +218,7 @@ inline int valid_item(fav_type_t *ft){ /* return: the exact number after cleaning * reset the line number, board number, folder number, and total number (number) */ -static void rebuild_fav(fav_t *fp) +static void rebuild_fav(fav_t *fp, int clean_invisible) { int i, j, nData; fav_type_t *ft; @@ -229,9 +229,12 @@ static void rebuild_fav(fav_t *fp) for (i = 0, j = 0; i < nData; i++){ if (!(fp->favh[i].attr & FAVH_FAV)) continue; + ft = &fp->favh[i]; switch (get_item_type(ft)){ case FAVT_BOARD: + if( clean_invisible && Ben_Perm(&bcache[cast_board(ft)->bid - 1])) + continue; /* bid = cast_board(ft)->bid; if (SHM->GV2.e.cleanboard && bcache[bid - 1].brdname[0]) @@ -243,7 +246,7 @@ static void rebuild_fav(fav_t *fp) break; case FAVT_FOLDER: cast_folder(ft)->fid = fp->folderID + 1; - rebuild_fav(get_fav_folder(&fp->favh[i])); + rebuild_fav(get_fav_folder(&fp->favh[i]), clean_invisible); break; default: continue; @@ -258,7 +261,7 @@ static void rebuild_fav(fav_t *fp) inline void cleanup(void) { - rebuild_fav(get_fav_root()); + rebuild_fav(get_fav_root(), 1); } /* sort the fav */ @@ -269,7 +272,7 @@ static int favcmp_by_name(const void *a, const void *b) void fav_sort_by_name(void) { - rebuild_fav(get_current_fav()); + rebuild_fav(get_current_fav(), 0); qsort(get_current_fav()->favh, get_data_number(get_current_fav()), sizeof(fav_type_t), favcmp_by_name); } @@ -297,7 +300,7 @@ static int favcmp_by_class(const void *a, const void *b) void fav_sort_by_class(void) { - rebuild_fav(get_current_fav()); + rebuild_fav(get_current_fav(), 0); qsort(get_current_fav()->favh, get_data_number(get_current_fav()), sizeof(fav_type_t), favcmp_by_class); } |