本文整理汇总了C++中disconnect函数的典型用法代码示例。如果您正苦于以下问题:C++ disconnect函数的具体用法?C++ disconnect怎么用?C++ disconnect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了disconnect函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: connect
void CMainWindow::connectSignals()
{
CChatManager *Manager = CChatManager::instance();
CNetworkClient *Network = CNetworkClient::instance();
CBattleManager *BattleManager = CBattleManager::instance();
connect(ui->ChatTabWidget->tabBar(), SIGNAL(tabCloseRequested(int)), Manager, SLOT(closeChannel(int)));
connect(ui->ChatTabWidget->tabBar(), SIGNAL(currentChanged(int)), Manager, SLOT(changeCurrentChannel(int)));
connect(ui->ChatTabWidget->tabBar(), SIGNAL(tabMoved(int,int)), Manager, SLOT(moveChannel(int,int)));
connect(Manager, SIGNAL(joined(CChannel*)), this, SLOT(createTab(CChannel*)));
connect(Manager, SIGNAL(closeTab(int)), this, SLOT(removeTab(int)));
connect(Manager, SIGNAL(currentChanged(CChannel*)), ui->ChatTabWidget->chatView(), SLOT(loadChannel(CChannel*)));
connect(ui->ChannelsView, SIGNAL(doubleClicked(QModelIndex)), CChatManager::instance(), SLOT(doubleClicked(QModelIndex)));
connect(ui->ChannelUserView, SIGNAL(doubleClicked(QModelIndex)),
CUserManager::instance()->chatModel(), SLOT(doubleClicked(QModelIndex)));
connect(ui->actionChatSend, SIGNAL(triggered()), this, SLOT(sendChat()));
connect(ui->actionBattleSend, SIGNAL(triggered()), this, SLOT(sendBattle()));
connect(Manager, SIGNAL(currentChanged(int)), ui->ChatTabWidget->tabBar(), SLOT(setCurrentIndex(int)));
connect(ui->BattleListView->selectionModel(), SIGNAL(currentRowChanged(QModelIndex,QModelIndex)),
CBattleManager::instance(), SLOT(battleSelected(QModelIndex)));
connect(ui->BattleListView, SIGNAL(doubleClicked(QModelIndex)), CBattleManager::instance(), SLOT(doubleClicked(QModelIndex)));
connect(ui->BattlePreviewView, SIGNAL(doubleClicked(QModelIndex)),
CBattleManager::instance()->battlePreviewModel(), SLOT(doubleClicked(QModelIndex)));
connect(ui->actionConnect, SIGNAL(triggered()), this, SLOT(showConnectDialog()));
connect(&ConnectDialog, SIGNAL(connect(QString,int,QString,QString)), Network, SLOT(connectToServer(QString,int,QString,QString)));
connect(Network, SIGNAL(disconnected()), this, SLOT(networkDisconnected()));
connect(Network, SIGNAL(connected()), this, SLOT(networkConnected()));
connect(Network, SIGNAL(multiplayerDisabled()), this, SLOT(disableMultiplayerGUI()));
connect(Network, SIGNAL(multiplayerEnabled()), this, SLOT(enableMultiplayerGUI()));
connect(ui->actionDisconnect, SIGNAL(triggered()), Network, SLOT(disconnect()));
connect(CBattleManager::instance(), SIGNAL(currentMapChanged(CMap*)), ui->MapInfo, SLOT(setMap(CMap*)));
connect(CBattleroomManager::instance(), SIGNAL(mapChanged(CMap*)), ui->BattleMapInfo, SLOT(setMap(CMap*)));
connect(CBattleroomManager::instance(), SIGNAL(updateChat(CChannel*)), ui->BattleChatText, SLOT(loadChannel(CChannel*)));
connect(CBattleroomManager::instance(), SIGNAL(error(int,QString)), this, SLOT(error(int,QString)));
connect(ui->LeaveBattleButton, SIGNAL(clicked()), CBattleroomManager::instance(), SLOT(leaveBattle()));
connect(ui->DownloadButton, SIGNAL(clicked()), this, SLOT(execDownload()));
connect(ui->actionDeleteDownload, SIGNAL(triggered()), this, SLOT(removeDownload()));
connect(ui->actionDownloadMap, SIGNAL(triggered()), BattleManager, SLOT(downloadMapForBattle()));
connect(ui->actionDownloadMod, SIGNAL(triggered()), BattleManager, SLOT(downloadModForBattle()));
connect(ui->DownloadView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showDownloadContextMenu(QPoint)));
connect(ui->BattleListView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showBattleContextMenu(QPoint)));
connect(Network, SIGNAL(error(int,QString)), this, SLOT(error(int,QString)));
connect(CDownloadManager::instance(), SIGNAL(error(int,QString)), this, SLOT(error(int,QString)));
connect(Manager, SIGNAL(error(int,QString)), this, SLOT(error(int,QString)));
connect(CDownloadManager::instance(), SIGNAL(error(int,QString)), this, SLOT(error(int,QString)));
connect(Network, SIGNAL(agreement(QString)), this, SLOT(showAgreement(QString)));
connect(ui->actionReloadUnitSync, SIGNAL(triggered()), CUnitSync::instance(), SLOT(reload()));
connect(CUnitSync::instance(), SIGNAL(error(int,QString)), this, SLOT(error(int,QString)));
connect(CUserManager::instance(), SIGNAL(lobbyUserBattleStatusChanged(CBattleStatus*)),
this, SLOT(updateBattleStatus(CBattleStatus*)));
connect(CUnitSync::instance(), SIGNAL(loaded()), this, SLOT(unitsyncLoaded()));
connect(CUnitSync::instance(), SIGNAL(unloaded()), this, SLOT(unitsyncUnloaded()));
connect(ui->actionUpdateStatus, SIGNAL(triggered()), this, SLOT(changeBattleStatus()));
connect(CBattleroomManager::instance(), SIGNAL(battleJoined(CBattle*)), this, SLOT(enableBattleroom(CBattle*)));
connect(CBattleroomManager::instance(), SIGNAL(battleClosed()), this, SLOT(disableBattleroom()));
connect(CBattleroomManager::instance(), SIGNAL(gameStarted()), this, SLOT(lockBattleroom()));
connect(CBattleroomManager::instance(), SIGNAL(gameEnded()), this, SLOT(unlockBattleroom()));
connect(CBattleroomManager::instance(), SIGNAL(battleStarted()), this, SLOT(onBattleStarted()));
connect(CBattleroomManager::instance(), SIGNAL(battleEnded()), this, SLOT(onBattleEnded()));
connect(ui->SelectColorButton, SIGNAL(clicked()), this, SLOT(selectColor()));
connect(ui->StartBattleButton, SIGNAL(clicked()), CBattleroomManager::instance(), SLOT(startGame()));
connect(&ColorDialog, SIGNAL(colorSelected(QColor)), this, SLOT(colorSelected(QColor)));
}
开发者ID:ObKo,项目名称:HoSpLo,代码行数:72,代码来源:MainWindow.cpp
示例2: disconnect
VisualDebugger::~VisualDebugger()
{
disconnect();
}
开发者ID:rudysnow,项目名称:SimbiconPlatform,代码行数:4,代码来源:PvdVisualDebugger.cpp
示例3: disconnect
void stringListEntryWidget::setAllWidgets(QList<stringListEntryWidget*> widgets)
{
disconnect(0, 0, this, SLOT(verify())) ;
newValue->setValidator(new stringListEntryValidator(widgets, this)) ;
}
开发者ID:hvennekate,项目名称:data_element,代码行数:5,代码来源:specdescriptoreditaction.cpp
示例4: connect
/*
* Establish connection for tip
*
* If DU is true, we should dial an ACU whose type is AT.
* The phone numbers are in PN, and the call unit is in CU.
*
* If the PN is an '@', then we consult the PHONES file for
* the phone numbers. This file is /etc/phones, unless overriden
* by an exported shell variable.
*
* The data base files must be in the format:
* host-name[ \t]*phone-number
* with the possibility of multiple phone numbers
* for a single host acting as a rotary (in the order
* found in the file).
*/
char *
connect(void)
{
char *cp = PN;
char *phnum, string[256];
FILE *fd;
int tried = 0;
if (!DU) { /* regular connect message */
if (CM != NULL)
xpwrite(FD, CM, size(CM));
logent(value(HOST), "", DV, "call completed");
return (NULL);
}
/*
* @ =>'s use data base in PHONES environment variable
* otherwise, use /etc/phones
*/
signal(SIGINT, acuabort);
signal(SIGQUIT, acuabort);
if (setjmp(jmpbuf)) {
signal(SIGINT, SIG_IGN);
signal(SIGQUIT, SIG_IGN);
printf("\ncall aborted\n");
logent(value(HOST), "", "", "call aborted");
if (acu != NULL) {
boolean(value(VERBOSE)) = FALSE;
if (conflag)
disconnect(NULL);
else
(*acu->acu_abort)();
}
return ("interrupt");
}
if ((acu = acutype(AT)) == NULL)
return ("unknown ACU type");
if (*cp != '@') {
while (*cp) {
for (phnum = cp; *cp && *cp != ','; cp++)
;
if (*cp)
*cp++ = '\0';
if ((conflag = (*acu->acu_dialer)(phnum, CU))) {
if (CM != NULL)
xpwrite(FD, CM, size(CM));
logent(value(HOST), phnum, acu->acu_name,
"call completed");
return (NULL);
} else
logent(value(HOST), phnum, acu->acu_name,
"call failed");
tried++;
}
} else {
if ((fd = fopen(PH, "r")) == NULL) {
printf("%s: ", PH);
return ("can't open phone number file");
}
while (fgets(string, sizeof(string), fd) != NULL) {
for (cp = string; !any(*cp, " \t\n"); cp++)
;
if (*cp == '\n') {
fclose(fd);
return ("unrecognizable host name");
}
*cp++ = '\0';
if (strcmp(string, value(HOST)))
continue;
while (any(*cp, " \t"))
cp++;
if (*cp == '\n') {
fclose(fd);
return ("missing phone number");
}
for (phnum = cp; *cp && *cp != ',' && *cp != '\n'; cp++)
;
if (*cp)
*cp++ = '\0';
if ((conflag = (*acu->acu_dialer)(phnum, CU))) {
fclose(fd);
if (CM != NULL)
xpwrite(FD, CM, size(CM));
//.........这里部分代码省略.........
开发者ID:wan721,项目名称:DragonFlyBSD,代码行数:101,代码来源:acu.c
示例5: readyToAnimate
void QQuickAnimatorProxyJob::sceneGraphInitialized()
{
readyToAnimate();
disconnect(this, SLOT(sceneGraphInitialized()));
}
开发者ID:CodeDJ,项目名称:qt5-hidpi,代码行数:5,代码来源:qquickanimatorjob.cpp
示例6: disconnect
QtConnectionOwner::~QtConnectionOwner() {
disconnect();
}
开发者ID:telegramdesktop,项目名称:tdesktop,代码行数:3,代码来源:message_field.cpp
示例7: disconnect
void FormJoinGame::hide()
{
disconnect(TcpGameConnectionClient::instance(), &TcpGameConnectionClient::notifyError, this, &FormJoinGame::gameJoinError);
Form::hide();
}
开发者ID:patadejaguar,项目名称:GuerraDeTanques,代码行数:5,代码来源:formjoingame.cpp
示例8: connect
void PureMaid::changeSelfMode(int mode)
{
for(int i = 0;i < cardNum;i++)
{
for(int j = 0;j < cardNum;j++)
{
if(i != j)
{
connect(cardButton[i],SIGNAL(changeClicked()),cardButton[j],SLOT(cancelX()));
}
}
for(int j = 0;j < 6;j++)
{
if(paintStructX->gameCharacter[5]->color != paintStructX->gameCharacter[j]->color)
{
connect(cardButton[i],SIGNAL(changeClicked()),paintStructX->gameCharacter[j]->characterPic,SLOT(recoverClick()));
connect(cardButton[i],SIGNAL(notClicked()),paintStructX->gameCharacter[j]->characterPic,SLOT(cancelClick()));
}
}
}
for(int i = 0;i < 6;i++)
{
connect(paintStructX->gameCharacter[i]->characterPic,SIGNAL(changeClicked()),ensure,SLOT(recoverClick()));
connect(paintStructX->gameCharacter[i]->characterPic,SIGNAL(notClicked()),ensure,SLOT(cancelClick()));
for(int j = 0;j < 6;j ++)
{
if(i != j)
{
connect(paintStructX->gameCharacter[i]->characterPic,SIGNAL(changeClicked()),paintStructX->gameCharacter[j]->characterPic,SLOT(cancelX()));
}
}
}
cancel->canBeClicked = true;
switch(mode)
{
case 4://治疗术响应阶段
{
cancel->canBeClicked = false;
//system("pause");
//system("pause");
for(int i = 0;i < cardNum;i++)
{
if(cardList->getSkillOne(card[i]) == 61)
{
cardButton[i]->canBeClicked = true;
}
}
for(int i = 0;i < cardNum;i++)
{
for(int j = 0;j < 6;j++)
{
if(paintStructX->gameCharacter[5]->color != paintStructX->gameCharacter[j]->color)
{
disconnect(cardButton[i],SIGNAL(changeClicked()),paintStructX->gameCharacter[j]->characterPic,SLOT(recoverClick()));
disconnect(cardButton[i],SIGNAL(notClicked()),paintStructX->gameCharacter[j]->characterPic,SLOT(cancelClick()));
}
connect(cardButton[i],SIGNAL(changeClicked()),paintStructX->gameCharacter[j]->characterPic,SLOT(recoverClick()));
connect(cardButton[i],SIGNAL(notClicked()),paintStructX->gameCharacter[j]->characterPic,SLOT(cancelClick()));
}
}
//disconnect(ensure,SIGNAL(changeClicked()),this,SLOT(selfReset()));
break;
}
case 5://治愈之光响应阶段
{
cancel->canBeClicked = false;
for(int i = 0;i < 6;i++)
{
disconnect(paintStructX->gameCharacter[i]->characterPic,SIGNAL(changeClicked()),ensure,SLOT(recoverClick()));
disconnect(paintStructX->gameCharacter[i]->characterPic,SIGNAL(notClicked()),ensure,SLOT(cancelClick()));
for(int j = 0;j < 6;j ++)
{
if(i != j)
{
disconnect(paintStructX->gameCharacter[i]->characterPic,SIGNAL(changeClicked()),paintStructX->gameCharacter[j]->characterPic,SLOT(cancelX()));
}
}
}
for(int i = 0;i < cardNum;i++)
{
if(cardList->getSkillOne(card[i]) == 62)
{
cardButton[i]->canBeClicked = true;
}
}
for(int i = 0;i < 6;i++)
{
connect(paintStructX->gameCharacter[i]->characterPic,SIGNAL(changeClicked()),this,SLOT(countPlus()));
connect(paintStructX->gameCharacter[i]->characterPic,SIGNAL(notClicked()),this,SLOT(countMinus()));
}
for(int i = 0;i < cardNum;i++)
{
for(int j = 0;j < 6;j++)
{
if(paintStructX->gameCharacter[5]->color != paintStructX->gameCharacter[j]->color)
{
disconnect(cardButton[i],SIGNAL(changeClicked()),paintStructX->gameCharacter[j]->characterPic,SLOT(recoverClick()));
disconnect(cardButton[i],SIGNAL(notClicked()),paintStructX->gameCharacter[j]->characterPic,SLOT(cancelClick()));
}
connect(cardButton[i],SIGNAL(changeClicked()),paintStructX->gameCharacter[j]->characterPic,SLOT(recoverClick()));
//.........这里部分代码省略.........
开发者ID:Hubertzhang,项目名称:AsteriatedGUI,代码行数:101,代码来源:puremaid.cpp
示例9: disconnect
StreamAdapter::~StreamAdapter() {
disconnect();
}
开发者ID:RajaMu,项目名称:hardware_libhardware,代码行数:3,代码来源:camera2_utils.cpp
示例10: disconnect
void QgsMapToolAdvancedDigitizing::deactivate()
{
QgsMapToolEdit::deactivate();
disconnect( mCadDockWidget, SIGNAL( pointChanged( QgsPoint ) ), this, SLOT( cadPointChanged( QgsPoint ) ) );
mCadDockWidget->disable();
}
开发者ID:grhelle,项目名称:QGIS,代码行数:6,代码来源:qgsmaptooladvanceddigitizing.cpp
示例11: disconnect
WebSocketsClient::~WebSocketsClient() {
disconnect();
}
开发者ID:chrisella,项目名称:arduinoWebSockets,代码行数:3,代码来源:WebSocketsClient.cpp
示例12: disconnect
WorkerThreadableWebSocketChannel::Bridge::~Bridge()
{
disconnect();
}
开发者ID:IllusionRom-deprecated,项目名称:android_platform_external_chromium_org_third_party_WebKit,代码行数:4,代码来源:WorkerThreadableWebSocketChannel.cpp
示例13: QDialog
LBMUIMFlowDialog::LBMUIMFlowDialog(QWidget * parent, capture_file * cfile) :
QDialog(parent),
m_ui(new Ui::LBMUIMFlowDialog),
m_capture_file(cfile),
m_num_items(0),
m_packet_num(0),
m_node_label_width(20)
{
m_ui->setupUi(this);
QCustomPlot * sp = m_ui->sequencePlot;
m_sequence_diagram = new SequenceDiagram(sp->yAxis, sp->xAxis2, sp->yAxis2);
sp->addPlottable(m_sequence_diagram);
sp->axisRect()->setRangeDragAxes(sp->xAxis2, sp->yAxis);
sp->xAxis->setVisible(false);
sp->xAxis->setPadding(0);
sp->xAxis->setLabelPadding(0);
sp->xAxis->setTickLabelPadding(0);
sp->xAxis2->setVisible(true);
sp->yAxis2->setVisible(true);
m_one_em = QFontMetrics(sp->yAxis->labelFont()).height();
m_ui->horizontalScrollBar->setSingleStep(100 / m_one_em);
m_ui->verticalScrollBar->setSingleStep(100 / m_one_em);
sp->setInteractions(QCP::iRangeDrag);
m_ui->gridLayout->setSpacing(0);
connect(sp->yAxis, SIGNAL(rangeChanged(QCPRange)), sp->yAxis2, SLOT(setRange(QCPRange)));
m_context_menu.addAction(m_ui->actionReset);
m_context_menu.addSeparator();
m_context_menu.addAction(m_ui->actionMoveRight10);
m_context_menu.addAction(m_ui->actionMoveLeft10);
m_context_menu.addAction(m_ui->actionMoveUp10);
m_context_menu.addAction(m_ui->actionMoveDown10);
m_context_menu.addAction(m_ui->actionMoveRight1);
m_context_menu.addAction(m_ui->actionMoveLeft1);
m_context_menu.addAction(m_ui->actionMoveUp1);
m_context_menu.addAction(m_ui->actionMoveDown1);
m_context_menu.addSeparator();
m_context_menu.addAction(m_ui->actionGoToPacket);
memset(&m_sequence_analysis, 0, sizeof(m_sequence_analysis));
m_ui->showComboBox->blockSignals(true);
m_ui->showComboBox->setCurrentIndex(0);
m_ui->showComboBox->blockSignals(false);
m_sequence_analysis.all_packets = TRUE;
m_sequence_analysis.any_addr = TRUE;
QPushButton * save_bt = m_ui->buttonBox->button(QDialogButtonBox::Save);
save_bt->setText(tr("Save As..."));
// XXX Use recent settings instead
if (parent)
{
resize(parent->width(), parent->height() * 4 / 5);
}
connect(m_ui->horizontalScrollBar, SIGNAL(valueChanged(int)), this, SLOT(hScrollBarChanged(int)));
connect(m_ui->verticalScrollBar, SIGNAL(valueChanged(int)), this, SLOT(vScrollBarChanged(int)));
connect(sp->xAxis2, SIGNAL(rangeChanged(QCPRange)), this, SLOT(xAxisChanged(QCPRange)));
connect(sp->yAxis, SIGNAL(rangeChanged(QCPRange)), this, SLOT(yAxisChanged(QCPRange)));
connect(sp, SIGNAL(mousePress(QMouseEvent*)), this, SLOT(diagramClicked(QMouseEvent*)));
connect(sp, SIGNAL(mouseMove(QMouseEvent*)), this, SLOT(mouseMoved(QMouseEvent*)));
connect(sp, SIGNAL(mouseRelease(QMouseEvent*)), this, SLOT(mouseReleased(QMouseEvent*)));
connect(this, SIGNAL(goToPacket(int)), m_sequence_diagram, SLOT(setSelectedPacket(int)));
disconnect(m_ui->buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
fillDiagram();
}
开发者ID:GZJ,项目名称:wireshark,代码行数:74,代码来源:lbm_uimflow_dialog.cpp
示例14: disconnect
void base_lco::disconnect_nonvirt(naming::id_type const & id)
{
disconnect(id);
}
开发者ID:7ev3n,项目名称:hpx,代码行数:4,代码来源:base_lco.cpp
示例15: disconnect
TelemetryDataRF::~TelemetryDataRF()
{
disconnect();
}
开发者ID:BenGig,项目名称:OpenSimDashServer,代码行数:4,代码来源:TelemetryDataRF.cpp
示例16: clear
/**
* Update all the MetaData and art on an "item-changed" event
**/
void MetaPanel::update( input_item_t *p_item )
{
if( !p_item )
{
clear();
return;
}
/* Don't update if you are in edit mode */
if( b_inEditMode ) return;
p_input = p_item;
char *psz_meta;
#define UPDATE_META( meta, widget ) { \
psz_meta = input_item_Get##meta( p_item ); \
widget->setText( !EMPTY_STR( psz_meta ) ? qfu( psz_meta ) : "" ); \
free( psz_meta ); }
#define UPDATE_META_INT( meta, widget ) { \
psz_meta = input_item_Get##meta( p_item ); \
if( !EMPTY_STR( psz_meta ) ) \
widget->setValue( atoi( psz_meta ) ); } \
free( psz_meta );
/* Name / Title */
psz_meta = input_item_GetTitleFbName( p_item );
if( psz_meta )
{
title_text->setText( qfu( psz_meta ) );
free( psz_meta );
}
else
title_text->setText( "" );
/* URL / URI */
psz_meta = input_item_GetURI( p_item );
if( !EMPTY_STR( psz_meta ) )
emit uriSet( qfu( psz_meta ) );
fingerprintButton->setVisible( Chromaprint::isSupported( QString( psz_meta ) ) );
free( psz_meta );
/* Other classic though */
UPDATE_META( Artist, artist_text );
UPDATE_META( Genre, genre_text );
UPDATE_META( Copyright, copyright_text );
UPDATE_META( Album, collection_text );
disconnect( description_text, SIGNAL(textChanged()), this,
SLOT(enterEditMode()) );
UPDATE_META( Description, description_text );
CONNECT( description_text, textChanged(), this, enterEditMode() );
UPDATE_META( Language, language_text );
UPDATE_META( NowPlaying, nowplaying_text );
UPDATE_META( Publisher, publisher_text );
UPDATE_META( EncodedBy, encodedby_text );
UPDATE_META( Date, date_text );
UPDATE_META( TrackNum, seqnum_text );
UPDATE_META( TrackTotal, seqtot_text );
// UPDATE_META( Setting, setting_text );
// UPDATE_META_INT( Rating, rating_text );
/* URL */
psz_meta = input_item_GetURL( p_item );
if( !EMPTY_STR( psz_meta ) )
{
QString newURL = qfu(psz_meta);
if( currentURL != newURL )
{
currentURL = newURL;
lblURL->setText( "<a href='" + currentURL + "'>" +
currentURL.remove( QRegExp( ".*://") ) + "</a>" );
}
}
free( psz_meta );
#undef UPDATE_META_INT
#undef UPDATE_META
// If a artURL is available as a local file, directly display it !
QString file;
char *psz_art = input_item_GetArtURL( p_item );
if( psz_art )
{
char *psz = vlc_uri2path( psz_art );
free( psz_art );
file = qfu( psz );
free( psz );
}
art_cover->showArtUpdate( file );
art_cover->setItem( p_item );
}
开发者ID:mingyueqingquan,项目名称:vlc,代码行数:95,代码来源:info_panels.cpp
示例17: disconnect
DictClient::~DictClient()
{
disconnect();
}
开发者ID:Forever-Young,项目名称:mstardict,代码行数:4,代码来源:dict_client.cpp
示例18: g_debug
bool DictClient::parse(gchar *line, int status_code)
{
g_debug("get %s\n", line);
if (!cmd_.get()) {
if (status_code == STATUS_CONNECT)
is_connected_ = true;
else if (status_code == STATUS_SERVER_DOWN ||
status_code == STATUS_SHUTDOWN) {
gchar *mes =
g_strdup_printf("Unable to connect to the "
"dictionary server at '%s:%d'. "
"The server replied with code"
" %d (server down)",
host_.c_str(), port_,
status_code);
on_error_.emit(mes);
g_free(mes);
return true;
} else {
gchar *mes =
g_strdup_printf("Unable to parse the dictionary"
" server reply: '%s'", line);
on_error_.emit(mes);
g_free(mes);
return false;
}
}
bool success = false;
switch (status_code) {
case STATUS_BAD_PARAMETERS:
{
gchar *mes = g_strdup_printf("Bad parameters for command '%s'",
cmd_->query().c_str());
on_error_.emit(mes);
g_free(mes);
cmd_->state_ = DICT::Cmd::FINISH;
break;
}
case STATUS_BAD_COMMAND:
{
gchar *mes = g_strdup_printf("Bad command '%s'",
cmd_->query().c_str());
on_error_.emit(mes);
g_free(mes);
cmd_->state_ = DICT::Cmd::FINISH;
break;
}
default:
success = true;
break;
}
if (cmd_->state_ == DICT::Cmd::START) {
GError *err = NULL;
cmd_->send(channel_, err);
if (err) {
on_error_.emit(err->message);
g_error_free(err);
return false;
}
return true;
}
if (status_code == STATUS_OK || cmd_->state_ == DICT::Cmd::FINISH ||
status_code == STATUS_NO_MATCH ||
status_code == STATUS_BAD_DATABASE ||
status_code == STATUS_BAD_STRATEGY ||
status_code == STATUS_NO_DATABASES_PRESENT ||
status_code == STATUS_NO_STRATEGIES_PRESENT) {
defmap_.clear();
const DICT::DefList& res = cmd_->result();
if (simple_lookup_) {
IndexList ilist(res.size());
for (size_t i = 0; i < res.size(); ++i) {
ilist[i] = last_index_;
defmap_.insert(std::make_pair(last_index_++, res[i]));
}
last_index_ = 0;
cmd_.reset(0);
disconnect();
on_simple_lookup_end_.emit(ilist);
} else {
StringList slist;
for (size_t i = 0; i < res.size(); ++i)
slist.push_back(res[i].word_);
last_index_ = 0;
cmd_.reset(0);
disconnect();
on_complex_lookup_end_.emit(slist);
}
return success;
}
if (!cmd_->parse(line, status_code))
return false;
//.........这里部分代码省略.........
开发者ID:Forever-Young,项目名称:mstardict,代码行数:101,代码来源:dict_client.cpp
示例19: disconnect
void ThreadedGLWidgetWrapper::stopTriggerTimer()
{
tTriggerTimer.stop();
disconnect(&tTriggerTimer, SIGNAL(timeout()), this, SLOT(incrementTriggerCount()));
}
开发者ID:svengijsen,项目名称:BrainStim,代码行数:5,代码来源:threadedglwidgetwrapper.cpp
示例20: disconnect
void CloseEventFilter::cancelStopApplication()
{
disconnect(m_downloadManager, &DownloadManager::allTransfersCompleted,
this, &CloseEventFilter::stopApplication);
m_shutdownWatchdog.stop();
}
开发者ID:sailfishos,项目名称:sailfish-browser,代码行数:6,代码来源:closeeventfilter.cpp
注:本文中的disconnect函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论