本文整理汇总了C++中KviCString::sprintf方法的典型用法代码示例。如果您正苦于以下问题:C++ KviCString::sprintf方法的具体用法?C++ KviCString::sprintf怎么用?C++ KviCString::sprintf使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KviCString
的用法示例。
在下文中一共展示了KviCString::sprintf方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: kvi_ipcLoadAtoms
static void kvi_ipcLoadAtoms()
{
if(g_bIpcAtomsLoaded)
return;
g_bIpcAtomsLoaded = true;
g_uLocalInstanceId = (kvi_u64_t)::getpid();
kvi_sentinel_id.sprintf("pane tonno e mistero - %d", getuid());
kvi_atom_ipc_sentinel_window = XInternAtom(kvi_ipc_get_xdisplay(), "XA_KVI4_IPC_SENTINEL_WINDOW", False);
kvi_atom_ipc_remote_command = XInternAtom(kvi_ipc_get_xdisplay(), "XA_KVI4_IPC_REMOTE_COMMAND", False);
kvi_atom_ipc_remote_message = XInternAtom(kvi_ipc_get_xdisplay(), "XA_KVI4_IPC_REMOTE_MESSAGE", False);
}
示例2: save
void OptionsWidget_messageColors::save()
{
QString szName;
QString szInit;
g_pApp->getLocalKvircDirectory(szInit,KviApplication::MsgColors);
if(KviFileDialog::askForSaveFileName(szName,__tr2qs_ctx("Choose a Filename - KVIrc","options"),szInit))
{
if(m_pLastItem)saveLastItem();
KviConfigurationFile cfg(szName,KviConfigurationFile::Write);
cfg.setGroup("Messages");
KviCString tmp;
int count = m_pListView->count();
for(int i=0; i<count;i++)
{
MessageListWidgetItem* it = (MessageListWidgetItem *)m_pListView->item(i);
tmp.sprintf("Fore%d",it->optionId());
cfg.writeEntry(tmp.ptr(),it->msgType()->fore());
tmp.sprintf("Back%d",it->optionId());
cfg.writeEntry(tmp.ptr(),it->msgType()->back());
tmp.sprintf("Icon%d",it->optionId());
cfg.writeEntry(tmp.ptr(),it->msgType()->pixId());
tmp.sprintf("Log%d",it->optionId());
cfg.writeEntry(tmp.ptr(),it->msgType()->logEnabled());
tmp.sprintf("Level%d",it->optionId());
cfg.writeEntry(tmp.ptr(),it->msgType()->level());
}
}
}
示例3: load
void KviInputHistory::load(const QString & szFileName)
{
KviConfigurationFile c(szFileName, KviConfigurationFile::Read);
int iCount = c.readIntEntry("Count", 0);
if(iCount > KVI_INPUT_MAX_GLOBAL_HISTORY_ENTRIES)
iCount = KVI_INPUT_MAX_GLOBAL_HISTORY_ENTRIES;
KviCString szTmp;
for(int i = 0; i < iCount; i++)
{
szTmp.sprintf("S%d", i);
QString szEntry = c.readEntry(szTmp.ptr(), "");
if(!szEntry.isEmpty())
add(szEntry);
}
}
示例4: save
void KviInputHistory::save(const QString & szFileName)
{
KviConfigurationFile c(szFileName, KviConfigurationFile::Write);
c.clear();
c.writeEntry("Count", static_cast<unsigned>(m_StringList.size()));
KviCString szTmp;
int iIdx = 0;
for(auto & szString : m_StringList)
{
if(!szString.isEmpty())
{
szTmp.sprintf("S%d", iIdx);
c.writeEntry(szTmp.ptr(), szString);
iIdx++;
}
}
}
示例5: timerSlot
void KviIrcConnectionRequestQueue::timerSlot()
{
if(m_channels.isEmpty())
{
m_timer.stop();
} else {
KviChannelWindow * pChan = m_channels.head();
QByteArray encodedChan = pChan->connection()->encodeText(pChan->target()).data();
/* The following switch will let the execution flow pass-through if any request type
* is currently disabled (or not available on the server). Channel's "MODE" request is
* the only mandatory request.
*/
switch(m_curType)
{
case BanException:
if(pChan->serverInfo()->supportedListModes().contains('e') &&
!KVI_OPTION_BOOL(KviOption_boolDisableBanExceptionListRequestOnJoin) &&
!( pChan->serverInfo()->getNeedsOpToListModeseI() &&
!pChan->isMeOp()
)
)
{
if(!pChan->connection()->sendFmtData("MODE %s e",encodedChan.data()))
clearAll(); // disconnected
else pChan->setSentListRequest('e');
m_curType = Invite;
break;
}
case Invite:
if(pChan->serverInfo()->supportedListModes().contains('I') &&
!KVI_OPTION_BOOL(KviOption_boolDisableInviteListRequestOnJoin) &&
!( pChan->serverInfo()->getNeedsOpToListModeseI() &&
!pChan->isMeOp()
)
)
{
if(!pChan->connection()->sendFmtData("MODE %s I",encodedChan.data()))
clearAll(); // disconnected
else pChan->setSentListRequest('I');
m_curType = QuietBan;
break;
}
case QuietBan:
if(pChan->serverInfo()->supportedListModes().contains('q') &&
!KVI_OPTION_BOOL(KviOption_boolDisableQuietBanListRequestOnJoin))
{
if(!pChan->connection()->sendFmtData("MODE %s q",encodedChan.data()))
clearAll(); // disconnected
else pChan->setSentListRequest('q');
m_curType = Who;
break;
}
case Who:
if(!KVI_OPTION_BOOL(KviOption_boolDisableWhoRequestOnJoin))
{
// TODO: cleanup
pChan->connection()->stateData()->setLastSentChannelWhoRequest(kvi_unixTime());
if(pChan->connection()->lagMeter())
{
KviCString tmp;
if(pChan->serverInfo()->supportsWhox())
tmp.sprintf("WHO %s %acdfhlnrsu",encodedChan.data());
else
tmp.sprintf("WHO %s",encodedChan.data());
pChan->connection()->lagMeter()->lagCheckRegister(tmp.ptr(),60);
}
if(pChan->serverInfo()->supportsWhox())
{
if(!pChan->connection()->sendFmtData("WHO %s %acdfhlnrsu",encodedChan.data()))
clearAll(); // disconnected
else pChan->setSentWhoRequest();
} else {
if(!pChan->connection()->sendFmtData("WHO %s",encodedChan.data()))
clearAll(); // disconnected
else pChan->setSentWhoRequest();
}
m_curType = Ban;
break;
}
case Ban:
if(!KVI_OPTION_BOOL(KviOption_boolDisableBanListRequestOnJoin))
{
if(!pChan->connection()->sendFmtData("MODE %s b",encodedChan.data()))
{
clearAll(); // disconnected
} else {
pChan->setSentListRequest('b');
m_channels.dequeue();
}
m_curType = Mode;
break;
}
default:
// we're at the end of the list
m_channels.dequeue();
pChan->checkChannelSync();
m_curType = Mode;
if(m_channels.isEmpty())
{
m_timer.stop();
//.........这里部分代码省略.........