Skip to content

Commit

Permalink
Show Auto-Type select dialog even if window title is empty
Browse files Browse the repository at this point in the history
* Fixes #11597
  • Loading branch information
droidmonkey committed Dec 27, 2024
1 parent e76e9d4 commit 0a3cfeb
Showing 1 changed file with 20 additions and 25 deletions.
45 changes: 20 additions & 25 deletions src/autotype/AutoType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -434,38 +434,33 @@ void AutoType::startGlobalAutoType(const QString& search)
*/
void AutoType::performGlobalAutoType(const QList<QSharedPointer<Database>>& dbList, const QString& search)
{
if (!m_plugin) {
return;
}

if (!m_inGlobalAutoTypeDialog.tryLock()) {
return;
}

if (m_windowTitleForGlobal.isEmpty()) {
m_inGlobalAutoTypeDialog.unlock();
if (!m_plugin || !m_inGlobalAutoTypeDialog.tryLock()) {
return;
}

QList<AutoTypeMatch> matchList;
bool hideExpired = config()->get(Config::AutoTypeHideExpiredEntry).toBool();

for (const auto& db : dbList) {
const QList<Entry*> dbEntries = db->rootGroup()->entriesRecursive();
for (auto entry : dbEntries) {
auto group = entry->group();
if (!group || !group->resolveAutoTypeEnabled() || !entry->autoTypeEnabled()) {
continue;
}
// Generate entry/sequence match list if there is a valid window title
if (!m_windowTitleForGlobal.isEmpty()) {
bool hideExpired = config()->get(Config::AutoTypeHideExpiredEntry).toBool();
for (const auto& db : dbList) {
const QList<Entry*> dbEntries = db->rootGroup()->entriesRecursive();
for (auto entry : dbEntries) {
auto group = entry->group();
if (!group || !group->resolveAutoTypeEnabled() || !entry->autoTypeEnabled()) {
continue;
}

if (hideExpired && entry->isExpired()) {
continue;
}
const QSet<QString> sequences = Tools::asSet(entry->autoTypeSequences(m_windowTitleForGlobal));
for (const auto& sequence : sequences) {
matchList << AutoTypeMatch(entry, sequence);
if (hideExpired && entry->isExpired()) {
continue;
}
const QSet<QString> sequences = Tools::asSet(entry->autoTypeSequences(m_windowTitleForGlobal));
for (const auto& sequence : sequences) {
matchList << AutoTypeMatch(entry, sequence);
}
}
}
} else {
qWarning() << "Auto-Type: Window title was empty from the operating system";
}

// Show the selection dialog if we always ask, have multiple matches, or no matches
Expand Down

0 comments on commit 0a3cfeb

Please sign in to comment.