Logo Search packages:      
Sourcecode: nateon version File versions  Download package

void KNateon::slotCopyBuddy ( const QString &  sGroup  )  [private, slot]

다중선택 버디 사용자 복사 / 이동 / 삭제

친구 복사

KSelectAction의 선택을 없앰.

pGroup에서 Group의 Buddy 리스트를 얻는다.

XXXXXXXXXXXXXXX TARGET GID

pGroup에 추가된 buddy handle을 추가한다. 같은 그룹에 계속 추가되는것을 막음.

pList 가 멀티셀렉션으로 세팅 되있으면 isMultiSelection은 무조건 true 임. else { Buddy *pBuddy = m_pBuddyList->getBuddyByHandle( pList->currentItem()->text(2) ); m_pMainView->slotAddBuddy( groupItem, pBuddy ); }

명령어가 있을때만 DP로 보냄.

목록 refresh

Definition at line 3797 of file knateon.cpp.

References Group::addBuddy(), BuddyList::getBuddyByHandle(), Group::getBuddyList(), CurrentAccount::getBuddyList(), MyListItem::getGID(), GroupList::getGroupByName(), NateonDPConnection::getGroupCache(), KNateonMainview::getGroupItemByName(), CurrentAccount::getGroupList(), BuddyBase::getHandle(), BuddyBase::getUID(), KNateonMainview::pCopybuddyAction, NateonConnection::sendCommand(), KNateonMainview::slotAddBuddy(), KNateonMainview::slotEmoticonList(), and nmconfig::viewemoticonlist.

Referenced by connected().

{
      /*!
        KSelectAction의 선택을 없앰.
      */
      m_pMainView->pCopybuddyAction->setCurrentItem(-1);
      pCopyfriendSelectAction->setCurrentItem(-1);

      QListView *pList = m_pMainView->listView3;
      m_pBuddyList = const_cast<BuddyList*>(m_pCurrentAccount->getBuddyList());

      QListViewItem *groupItem = m_pMainView->getGroupItemByName( sGroup );

      if ( !groupItem )
      {
#ifdef NETDEBUG
            kdDebug() << "XXXX [" << sGroup << "]" << endl;
#endif
            return;
      }
  
      /*!
        pGroup에서 Group의 Buddy 리스트를 얻는다.
      */
    QPtrList<Buddy> plBuddyList = m_pCurrentAccount->getGroupList()->getGroupByName( sGroup )->getBuddyList();

      QString sBody;
      int nIDX = 0;

      if (pList->isMultiSelection ())
      {
            QListViewItemIterator it( pList );
            for ( ; it.current(); ++it )
            {
                  if (  pList->isSelected( it.current() ) )
                  {
                        if ( plBuddyList.contains( m_pBuddyList->getBuddyByHandle( it.current()->text(2) ) ) > 0 )
                        {
#ifdef NETDEBUG
                              kdDebug() << "This buddy is exist : [" << it.current()->text(2) << "]" << endl;
#endif
                              continue;
                        }
                        Buddy *pBuddy = m_pBuddyList->getBuddyByHandle( it.current()->text(2) );
                        if (pBuddy)
                        {
                              m_pMainView->slotAddBuddy( groupItem, pBuddy );
                              sBody += QString::number( nIDX++ );
                              sBody += " ";
                              sBody += pBuddy->getHandle();
                              sBody += " ";
                              sBody += pBuddy->getUID();
                              sBody += " ";
                              sBody += pBuddy->getGID();
                              sBody += " ";
                              /*! XXXXXXXXXXXXXXX TARGET GID */
                              sBody += groupItem->text(1);
                              sBody += "\r\n";

                              /*!
                                pGroup에 추가된 buddy handle을 추가한다.
                                같은 그룹에 계속 추가되는것을 막음.
                              */
                              m_pCurrentAccount->getGroupList()->getGroupByName( sGroup )->addBuddy( pBuddy );
                        }
                  }
            }
      }
      /*! pList 가 멀티셀렉션으로 세팅 되있으면 isMultiSelection은 무조건 true 임.
        else
        {
        Buddy *pBuddy = m_pBuddyList->getBuddyByHandle( pList->currentItem()->text(2) );
        m_pMainView->slotAddBuddy( groupItem, pBuddy );
        }
      */

      /*!
        명령어가 있을때만 DP로 보냄.
      */
      if ( sBody.length() )
      {
            QString sCommand;
            sCommand = QString::number( m_pDPcon->getGroupCache() );
            sCommand += " ";
            sCommand += QString::number( sBody.length() );
            sCommand += "\r\n";
            sCommand += sBody;
            m_pDPcon->sendCommand( "CPBG", sCommand );

            /*!
             * 목록 refresh
             */
            m_pMainView->slotEmoticonList( stConfig.viewemoticonlist );
      }
      else
      {
            KMessageBox::information (this, UTF8("이미 등록된 친구를 복사하거나, 친구 선택을 안하셨습니다.\n확인하시고 다시 실행해 주십시오."), UTF8("친구 복사 알림"));
      }
}


Generated by  Doxygen 1.6.0   Back to index