当前位置: 首页>>代码示例>>C++>>正文


C++ delSetting函数代码示例

本文整理汇总了C++中delSetting函数的典型用法代码示例。如果您正苦于以下问题:C++ delSetting函数的具体用法?C++ delSetting怎么用?C++ delSetting使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了delSetting函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


注:本文中的delSetting函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。