Browse Source

In paste for last 10 keys handle the option to show group clips in the main list

git-svn-id: svn://svn.code.sf.net/p/ditto-cp/code/trunk@621 595ec19a-5cb4-439b-94a8-42fb3063c22c
sabrogden 14 years ago
parent
commit
03d347e89d
1 changed files with 8 additions and 1 deletions
  1. 8 1
      MainFrm.cpp

+ 8 - 1
MainFrm.cpp

@@ -414,7 +414,14 @@ void CMainFrame::DoFirstTenPositionsPaste(int nPos)
 {
     try
     {
-        CppSQLite3Query q = theApp.m_db.execQueryEx(_T("SELECT lID, bIsGroup FROM Main WHERE ((bIsGroup = 1 AND lParentID = -1) OR bIsGroup = 0) ORDER BY bIsGroup ASC, clipOrder DESC LIMIT 1 OFFSET %d"), nPos);
+		CString filter = "((Main.bIsGroup = 1 AND Main.lParentID = -1) OR (Main.bIsGroup = 0 AND Main.lParentID = -1))";
+
+		if(g_Opt.m_bShowAllClipsInMainList)
+		{
+			filter = "((Main.bIsGroup = 1 AND Main.lParentID = -1) OR Main.bIsGroup = 0)";
+		}
+
+        CppSQLite3Query q = theApp.m_db.execQueryEx(_T("SELECT lID, bIsGroup FROM Main WHERE %s ORDER BY bIsGroup ASC, clipOrder DESC LIMIT 1 OFFSET %d"), filter, nPos);
 
         if(q.eof() == false)
         {