diff --git a/src/apps/deskflow-gui/MainWindow.cpp b/src/apps/deskflow-gui/MainWindow.cpp index 1bbb6253e..b44b88618 100644 --- a/src/apps/deskflow-gui/MainWindow.cpp +++ b/src/apps/deskflow-gui/MainWindow.cpp @@ -1125,11 +1125,12 @@ void MainWindow::setHostName() if (existingScreen) { body = tr("Screen name already exists"); } else { - body = tr("The name you have chosen is invalid.\n\n" - "Valid names:\n" - "• Use letters and numbers\n" - "• May also use _ or -\n" - "• Are between 1 and 255 characters"); + body = + tr("The name you have chosen is invalid.\n\n" + "Valid names:\n" + "• Use letters and numbers\n" + "• May also use _ or -\n" + "• Are between 1 and 255 characters"); } QMessageBox::information(this, title, body); return; diff --git a/src/apps/deskflow-gui/dialogs/FingerprintDialog.cpp b/src/apps/deskflow-gui/dialogs/FingerprintDialog.cpp index 1d4ce18ed..f4668f875 100644 --- a/src/apps/deskflow-gui/dialogs/FingerprintDialog.cpp +++ b/src/apps/deskflow-gui/dialogs/FingerprintDialog.cpp @@ -45,8 +45,9 @@ FingerprintDialog::FingerprintDialog( connect(m_buttonBox->button(QDialogButtonBox::Ok), &QPushButton::clicked, this, &QDialog::accept); } else { setWindowTitle(tr("Security Question")); - auto body = tr("Compare the fingerprints in this dialog to those on the %1.\n" - "Only connect if they match!"); + auto body = + tr("Compare the fingerprints in this dialog to those on the %1.\n" + "Only connect if they match!"); if (mode == FingerprintDialogMode::Server) { m_lblHeader->setText(tr("A new client is connecting.\n%1").arg(body.arg(tr("client")))); diff --git a/src/apps/deskflow-gui/main.cpp b/src/apps/deskflow-gui/main.cpp index 46d9e19b3..bdbaac204 100644 --- a/src/apps/deskflow-gui/main.cpp +++ b/src/apps/deskflow-gui/main.cpp @@ -120,8 +120,10 @@ int main(int argc, char *argv[]) #if defined(Q_OS_MAC) if (app.applicationDirPath().startsWith("/Volumes/")) { - QString msgBody = QStringLiteral("Please drag %1 to the Applications folder, " - "and open it from there."); + QString msgBody = QStringLiteral( + "Please drag %1 to the Applications folder, " + "and open it from there." + ); QMessageBox::information(NULL, kAppName, msgBody.arg(kAppName)); return 1; } @@ -181,9 +183,11 @@ bool checkMacAssistiveDevices() // now deprecated in mavericks. bool result = AXAPIEnabled(); if (!result) { - QString msgBody = QString("Please enable access to assistive devices " - "System Preferences -> Security & Privacy -> " - "Privacy -> Accessibility, then re-open %1."); + QString msgBody = QString( + "Please enable access to assistive devices " + "System Preferences -> Security & Privacy -> " + "Privacy -> Accessibility, then re-open %1." + ); QMessageBox::information(NULL, kAppName, msgBody.arg(kAppName)); } return result; diff --git a/src/lib/arch/win32/XArchWindows.cpp b/src/lib/arch/win32/XArchWindows.cpp index eab011d0b..388d3e794 100644 --- a/src/lib/arch/win32/XArchWindows.cpp +++ b/src/lib/arch/win32/XArchWindows.cpp @@ -41,92 +41,166 @@ std::string XArchEvalWinsock::eval() const throw() { int m_code; const char *m_msg; - } s_netErrorCodes[] = { - /* 10004 */ {WSAEINTR, "The (blocking) call was canceled via WSACancelBlockingCall"}, - /* 10009 */ {WSAEBADF, "Bad file handle"}, - /* 10013 */ - {WSAEACCES, "The requested address is a broadcast address, but the " - "appropriate flag was not set"}, - /* 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 */ + } + + s_netErrorCodes[] = { + + // 10004 + {WSAEINTR, "The (blocking) call was canceled via WSACancelBlockingCall"}, + + // 10009 + {WSAEBADF, "Bad file handle"}, + + // 10013 + {WSAEACCES, "The requested address is a broadcast address, but the appropriate flag was not set"}, + + // 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"}, - /* 10037 */ + + // 10037 {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"}, - /* 10040 */ - {WSAEMSGSIZE, "The datagram was too large to fit into the specified " - "buffer and was truncated"}, - /* 10041 */ + + // 10038 + {WSAENOTSOCK, "At least on descriptor is not a socket"}, + + // 10039 + {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"}, - /* 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"}, - /* 10044 */ + + // 10044 {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"}, - /* 10046 */ {WSAEPFNOSUPPORT, "BSD: Protocol family not supported"}, - /* 10047 */ + + // 10046 + {WSAEPFNOSUPPORT, "BSD: Protocol family not supported"}, + + // 10047 {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"}, - /* 10050 */ - {WSAENETDOWN, "The Windows Sockets implementation has detected that the " - "network subsystem has failed"}, - /* 10051 */ + + // 10050 + {WSAENETDOWN, "The Windows Sockets implementation has detected that the network subsystem has failed"}, + + // 10051 {WSAENETUNREACH, "The network can't be reached from this host at this time"}, - /* 10052 */ - {WSAENETRESET, "The connection must be reset because the Windows Sockets " - "implementation dropped it"}, - /* 10053 */ + + // 10052 + {WSAENETRESET, "The connection must be reset because the Windows Sockets implementation dropped it"}, + + // 10053 {WSAECONNABORTED, "The virtual circuit was aborted due to timeout or other failure"}, - /* 10054 */ + + // 10054 {WSAECONNRESET, "The virtual circuit was reset by the remote side"}, - /* 10055 */ - {WSAENOBUFS, "No buffer space is available or a buffer deadlock has " - "occured. The socket cannot be created"}, - /* 10056 */ {WSAEISCONN, "The socket is already connected"}, - /* 10057 */ {WSAENOTCONN, "The socket is not connected"}, - /* 10058 */ {WSAESHUTDOWN, "The socket has been shutdown"}, - /* 10059 */ {WSAETOOMANYREFS, "BSD: Too many references"}, - /* 10060 */ + + // 10055 + {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"}, + + // 10058 + {WSAESHUTDOWN, "The socket has been shutdown"}, + + // 10059 + {WSAETOOMANYREFS, "BSD: Too many references"}, + + // 10060 {WSAETIMEDOUT, "Attempt to connect timed out without establishing a connection"}, - /* 10061 */ {WSAECONNREFUSED, "Connection was refused"}, - /* 10062 */ {WSAELOOP, "Undocumented WinSock error code used in BSD"}, - /* 10063 */ + + // 10061 + {WSAECONNREFUSED, "Connection was refused"}, + + // 10062 + {WSAELOOP, "Undocumented WinSock error code used in BSD"}, + + // 10063 {WSAENAMETOOLONG, "Undocumented WinSock error code used in BSD"}, - /* 10064 */ {WSAEHOSTDOWN, "Undocumented WinSock error code used in BSD"}, - /* 10065 */ {WSAEHOSTUNREACH, "No route to host"}, - /* 10066 */ {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 */ + + // 10064 + {WSAEHOSTDOWN, "Undocumented WinSock error code used in BSD"}, + + // 10065 + {WSAEHOSTUNREACH, "No route to host"}, + + // 10066 + {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"}, - /* 10092 */ - {WSAVERNOTSUPPORTED, "The version of WinSock API support requested is " - "not provided in this implementation"}, - /* 10093 */ + + // 10092 + {WSAVERNOTSUPPORTED, "The version of WinSock API support requested is not provided in this implementation"}, + + // 10093 {WSANOTINITIALISED, "WinSock subsystem not properly initialized"}, - /* 10101 */ + + // 10101 {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"}, - /* 11003 */ + + // 11003 {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"}, - /* end */ {0, NULL} + + // end + {0, NULL} }; for (unsigned int i = 0; s_netErrorCodes[i].m_code != 0; ++i) { diff --git a/src/lib/deskflow/win32/AppUtilWindows.cpp b/src/lib/deskflow/win32/AppUtilWindows.cpp index 11f41130e..ba94010b8 100644 --- a/src/lib/deskflow/win32/AppUtilWindows.cpp +++ b/src/lib/deskflow/win32/AppUtilWindows.cpp @@ -222,8 +222,10 @@ void AppUtilWindows::showNotification(const std::string &title, const std::strin return; } if (!WinToastLib::WinToast::instance()->isInitialized()) { - WinToastLib::WinToast::instance()->setAppName(L"" - "Deskflow"); + WinToastLib::WinToast::instance()->setAppName( + L"" + "Deskflow" + ); const auto aumi = WinToastLib::WinToast::configureAUMI( L"" "Deskflow Developers", diff --git a/src/lib/gui/config/ConfigScopes.h b/src/lib/gui/config/ConfigScopes.h index 107eb6b4d..8bfc457f2 100644 --- a/src/lib/gui/config/ConfigScopes.h +++ b/src/lib/gui/config/ConfigScopes.h @@ -40,8 +40,9 @@ public: bool scopeContains(const QString &name, Scope scope = Scope::Current) const override; bool isActiveScopeWritable() const 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) - const override; + QVariant getFromScope( + const QString &name, const QVariant &defaultValue = QVariant(), Scope scope = Scope::Current + ) const override; void setActiveScope(Scope scope = Scope::User) override; Scope activeScope() const override; QSettingsProxy &activeSettings() override; diff --git a/src/lib/gui/messages.cpp b/src/lib/gui/messages.cpp index 4ae406ffa..a2d9433a6 100644 --- a/src/lib/gui/messages.cpp +++ b/src/lib/gui/messages.cpp @@ -49,8 +49,10 @@ void showErrorDialog(const QString &message, const QString &fileLine, QtMsgType text = "
Sorry, a critical error has occurred.
"; } - text += QString(R"(Please report a bug)" - " and copy/paste the following error:
") + text += QString( + R"(Please report a bug)" + " and copy/paste the following error:
" + ) .arg(kUrlHelp, kColorSecondary); text += QString("v%1\n%2\n%3").arg(kVersion, message, fileLine); @@ -117,18 +119,22 @@ void messageHandler(QtMsgType type, const QMessageLogContext &context, const QSt void showCloseReminder(QWidget *parent) { - QString message = QString("
%1 will continue to run in the background and can be accessed " - "via the %1 icon in your system notifications area. This " - "setting " - "can be disabled.
") + QString message = QString( + "%1 will continue to run in the background and can be accessed " + "via the %1 icon in your system notifications area. This " + "setting " + "can be disabled.
" + ) .arg(kAppName); #if defined(Q_OS_LINUX) - message += QString("On some Linux systems such as GNOME 3, the " - "notification area might be disabled. " - "You may need to " - R"(enable an extension)" - " to see the %3 tray icon.
") + message += QString( + "On some Linux systems such as GNOME 3, the " + "notification area might be disabled. " + "You may need to " + R"(enable an extension)" + " to see the %3 tray icon.
" + ) .arg(kUrlGnomeTrayFix, kStyleLink, kAppName); #endif @@ -139,10 +145,12 @@ void showFirstServerStartMessage(QWidget *parent) { QMessageBox::information( parent, "Server is running", - QString("Great, the %1 server is now running.
" - "Now you can connect your client computers to this server. " - "You should see a prompt here on the server when a new client " - "tries to connect.
") + QString( + "Great, the %1 server is now running.
" + "Now you can connect your client computers to this server. " + "You should see a prompt here on the server when a new client " + "tries to connect.
" + ) .arg(kAppName) ); } @@ -161,13 +169,17 @@ void showFirstConnectedMessage(QWidget *parent, bool closeToTray, bool enableSer } if (!closeToTray && !enableService) { - message += QString("As you do not have the setting enabled to keep %1 running in " - "the background, you'll need to keep this window open or minimized " - "to keep %1 running.
") + message += QString( + "As you do not have the setting enabled to keep %1 running in " + "the background, you'll need to keep this window open or minimized " + "to keep %1 running.
" + ) .arg(kAppName); } else { - message += QString("You can now close this window and %1 will continue to run in " - "the background. This setting can be disabled.
") + message += QString( + "You can now close this window and %1 will continue to run in " + "the background. This setting can be disabled.
" + ) .arg(kAppName); } @@ -240,8 +252,10 @@ bool showClearSettings(QWidget *parent) QMessageBox message(parent); message.addButton(QObject::tr("Cancel"), QMessageBox::RejectRole); const auto clear = message.addButton(QObject::tr("Clear settings"), QMessageBox::AcceptRole); - message.setText(QString("Are you sure you want to clear all settings and restart %1?
" - "This action cannot be undone.
") + message.setText(QString( + "Are you sure you want to clear all settings and restart %1?
" + "This action cannot be undone.
" + ) .arg(kAppName)); message.exec(); @@ -253,8 +267,10 @@ void showReadOnlySettings(QWidget *parent, const QString &systemSettingsPath) QString nativePath = QDir::toNativeSeparators(systemSettingsPath); QMessageBox::information( parent, "Read-only settings", - QString("Settings are read-only because you only have read access " - "to the file:
%1
") + QString( + "Settings are read-only because you only have read access " + "to the file:
%1
" + ) .arg(nativePath) ); } @@ -263,14 +279,16 @@ void showWaylandLibraryError(QWidget *parent) { QMessageBox::critical( parent, "Library problem", - QString("Sorry, while this version of %1 does support Wayland, " - "this build was not linked with one or more of the required " - "libraries.
" - "Please either switch to X from your login screen or use a build " - "that uses the correct libraries.
" - "If you think this is incorrect, please " - R"(report a bug.
)" - "Please check the logs for more information.
") + QString( + "Sorry, while this version of %1 does support Wayland, " + "this build was not linked with one or more of the required " + "libraries.
" + "Please either switch to X from your login screen or use a build " + "that uses the correct libraries.
" + "If you think this is incorrect, please " + R"(report a bug.
)" + "Please check the logs for more information.
" + ) .arg(kAppName, kUrlHelp, kColorSecondary) ); } @@ -280,9 +298,11 @@ bool showUpdateCheckOption(QWidget *parent) QMessageBox message(parent); message.addButton(QObject::tr("No thanks"), QMessageBox::RejectRole); const auto checkButton = message.addButton(QObject::tr("Check for updates"), QMessageBox::AcceptRole); - message.setText(QString("Would you like to check for updates when %1 starts?
" - "Checking for updates requires an Internet connection.
" - "URL:
%2") + message.setText(QString( + "
Would you like to check for updates when %1 starts?
" + "Checking for updates requires an Internet connection.
" + "URL:
%2" + ) .arg(kAppName, env_vars::versionUrl())); message.exec(); diff --git a/src/lib/gui/styles.h b/src/lib/gui/styles.h index efab9277b..7605ef5ef 100644 --- a/src/lib/gui/styles.h +++ b/src/lib/gui/styles.h @@ -23,19 +23,25 @@ const auto kStyleLineEditErrorBorder = QStringLiteral("border: 1px solid %1; border-radius: 2px; padding: 2px;").arg(kColorError); const auto kStyleErrorActiveLabel = // - QStringLiteral("padding: 3px 5px; border-radius: 3px; " - "background-color: %1; color: %2") + QStringLiteral( + "padding: 3px 5px; border-radius: 3px; " + "background-color: %1; color: %2" + ) .arg(kColorError, kColorWhite); const auto kStyleErrorInactiveLabel = // - QStringLiteral("padding: 3px 5px; border-radius: 3px;" - "background-color: none"); + QStringLiteral( + "padding: 3px 5px; border-radius: 3px;" + "background-color: none" + ); const auto kStyleFlatButton = QStringLiteral("QAbstractButton{background-color: none; border: none;}"); -const auto kStyleFlatButtonHoverable = QStringLiteral("%1\n" - "QAbstractButton:hover{border: 1px solid palette(highlight);" - " border-radius: 6px}") +const auto kStyleFlatButtonHoverable = QStringLiteral( + "%1\n" + "QAbstractButton:hover{border: 1px solid palette(highlight);" + " border-radius: 6px}" +) .arg(kStyleFlatButton); } // namespace deskflow::gui diff --git a/src/lib/gui/tls/TlsUtility.cpp b/src/lib/gui/tls/TlsUtility.cpp index 1768acc67..c4ad35e01 100644 --- a/src/lib/gui/tls/TlsUtility.cpp +++ b/src/lib/gui/tls/TlsUtility.cpp @@ -25,12 +25,16 @@ bool TlsUtility::isEnabled() const bool TlsUtility::generateCertificate() { - qDebug("generating tls certificate, " - "all clients must trust the new fingerprint"); + qDebug( + "generating tls certificate, " + "all clients must trust the new fingerprint" + ); if (!isEnabled()) { - qCritical("unable to generate tls certificate, " - "tls is either not available or not enabled"); + qCritical( + "unable to generate tls certificate, " + "tls is either not available or not enabled" + ); return false; } diff --git a/src/lib/gui/validators/ScreenNameValidator.cpp b/src/lib/gui/validators/ScreenNameValidator.cpp index 90af51a8e..086ffc36d 100644 --- a/src/lib/gui/validators/ScreenNameValidator.cpp +++ b/src/lib/gui/validators/ScreenNameValidator.cpp @@ -23,9 +23,11 @@ ScreenNameValidator::ScreenNameValidator(QLineEdit *lineEdit, ValidationError *e addValidator(std::make_unique