示例#1
0
void Dialog::dropEvent(QDropEvent *event)
{
    qDebug() << "drop enter event";
    if (event->mimeData()->hasUrls())
    {
//        //qDebug() << event->mimeData()->urls();
        QMessageBox msgBox;

//        if (m_isInNode)
//        {
//            QString str;
//            Device dev;
//            str = dev.getDetailPropertyContent(DP_IP);
//            //node2Device(m_currentNodeIndex,&dev);
//            msgBox.setText(str);
//            msgBox.exec();


            m_urls = event->mimeData()->urls();

            if (!m_urls.empty())
            {
                QString strFile;
                foreach(QUrl url, m_urls)
                {
                    strFile = url.toLocalFile();
                }

                qint64 iSize = countSize(strFile);
                if (m_bFolder)
                {
                    //mSendFile = new sendfile("192.168.9.15", strFile, m_fileList ,iSize);
                    mSendFile = new sendfile("127.0.0.1", strFile, m_fileList ,m_emptyFolderList, iSize);

                }
                else
                {
                     //mSendFile = new sendfile("192.168.9.15", strFile);
                    mSendFile = new sendfile("127.0.0.1", strFile);
                }

                connect(mSendFile,SIGNAL(sendSuccess()),this,SLOT(onSendSuccess()));
                mSendFile->startThread();
                m_urls.erase(m_urls.begin());
            }
示例#2
0
        ////////////////////////////////////////////////////////////
        // BigRequest
        //
        void BigRequest()
        {
            _server->registerMethod("countSize", *this, &BinRpcTest::countSize);

            cxxtools::bin::RpcClient client(_loop, "", _port);
            cxxtools::RemoteProcedure<unsigned, std::vector<int> > countSize(client, "countSize");

            std::vector<int> v;
            v.resize(5000);

            countSize.begin(v);

            try
            {
                countSize.end(2000);
            }
            catch (const std::exception& e)
            {
                log_error("loop exited with exception: " << e.what());
                CXXTOOLS_UNIT_ASSERT_MSG(false, std::string("unexpected exception ") + typeid(e).name() + ": " + e.what());
            }
        }