Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/dde-lock/lockframe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,12 @@ bool LockFrame::event(QEvent *event)
}

if (keyValue != "") {
#ifdef ENABLE_DSS_SNIPE
// v25 dde-daemon接受小驼峰命名的name
emit sendKeyValue(qtifyName(keyValue));
#else
emit sendKeyValue(keyValue);
#endif
}
}
return FullScreenBackground::event(event);
Expand Down
18 changes: 18 additions & 0 deletions src/global_util/public_func.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,3 +356,21 @@
return value.toBool();
}
#endif

QString qtifyName(const QString &name) {

Check warning on line 360 in src/global_util/public_func.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

The function 'qtifyName' is never used.
bool next_cap = false;
QString result;

for (auto it = name.cbegin(); it != name.cend(); ++it) {
if (*it == '-') {
next_cap = true;
} else if (next_cap) {
result.append(it->toUpper());
next_cap = false;
} else {
result.append(*it);
}
}

return result;
}
6 changes: 6 additions & 0 deletions src/global_util/public_func.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,10 @@ void configWebEngine();
bool isSleepLock();
#endif

/**
* @brief convert 'some-key' to 'someKey'.
*/

QString qtifyName(const QString &name);

#endif // PUBLIC_FUNC_H
Loading