OSDN Git Service

Restrain trace messages.
authorAiwota Programmer <aiwotaprog@tetteke.tk>
Sat, 4 Jul 2009 21:22:26 +0000 (06:22 +0900)
committerAiwota Programmer <aiwotaprog@tetteke.tk>
Sat, 4 Jul 2009 21:22:26 +0000 (06:22 +0900)
src/board_window.cxx
src/thread_idx_cache.cxx

index b450b2a..5e02c53 100644 (file)
@@ -243,7 +243,10 @@ void BoardWindow::merge_subject_txt(
 
   boost::posix_time::ptime last_modified;
   try {
-    last_modified = rfc1123_to_ptime(idx_.last_modified_);
+    if (!idx_.last_modified_.empty())
+      last_modified = rfc1123_to_ptime(idx_.last_modified_);
+    else
+      last_modified = boost::posix_time::second_clock::universal_time();
   } catch (const HTTPDateError& e) {
     std::cerr << e.what() << std::endl;
     last_modified = boost::posix_time::second_clock::universal_time();
@@ -256,6 +259,9 @@ void BoardWindow::merge_subject_txt(
     model_column::field<model_column::ID>(cols) = item.id_;
     model_column::field<model_column::ResNum>(cols) = item.res_num_;
 
+    // avoid some threads like '9242006007'
+    if (item.id_.size() == 10 && item.id_[0] == '9') continue;
+
     try {
       const std::time_t _start = boost::lexical_cast<std::time_t>(item.id_);
       const boost::posix_time::ptime start = boost::posix_time::from_time_t(_start);
index 9dea8e5..668a67e 100644 (file)
@@ -170,7 +170,7 @@ void ThreadIdxCache::merge_idx(const boost::filesystem::path& idx_dir,
       if (last_modified <= cache_last_modified) continue;
     }
 
-    std::cout << "modified:" << id << std::endl;
+//    std::cout << "modified:" << id << std::endl;
     ThreadIdx idx = ThreadIdx::from_xml(leaf);
     if (idx.last_modified_.empty()) continue;
     ThreadIdxCache& cache = caches[id];