本文整理汇总了C++中KviCString::isEmpty方法的典型用法代码示例。如果您正苦于以下问题:C++ KviCString::isEmpty方法的具体用法?C++ KviCString::isEmpty怎么用?C++ KviCString::isEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KviCString
的用法示例。
在下文中一共展示了KviCString::isEmpty方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: okClicked
void RegisteredUserMaskDialog::okClicked()
{
KviCString szTmp = m_pNickEdit->text();
if(szTmp.isEmpty())szTmp = "*";
m_pMask->setNick(szTmp.ptr());
szTmp = m_pUserEdit->text();
if(szTmp.isEmpty())szTmp = "*";
m_pMask->setUsername(szTmp.ptr());
szTmp = m_pHostEdit->text();
if(szTmp.isEmpty())szTmp = "*";
m_pMask->setHost(szTmp.ptr());
accept();
}
示例2:
bool KviIpcSentinel::x11GetRemoteMessage()
{
Atom type;
int format;
unsigned long nItems, after;
unsigned char * data = nullptr;
KviCString szData;
if(XGetWindowProperty(kvi_ipc_get_xdisplay(), winId(), kvi_atom_ipc_remote_command,
0, 1024, false, XA_STRING, &type, &format, &nItems, &after, &data) == Success)
{
if((type == XA_STRING) && (format == 8) && (nItems > 8) && data)
{
kvi_u32_t uSenderId = *((kvi_u32_t *)(data));
if(uSenderId != g_uLocalInstanceId)
szData = (char *)(data + 8);
XFree((char *)data);
}
}
if(szData.isEmpty())
return false; // no command, or our own command
kvi_ipcSetRemoteCommand(winId(), "");
if(g_pApp)
g_pApp->ipcMessage(szData.ptr());
return true;
}
示例3: editAllPropertiesClicked
void RegisteredUserEntryDialog::editAllPropertiesClicked()
{
m_pAvatarSelector->commit();
if(m_pAvatar->isNull())
{
m_pPropertyDict->remove("avatar");
} else {
KviCString szPath = m_pAvatar->path();
if(szPath.isEmpty())m_pPropertyDict->remove("avatar");
else m_pPropertyDict->replace("avatar",new QString(szPath));
}
if(m_pNotifyCheck->isChecked())
{
QString szNicks = m_pNotifyNick->text();
if(!szNicks.isEmpty())
{
m_pPropertyDict->replace("notify",new QString(szNicks));
} else {
m_pPropertyDict->remove("notify");
}
} else {
m_pPropertyDict->remove("notify");
}
RegisteredUserPropertiesDialog * dlg = new RegisteredUserPropertiesDialog(this,m_pPropertyDict);
if(dlg->exec() != QDialog::Accepted)
{
delete dlg;
return;
}
delete dlg;
QString * notify = m_pPropertyDict->find("notify");
bool bGotIt = false;
if(notify)
{
if(!notify->isEmpty())
{
bGotIt = true;
m_pNotifyNick->setText(*notify);
}
}
m_pNotifyCheck->setChecked(bGotIt);
m_pNotifyNick->setEnabled(bGotIt);
if(!bGotIt)m_pNotifyNick->setText("");
QString * avatar = m_pPropertyDict->find("avatar");
bGotIt = false;
if(avatar)
{
if(!avatar->isEmpty())
m_pAvatarSelector->setImagePath(*avatar);
}
}
示例4: processHeader
//.........这里部分代码省略.........
)
{
// This is not "OK" and not "Partial content"
// Error, redirect or something confusing
if(m_eProcessingType != HeadersOnly)
{
switch(uStatus)
{
case 301: // Moved permanently
case 302: // Found
case 303: // See Other
case 307: // Temporary Redirect
{
if(!m_bFollowRedirects)
{
resetInternalStatus();
m_szLastError = szResponse.ptr();
emit terminated(false);
return false;
}
m_uRedirectCount++;
if(m_uRedirectCount > m_uMaximumRedirectCount)
{
resetInternalStatus();
m_szLastError = __tr2qs("Too many redirects");
emit terminated(false);
return false;
}
KviCString * headerLocation = hdr.find("Location");
if(!headerLocation || headerLocation->isEmpty())
{
resetInternalStatus();
m_szLastError = __tr2qs("Bad redirect");
emit terminated(false);
return false;
}
KviUrl url;
QString location(headerLocation->ptr());
if(location.startsWith('/'))
{
// relative redirect, use the old url and only update the path
url = m_connectionUrl;
url.setPath(location);
} else {
// absolute redirect
url.setUrl(location);
}
if(
(url.url() == m_connectionUrl.url()) || (url.url() == m_url.url()))
{
resetInternalStatus();
m_szLastError = __tr2qs("Redirect loop");
emit terminated(false);
return false;
}
m_connectionUrl = url;
emit status(__tr2qs("Following Redirect to %1").arg(url.url()));
示例5: load
//.........这里部分代码省略.........
}
// yeah, have some data in this line :D
switch(*begin)
{
case 0:
// empty line
break;
case '#':
// comment: just skip it
break;
case '[':
// group ?
begin++;
if(*begin && (*begin != ']'))
{
char * z = begin;
#define COMPAT_WITH_OLD_CONFIGS
#ifdef COMPAT_WITH_OLD_CONFIGS
// run to the end of the string
while(*z)z++;
// run back to the trailing ']'
while((z > begin) && (*z != ']'))z--;
// if it is not ther just run back to the end of the string
if(*z != ']')while(*z)z++;
#else
// new configs have it always encoded properly
while(*z && (*z != ']'))z++;
#endif
*z = 0;
tmp.hexDecode(begin);
tmp.stripRightWhiteSpace(); // no external spaces in group names
if(!tmp.isEmpty())
{
QString szGroup = m_bLocal8Bit ?
QString::fromLocal8Bit(tmp.ptr(),tmp.len()) :
QString::fromUtf8(tmp.ptr(),tmp.len());
p_group = m_pDict->find(szGroup);
if(!p_group)
{
p_group = new KviConfigurationFileGroup(17,false);
p_group->setAutoDelete(true);
m_pDict->insert(szGroup,p_group);
}
}
}
break;
default:
{
// real data ?
char * z = begin;
while(*z && (*z != '='))z++;
if(*z && (z != begin))
{
*z = 0;
tmp.hexDecode(begin);
tmp.stripRightWhiteSpace(); // No external spaces at all in keys
if(!tmp.isEmpty())
{
QString szKey = m_bLocal8Bit ?
QString::fromLocal8Bit(tmp.ptr(),tmp.len()) :
QString::fromUtf8(tmp.ptr(),tmp.len());
z++;
while(*z && ((*z == ' ') || (*z == '\t')))z++;
if(*z)