chore: update formating for clang-format 20.1.0

This commit is contained in:
sithlord48 2025-03-10 20:21:57 -04:00 committed by Chris Rizzitello
parent bb38ad0766
commit 6e8952c8a0
13 changed files with 265 additions and 142 deletions

View file

@ -1125,11 +1125,12 @@ void MainWindow::setHostName()
if (existingScreen) { if (existingScreen) {
body = tr("Screen name already exists"); body = tr("Screen name already exists");
} else { } else {
body = tr("The name you have chosen is invalid.\n\n" body =
"Valid names:\n" tr("The name you have chosen is invalid.\n\n"
"• Use letters and numbers\n" "Valid names:\n"
"• May also use _ or -\n" "• Use letters and numbers\n"
"• Are between 1 and 255 characters"); "• May also use _ or -\n"
"• Are between 1 and 255 characters");
} }
QMessageBox::information(this, title, body); QMessageBox::information(this, title, body);
return; return;

View file

@ -45,8 +45,9 @@ FingerprintDialog::FingerprintDialog(
connect(m_buttonBox->button(QDialogButtonBox::Ok), &QPushButton::clicked, this, &QDialog::accept); connect(m_buttonBox->button(QDialogButtonBox::Ok), &QPushButton::clicked, this, &QDialog::accept);
} else { } else {
setWindowTitle(tr("Security Question")); setWindowTitle(tr("Security Question"));
auto body = tr("Compare the fingerprints in this dialog to those on the %1.\n" auto body =
"Only connect if they match!"); tr("Compare the fingerprints in this dialog to those on the %1.\n"
"Only connect if they match!");
if (mode == FingerprintDialogMode::Server) { if (mode == FingerprintDialogMode::Server) {
m_lblHeader->setText(tr("A new client is connecting.\n%1").arg(body.arg(tr("client")))); m_lblHeader->setText(tr("A new client is connecting.\n%1").arg(body.arg(tr("client"))));

View file

@ -120,8 +120,10 @@ int main(int argc, char *argv[])
#if defined(Q_OS_MAC) #if defined(Q_OS_MAC)
if (app.applicationDirPath().startsWith("/Volumes/")) { if (app.applicationDirPath().startsWith("/Volumes/")) {
QString msgBody = QStringLiteral("Please drag %1 to the Applications folder, " QString msgBody = QStringLiteral(
"and open it from there."); "Please drag %1 to the Applications folder, "
"and open it from there."
);
QMessageBox::information(NULL, kAppName, msgBody.arg(kAppName)); QMessageBox::information(NULL, kAppName, msgBody.arg(kAppName));
return 1; return 1;
} }
@ -181,9 +183,11 @@ bool checkMacAssistiveDevices()
// now deprecated in mavericks. // now deprecated in mavericks.
bool result = AXAPIEnabled(); bool result = AXAPIEnabled();
if (!result) { if (!result) {
QString msgBody = QString("Please enable access to assistive devices " QString msgBody = QString(
"System Preferences -> Security & Privacy -> " "Please enable access to assistive devices "
"Privacy -> Accessibility, then re-open %1."); "System Preferences -> Security & Privacy -> "
"Privacy -> Accessibility, then re-open %1."
);
QMessageBox::information(NULL, kAppName, msgBody.arg(kAppName)); QMessageBox::information(NULL, kAppName, msgBody.arg(kAppName));
} }
return result; return result;

View file

@ -41,92 +41,166 @@ std::string XArchEvalWinsock::eval() const throw()
{ {
int m_code; int m_code;
const char *m_msg; const char *m_msg;
} s_netErrorCodes[] = { }
/* 10004 */ {WSAEINTR, "The (blocking) call was canceled via WSACancelBlockingCall"},
/* 10009 */ {WSAEBADF, "Bad file handle"}, s_netErrorCodes[] = {
/* 10013 */
{WSAEACCES, "The requested address is a broadcast address, but the " // 10004
"appropriate flag was not set"}, {WSAEINTR, "The (blocking) call was canceled via WSACancelBlockingCall"},
/* 10014 */ {WSAEFAULT, "WSAEFAULT"},
/* 10022 */ {WSAEINVAL, "WSAEINVAL"}, // 10009
/* 10024 */ {WSAEMFILE, "No more file descriptors available"}, {WSAEBADF, "Bad file handle"},
/* 10035 */
{WSAEWOULDBLOCK, "Socket is marked as non-blocking and no connections " // 10013
"are present or the receive operation would block"}, {WSAEACCES, "The requested address is a broadcast address, but the appropriate flag was not set"},
/* 10036 */
// 10014
{WSAEFAULT, "WSAEFAULT"},
// 10022
{WSAEINVAL, "WSAEINVAL"},
// 10024
{WSAEMFILE, "No more file descriptors available"},
// 10035
{WSAEWOULDBLOCK,
"Socket is marked as non-blocking and no connections are present or the receive operation would block"},
// 10036
{WSAEINPROGRESS, "A blocking Windows Sockets operation is in progress"}, {WSAEINPROGRESS, "A blocking Windows Sockets operation is in progress"},
/* 10037 */
// 10037
{WSAEALREADY, "The asynchronous routine being canceled has already completed"}, {WSAEALREADY, "The asynchronous routine being canceled has already completed"},
/* 10038 */ {WSAENOTSOCK, "At least on descriptor is not a socket"},
/* 10039 */ {WSAEDESTADDRREQ, "A destination address is required"}, // 10038
/* 10040 */ {WSAENOTSOCK, "At least on descriptor is not a socket"},
{WSAEMSGSIZE, "The datagram was too large to fit into the specified "
"buffer and was truncated"}, // 10039
/* 10041 */ {WSAEDESTADDRREQ, "A destination address is required"},
// 10040
{WSAEMSGSIZE, "The datagram was too large to fit into the specified buffer and was truncated"},
// 10041
{WSAEPROTOTYPE, "The specified protocol is the wrong type for this socket"}, {WSAEPROTOTYPE, "The specified protocol is the wrong type for this socket"},
/* 10042 */ {WSAENOPROTOOPT, "The option is unknown or unsupported"},
/* 10043 */ // 10042
{WSAENOPROTOOPT, "The option is unknown or unsupported"},
// 10043
{WSAEPROTONOSUPPORT, "The specified protocol is not supported"}, {WSAEPROTONOSUPPORT, "The specified protocol is not supported"},
/* 10044 */
// 10044
{WSAESOCKTNOSUPPORT, "The specified socket type is not supported by this address family"}, {WSAESOCKTNOSUPPORT, "The specified socket type is not supported by this address family"},
/* 10045 */
// 10045
{WSAEOPNOTSUPP, "The referenced socket is not a type that supports that operation"}, {WSAEOPNOTSUPP, "The referenced socket is not a type that supports that operation"},
/* 10046 */ {WSAEPFNOSUPPORT, "BSD: Protocol family not supported"},
/* 10047 */ // 10046
{WSAEPFNOSUPPORT, "BSD: Protocol family not supported"},
// 10047
{WSAEAFNOSUPPORT, "The specified address family is not supported"}, {WSAEAFNOSUPPORT, "The specified address family is not supported"},
/* 10048 */ {WSAEADDRINUSE, "The specified address is already in use"},
/* 10049 */ // 10048
{WSAEADDRINUSE, "The specified address is already in use"},
// 10049
{WSAEADDRNOTAVAIL, "The specified address is not available from the local machine"}, {WSAEADDRNOTAVAIL, "The specified address is not available from the local machine"},
/* 10050 */
{WSAENETDOWN, "The Windows Sockets implementation has detected that the " // 10050
"network subsystem has failed"}, {WSAENETDOWN, "The Windows Sockets implementation has detected that the network subsystem has failed"},
/* 10051 */
// 10051
{WSAENETUNREACH, "The network can't be reached from this host at this time"}, {WSAENETUNREACH, "The network can't be reached from this host at this time"},
/* 10052 */
{WSAENETRESET, "The connection must be reset because the Windows Sockets " // 10052
"implementation dropped it"}, {WSAENETRESET, "The connection must be reset because the Windows Sockets implementation dropped it"},
/* 10053 */
// 10053
{WSAECONNABORTED, "The virtual circuit was aborted due to timeout or other failure"}, {WSAECONNABORTED, "The virtual circuit was aborted due to timeout or other failure"},
/* 10054 */
// 10054
{WSAECONNRESET, "The virtual circuit was reset by the remote side"}, {WSAECONNRESET, "The virtual circuit was reset by the remote side"},
/* 10055 */
{WSAENOBUFS, "No buffer space is available or a buffer deadlock has " // 10055
"occured. The socket cannot be created"}, {WSAENOBUFS, "No buffer space is available or a buffer deadlock has occurred. The socket cannot be created"},
/* 10056 */ {WSAEISCONN, "The socket is already connected"},
/* 10057 */ {WSAENOTCONN, "The socket is not connected"}, // 10056
/* 10058 */ {WSAESHUTDOWN, "The socket has been shutdown"}, {WSAEISCONN, "The socket is already connected"},
/* 10059 */ {WSAETOOMANYREFS, "BSD: Too many references"},
/* 10060 */ // 10057
{WSAENOTCONN, "The socket is not connected"},
// 10058
{WSAESHUTDOWN, "The socket has been shutdown"},
// 10059
{WSAETOOMANYREFS, "BSD: Too many references"},
// 10060
{WSAETIMEDOUT, "Attempt to connect timed out without establishing a connection"}, {WSAETIMEDOUT, "Attempt to connect timed out without establishing a connection"},
/* 10061 */ {WSAECONNREFUSED, "Connection was refused"},
/* 10062 */ {WSAELOOP, "Undocumented WinSock error code used in BSD"}, // 10061
/* 10063 */ {WSAECONNREFUSED, "Connection was refused"},
// 10062
{WSAELOOP, "Undocumented WinSock error code used in BSD"},
// 10063
{WSAENAMETOOLONG, "Undocumented WinSock error code used in BSD"}, {WSAENAMETOOLONG, "Undocumented WinSock error code used in BSD"},
/* 10064 */ {WSAEHOSTDOWN, "Undocumented WinSock error code used in BSD"},
/* 10065 */ {WSAEHOSTUNREACH, "No route to host"}, // 10064
/* 10066 */ {WSAENOTEMPTY, "Undocumented WinSock error code"}, {WSAEHOSTDOWN, "Undocumented WinSock error code used in BSD"},
/* 10067 */ {WSAEPROCLIM, "Undocumented WinSock error code"},
/* 10068 */ {WSAEUSERS, "Undocumented WinSock error code"}, // 10065
/* 10069 */ {WSAEDQUOT, "Undocumented WinSock error code"}, {WSAEHOSTUNREACH, "No route to host"},
/* 10070 */ {WSAESTALE, "Undocumented WinSock error code"},
/* 10071 */ {WSAEREMOTE, "Undocumented WinSock error code"}, // 10066
/* 10091 */ {WSAENOTEMPTY, "Undocumented WinSock error code"},
// 10067
{WSAEPROCLIM, "Undocumented WinSock error code"},
// 10068
{WSAEUSERS, "Undocumented WinSock error code"},
// 10069
{WSAEDQUOT, "Undocumented WinSock error code"},
// 10070
{WSAESTALE, "Undocumented WinSock error code"},
// 10071
{WSAEREMOTE, "Undocumented WinSock error code"},
// 10091
{WSASYSNOTREADY, "Underlying network subsytem is not ready for network communication"}, {WSASYSNOTREADY, "Underlying network subsytem is not ready for network communication"},
/* 10092 */
{WSAVERNOTSUPPORTED, "The version of WinSock API support requested is " // 10092
"not provided in this implementation"}, {WSAVERNOTSUPPORTED, "The version of WinSock API support requested is not provided in this implementation"},
/* 10093 */
// 10093
{WSANOTINITIALISED, "WinSock subsystem not properly initialized"}, {WSANOTINITIALISED, "WinSock subsystem not properly initialized"},
/* 10101 */
// 10101
{WSAEDISCON, "Virtual circuit has gracefully terminated connection"}, {WSAEDISCON, "Virtual circuit has gracefully terminated connection"},
/* 11001 */ {WSAHOST_NOT_FOUND, "The specified host is unknown"},
/* 11002 */ // 11001
{WSAHOST_NOT_FOUND, "The specified host is unknown"},
// 11002
{WSATRY_AGAIN, "A temporary error occurred on an authoritative name server"}, {WSATRY_AGAIN, "A temporary error occurred on an authoritative name server"},
/* 11003 */
// 11003
{WSANO_RECOVERY, "A non-recoverable name server error occurred"}, {WSANO_RECOVERY, "A non-recoverable name server error occurred"},
/* 11004 */
// 11004
{WSANO_DATA, "The requested name is valid but does not have an IP address"}, {WSANO_DATA, "The requested name is valid but does not have an IP address"},
/* end */ {0, NULL}
// end
{0, NULL}
}; };
for (unsigned int i = 0; s_netErrorCodes[i].m_code != 0; ++i) { for (unsigned int i = 0; s_netErrorCodes[i].m_code != 0; ++i) {

View file

@ -222,8 +222,10 @@ void AppUtilWindows::showNotification(const std::string &title, const std::strin
return; return;
} }
if (!WinToastLib::WinToast::instance()->isInitialized()) { if (!WinToastLib::WinToast::instance()->isInitialized()) {
WinToastLib::WinToast::instance()->setAppName(L"" WinToastLib::WinToast::instance()->setAppName(
"Deskflow"); L""
"Deskflow"
);
const auto aumi = WinToastLib::WinToast::configureAUMI( const auto aumi = WinToastLib::WinToast::configureAUMI(
L"" L""
"Deskflow Developers", "Deskflow Developers",

View file

@ -40,8 +40,9 @@ public:
bool scopeContains(const QString &name, Scope scope = Scope::Current) const override; bool scopeContains(const QString &name, Scope scope = Scope::Current) const override;
bool isActiveScopeWritable() const override; bool isActiveScopeWritable() const override;
void setInScope(const QString &name, const QVariant &value, Scope scope = Scope::Current) override; void setInScope(const QString &name, const QVariant &value, Scope scope = Scope::Current) override;
QVariant getFromScope(const QString &name, const QVariant &defaultValue = QVariant(), Scope scope = Scope::Current) QVariant getFromScope(
const override; const QString &name, const QVariant &defaultValue = QVariant(), Scope scope = Scope::Current
) const override;
void setActiveScope(Scope scope = Scope::User) override; void setActiveScope(Scope scope = Scope::User) override;
Scope activeScope() const override; Scope activeScope() const override;
QSettingsProxy &activeSettings() override; QSettingsProxy &activeSettings() override;

View file

@ -49,8 +49,10 @@ void showErrorDialog(const QString &message, const QString &fileLine, QtMsgType
text = "<p>Sorry, a critical error has occurred.</p>"; text = "<p>Sorry, a critical error has occurred.</p>";
} }
text += QString(R"(<p>Please <a href="%1" style="color: %2">report a bug</a>)" text += QString(
" and copy/paste the following error:</p>") R"(<p>Please <a href="%1" style="color: %2">report a bug</a>)"
" and copy/paste the following error:</p>"
)
.arg(kUrlHelp, kColorSecondary); .arg(kUrlHelp, kColorSecondary);
text += QString("<pre>v%1\n%2\n%3</pre>").arg(kVersion, message, fileLine); text += QString("<pre>v%1\n%2\n%3</pre>").arg(kVersion, message, fileLine);
@ -117,18 +119,22 @@ void messageHandler(QtMsgType type, const QMessageLogContext &context, const QSt
void showCloseReminder(QWidget *parent) void showCloseReminder(QWidget *parent)
{ {
QString message = QString("<p>%1 will continue to run in the background and can be accessed " QString message = QString(
"via the %1 icon in your system notifications area. This " "<p>%1 will continue to run in the background and can be accessed "
"setting " "via the %1 icon in your system notifications area. This "
"can be disabled.</p>") "setting "
"can be disabled.</p>"
)
.arg(kAppName); .arg(kAppName);
#if defined(Q_OS_LINUX) #if defined(Q_OS_LINUX)
message += QString("<p>On some Linux systems such as GNOME 3, the " message += QString(
"notification area might be disabled. " "<p>On some Linux systems such as GNOME 3, the "
"You may need to " "notification area might be disabled. "
R"(<a href="%1" %2>enable an extension</a>)" "You may need to "
" to see the %3 tray icon.</p>") R"(<a href="%1" %2>enable an extension</a>)"
" to see the %3 tray icon.</p>"
)
.arg(kUrlGnomeTrayFix, kStyleLink, kAppName); .arg(kUrlGnomeTrayFix, kStyleLink, kAppName);
#endif #endif
@ -139,10 +145,12 @@ void showFirstServerStartMessage(QWidget *parent)
{ {
QMessageBox::information( QMessageBox::information(
parent, "Server is running", parent, "Server is running",
QString("<p>Great, the %1 server is now running.</p>" QString(
"<p>Now you can connect your client computers to this server. " "<p>Great, the %1 server is now running.</p>"
"You should see a prompt here on the server when a new client " "<p>Now you can connect your client computers to this server. "
"tries to connect.</p>") "You should see a prompt here on the server when a new client "
"tries to connect.</p>"
)
.arg(kAppName) .arg(kAppName)
); );
} }
@ -161,13 +169,17 @@ void showFirstConnectedMessage(QWidget *parent, bool closeToTray, bool enableSer
} }
if (!closeToTray && !enableService) { if (!closeToTray && !enableService) {
message += QString("<p>As you do not have the setting enabled to keep %1 running in " message += QString(
"the background, you'll need to keep this window open or minimized " "<p>As you do not have the setting enabled to keep %1 running in "
"to keep %1 running.</p>") "the background, you'll need to keep this window open or minimized "
"to keep %1 running.</p>"
)
.arg(kAppName); .arg(kAppName);
} else { } else {
message += QString("<p>You can now close this window and %1 will continue to run in " message += QString(
"the background. This setting can be disabled.</p>") "<p>You can now close this window and %1 will continue to run in "
"the background. This setting can be disabled.</p>"
)
.arg(kAppName); .arg(kAppName);
} }
@ -240,8 +252,10 @@ bool showClearSettings(QWidget *parent)
QMessageBox message(parent); QMessageBox message(parent);
message.addButton(QObject::tr("Cancel"), QMessageBox::RejectRole); message.addButton(QObject::tr("Cancel"), QMessageBox::RejectRole);
const auto clear = message.addButton(QObject::tr("Clear settings"), QMessageBox::AcceptRole); const auto clear = message.addButton(QObject::tr("Clear settings"), QMessageBox::AcceptRole);
message.setText(QString("<p>Are you sure you want to clear all settings and restart %1?</p>" message.setText(QString(
"<p>This action cannot be undone.</p>") "<p>Are you sure you want to clear all settings and restart %1?</p>"
"<p>This action cannot be undone.</p>"
)
.arg(kAppName)); .arg(kAppName));
message.exec(); message.exec();
@ -253,8 +267,10 @@ void showReadOnlySettings(QWidget *parent, const QString &systemSettingsPath)
QString nativePath = QDir::toNativeSeparators(systemSettingsPath); QString nativePath = QDir::toNativeSeparators(systemSettingsPath);
QMessageBox::information( QMessageBox::information(
parent, "Read-only settings", parent, "Read-only settings",
QString("<p>Settings are read-only because you only have read access " QString(
"to the file:</p><p>%1</p>") "<p>Settings are read-only because you only have read access "
"to the file:</p><p>%1</p>"
)
.arg(nativePath) .arg(nativePath)
); );
} }
@ -263,14 +279,16 @@ void showWaylandLibraryError(QWidget *parent)
{ {
QMessageBox::critical( QMessageBox::critical(
parent, "Library problem", parent, "Library problem",
QString("<p>Sorry, while this version of %1 does support Wayland, " QString(
"this build was not linked with one or more of the required " "<p>Sorry, while this version of %1 does support Wayland, "
"libraries.</p>" "this build was not linked with one or more of the required "
"<p>Please either switch to X from your login screen or use a build " "libraries.</p>"
"that uses the correct libraries.</p>" "<p>Please either switch to X from your login screen or use a build "
"<p>If you think this is incorrect, please " "that uses the correct libraries.</p>"
R"(<a href="%2" style="color: %3">report a bug</a>.</p>)" "<p>If you think this is incorrect, please "
"<p>Please check the logs for more information.</p>") R"(<a href="%2" style="color: %3">report a bug</a>.</p>)"
"<p>Please check the logs for more information.</p>"
)
.arg(kAppName, kUrlHelp, kColorSecondary) .arg(kAppName, kUrlHelp, kColorSecondary)
); );
} }
@ -280,9 +298,11 @@ bool showUpdateCheckOption(QWidget *parent)
QMessageBox message(parent); QMessageBox message(parent);
message.addButton(QObject::tr("No thanks"), QMessageBox::RejectRole); message.addButton(QObject::tr("No thanks"), QMessageBox::RejectRole);
const auto checkButton = message.addButton(QObject::tr("Check for updates"), QMessageBox::AcceptRole); const auto checkButton = message.addButton(QObject::tr("Check for updates"), QMessageBox::AcceptRole);
message.setText(QString("<p>Would you like to check for updates when %1 starts?</p>" message.setText(QString(
"<p>Checking for updates requires an Internet connection.</p>" "<p>Would you like to check for updates when %1 starts?</p>"
"<p>URL: <pre>%2</pre></p>") "<p>Checking for updates requires an Internet connection.</p>"
"<p>URL: <pre>%2</pre></p>"
)
.arg(kAppName, env_vars::versionUrl())); .arg(kAppName, env_vars::versionUrl()));
message.exec(); message.exec();

View file

@ -23,19 +23,25 @@ const auto kStyleLineEditErrorBorder =
QStringLiteral("border: 1px solid %1; border-radius: 2px; padding: 2px;").arg(kColorError); QStringLiteral("border: 1px solid %1; border-radius: 2px; padding: 2px;").arg(kColorError);
const auto kStyleErrorActiveLabel = // const auto kStyleErrorActiveLabel = //
QStringLiteral("padding: 3px 5px; border-radius: 3px; " QStringLiteral(
"background-color: %1; color: %2") "padding: 3px 5px; border-radius: 3px; "
"background-color: %1; color: %2"
)
.arg(kColorError, kColorWhite); .arg(kColorError, kColorWhite);
const auto kStyleErrorInactiveLabel = // const auto kStyleErrorInactiveLabel = //
QStringLiteral("padding: 3px 5px; border-radius: 3px;" QStringLiteral(
"background-color: none"); "padding: 3px 5px; border-radius: 3px;"
"background-color: none"
);
const auto kStyleFlatButton = QStringLiteral("QAbstractButton{background-color: none; border: none;}"); const auto kStyleFlatButton = QStringLiteral("QAbstractButton{background-color: none; border: none;}");
const auto kStyleFlatButtonHoverable = QStringLiteral("%1\n" const auto kStyleFlatButtonHoverable = QStringLiteral(
"QAbstractButton:hover{border: 1px solid palette(highlight);" "%1\n"
" border-radius: 6px}") "QAbstractButton:hover{border: 1px solid palette(highlight);"
" border-radius: 6px}"
)
.arg(kStyleFlatButton); .arg(kStyleFlatButton);
} // namespace deskflow::gui } // namespace deskflow::gui

View file

@ -25,12 +25,16 @@ bool TlsUtility::isEnabled() const
bool TlsUtility::generateCertificate() bool TlsUtility::generateCertificate()
{ {
qDebug("generating tls certificate, " qDebug(
"all clients must trust the new fingerprint"); "generating tls certificate, "
"all clients must trust the new fingerprint"
);
if (!isEnabled()) { if (!isEnabled()) {
qCritical("unable to generate tls certificate, " qCritical(
"tls is either not available or not enabled"); "unable to generate tls certificate, "
"tls is either not available or not enabled"
);
return false; return false;
} }

View file

@ -23,9 +23,11 @@ ScreenNameValidator::ScreenNameValidator(QLineEdit *lineEdit, ValidationError *e
addValidator(std::make_unique<EmptyStringValidator>("Computer name cannot be empty")); addValidator(std::make_unique<EmptyStringValidator>("Computer name cannot be empty"));
addValidator(std::make_unique<SpacesValidator>("Computer name cannot contain spaces")); addValidator(std::make_unique<SpacesValidator>("Computer name cannot contain spaces"));
addValidator(std::make_unique<ComputerNameValidator>("Contains invalid characters or is too long")); addValidator(std::make_unique<ComputerNameValidator>("Contains invalid characters or is too long"));
addValidator(std::make_unique<ScreenDuplicationsValidator>( addValidator(
"A computer with this name already exists", lineEdit ? lineEdit->text() : "", pScreens std::make_unique<ScreenDuplicationsValidator>(
)); "A computer with this name already exists", lineEdit ? lineEdit->text() : "", pScreens
)
);
} }
} // namespace validators } // namespace validators

View file

@ -36,10 +36,12 @@ UINT MSWindowsClipboardHTMLConverter::getWin32Format() const
std::string MSWindowsClipboardHTMLConverter::doFromIClipboard(const std::string &data) const std::string MSWindowsClipboardHTMLConverter::doFromIClipboard(const std::string &data) const
{ {
// prepare to CF_HTML format prefix and suffix // prepare to CF_HTML format prefix and suffix
std::string prefix("Version:0.9\r\nStartHTML:0000000105\r\n" std::string prefix(
"EndHTML:ZZZZZZZZZZ\r\n" "Version:0.9\r\nStartHTML:0000000105\r\n"
"StartFragment:XXXXXXXXXX\r\nEndFragment:YYYYYYYYYY\r\n" "EndHTML:ZZZZZZZZZZ\r\n"
"<!DOCTYPE><HTML><BODY><!--StartFragment-->"); "StartFragment:XXXXXXXXXX\r\nEndFragment:YYYYYYYYYY\r\n"
"<!DOCTYPE><HTML><BODY><!--StartFragment-->"
);
std::string suffix("<!--EndFragment--></BODY></HTML>\r\n"); std::string suffix("<!--EndFragment--></BODY></HTML>\r\n");
// Get byte offsets for header // Get byte offsets for header

View file

@ -472,8 +472,10 @@ void assertMaskIsOne(ForeachKeyCallback cb, void *userData)
ASSERT_EQ(1, ((KeyState::AddActiveModifierContext *)userData)->m_mask); ASSERT_EQ(1, ((KeyState::AddActiveModifierContext *)userData)->m_mask);
} }
const deskflow::KeyMap::KeyItem * const deskflow::KeyMap::KeyItem *stubMapKey(
stubMapKey(deskflow::KeyMap::Keystrokes &keys, KeyID, int32_t, deskflow::KeyMap::ModifierToKeys &, KeyModifierMask &, KeyModifierMask, bool, const std::string &) deskflow::KeyMap::Keystrokes &keys, KeyID, int32_t, deskflow::KeyMap::ModifierToKeys &, KeyModifierMask &,
KeyModifierMask, bool, const std::string &
)
{ {
keys.push_back(s_stubKeystroke); keys.push_back(s_stubKeystroke);
return &s_stubKeyItem; return &s_stubKeyItem;

View file

@ -52,8 +52,10 @@ TEST_F(ClientConnectionTests, handleLogLine_alreadyConnected_showError)
EXPECT_CALL(*m_pDeps, showError(_, AlreadyConnected, serverName)); EXPECT_CALL(*m_pDeps, showError(_, AlreadyConnected, serverName));
clientConnection.handleLogLine("failed to connect to server\n" clientConnection.handleLogLine(
"server already has a connected client with our name"); "failed to connect to server\n"
"server already has a connected client with our name"
);
} }
TEST_F(ClientConnectionTests, handleLogLine_withHostname_showError) TEST_F(ClientConnectionTests, handleLogLine_withHostname_showError)
@ -95,8 +97,10 @@ TEST_F(ClientConnectionTests, handleLogLine_serverRefusedClient_shouldNotShowErr
EXPECT_CALL(*m_pDeps, showError(_, _, _)).Times(0); EXPECT_CALL(*m_pDeps, showError(_, _, _)).Times(0);
clientConnection.handleLogLine("failed to connect to server\n" clientConnection.handleLogLine(
"server refused client with our name"); "failed to connect to server\n"
"server refused client with our name"
);
} }
TEST_F(ClientConnectionTests, handleLogLine_connected_shouldPreventFutureError) TEST_F(ClientConnectionTests, handleLogLine_connected_shouldPreventFutureError)