本文整理汇总了C++中completed函数的典型用法代码示例。如果您正苦于以下问题:C++ completed函数的具体用法?C++ completed怎么用?C++ completed使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了completed函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: switch
void Sasl::respond(qpid::SaslServer::Status status, const std::string& chllnge)
{
switch (status) {
case qpid::SaslServer::OK:
connection.setUserid(authenticator->getUserid());
completed(true);
//can't set authenticated & failed until we have actually sent the outcome
state = SUCCESS_PENDING;
securityLayer = authenticator->getSecurityLayer(65535);
if (securityLayer.get()) {
QPID_LOG_CAT(info, security, id << " Security layer installed");
securityLayer->init(&connection);
connection.setSaslSsf(securityLayer->getSsf());
}
QPID_LOG_CAT(info, security, id << " Authenticated as " << authenticator->getUserid());
break;
case qpid::SaslServer::FAIL:
completed(false);
state = FAILURE_PENDING;
QPID_LOG_CAT(info, security, id << " Failed to authenticate");
break;
case qpid::SaslServer::CHALLENGE:
challenge(&chllnge);
QPID_LOG_CAT(info, security, id << " Challenge issued");
break;
}
haveOutput = true;
out.activateOutput();
}
开发者ID:ted-ross,项目名称:qpid-spf,代码行数:29,代码来源:Sasl.cpp
示例2: completed
void ImportWorker::run()
{
if (!runCheck(1))
emit completed(getStyledText(tr("Consistency error, "
"import could not be performed with current import configuration"),
"red",true));
else
{
if (runImport(OGRGDALEXT_PRECHECK_STEPS+1))
{
emit completed(getStyledText(tr("Import sucessful"),
"green",true));
}
else
{
emit completed(getStyledText(tr("Import error. "
"Import may be uncompleted or inconsistent"),
"red",true));
}
emit closeRequired();
}
emit finished();
}
开发者ID:fabrejc,项目名称:travis-test,代码行数:25,代码来源:ImportWorker.cpp
示例3: connectionStatus
void ConnectionDiagnosticThread::run()
{
boost::scoped_ptr<mongo::DBClientConnection> connection;
try {
connection.reset(new mongo::DBClientConnection);
connection->connect(_connection->info());
emit connectionStatus("", true);
}
catch(const mongo::UserException &ex) {
const char *what = ex.what();
emit connectionStatus(QString(what), false);
emit completed();
return;
}
try {
if (_connection->hasEnabledPrimaryCredential())
{
CredentialSettings *credential = _connection->primaryCredential();
std::string database = credential->databaseName();
std::string username = credential->userName();
std::string password = credential->userPassword();
std::string errmsg;
bool ok = connection->auth(database, username, password, errmsg);
emit authStatus("", ok);
}
} catch (const mongo::UserException &) {
emit authStatus("", false);
}
emit completed();
}
开发者ID:2812140729,项目名称:robomongo,代码行数:34,代码来源:ConnectionDiagnosticDialog.cpp
示例4: disconnect
void regionEditDialog::refresh(void)
{
disconnect(link, SIGNAL(completed()), 0, 0);
connect(link, SIGNAL(completed()), this, SLOT(getLock()));
if (regionIndex < link->regionListCount())
link->tx("region[" + link->getRegionIdAt(regionIndex) + "].refresh?\n");
}
开发者ID:jbagg,项目名称:vactracker,代码行数:7,代码来源:regionEdit.cpp
示例5: kDebug
bool KHTMLReader::filter(const KUrl& url)
{
kDebug(30503) << "KHTMLReader::filter";
QObject::connect(_html, SIGNAL(completed()), this, SLOT(completed()));
_state.clear();
_list_depth = 0;
_html->view()->resize(600, 530);
_html->setAutoloadImages(false);
_html->setJScriptEnabled(false);
_html->setPluginsEnabled(false);
_html->setJavaEnabled(false);
_html->setMetaRefreshEnabled(false);
if (_html->openUrl(url) == false) {
kWarning(30503) << "openUrl returned false";
return false;
}
#ifdef __GNUC__
#warning "kde4: port it"
#endif
#if 0
//FIXME use synchronous IO instead of this hack if possible.
QWidget dummy(0);//,0,WType_Dialog | WShowModal);
qt_enter_modal(&dummy);
qApp->enter_loop();
qt_leave_modal(&dummy);
#endif
return _it_worked;
}
开发者ID:KDE,项目名称:koffice,代码行数:31,代码来源:khtmlreader.cpp
示例6: g_build_filename
void
MoonInstallerService::UpdaterCompleted ()
{
char *content, *path, *tmp;
char *xap;
int err = 0;
gsize size;
gsize xap_len;
FILE *fp;
path = g_build_filename (GetBaseInstallDir (), app->uid, "Application.xap", NULL);
// check that the xap has changed...
if (g_file_get_contents (path, &content, &size, NULL)) {
if (g_file_get_contents (request->GetFilename (), &xap, &xap_len, NULL)) {
if (xap_len == size && !memcmp (xap, content, size)) {
// no change to the xap
completed (false, NULL, user_data);
CloseDownloader (false);
g_free (content);
g_free (xap);
g_free (path);
return;
}
g_free (xap);
}
g_free (content);
}
tmp = g_strdup_printf ("%s.tmp", path);
if ((fp = fopen (tmp, "wb"))) {
// write to the temporary file
if (CopyFileTo (request->GetFilename (), fileno (fp)))
err = ferror (fp);
fclose (fp);
if (err == 0) {
// rename the temp file to the actual file
if (g_rename (tmp, path) == -1)
err = errno;
}
} else {
err = errno;
}
g_free (path);
g_free (tmp);
if (err == 0) {
// update the app's mtime
// FIXME: get the Last-Modified: header from the downloader?
app->mtime = time (NULL);
db->SyncAppRecord (app);
}
completed (err == 0, err ? g_strerror (err) : NULL, user_data);
CloseDownloader (false);
}
开发者ID:499940913,项目名称:moon,代码行数:60,代码来源:pal.cpp
示例7: completed
void Link::rx(void)
{
qint32 i;
rxStream+= server.readAll();
QStringList cmds = rxStream.split(QRegExp("[\r\n]"));
for (i=0; i<cmds.size()-1; i++)
{
if (cmds[i] == "ok") {
succeeded = 1;
emit completed();
emit success();
}
else if (cmds[i].contains("error")) {
succeeded = 0;
emit completed();
if (cmds[i].section('=', 1).size())
emit error(cmds[i].section('=', 1));
emit error();
}
else
parseCmd(this, cmds[i]);
}
if (cmds.size() > 1)
{
rxStream.clear();
if (cmds.at(i).size()) // if string size != 0, there is a partial command leftover
rxStream+= cmds.at(i);
}
}
开发者ID:jbagg,项目名称:vactracker,代码行数:32,代码来源:link.cpp
示例8: f
void HasherThread::run()
{
#if DEBUG_TEST_BUFFER_MODE == 1
qint64 size;
qint64 iReadCount=0;
int iProgress=0;
char buffer[pagesize*BEST_BUFFER_SIZE];
int count;
#endif
m_stop = false;
QFile f( fullFileName );
if ( !f.open(QIODevice::ReadOnly) ) {
emit error(treeitem, QString("Unable to open file %1").arg(fullFileName) );
return;
}
#if DEBUG_TEST_BUFFER_MODE == 1
size = f.size();
#endif
hasher->reset();
#if DEBUG_TEST_TIME == 1
QDateTime sT = QDateTime::currentDateTime();
emit msg(treeitem, "Start: " + sT.toString("yyyy-MM-dd_HH:mm:ss zzz"));
#endif
#if DEBUG_TEST_BUFFER_MODE == 1
do {
count = f.read( buffer, sizeof(buffer) );
if ( count == -1 ) {
emit error(treeitem, QString("Read error") );
break;
}
//add hash data by read position
hasher->addData( buffer, count );
iReadCount = iReadCount + count;
//signal how many byte read
iProgress = ((iReadCount *100) / size);
emit fileReadPos(treeitem, iProgress);
} while( !f.atEnd() && (!m_stop));
if (!m_stop) {
emit completed(treeitem, hasher->result().toHex().toUpper() );
}
#else
//add by filename
//connect(&f,SIGNAL(f.),this,filehashPos() );
if (hasher->addData(&f)) {
emit completed(treeitem, hasher->result().toHex().toUpper() );
}
#endif
#if DEBUG_TEST_TIME == 1
QDateTime eT = QDateTime::currentDateTime();
emit msg(treeitem, "Finish: " + eT.toString("yyyy-MM-dd_HH:mm:ss zzz"));
#endif
//*/
f.close();
}
开发者ID:coolshou,项目名称:DesktopEntry-actions,代码行数:55,代码来源:hasherthread.cpp
示例9: context_switch
/*
* implementation for context_switch
*/
void context_switch(sc_context * pContext) {
assert(pContext != NULL);
if (pContext->pFiber != NULL && !completed(pContext)) {
if (current_context != NULL) if (!completed(current_context)) current_context->state = FS_DELAYED;
current_context = pContext;
SwitchToFiber(pContext->pFiber);
}
return;
}
开发者ID:energyfive,项目名称:sc-core,代码行数:14,代码来源:win32-nt4-context.cpp
示例10: context_recall
/*
* implementation for context_recall
*/
void * context_recall(sc_context * pContext) {
void * r;
assert(pContext != NULL);
if (top_context == current_context) /*especially for PM realization*/
context_switch(pContext);
r = (pContext->pFiber != NULL)?
completed(pContext)? *(pContext->pParameter): NULL:
NULL;
if (completed(pContext)) context_complete(pContext);
return r;
}
开发者ID:energyfive,项目名称:sc-core,代码行数:16,代码来源:win32-nt4-context.cpp
示例11: PrecheckImportDialog
void OGRGDALImportExtension::proceedToImport()
{
if (mp_PrecheckImportDlg != NULL)
delete mp_PrecheckImportDlg;
mp_PrecheckImportDlg = new PrecheckImportDialog(OGRGDALEXT_PRECHECK_STEPS+m_SourcesInfos.size()+2,this);
mp_PrecheckImportDlg->open();
QThread* WThread = new QThread;
ImportWorker* Worker = new ImportWorker(m_SourcesInfos,mp_AdvancedDesc,m_InputDir);
Worker->moveToThread(WThread);
connect(Worker, SIGNAL(stepEntered(QString)), mp_PrecheckImportDlg, SLOT(handleStepEntered(QString)));
connect(Worker, SIGNAL(stepCompleted(int,QString)), mp_PrecheckImportDlg, SLOT(handleStepCompleted(int,QString)));
connect(Worker, SIGNAL(completed(QString)), mp_PrecheckImportDlg, SLOT(handleCompleted(QString)));
connect(Worker, SIGNAL(finished()), mp_PrecheckImportDlg, SLOT(handleFinished()));
// for automatic closing on successful import
connect(Worker, SIGNAL(closeRequired()), mp_PrecheckImportDlg, SLOT(handleCloseRequired()));
connect(mp_PrecheckImportDlg, SIGNAL(closeRequired()), this, SLOT(handleCloseRequired()));
connect(WThread, SIGNAL(started()), Worker, SLOT(run()));
connect(Worker, SIGNAL(finished()), WThread, SLOT(quit()));
connect(Worker, SIGNAL(finished()), Worker, SLOT(deleteLater()));
connect(WThread, SIGNAL(finished()), WThread, SLOT(deleteLater()));
WThread->start();
}
开发者ID:jylfc0307,项目名称:openfluid-1,代码行数:31,代码来源:OGRGDALImportExtension.cpp
示例12: KPanelMenu
MenuMedia::MenuMedia()
: KPanelMenu( QString::null, 0, "Media" ),
mMenuId(0)
{
disableAutoClear();
setCaption(i18n("Media Menu"));
m_DirLister = new KDirLister();
connect( m_DirLister, SIGNAL( clear() ), this, SLOT( slotClear() ) );
connect( m_DirLister, SIGNAL( started(const KURL&) ),
this, SLOT( slotStarted(const KURL&) ) );
connect( m_DirLister, SIGNAL( completed() ),
this, SLOT( slotCompleted() ) );
connect( m_DirLister, SIGNAL( newItems( const KFileItemList & ) ),
this, SLOT( slotNewItems( const KFileItemList & ) ) );
connect( m_DirLister, SIGNAL( deleteItem( KFileItem * ) ),
this, SLOT( slotDeleteItem( KFileItem * ) ) );
connect( m_DirLister, SIGNAL( refreshItems( const KFileItemList & ) ),
this, SLOT( slotRefreshItems( const KFileItemList & ) ) );
m_ExcludedTypesList.clear();
m_ExcludedTypesList << "media/hdd_mounted";
m_ExcludedTypesList << "media/hdd_unmounted";
m_ExcludedTypesList << "media/nfs_mounted";
m_ExcludedTypesList << "media/nfs_unmounted";
m_ExcludedTypesList << "media/smb_mounted";
m_ExcludedTypesList << "media/smb_unmounted";
}
开发者ID:fuji7l,项目名称:KDesktop-Menu,代码行数:28,代码来源:menu_media.cpp
示例13: connect
TupExportWizardPage *TupExportWizard::addPage(TupExportWizardPage *newPage)
{
QString tag = newPage->getTag();
newPage->setParent(k->history);
newPage->show();
k->history->addWidget(newPage);
if (k->history->count() == 1) { // First Page
newPage->setFocus();
k->backButton->setEnabled(false);
k->nextButton->setDefault(true);
}
// k->nextButton->setEnabled(newPage->isComplete());
connect(newPage, SIGNAL(completed()), this, SLOT(pageCompleted()));
connect(newPage, SIGNAL(emptyField()), this, SLOT(disableButton()));
if (tag.compare("PLUGIN") == 0) {
// connect(newPage, SIGNAL(formatSelected(int, const QString &)), this, SLOT(setFormat(int, const QString &)));
connect(newPage, SIGNAL(animatedImageFormatSelected(int, const QString &)), this, SLOT(setFormat(int, const QString &)));
connect(newPage, SIGNAL(imagesArrayFormatSelected(int, const QString &)), this, SLOT(setFormat(int, const QString &)));
connect(newPage, SIGNAL(animationFormatSelected(int, const QString &)), this, SLOT(setFormat(int, const QString &)));
}
开发者ID:bedna-KU,项目名称:tupi,代码行数:25,代码来源:tupexportwizard.cpp
示例14: spi_dw_isr
void spi_dw_isr(void *arg)
{
struct device *dev = (struct device *)arg;
const struct spi_dw_config *info = dev->config->config_info;
u32_t error = 0;
u32_t int_status;
int_status = read_isr(info->regs);
SYS_LOG_DBG("SPI int_status 0x%x - (tx: %d, rx: %d)",
int_status, read_txflr(info->regs), read_rxflr(info->regs));
if (int_status & DW_SPI_ISR_ERRORS_MASK) {
error = 1;
goto out;
}
if (int_status & DW_SPI_ISR_RXFIS) {
pull_data(dev);
}
if (int_status & DW_SPI_ISR_TXEIS) {
push_data(dev);
}
out:
clear_interrupts(info->regs);
completed(dev, error);
}
开发者ID:zmole945,项目名称:zephyr,代码行数:29,代码来源:spi_dw_legacy.c
示例15: f
void HasherThread::run()
{
QFile f( filename );
if ( !f.open(QIODevice::ReadOnly) )
{
emit error( QString("Unable to open file %1").arg(filename) );
return;
}
hasher->reset();
char buffer[16*1024];
qint64 count;
qint64 summator = 0;
int _progress = 0;
do {
count = f.read( buffer, sizeof(buffer) );
summator += count;
_progress = (int)((float(summator)/f.size()) * 1000);
//qDebug() << "HasherThread::run " << count;
// qDebug() << "HasherThread::run " << f.size() << " - " << summator << " - " << float(summator)/f.size();
// qDebug() << "HasherThread::progress " << _progress;
emit progress(_progress);
if ( count == -1 )
{
emit error( QString("Read error") );
break;
}
hasher->addData( buffer, count );
} while( !f.atEnd() );
emit completed( hasher->result().toHex() );
}
开发者ID:MakSim345,项目名称:QT-Dev,代码行数:35,代码来源:HasherThread.cpp
示例16: OC_LOG_V
void POSTRequestGenerator::onResponseReceived(SimulatorResult result,
SimulatorResourceModelSP repModel)
{
OC_LOG_V(INFO, TAG, "Response recieved result:%d", result);
m_responseCnt++;
completed();
}
开发者ID:chetan336,项目名称:iotivity,代码行数:7,代码来源:post_request_generator.cpp
示例17: Q_ASSERT
void QgsTask::start()
{
mStartCount++;
Q_ASSERT( mStartCount == 1 );
if ( mStatus != Queued )
return;
mStatus = Running;
mOverallStatus = Running;
emit statusChanged( Running );
emit begun();
// force initial emission of progressChanged, but respect if task has had initial progress manually set
setProgress( mProgress );
if ( run() )
{
completed();
}
else
{
terminated();
}
}
开发者ID:spono,项目名称:QGIS,代码行数:25,代码来源:qgstaskmanager.cpp
示例18: connect
void regionEditDialog::doRegionChange(void)
{
if (nextRegionIndex < 0) {
regionEntry.setEnabled(1);
addRegionButton.setEnabled(1);
yearEntry.setEnabled(0);
addYearButton.setEnabled(0);
}
else {
regionEntry.setEnabled(0);
addRegionButton.setEnabled(0);
yearEntry.setEnabled(1);
addYearButton.setEnabled(1);
}
if (nextRegionIndex != regionIndex) {
yearSelector.clear();
yearEntry.clear();
stats.clear();
if (regionIndex >= 0) {
if (nextRegionIndex >= 0)
connect(link, SIGNAL(completed()), this, SLOT(refresh())); // valid -> valid
if (regionIndex < link->regionListCount())
link->tx("region[" + link->getRegionIdAt(regionIndex) + "].unlock\n");
regionIndex = nextRegionIndex;
}
else if (nextRegionIndex >= 0) { // (-1) -> valid
regionIndex = nextRegionIndex;
refresh();
}
}
}
开发者ID:jbagg,项目名称:vactracker,代码行数:32,代码来源:regionEdit.cpp
示例19: Q_UNUSED
void FullMessageCombiner::slotDataChanged(const QModelIndex &left, const QModelIndex &right)
{
Q_UNUSED(left);
Q_UNUSED(right);
if (!indexesValid()) {
emit failed(tr("Message is gone"));
return;
}
if (m_headerPartIndex.data(Imap::Mailbox::RoleIsFetched).toBool() && m_bodyPartIndex.data(Imap::Mailbox::RoleIsFetched).toBool()) {
emit completed();
disconnect(m_dataChanged);
}
bool headerOffline = m_headerPartIndex.data(Imap::Mailbox::RoleIsUnavailable).toBool();
bool bodyOffline = m_bodyPartIndex.data(Imap::Mailbox::RoleIsUnavailable).toBool();
if (headerOffline && bodyOffline) {
emit failed(tr("Offline mode: uncached message data not available"));
} else if (headerOffline) {
emit failed(tr("Offline mode: uncached header data not available"));
} else if (bodyOffline) {
emit failed(tr("Offline mode: uncached body data not available"));
}
}
开发者ID:ChristopherCotnoir,项目名称:trojita,代码行数:25,代码来源:FullMessageCombiner.cpp
示例20: QDialog
FileStoreUploadDialog::FileStoreUploadDialog(QWidget *parent, FileStore *store, RideItem *item) : QDialog(parent), store(store), item(item)
{
// get a compressed version
store->compressRide(item->ride(), data, QFileInfo(item->fileName).baseName() + ".json");
// setup the gui!
QVBoxLayout *layout = new QVBoxLayout(this);
info = new QLabel(QString(tr("Uploading %1 bytes...")).arg(data.size()));
layout->addWidget(info);
progress = new QProgressBar(this);
progress->setMaximum(0);
progress->setValue(0);
layout->addWidget(progress);
okcancel = new QPushButton(tr("Cancel"));
QHBoxLayout *buttons = new QHBoxLayout;
buttons->addStretch();
buttons->addWidget(okcancel);
layout->addLayout(buttons);
// get notification when done
connect(store, SIGNAL(writeComplete(QString,QString)), this, SLOT(completed(QString,QString)));
// ok, so now we can kickoff the upload
store->writeFile(data, QFileInfo(item->fileName).baseName() + ".json.zip");
}
开发者ID:jto2000,项目名称:GoldenCheetah,代码行数:27,代码来源:FileStore.cpp
注:本文中的completed函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论