Beispiel #1
0
int do_extract()
{
        guint i;
        ProtoBye pb;
        
        if(int_option(kOption_verbose) & VERBOSE_FLOW)
                g_message("begin do_extract");
        
        if(g_args->len == 0) {
                extract_it(NULL);
        } else {
                for(i = 0; i < g_args->len; i++)
                        extract_it((const char *)g_ptr_array_index(g_args, i));
        }

        if(int_option(kOption_verbose) & VERBOSE_FLOW)
                g_message("end do_extract");
        if(!wt_more()) {
                memset(&pb, 0, sizeof(pb));
                pb.error = pbe_OK;
                send_bye(&pb);
        }
        return 0;
}
Beispiel #2
0
bool ColMsg::extract_it(ColMsgList & top)
{
    int index = 0;
    foreach (ColMsg *msg, top) {
        if (msg == this) {
            top.removeAt(index);
            return TRUE;
        }

        if (extract_it(msg->msgs))
            return TRUE;
        ++index;
    }

    return FALSE;
}
Beispiel #3
0
bool ColMsg::extract_it(ColMsgList & top) {
  Q3PtrListIterator<ColMsg> it(top);
  int index;
  
  for (index = 0; it.current(); ++it, index += 1) {
    if (it.current() == this) {
      top.remove(index);
      return TRUE;
    }
    
    if (extract_it(it.current()->msgs))
      return TRUE;

  }
  
  return FALSE;
}
Beispiel #4
0
void ColMsg::delete_it(bool rec, ColMsgList & top) {
  // extract it from all msg
  extract_it(top);
  
  if (rec)
    delete_it_internal();
  else {
    // moves sub messages at toplevel
    while (msgs.first() != 0)
      top.append(msgs.take());
    
    // remove it from (self)link
    in->remove_it(this);
    
    delete this;
  }
}
Beispiel #5
0
void ColMsg::delete_it(bool rec, ColMsgList & top)
{
    // extract it from all msg
    extract_it(top);

    if (rec)
        delete_it_internal();
    else {
        // moves sub messages at toplevel
        top << msgs;
        msgs.clear();

        // remove it from (self)link
        in->remove_it(this);

        delete this;
    }
}