Browse Source

fixed issue with showing never delete icon when it shouldn't be shown

ScottBrogden 8 years ago
parent
commit
aca5cd098f
2 changed files with 40 additions and 2 deletions
  1. 21 2
      QListCtrl.cpp
  2. 19 0
      QPasteWnd.cpp

+ 21 - 2
QListCtrl.cpp

@@ -433,7 +433,7 @@ void CQListCtrl::OnCustomdrawList(NMHDR* pNMHDR, LRESULT* pResult)
 				m_groupFolder.Draw(pDC, this, rcText.left, rcText.top, false, false);
 				m_groupFolder.Draw(pDC, this, rcText.left, rcText.top, false, false);
 				rcText.left += m_groupFolder.ImageWidth() + theApp.m_metrics.ScaleX(2);
 				rcText.left += m_groupFolder.ImageWidth() + theApp.m_metrics.ScaleX(2);
 			}
 			}
-			if (strSymbols.Find(_T("<noautodelete>"))) //don't auto delete
+			if (strSymbols.Find(_T("<noautodelete>")) >= 0) //don't auto delete
 			{
 			{
 				m_dontDeleteImage.Draw(pDC, this, rcText.left, rcText.top, false, false);
 				m_dontDeleteImage.Draw(pDC, this, rcText.left, rcText.top, false, false);
 				rcText.left += m_dontDeleteImage.ImageWidth() + theApp.m_metrics.ScaleX(2);
 				rcText.left += m_dontDeleteImage.ImageWidth() + theApp.m_metrics.ScaleX(2);
@@ -1012,7 +1012,7 @@ bool CQListCtrl::ShowFullDescription(bool bFromAuto, bool fromNextPrev)
 
 
 		try
 		try
 		{
 		{
-			CppSQLite3Query q = theApp.m_db.execQueryEx(_T("SELECT lID, lDate, lastPasteDate, lDontAutoDelete, QuickPasteText, lShortCut, globalShortCut FROM Main WHERE lID = %d"), clipId);
+			CppSQLite3Query q = theApp.m_db.execQueryEx(_T("SELECT lID, lDate, lastPasteDate, lDontAutoDelete, QuickPasteText, lShortCut, globalShortCut, stickyClipOrder, stickyClipGroupOrder FROM Main WHERE lID = %d"), clipId);
 			if (q.eof() == false)
 			if (q.eof() == false)
 			{
 			{
 				CString clipData;
 				CString clipData;
@@ -1047,6 +1047,25 @@ bool CQListCtrl::ShowFullDescription(bool bFromAuto, bool fromNextPrev)
 					}
 					}
 				}
 				}
 
 
+				if (theApp.m_GroupID > 0)
+				{
+					int sticky = q.getIntField(_T("stickyClipGroupOrder"));
+					if (sticky != INVALID_STICKY)
+					{
+						clipData += _T(" | ");
+						clipData += _T(" - Sticky In Group");
+					}
+				}
+				else
+				{
+					int sticky = q.getIntField(_T("stickyClipOrder"));
+					if (sticky != INVALID_STICKY)
+					{
+						clipData += _T(" | ");
+						clipData += _T(" - Sticky");
+					}
+				}
+
 				m_pToolTip->SetClipData(clipData);
 				m_pToolTip->SetClipData(clipData);
 			}
 			}
 		}
 		}

+ 19 - 0
QPasteWnd.cpp

@@ -4889,6 +4889,25 @@ void CQPasteWnd::OnGetToolTipText(NMHDR *pNMHDR, LRESULT *pResult)
 					cs += " - Global Shortcut Key";
 					cs += " - Global Shortcut Key";
 				}
 				}
             }
             }
+
+			if (theApp.m_GroupID > 0)
+			{
+				int sticky = q.getIntField(_T("stickyClipGroupOrder"));
+				if (sticky != INVALID_STICKY)
+				{
+					cs += "\n\n";
+					cs += _T(" - Sticky In Group");
+				}
+			}
+			else
+			{
+				int sticky = q.getIntField(_T("stickyClipOrder"));
+				if (sticky != INVALID_STICKY)
+				{
+					cs += "\n\n";
+					cs += _T(" - Sticky");
+				}
+			}
         }
         }
 
 
         lstrcpyn(pInfo->pszText, cs, pInfo->cchTextMax);
         lstrcpyn(pInfo->pszText, cs, pInfo->cchTextMax);