Cashed last opened thread, that greatly increase tree opening speed, especially useful for READGotoThNextUnread.

This commit is contained in:
Ianos Gnatiuc 2006-09-28 18:08:30 +00:00
parent 7184b3e471
commit 673ebc8bca
4 changed files with 59 additions and 26 deletions

View File

@ -10,6 +10,8 @@ _____________________________________________________________________________
‡ ¬¥âª¨ ¤«ï GoldED+ 1.1.5, /snapshot/ ‡ ¬¥âª¨ ¤«ï GoldED+ 1.1.5, /snapshot/
_____________________________________________________________________________ _____________________________________________________________________________
+ ’¥¯¥אל קט¨אד¥גבן ¯®ב«¥₪­¨© ®ג×אכגכ© גאם₪, חג® ב¨«ל­® ¯®¢כב¨«® ב×®א®בגל
¯®¢ג®א­®£® ¥£® ®ג×אכג¨ן. <20>ב®¡¥­­® םג® § ¬¥ג­® ­  READGotoThNextUnread.
+ Š®£¤  á®®¡é¥­¨¥ ¯¥à¥¬¥é ¥âáï ¨§ ª®à§¨­ë, â® ¢ë¡¨à ¥âáï ¯® 㬮«ç ­¨î  à¨ï + Š®£¤  á®®¡é¥­¨¥ ¯¥à¥¬¥é ¥âáï ¨§ ª®à§¨­ë, â® ¢ë¡¨à ¥âáï ¯® 㬮«ç ­¨î  à¨ï
¨§ ª«ã¤¦  AREA. ¨§ ª«ã¤¦  AREA.
- uudecoder: ⥯¥àì ¡ã¤¥â ¨£­®à¨à®¢ ­® ¢á¥ ¯®á«¥ áâப¨ çâ® ­ ç¨­ ¥âáï - uudecoder: ⥯¥àì ¡ã¤¥â ¨£­®à¨à®¢ ­® ¢á¥ ¯®á«¥ áâப¨ çâ® ­ ç¨­ ¥âáï

View File

@ -10,6 +10,9 @@ ______________________________________________________________________
Notes for GoldED+ 1.1.5, /snapshot/ Notes for GoldED+ 1.1.5, /snapshot/
______________________________________________________________________ ______________________________________________________________________
+ Cashed last opened thread, that greatly increase tree opening speed,
especially useful for READGotoThNextUnread.
+ When moving from recyclebin, area from AREA: kludge is selected by default. + When moving from recyclebin, area from AREA: kludge is selected by default.
- uudecoder: now are skipped all lines which follows line that starts - uudecoder: now are skipped all lines which follows line that starts

View File

