Skip to content

Add filter functionality to Advanced options#844

Merged
sabrogden merged 1 commit intosabrogden:masterfrom
dcog989:Advanced-options-dynamic-filter
May 8, 2025
Merged

Add filter functionality to Advanced options#844
sabrogden merged 1 commit intosabrogden:masterfrom
dcog989:Advanced-options-dynamic-filter

Conversation

@dcog989
Copy link
Copy Markdown
Contributor

@dcog989 dcog989 commented May 7, 2025

  • Introduced an edit control for filtering properties in the Advanced options dialog.
  • Updated resource definitions to include the new edit control.
  • Enhanced data exchange and message map to support filtering logic.
  • Added logic to filter properties based on user input in real-time.

- Introduced an edit control for filtering properties in the advanced options dialog.
- Updated resource definitions to include the new edit control.
- Enhanced data exchange and message map to support filtering logic.
- Added logic to filter properties based on user input in real-time.
@sabrogden sabrogden merged commit e364b1f into sabrogden:master May 8, 2025
1 check passed
@dcog989
Copy link
Copy Markdown
Contributor Author

dcog989 commented May 8, 2025

It's crashing. Will investigate tomorrow.

@dcog989
Copy link
Copy Markdown
Contributor Author

dcog989 commented May 8, 2025

Resource.h has many duplicate resource IDs - e.g.:


#define IDB_CLOSE_12_12                 197
#define IDB_CLOSE_8_8                   197
...
#define IDB_PNG3                        201
#define IDB_CLOSE_16_16                 201

Not sure if that's the cause of the crash, but I think it is a significant issue that needs fixing? Please advise.

@dcog989 dcog989 deleted the Advanced-options-dynamic-filter branch May 9, 2025 15:37
@dcog989
Copy link
Copy Markdown
Contributor Author

dcog989 commented May 9, 2025

I spent a long time on this but it just kept getting more complex. So I'm abandoning it. Please revert the PR to fix the crash.

@dcog989
Copy link
Copy Markdown
Contributor Author

dcog989 commented May 9, 2025

P.S. While investigating the crash, I was prompted with suggestions for compacting - don't know if useful but here they are:

void CAdvGeneral::OnBnClickedBtCompactAndRepair()
{
	auto msg = theApp.m_Language.GetString("CompactRepairWarning", "Warning this can take quite a long time and require up to double the hard drive space as your current database size, Continue?");
	int ret = MessageBox(msg, _T("Ditto"), MB_YESNO);

	if (ret == IDYES)
	{
		CWaitCursor wait;

		try
		{
			// The RemoveOldEntries loop seems excessive and might not be what's intended for a simple compact.
			// Usually, VACUUM is enough after deletions. If RemoveOldEntries is part of a larger cleanup,
			// it might be okay, but ensure it's efficient.
			// For now, let's assume it's intentional.
			try
			{
				for (int i = 0; i < 100; i++)
				{
					// Consider if this query and loop are truly necessary before VACUUM.
					// VACUUM itself reclaims space from deleted rows.
					int toDeleteCount = theApp.m_db.execScalar(_T("SELECT COUNT(clipID) FROM MainDeletes"));
					if (toDeleteCount <= 0)
						break;

					RemoveOldEntries(false);
				}
			}
			CATCH_SQLITE_EXCEPTION

			theApp.m_db.execDML(_T("PRAGMA auto_vacuum = FULL")); // FULL is more thorough than INCREMENTAL (1)
			theApp.m_db.execDML(_T("VACUUM")); // execDML for commands that don't return data
			MessageBox(_T("Compact and Repair completed."), _T("Ditto"), MB_OK | MB_ICONINFORMATION);
		}
		CATCH_SQLITE_EXCEPTION
	}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants