本文整理汇总了C++中delSetting函数的典型用法代码示例。如果您正苦于以下问题:C++ delSetting函数的具体用法?C++ delSetting怎么用?C++ delSetting使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了delSetting函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: mir_snprintf
DWORD CMraProto::MraSetXStatusInternal(DWORD dwXStatus)
{
if (IsXStatusValid(dwXStatus)) {
CMStringW szBuff;
// obsolete (TODO: remove in next version)
char szValueName[MAX_PATH];
mir_snprintf(szValueName, SIZEOF(szValueName), "XStatus%ldName", dwXStatus);
if (!mraGetStringW(NULL, szValueName, szBuff))
szBuff = lpcszXStatusNameDef[dwXStatus];
mraSetStringExW(NULL, DBSETTING_XSTATUSNAME, szBuff);
// obsolete (TODO: remove in next version)
mir_snprintf(szValueName, SIZEOF(szValueName), "XStatus%ldMsg", dwXStatus);
if (mraGetStringW(NULL, szValueName, szBuff))
mraSetStringExW(NULL, DBSETTING_XSTATUSMSG, szBuff);
else
delSetting(DBSETTING_XSTATUSMSG);
}
else {
delSetting(DBSETTING_XSTATUSNAME);
delSetting(DBSETTING_XSTATUSMSG);
dwXStatus = MRA_MIR_XSTATUS_NONE;
}
DWORD dwOldStatusMode = InterlockedExchange((volatile LONG*)&m_iXStatus, dwXStatus);
setByte(DBSETTING_XSTATUSID, (BYTE)dwXStatus);
MraSendNewStatus(m_iStatus, dwXStatus, _T(""), _T(""));
return dwOldStatusMode;
}
开发者ID:martok,项目名称:miranda-ng,代码行数:32,代码来源:Mra_svcs.cpp
示例2: passw
void CJabberProto::ConvertPasswords()
{
ptrT passw(JSetStringCrypt(m_szModuleName, NULL, "LoginPassword"));
if (passw == NULL)
return;
setTString("Password", passw);
delSetting("LoginPassword");
for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
if ((passw = JSetStringCrypt(m_szModuleName, hContact, "LoginPassword")) == NULL)
continue;
setTString(hContact, "Password", passw);
delSetting(hContact, "LoginPassword");
}
for (int i = 0;; i++) {
char varName[100];
mir_snprintf(varName, sizeof(varName), "rcMuc_%d_server", i);
ptrA str(getStringA(NULL, varName));
if (str == NULL)
break;
mir_snprintf(varName, sizeof(varName), "rcMuc_%d", i);
if ((passw = JSetStringCrypt(m_szModuleName, NULL, varName)) != NULL) {
delSetting(varName);
mir_snprintf(varName, sizeof(varName), "password_rcMuc_%d", i);
setTString(varName, passw);
}
}
}
开发者ID:MrtsComputers,项目名称:miranda-ng,代码行数:33,代码来源:jabber_std.cpp
示例3: delSetting
void CSteamProto::DeleteAuthSettings()
{
delSetting("TwoFactorCode");
delSetting("GuardId");
delSetting("GuardCode");
delSetting("CaptchaId");
delSetting("CaptchaText");
}
开发者ID:ybznek,项目名称:miranda-ng,代码行数:8,代码来源:steam_login.cpp
示例4: setWord
void CYahooProto::logoff_buddies()
{
//set all contacts to 'offline'
for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
setWord(hContact, "Status", ID_STATUS_OFFLINE);
setDword(hContact, "IdleTS", 0);
setDword(hContact, "PictLastCheck", 0);
setDword(hContact, "PictLoading", 0);
db_unset(hContact, "CList", "StatusMsg");
delSetting(hContact, "YMsg");
delSetting(hContact, "YGMsg");
}
}
开发者ID:ybznek,项目名称:miranda-ng,代码行数:13,代码来源:services.cpp
示例5: setWord
void CJabberProto::SetContactOfflineStatus(MCONTACT hContact)
{
if (getWord(hContact, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE)
setWord(hContact, "Status", ID_STATUS_OFFLINE);
delSetting(hContact, DBSETTING_XSTATUSID);
delSetting(hContact, DBSETTING_XSTATUSNAME);
delSetting(hContact, DBSETTING_XSTATUSMSG);
delSetting(hContact, DBSETTING_DISPLAY_UID);
ResetAdvStatus(hContact, ADVSTATUS_MOOD);
ResetAdvStatus(hContact, ADVSTATUS_TUNE);
}
开发者ID:kxepal,项目名称:miranda-ng,代码行数:13,代码来源:jabber_misc.cpp
示例6: delSetting
void CSteamProto::HandleTokenExpired()
{
// Delete expired token
delSetting("TokenSecret");
// Try to relogin automatically (but only once)
if (isLoginAgain) {
// Notify error to user
ShowNotification(_T("Steam"), TranslateT("Cannot obtain connection token."));
// Just go offline; it also resets the isLoginAgain to false
SetStatus(ID_STATUS_OFFLINE);
}
else
{
// Remember we are trying to relogin
isLoginAgain = true;
// Remember status user wanted
int desiredStatus = m_iDesiredStatus;
// Set status to offline
SetStatus(ID_STATUS_OFFLINE);
// Try to login again automatically
SetStatus(desiredStatus);
}
}
开发者ID:kxepal,项目名称:miranda-ng,代码行数:28,代码来源:steam_login.cpp
示例7: s
void MinecraftDynmapProto::SignOffWorker(void*)
{
ScopedLock s(signon_lock_);
SetEvent(events_loop_event_);
m_cookie.clear();
m_title.clear();
m_server.clear();
m_timestamp.clear();
int old_status = m_iStatus;
m_iStatus = ID_STATUS_OFFLINE;
Netlib_Shutdown(hEventsConnection);
OnLeaveChat(NULL, NULL);
delSetting("LogonTS");
ProtoBroadcastAck(0, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)old_status, m_iStatus);
//SetAllContactStatuses(ID_STATUS_OFFLINE);
//ToggleStatusMenuItems(false);
if (hConnection)
Netlib_CloseHandle(hConnection);
hConnection = NULL;
if (hEventsConnection)
Netlib_CloseHandle(hEventsConnection);
hEventsConnection = NULL;
}
开发者ID:kxepal,项目名称:miranda-ng,代码行数:33,代码来源:communication.cpp
示例8: DBCreateContact
void CJabberProto::DBAddAuthRequest(const TCHAR *jid, const TCHAR *nick)
{
MCONTACT hContact = DBCreateContact(jid, nick, TRUE, TRUE);
delSetting(hContact, "Hidden");
char* szJid = mir_utf8encodeT(jid);
char* szNick = mir_utf8encodeT(nick);
//blob is: uin(DWORD), hContact(DWORD), nick(ASCIIZ), first(ASCIIZ), last(ASCIIZ), email(ASCIIZ), reason(ASCIIZ)
//blob is: 0(DWORD), hContact(DWORD), nick(ASCIIZ), ""(ASCIIZ), ""(ASCIIZ), email(ASCIIZ), ""(ASCIIZ)
DBEVENTINFO dbei = { sizeof(DBEVENTINFO) };
dbei.szModule = m_szModuleName;
dbei.timestamp = (DWORD)time(NULL);
dbei.flags = DBEF_UTF;
dbei.eventType = EVENTTYPE_AUTHREQUEST;
dbei.cbBlob = (DWORD)(sizeof(DWORD)*2 + strlen(szNick) + strlen(szJid) + 5);
PBYTE pCurBlob = dbei.pBlob = (PBYTE)mir_alloc(dbei.cbBlob);
*((PDWORD)pCurBlob) = 0; pCurBlob += sizeof(DWORD);
*((PDWORD)pCurBlob) = (DWORD)hContact; pCurBlob += sizeof(DWORD);
strcpy((char*)pCurBlob, szNick); pCurBlob += strlen(szNick)+1;
*pCurBlob = '\0'; pCurBlob++; //firstName
*pCurBlob = '\0'; pCurBlob++; //lastName
strcpy((char*)pCurBlob, szJid); pCurBlob += strlen(szJid)+1;
*pCurBlob = '\0'; //reason
db_event_add(NULL, &dbei);
debugLogA("Setup DBAUTHREQUEST with nick='%s' jid='%s'", szNick, szJid);
mir_free(szJid);
mir_free(szNick);
}
开发者ID:0xmono,项目名称:miranda-ng,代码行数:31,代码来源:jabber_misc.cpp
示例9: mir_snprintf
void CJabberProto::SearchDeleteFromRecent(const TCHAR *szAddr, BOOL deleteLastFromDB)
{
//search in recent
for (int i=0; i<10; i++) {
char key[30];
mir_snprintf(key, SIZEOF(key), "RecentlySearched_%d", i);
ptrT szValue( getTStringA(key));
if (szValue == NULL || _tcsicmp(szAddr, szValue))
continue;
for (int j=i; j < 10; j++) {
mir_snprintf(key, SIZEOF(key), "RecentlySearched_%d", j + 1);
szValue = getTStringA(key);
if (szValue != NULL) {
mir_snprintf(key, SIZEOF(key), "RecentlySearched_%d", j);
setTString(NULL, key, szValue);
}
else {
if (deleteLastFromDB) {
mir_snprintf(key, SIZEOF(key), "RecentlySearched_%d", j);
delSetting(NULL,key);
}
break;
} }
break;
} }
开发者ID:0xmono,项目名称:miranda-ng,代码行数:26,代码来源:jabber_search.cpp
示例10: setTString
void CSkypeProto::UpdateProfileLastName(const JSONNode &root, MCONTACT hContact)
{
CMString lastname = root["lastname"].as_mstring();
if (!lastname.IsEmpty() && lastname != "null")
setTString(hContact, "LastName", lastname);
else
delSetting(hContact, "LastName");
}
开发者ID:kxepal,项目名称:miranda-ng,代码行数:8,代码来源:skype_profile.cpp
示例11: setByte
void CSkypeProto::UpdateProfileGender(const JSONNode &root, MCONTACT hContact)
{
CMString gender = root["gender"].as_mstring();
if (!gender.IsEmpty() && gender != "null")
setByte(hContact, "Gender", (BYTE)(_ttoi(gender) == 1 ? 'M' : 'F'));
else
delSetting(hContact, "Gender");
}
开发者ID:kxepal,项目名称:miranda-ng,代码行数:8,代码来源:skype_profile.cpp
示例12: delSetting
void CVkProto::ConnectionFailed(int iReason)
{
delSetting("AccessToken");
ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, iReason);
debugLogA("CVkProto::ConnectionFailed ShutdownSession");
ShutdownSession();
}
开发者ID:gloria8023,项目名称:miranda-ng,代码行数:8,代码来源:vk_thread.cpp
示例13: _stscanf
void CSkypeProto::UpdateProfileBirthday(const JSONNode &root, MCONTACT hContact)
{
CMString birthday = root["birthday"].as_mstring();
if (!birthday.IsEmpty() && birthday != "null")
{
int d, m, y;
_stscanf(birthday.GetBuffer(), _T("%d-%d-%d"), &y, &m, &d);
setWord(hContact, "BirthYear", y);
setByte(hContact, "BirthDay", d);
setByte(hContact, "BirthMonth", m);
}
else
{
delSetting(hContact, "BirthYear");
delSetting(hContact, "BirthDay");
delSetting(hContact, "BirthMonth");
}
}
开发者ID:kxepal,项目名称:miranda-ng,代码行数:18,代码来源:skype_profile.cpp
示例14: mir_sntprintf
void CMsnProto::MSN_GetAvatarFileName(MCONTACT hContact, TCHAR* pszDest, size_t cbLen, const TCHAR *ext)
{
size_t tPathLen = mir_sntprintf(pszDest, cbLen, _T("%s\\%S"), VARST(_T("%miranda_avatarcache%")), m_szModuleName);
if (_taccess(pszDest, 0))
CreateDirectoryTreeT(pszDest);
size_t tPathLen2 = tPathLen;
if (hContact != NULL) {
DBVARIANT dbv;
if (getString(hContact, "PictContext", &dbv) == 0) {
char* szAvatarHash = MSN_GetAvatarHash(dbv.pszVal);
if (szAvatarHash != NULL) {
TCHAR *sztAvatarHash = mir_a2t(szAvatarHash);
tPathLen += mir_sntprintf(pszDest + tPathLen, cbLen - tPathLen, _T("\\%s."), sztAvatarHash);
mir_free(sztAvatarHash);
mir_free(szAvatarHash);
}
else {
delSetting(hContact, "PictContext");
if (cbLen) pszDest[0] = 0;
}
db_free(&dbv);
}
else if (cbLen)
pszDest[0] = 0;
}
else {
TCHAR *sztModuleName = mir_a2t(m_szModuleName);
tPathLen += mir_sntprintf(pszDest + tPathLen, cbLen - tPathLen, _T("\\%s avatar."), sztModuleName);
mir_free(sztModuleName);
}
if (ext == NULL) {
mir_sntprintf(pszDest + tPathLen, cbLen - tPathLen, _T("*"));
bool found = false;
_tfinddata_t c_file;
long hFile = _tfindfirst(pszDest, &c_file);
if (hFile > -1L) {
do {
if (_tcsrchr(c_file.name, '.')) {
mir_sntprintf(pszDest + tPathLen2, cbLen - tPathLen2, _T("\\%s"), c_file.name);
found = true;
}
}
while(_tfindnext(hFile, &c_file) == 0);
_findclose( hFile );
}
if (!found) pszDest[0] = 0;
}
else {
tPathLen--;
mir_sntprintf(pszDest + tPathLen, cbLen - tPathLen, ext);
}
}
开发者ID:0xmono,项目名称:miranda-ng,代码行数:57,代码来源:msn_misc.cpp
示例15: MSN_GetAvatarFileName
INT_PTR CMsnProto::SetAvatar(WPARAM, LPARAM lParam)
{
TCHAR* szFileName = (TCHAR*)lParam;
TCHAR tFileName[MAX_PATH];
MSN_GetAvatarFileName(NULL, tFileName, _countof(tFileName), NULL);
_tremove(tFileName);
if (szFileName == NULL) {
delSetting("PictObject");
delSetting("AvatarHash");
ForkThread(&CMsnProto::msn_storeAvatarThread, NULL);
}
else {
int fileId = _topen(szFileName, _O_RDONLY | _O_BINARY, _S_IREAD);
if (fileId < 0) return 1;
size_t dwPngSize = _filelengthi64(fileId);
unsigned char* pData = (unsigned char*)mir_alloc(dwPngSize);
if (pData == NULL) {
_close(fileId);
return 2;
}
_read(fileId, pData, (unsigned)dwPngSize);
_close(fileId);
TCHAR drive[_MAX_DRIVE], dir[_MAX_DIR], fname[_MAX_FNAME], ext[_MAX_EXT];
_tsplitpath(szFileName, drive, dir, fname, ext);
MSN_SetMyAvatar(fname, pData, dwPngSize);
StoreAvatarData* par = (StoreAvatarData*)mir_alloc(sizeof(StoreAvatarData));
par->szName = mir_tstrdup(fname);
par->data = pData;
par->dataSize = dwPngSize;
par->szMimeType = "image/png";
ForkThread(&CMsnProto::msn_storeAvatarThread, par);
}
MSN_SetServerStatus(m_iStatus);
return 0;
}
开发者ID:kxepal,项目名称:miranda-ng,代码行数:44,代码来源:msn_svcs.cpp
示例16: setString
void CSkypeProto::UpdateProfileCountry(const JSONNode &root, MCONTACT hContact)
{
std::string isocode = root["country"].as_string();
if (!isocode.empty() && isocode != "null")
{
char *country = (char *)CallService(MS_UTILS_GETCOUNTRYBYISOCODE, (WPARAM)isocode.c_str(), 0);
setString(hContact, "Country", country);
}
else delSetting(hContact, "Country");
}
开发者ID:kxepal,项目名称:miranda-ng,代码行数:10,代码来源:skype_profile.cpp
示例17: mir_free
INT_PTR CMsnProto::SetCurrentMedia(WPARAM, LPARAM lParam)
{
// Clear old info
mir_free(msnCurrentMedia.ptszArtist);
mir_free(msnCurrentMedia.ptszAlbum);
mir_free(msnCurrentMedia.ptszTitle);
mir_free(msnCurrentMedia.ptszTrack);
mir_free(msnCurrentMedia.ptszYear);
mir_free(msnCurrentMedia.ptszGenre);
mir_free(msnCurrentMedia.ptszLength);
mir_free(msnCurrentMedia.ptszPlayer);
mir_free(msnCurrentMedia.ptszType);
memset(&msnCurrentMedia, 0, sizeof(msnCurrentMedia));
// Copy new info
LISTENINGTOINFO *cm = (LISTENINGTOINFO *)lParam;
if (cm != NULL && cm->cbSize == sizeof(LISTENINGTOINFO) && (cm->ptszArtist != NULL || cm->ptszTitle != NULL)) {
bool unicode = (cm->dwFlags & LTI_UNICODE) != 0;
msnCurrentMedia.cbSize = sizeof(msnCurrentMedia); // Marks that there is info set
msnCurrentMedia.dwFlags = LTI_TCHAR;
overrideStr(msnCurrentMedia.ptszType, cm->ptszType, unicode, _T("Music"));
overrideStr(msnCurrentMedia.ptszArtist, cm->ptszArtist, unicode);
overrideStr(msnCurrentMedia.ptszAlbum, cm->ptszAlbum, unicode);
overrideStr(msnCurrentMedia.ptszTitle, cm->ptszTitle, unicode, _T("No Title"));
overrideStr(msnCurrentMedia.ptszTrack, cm->ptszTrack, unicode);
overrideStr(msnCurrentMedia.ptszYear, cm->ptszYear, unicode);
overrideStr(msnCurrentMedia.ptszGenre, cm->ptszGenre, unicode);
overrideStr(msnCurrentMedia.ptszLength, cm->ptszLength, unicode);
overrideStr(msnCurrentMedia.ptszPlayer, cm->ptszPlayer, unicode);
}
// Set user text
if (msnCurrentMedia.cbSize == 0)
delSetting("ListeningTo");
else {
TCHAR *text;
if (ServiceExists(MS_LISTENINGTO_GETPARSEDTEXT))
text = (TCHAR *)CallService(MS_LISTENINGTO_GETPARSEDTEXT, (WPARAM)_T("%title% - %artist%"), (LPARAM)&msnCurrentMedia);
else {
text = (TCHAR *)mir_alloc(128 * sizeof(TCHAR));
mir_sntprintf(text, 128, _T("%s - %s"), (msnCurrentMedia.ptszTitle ? msnCurrentMedia.ptszTitle : _T("")),
(msnCurrentMedia.ptszArtist ? msnCurrentMedia.ptszArtist : _T("")));
}
setTString("ListeningTo", text);
mir_free(text);
}
// Send it
char** msgptr = GetStatusMsgLoc(m_iDesiredStatus);
MSN_SendStatusMessage(msgptr ? *msgptr : NULL);
return 0;
}
开发者ID:kxepal,项目名称:miranda-ng,代码行数:55,代码来源:msn_svcs.cpp
示例18: delSetting
int CSteamProto::OnIdleChanged(WPARAM, LPARAM lParam)
{
bool idle = (lParam & IDF_ISIDLE) != 0;
bool privacy = (lParam & IDF_PRIVACY) != 0;
// Respect user choice about (not) notifying idle to protocols
if (privacy)
{
// Reset it to 0 if there is some time already
if (m_idleTS)
{
m_idleTS = 0;
delSetting("IdleTS");
}
return 0;
}
// We don't want to reset idle time when we're already in idle state
if (idle && m_idleTS > 0)
return 0;
if (idle)
{
// User started being idle
MIRANDA_IDLE_INFO mii = { sizeof(mii) };
CallService(MS_IDLE_GETIDLEINFO, 0, (LPARAM)&mii);
// Compute time when user really became idle
m_idleTS = time(0) - mii.idleTime * 60;
setDword("IdleTS", m_idleTS);
}
else
{
// User stopped being idle
m_idleTS = 0;
delSetting("IdleTS");
}
return 0;
}
开发者ID:kxepal,项目名称:miranda-ng,代码行数:41,代码来源:steam_events.cpp
示例19: isChatRoom
INT_PTR __cdecl CJabberProto::OnMenuConvertChatContact(WPARAM hContact, LPARAM)
{
BYTE bIsChatRoom = isChatRoom(hContact);
const char *szSetting = (bIsChatRoom) ? "ChatRoomID" : "jid";
ptrT jid(getTStringA(hContact, szSetting));
if (jid != NULL) {
delSetting(hContact, szSetting);
setTString(hContact, szSetting, jid);
setByte(hContact, "ChatRoom", !bIsChatRoom);
}
return 0;
}
开发者ID:Seldom,项目名称:miranda-ng,代码行数:13,代码来源:jabber_menu.cpp
示例20: updateStringUtf
void FacebookProto::SaveName(MCONTACT hContact, const facebook_user *fbu)
{
if (fbu->type == CONTACT_PAGE) {
// Page has only nickname and no first/last names
std::string nick = m_pagePrefix + " " + fbu->real_name;
updateStringUtf(this, hContact, FACEBOOK_KEY_NICK, nick);
delSetting(hContact, FACEBOOK_KEY_FIRST_NAME);
delSetting(hContact, FACEBOOK_KEY_SECOND_NAME);
delSetting(hContact, FACEBOOK_KEY_LAST_NAME);
return;
}
// Save nick
std::string nick = fbu->real_name;
if (!getBool(FACEBOOK_KEY_NAME_AS_NICK, 1) && !fbu->nick.empty())
nick = fbu->nick;
updateStringUtf(this, hContact, FACEBOOK_KEY_NICK, nick);
// Explode whole name into first, second and last name
std::vector<std::string> names;
utils::text::explode(fbu->real_name, " ", &names);
updateStringUtf(this, hContact, FACEBOOK_KEY_FIRST_NAME, names.size() > 0 ? names.front().c_str() : "");
updateStringUtf(this, hContact, FACEBOOK_KEY_LAST_NAME, names.size() > 1 ? names.back().c_str() : "");
std::string middle;
if (names.size() > 2) {
for (std::string::size_type i = 1; i < names.size() - 1; i++) {
if (!middle.empty())
middle += " ";
middle += names.at(i);
}
}
updateStringUtf(this, hContact, FACEBOOK_KEY_SECOND_NAME, middle);
}
开发者ID:ybznek,项目名称:miranda-ng,代码行数:38,代码来源:contacts.cpp
注:本文中的delSetting函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论