diff --git a/filemonitor.cpp b/filemonitor.cpp index 95ec4b2..44d5423 100644 --- a/filemonitor.cpp +++ b/filemonitor.cpp @@ -112,7 +112,6 @@ void FileMonitor::run() // We need a mutex or semaphore to lock out this page while we do that // lock p->LoadPage(name); // What if this fails? We can see the bool. What to do ? - //TODO: If this was a normal page and is now a special page or vice versa we have loaded it into the wrong pagelist! FIX ME! p->SetModifiedTime(attrib.st_mtime); // unlock diff --git a/pagelist.cpp b/pagelist.cpp index 0fbad3a..e14378f 100644 --- a/pagelist.cpp +++ b/pagelist.cpp @@ -48,12 +48,7 @@ int PageList::LoadPageList(std::string filepath) q->GetPageCount(); // Use for the side effect of renumbering the subcodes int mag=(q->GetPageNumber() >> 16) & 0x7; - PageFunction func = q->GetPageFunction(); - if (func == GPOP || func == POP || func == GDRCS || func == DRCS || func == MOT || func == MIP){ - _pageList[mag+8].push_back(*q); // put page in separate pageList for "special" pages - } else { - _pageList[mag].push_back(*q); // This copies. But we can't copy a mutex - } + _pageList[mag].push_back(*q); // This copies. But we can't copy a mutex } } } @@ -92,13 +87,8 @@ int PageList::LoadPageList(std::string filepath) void PageList::AddPage(TTXPageStream* page) { - int mag=(page->GetPageNumber() >> 16) & 0x7; - PageFunction func = page->GetPageFunction(); - if (func == GPOP || func == POP || func == GDRCS || func == DRCS || func == MOT || func == MIP){ - _pageList[mag+8].push_back(*page); // put page into separate pageList for "special" pages - } else { - _pageList[mag].push_back(*page); // put page into the normal page sequence - } + int mag=(page->GetPageNumber() >> 16) & 0x7; + _pageList[mag].push_back(*page); } @@ -107,7 +97,7 @@ TTXPageStream* PageList::Locate(std::string filename) { // This is called from the FileMonitor thread // std::cerr << "[PageList::Locate] *** TODO *** " << filename << std::endl; - for (int mag=0;mag<16;mag++) // check both sets of page lists as it might be one of the special pages + for (int mag=0;mag<8;mag++) { //for (auto p : _pageList[mag]) for (std::list::iterator p=_pageList[mag].begin();p!=_pageList[mag].end();++p) diff --git a/pagelist.h b/pagelist.h index ea85d70..1d70926 100644 --- a/pagelist.h +++ b/pagelist.h @@ -85,7 +85,7 @@ class PageList private: Configure* _configure; // The configuration object - std::list _pageList[16]; /// The list of Pages in this service. Two lists per magazine (normal pages in lists 0-7, enhancement and magazine inventory and organisation table pages in 8-15) + std::list _pageList[8]; /// The list of Pages in this service. One list per magazine vbit::Mag* _mag[8]; // iterators through selected pages. (use the same iterator for D command and MD, L etc.)