1
0
Эх сурвалжийг харах

Fix for registering global clips with long descriptions

Scott Brogden 4 жил өмнө
parent
commit
3970fc3923
2 өөрчлөгдсөн 3 нэмэгдсэн , 3 устгасан
  1. 2 3
      CP_Main.cpp
  2. 1 0
      HotKeys.cpp

+ 2 - 3
CP_Main.cpp

@@ -482,16 +482,15 @@ void CCP_MainApp::LoadGlobalClips()
 	try
 	{
 		{
-			CppSQLite3Query q = m_db.execQuery(_T("SELECT lID, lShortCut, mText FROM Main WHERE lShortCut > 0 AND globalShortCut = 1"));
+			CppSQLite3Query q = m_db.execQuery(_T("SELECT lID, lShortCut FROM Main WHERE lShortCut > 0 AND globalShortCut = 1"));
 
 			while(q.eof() == false)
 			{
 				int id = q.getIntField(_T("lID"));
 				int shortcut = q.getIntField(_T("lShortCut"));
-				CString desc = q.getStringField(_T("mText"));
 
 				//Constructor will add to a global list and free
-				CHotKey* globalHotKey = new CHotKey(desc, shortcut, true, CHotKey::PASTE_OPEN_CLIP);
+				CHotKey* globalHotKey = new CHotKey(StrF(_T("GlobalClip: %d"), id), shortcut, true, CHotKey::PASTE_OPEN_CLIP);
 				if(globalHotKey != NULL)
 				{
 					globalHotKey->m_clipId = id;

+ 1 - 0
HotKeys.cpp

@@ -27,6 +27,7 @@ CHotKey::CHotKey(CString name, DWORD defKey, bool bUnregOnShowDitto, HotKeyType
 CHotKey::~CHotKey()
 {
 	Unregister();
+	::GlobalDeleteAtom(m_Atom);
 }
 
 CString CHotKey::GetHotKeyDisplay()