#include "misc.hxx"
#include "board_window_state.hxx"
#include "thread_idx.hxx"
+#include "thread_window.hxx"
namespace dialektos {
unmerge_subject_txt(buffer);
merge_subject_txt(subjects, buffer);
tree_model_->set_buffer(buffer);
+
+ inform_to_threads(buffer);
}
void BoardWindow::on_refresh_end(const http::StatusLine& status,
state.to_xml(boost::filesystem::path(bbs_->get_board_state_path()));
}
+void BoardWindow::inform_to_threads(
+ boost::unordered_map<std::string, ModelColumns>& buffer) const {
+ typedef boost::unordered_map<std::string, ModelColumns> MapType;
+ typedef MapType::const_iterator Iter;
+
+ BOOST_FOREACH(ApplicationWindow& window, windows) {
+ if (ThreadWindow* thread_window = dynamic_cast<ThreadWindow*>(&window)) {
+ const bbs_detail::Base& bbs = thread_window->get_bbs_detail();
+ if (!bbs.belongs_to(*bbs_)) continue;
+
+ const std::string thread = bbs.get_thread_id();
+ Iter it = buffer.find(thread);
+ int res = 0;
+ if (it != buffer.end())
+ res = model_column::field<model_column::ResNum>(it->second);
+ inform_to_thread(*thread_window, res);
+ }
+ }
+}
+
+void BoardWindow::inform_to_thread(ThreadWindow& window, int res_num) const {
+ window.on_informed_from_board(res_num);
+}
+
} // namespace dialektos