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

fix for showing description when clip is loaded from thread

scott brogden 8 жил өмнө
parent
commit
f65e79485f
3 өөрчлөгдсөн 8 нэмэгдсэн , 5 устгасан
  1. 6 4
      QListCtrl.cpp
  2. 1 1
      QListCtrl.h
  3. 1 0
      QPasteWnd.cpp

+ 6 - 4
QListCtrl.cpp

@@ -904,21 +904,21 @@ void CQListCtrl::LoadCopyOrCutToClipboard()
 	g_Opt.m_bUpdateTimeOnPaste = bItWas;
 	g_Opt.m_bUpdateTimeOnPaste = bItWas;
 }
 }
 
 
-bool CQListCtrl::PostEventLoadedCheckDescription()
+bool CQListCtrl::PostEventLoadedCheckDescription(int updatedRow)
 {
 {
 	bool loadedClip = false;
 	bool loadedClip = false;
 
 
-	int clipRow = this->GetCaret();
-
 	if (VALID_TOOLTIP)
 	if (VALID_TOOLTIP)
 	{
 	{
 		int toolTipClipId = m_pToolTip->GetClipId();
 		int toolTipClipId = m_pToolTip->GetClipId();
 		int toolTipClipRow = m_pToolTip->GetClipRow();
 		int toolTipClipRow = m_pToolTip->GetClipRow();
 
 
+		log(StrF(_T("PostEventLoadedCheckDescription refreshRow: %d tt_row: %d tt_id: %d"), updatedRow, toolTipClipRow, toolTipClipId));
+
 		//We tried to show the clip but we didn't have the id yet, it was loaded in a thread, now it's being updated
 		//We tried to show the clip but we didn't have the id yet, it was loaded in a thread, now it's being updated
 		//see if we need to show this rows description
 		//see if we need to show this rows description
 		if (toolTipClipId <= 0 &&
 		if (toolTipClipId <= 0 &&
-			toolTipClipRow == clipRow &&
+			toolTipClipRow == updatedRow &&
 			::IsWindow(m_toolTipHwnd))
 			::IsWindow(m_toolTipHwnd))
 		{
 		{
 			ShowFullDescription(false, true);
 			ShowFullDescription(false, true);
@@ -939,6 +939,8 @@ bool CQListCtrl::ShowFullDescription(bool bFromAuto, bool fromNextPrev)
 	int clipRow = this->GetCaret();
 	int clipRow = this->GetCaret();
 	int clipId = this->GetItemData(clipRow);
 	int clipId = this->GetItemData(clipRow);
 
 
+	log(StrF(_T("Show full description row: %d id: %d"), clipRow, clipId));
+
 	if(VALID_TOOLTIP && 
 	if(VALID_TOOLTIP && 
 		m_pToolTip->GetClipId() == clipId &&
 		m_pToolTip->GetClipId() == clipId &&
 		::IsWindow(m_toolTipHwnd))
 		::IsWindow(m_toolTipHwnd))

+ 1 - 1
QListCtrl.h

@@ -131,7 +131,7 @@ public:
 
 
 	void DestroyAndCreateAccelerator(BOOL bCreate, CppSQLite3DB &db);
 	void DestroyAndCreateAccelerator(BOOL bCreate, CppSQLite3DB &db);
 
 
-	bool PostEventLoadedCheckDescription();
+	bool PostEventLoadedCheckDescription(int updatedRow);
 	bool ShowFullDescription(bool bFromAuto = false, bool fromNextPrev = false);
 	bool ShowFullDescription(bool bFromAuto = false, bool fromNextPrev = false);
 	BOOL SetItemCountEx(int iCount, DWORD dwFlags = 0);
 	BOOL SetItemCountEx(int iCount, DWORD dwFlags = 0);
 
 

+ 1 - 0
QPasteWnd.cpp

@@ -5198,6 +5198,7 @@ LRESULT CQPasteWnd::OnRefeshRow(WPARAM wParam, LPARAM lParam)
 	if(listPos >= topIndex && listPos <= lastIndex)
 	if(listPos >= topIndex && listPos <= lastIndex)
 	{
 	{
 		m_lstHeader.RefreshRow(listPos);
 		m_lstHeader.RefreshRow(listPos);
+		m_lstHeader.PostEventLoadedCheckDescription(listPos);
 	}
 	}
 
 
 	if(clipId == -2)
 	if(clipId == -2)