Преглед изворни кода

Revert "order by sticky clip order first then group, then clip order - updated indexes"

This reverts commit a224d4b86181aeae5e1832ed452b35f89f1e5992.
scott brogden пре 5 година
родитељ
комит
e6bf3801f2
6 измењених фајлова са 10 додато и 51 уклоњено
  1. 0 15
      AdvGeneral.cpp
  2. 3 20
      DatabaseUtilities.cpp
  3. 2 2
      DittoSetup/BuildDitto.bld
  4. 0 9
      MainFrm.cpp
  5. 1 1
      Options.cpp
  6. 4 4
      QPasteWnd.cpp

+ 0 - 15
AdvGeneral.cpp

@@ -124,8 +124,6 @@ END_MESSAGE_MAP()
 #define SETTING_FIRST_TEN_HOTKEYS_START 74
 #define SETTING_FIRST_TEN_HOTKEYS_FONT_SIZE 75
 
-#define SETTING_OPEN_TO_GROUP_AS_ACTIVE_EXE 76
-
 BOOL CAdvGeneral::OnInitDialog()
 {
 	CDialogEx::OnInitDialog();
@@ -191,8 +189,6 @@ BOOL CAdvGeneral::OnInitDialog()
 
 	AddTrueFalse(pGroupTest, _T("Multi-Paste in reverse order"), g_Opt.m_bMultiPasteReverse, SETTING_MULTIPASTE_REVERSE_ORDER);
 
-	AddTrueFalse(pGroupTest, _T("Open to group same as active exe"), CGetSetOptions::GetOpenToGroupByActiveExe(), SETTING_OPEN_TO_GROUP_AS_ACTIVE_EXE);
-
 	static TCHAR BASED_CODE szFilter[] = _T("Sounds(*.wav)|*.wav||");
 	CMFCPropertyGridFileProperty* pFileProp = new CMFCPropertyGridFileProperty(_T("On copy play the sound"), TRUE, CGetSetOptions::GetPlaySoundOnCopy(), _T("wav"), 0, szFilter, (LPCTSTR)0, SETTING_COPY_PLAY_SOUND);
 	pGroupTest->AddSubItem(pFileProp);
@@ -755,17 +751,6 @@ void CAdvGeneral::OnBnClickedOk()
 					CGetSetOptions::SetFirstTenHotKeysFontSize(pNewValue->lVal);
 				}
 				break;
-			case SETTING_OPEN_TO_GROUP_AS_ACTIVE_EXE:
-				if (wcscmp(pNewValue->bstrVal, pOrigValue->bstrVal) != 0)
-				{
-					BOOL val = false;
-					if (wcscmp(pNewValue->bstrVal, L"True") == 0)
-					{
-						val = true;
-					}
-					CGetSetOptions::SetOpenToGroupByActiveExe(val);
-				}
-				break;
 			}
 		}
 	}

+ 3 - 20
DatabaseUtilities.cpp

@@ -435,18 +435,6 @@ BOOL ValidDB(CString csPath, BOOL bUpgrade)
 
 			e.errorCode();
 		}
-
-		db.execDML(_T("DROP INDEX IF EXISTS Main_NoGroup"));
-		db.execDML(_T("DROP INDEX IF EXISTS Main_InGroup"));
-		db.execDML(_T("DROP INDEX IF EXISTS Main_ShortCut"));
-
-		db.execDML(_T("CREATE INDEX IF NOT EXISTS Main_TopLevelParentID ON Main(lParentId ASC, stickyClipOrder DESC, bIsGroup ASC, clipOrder DESC);"));
-		db.execDML(_T("CREATE INDEX IF NOT EXISTS Main_TopLevel ON Main(stickyClipOrder DESC, bIsGroup ASC, clipOrder DESC);"));
-		db.execDML(_T("CREATE INDEX IF NOT EXISTS Main_InGroup2 ON Main(lParentId ASC, stickyClipGroupOrder DESC, bIsGroup ASC, clipGroupOrder DESC);"));
-
-		db.execDML(_T("CREATE INDEX IF NOT EXISTS Main_ShortCut2 on Main(lShortCut DESC, globalShortCut DESC)"));
-		db.execDML(_T("CREATE INDEX IF NOT EXISTS Main_MoveToGroup on Main(MoveToGroupShortCut DESC, GlobalMoveToGroupShortCut DESC)"));
-		db.execDML(_T("CREATE INDEX IF NOT EXISTS Main_CRC on Main(CRC ASC)"));
 	}
 	CATCH_SQLITE_EXCEPTION_AND_RETURN(FALSE)
 
@@ -699,6 +687,7 @@ BOOL CreateDB(CString csFile)
 		db.execDML(_T("CREATE INDEX Main_ClipGroupOrder on Main(clipGroupOrder DESC)"));
 		db.execDML(_T("CREATE INDEX Main_ParentId on Main(lParentID DESC)"));
 		db.execDML(_T("CREATE INDEX Main_IsGroup on Main(bIsGroup DESC)"));
+        db.execDML(_T("CREATE INDEX Main_ShortCut on Main(lShortCut DESC)"));
 
 		db.execDML(_T("CREATE TRIGGER delete_data_trigger BEFORE DELETE ON Main FOR EACH ROW\n")
 			_T("BEGIN\n")
@@ -720,16 +709,10 @@ BOOL CreateDB(CString csFile)
 				_T("DELETE FROM Data WHERE lParentID = old.clipID;\n")
 			_T("END\n"));
 