@ -732,6 +732,10 @@ private:
std::vector<ThreadEntry> list; std::vector<ThreadEntry> list;
std::vector<std::string> tree; std::vector<std::string> tree;
dword m_OldMsgno;
uint m_OldTags;
std::string m_OldEchoId;
void BuildThreadIndex(dword msgno); void BuildThreadIndex(dword msgno);
void recursive_build(uint32_t msgn, uint32_t rn, uint32_t level, uint32_t index); void recursive_build(uint32_t msgn, uint32_t rn, uint32_t level, uint32_t index);
void GenTree(int idx); void GenTree(int idx);
@ -1073,20 +1077,16 @@ void GThreadlist::BuildThreadIndex(dword msgn)
{ {
w_info(LNG->Wait); w_info(LNG->Wait);
index = maximum_index = position = maximum_position = 0;
list.clear();
tree.clear();
AA->LoadHdr(&msg, msgn); AA->LoadHdr(&msg, msgn);
uint32_t msgno = msg.link.to(); uint32_t msgno = msg.link.to();
uint32_t prevmsgno = msgn; uint32_t prevmsgno = msgn;
// Search backwards // Search backwards
while(AA->Msgn.ToReln(msgno)) { while(AA->Msgn.ToReln(msgno))
{
if(not AA->LoadHdr(&msg, msgno)) { if (not AA->LoadHdr(&msg, msgno))
{
msg.link.to_set(0); msg.link.to_set(0);
msgno = prevmsgno; msgno = prevmsgno;
AA->LoadHdr(&msg, msgno); AA->LoadHdr(&msg, msgno);
@ -1097,21 +1097,33 @@ void GThreadlist::BuildThreadIndex(dword msgn)
msgno = msg.link.to(); msgno = msg.link.to();
} }
recursive_build(msg.msgno, 0, 0, 0); if ((m_OldMsgno != prevmsgno) || (m_OldTags != AA->Msgn.Tags()) || (m_OldEchoId != AA->echoid()))
{
m_OldMsgno = prevmsgno;
m_OldTags = AA->Msgn.Tags();
m_OldEchoId = AA->echoid();
index = maximum_index = position = maximum_position = 0;
list.clear();
tree.clear();
recursive_build(msg.msgno, 0, 0, 0);
minimum_index = 0;
maximum_index = list.size() - 1;
maximum_position = MinV((uint) list.size() - 1, (uint) ylen - 1);
index = 0;
h_offset = 0;
new_hoffset = 0;
for (uint i = 0; i < list.size(); i++)
{
if (list[i].msgno == msgn)
index = i;
}
}
w_info(NULL); w_info(NULL);
minimum_index = 0;
maximum_index = list.size() - 1;
maximum_position = MinV((uint) list.size() - 1, (uint) ylen - 1);
index = 0;
h_offset = 0;
new_hoffset = 0;
for(uint i = 0; i<list.size(); i++) {
if(list[i].msgno == msgn)
index = i;
}
} }
@ -1304,6 +1316,8 @@ void GThreadlist::Run() {
if(not aborted) if(not aborted)
AA->set_lastread(AA->Msgn.ToReln(list[index].msgno)); AA->set_lastread(AA->Msgn.ToReln(list[index].msgno));
ResetMsg(&msg);
} }
@ -1355,18 +1369,24 @@ bool GThreadlist::GoNextUnread(bool reader)
} }
} }
ResetMsg(&msg);
return found; return found;
} }
// ------------------------------------------------------------------ // ------------------------------------------------------------------
void MsgThreadlist() { GThreadlist *g_ThreadList = 0;
GThreadlist p;
p.Run(); // ------------------------------------------------------------------
void MsgThreadlist()
{
if (!g_ThreadList)
g_ThreadList = new GThreadlist;
g_ThreadList->Run();
} }
@ -1374,11 +1394,13 @@ void MsgThreadlist() {
void GotoThNextUnread() void GotoThNextUnread()
{ {
if (!g_ThreadList)
g_ThreadList = new GThreadlist;
w_info(LNG->Wait); w_info(LNG->Wait);
reader_direction = DIR_NEXT; reader_direction = DIR_NEXT;
GThreadlist p; if (!g_ThreadList->GoNextUnread(true))
if (!p.GoNextUnread(true))
{ {
SayBibi(); SayBibi();
reader_keyok = true; reader_keyok = true;

View File

@ -33,6 +33,9 @@
extern bool cmdlinenoscan; extern bool cmdlinenoscan;
extern bool cmdlineexportsoup; extern bool cmdlineexportsoup;
class GThreadlist;
extern GThreadlist *g_ThreadList;
GMsg* reader_msg; GMsg* reader_msg;
bool reader_gen_confirm = false; bool reader_gen_confirm = false;
int reader_finished; int reader_finished;
@ -1030,6 +1033,9 @@ void Reader() {
} while(not reader_finished and not gkbd.quitall); } while(not reader_finished and not gkbd.quitall);
delete g_ThreadList;
g_ThreadList = 0;
HeaderView->Destroy(); HeaderView->Destroy();
BodyView->Destroy(); BodyView->Destroy();
} }