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

void KNateon::slotSendFile ( SendFileInfo pSendFileInfo  )  [private, slot]

파일전송

파일 보내기.

파일 정보를 P2P 서버에 등록 시킨다.

파일 전송창

Definition at line 2501 of file knateon.cpp.

References FileTransfer::addListView(), P2PConnection::addSendFileInfo(), SQLiteDB::execOne(), BuddyList::getBuddyByID(), CurrentAccount::getBuddyList(), SendFileInfo::getFileName(), SendFileInfo::getFileSize(), CurrentAccount::getMyID(), BuddyBase::getName(), BuddyBase::getNick(), SendFileInfo::getSSCookie(), SendFileInfo::getYourID(), m_pFileTransfer, m_pP2PServer, nmconfig::p2pdbfilepath, nmconfig::p2pserverip, and pSQLiteDB.

Referenced by createChat().

{
    /*! 파일 정보를 P2P 서버에 등록 시킨다. */
    m_pP2PServer->addSendFileInfo( pSendFileInfo );

    QFileInfo fi( pSendFileInfo->getFileName() );
    QString sFileName = fi.fileName();
    QString sFilePath = fi.dirPath( true );
    
    QString sQuery;
    sQuery = "INSERT INTO tb_p2p ('File_Cookie', \
'Source_ID',                                                     \
'Destination_ID',                                                \
'File_Local_Path',                                               \
'P2P_Type',                                                      \
'Destination_P2P_IP',                                            \
'File_Name',                                                     \
'File_Size'                                                      \
) VALUES('";
    sQuery += pSendFileInfo->getSSCookie();
    sQuery += "', '";
    sQuery += m_pCurrentAccount->getMyID();
    sQuery += "', '";
    sQuery += pSendFileInfo->getYourID();
    sQuery += "', '";
    sQuery += sFilePath.utf8();
    sQuery += "', '";
    sQuery += "S";
    sQuery += "', '";
    sQuery += stConfig.p2pserverip;
    sQuery += "', '";
    sQuery += sFileName.utf8();
    sQuery += "', '";
    sQuery += QString::number( pSendFileInfo->getFileSize() );
    sQuery += "')";
    
    pSQLiteDB->execOne( stConfig.p2pdbfilepath, sQuery );

    /*! 파일 전송창 */
      if (! m_pFileTransfer ) {
            m_pFileTransfer = new FileTransfer();
        connect( m_pFileTransfer, SIGNAL( cancelFileTransfer( const QString & )), SLOT( slotMyTransferCancel( const QString & ) ) );

        if ( ! m_pFileTransfer->isShown() )
            m_pFileTransfer->show();
    }
    
    m_pBuddyList = m_pCurrentAccount->getBuddyList();
    Buddy* pBuddy = m_pBuddyList->getBuddyByID( pSendFileInfo->getYourID() );

    QString sReceiver;
    if ( pBuddy ) {
        sReceiver = pBuddy->getName();
        sReceiver += "(";
        sReceiver += pBuddy->getNick();
        sReceiver += ")";
    } else {
        sReceiver = pSendFileInfo->getYourID();
    }

    m_pFileTransfer->addListView(pSendFileInfo->getSSCookie(), sReceiver, sFileName,  pSendFileInfo->getFileSize(), true );
}


Generated by  Doxygen 1.6.0   Back to index