+		db.execDML(_T("CREATE INDEX Main_NoGroup ON Main(bIsGroup ASC, stickyClipOrder DESC, clipOrder DESC);"));
+		db.execDML(_T("CREATE INDEX Main_InGroup ON Main(lParentId ASC, bIsGroup ASC, stickyClipGroupOrder DESC, clipGroupOrder DESC);"));
 		db.execDML(_T("CREATE INDEX Data_ParentId_Format ON Data(lParentID COLLATE BINARY ASC, strClipBoardFormat COLLATE NOCASE ASC);"));
 
-		db.execDML(_T("CREATE INDEX IF NOT EXISTS Main_TopLevelParentID ON Main(lParentId ASC, stickyClipOrder DESC, bIsGroup ASC, clipOrder DESC);"));
-		db.execDML(_T("CREATE INDEX IF NOT EXISTS Main_TopLevel ON Main(stickyClipOrder DESC, bIsGroup ASC, clipOrder DESC);"));
-		db.execDML(_T("CREATE INDEX IF NOT EXISTS Main_InGroup2 ON Main(lParentId ASC, stickyClipGroupOrder DESC, bIsGroup ASC, clipGroupOrder DESC);"));
-
-		db.execDML(_T("CREATE INDEX IF NOT EXISTS Main_ShortCut2 on Main(lShortCut DESC, globalShortCut DESC)"));
-		db.execDML(_T("CREATE INDEX IF NOT EXISTS Main_MoveToGroup on Main(MoveToGroupShortCut DESC, GlobalMoveToGroupShortCut DESC)"));
-		db.execDML(_T("CREATE INDEX IF NOT EXISTS Main_CRC on Main(CRC ASC)"));
-
 		db.close();
 	}
 	CATCH_SQLITE_EXCEPTION_AND_RETURN(FALSE)

+ 2 - 2
DittoSetup/BuildDitto.bld

@@ -2944,7 +2944,7 @@ var sc_security="b3f57099";
 		</step>
 		<step action='Git'>
 			<Command>log</Command>
-			<Options>--pretty=format:"%%ad %%s" --date=short   --since=2020-01-01</Options>
+			<Options>--pretty=format:"%%ad %%s" --date=short   --since=2018-12-23</Options>
 			<WorkDir>%workDir%</WorkDir>
 			<buildfailsteps type='11'>0</buildfailsteps>
 			<indent type='3'>2</indent>
@@ -3063,7 +3063,7 @@ var sc_security="b3f57099";
 			<value>3</value>
 		</macro>
 		<macro name='verMinor'>
-			<value>23</value>
+			<value>22</value>
 		</macro>
 		<macro name='verRevision'>
 			<value>0</value>

+ 0 - 9
MainFrm.cpp

@@ -1249,15 +1249,6 @@ LRESULT CMainFrame::OnOptionsClosed(WPARAM wParam, LPARAM lParam)
 
 	m_trayIcon.SetMenu(NULL, IDR_MENU);
 	theApp.m_Language.UpdateTrayIconRightClickMenu(&m_trayIcon.GetMenu());
-
-	if (CGetSetOptions::GetShowIconInSysTray())
-	{
-		m_trayIcon.Show();
-	}
-	else
-	{
-		m_trayIcon.Hide();
-	}
 	
 
 	return 0;

+ 1 - 1
Options.cpp

@@ -2663,7 +2663,7 @@ CString	CGetSetOptions::GetRegexFilterByProcessName(int pos)
 
 BOOL CGetSetOptions::GetOpenToGroupByActiveExe()
 {
-	return GetProfileLong(_T("OpenToGroupByActiveExe"), FALSE);
+	return GetProfileLong(_T("OpenToGroupByActiveExe"), TRUE);
 }
 
 void CGetSetOptions::SetOpenToGroupByActiveExe(int val)

+ 4 - 4
QPasteWnd.cpp

@@ -1317,8 +1317,8 @@ BOOL CQPasteWnd::FillList(CString csSQLSearch /*=""*/)
 	if (theApp.m_GroupID < 0)
 	{
 		//do not change this this directly relates to the views in the Main table
-		csSort = "Main.stickyClipOrder DESC, "
-			"Main.bIsGroup ASC, "			
+		csSort = "Main.bIsGroup ASC, "
+			"Main.stickyClipOrder DESC, "
 			"Main.clipOrder DESC";
 
 		if (g_Opt.m_bShowAllClipsInMainList)
@@ -1342,8 +1342,8 @@ BOOL CQPasteWnd::FillList(CString csSQLSearch /*=""*/)
 		// it's some other group
 	{
 		//do not change this this directly relates to the views in the Main table
-		csSort = "Main.stickyClipGroupOrder DESC, "
-			"Main.bIsGroup ASC, "			
+		csSort = "Main.bIsGroup ASC, "
+			"Main.stickyClipGroupOrder DESC, "
 			"Main.clipGroupOrder DESC";
 
 		//Main.stickyClipGroupOrder DESC, Main.clipGroupOrder DESC";//