From 53a3d32114950435165608b5459502d8b873a70e Mon Sep 17 00:00:00 2001 From: ovari123 Date: Sun, 1 Dec 2024 20:03:37 -0400 Subject: [PATCH] cleanup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit → base 64 → Base64 cancelled → canceled {cannot, can't, couldn't} → unable to inexistent → nonexistent informations → information not possible → impossible retrieven → retrieved SIP try → attempt URI WebEngine wish → want Can this replace https://review.jami.net/c/jami-client-qt/+/27607 ? Change-Id: I21e1615a0c6e2979f02f913093c503c03ab32c82 --- CMakeLists.txt | 2 +- build.py | 10 +- .../docker/Dockerfile_debian_testing | 2 +- .../docker/Dockerfile_debian_unstable | 2 +- .../gnu-linux/docker/Dockerfile_ubuntu_23.10 | 2 +- extras/scripts/format.py | 12 +- extras/scripts/gen_qml_qrc.py | 184 +++++++++--------- extras/scripts/gen_resources_qrc.py | 6 +- extras/scripts/update-translations.py | 7 +- src/app/avadapter.cpp | 4 +- src/app/connectivitymonitor.cpp | 10 +- src/app/currentconversation.cpp | 8 +- src/app/mainapplication.cpp | 2 +- src/app/platform/windows/pttlistener.cpp | 2 +- src/app/screencastportal.cpp | 14 +- src/app/utils.cpp | 20 +- src/libclient/accountmodel.cpp | 18 +- src/libclient/api/accountmodel.h | 2 +- src/libclient/api/callmodel.h | 6 +- src/libclient/api/callparticipantsmodel.h | 2 +- src/libclient/api/contactmodel.h | 2 +- src/libclient/api/conversationmodel.h | 2 +- src/libclient/api/devicemodel.h | 2 +- src/libclient/avmodel.cpp | 6 +- src/libclient/callmodel.cpp | 18 +- src/libclient/contactmodel.cpp | 20 +- 26 files changed, 181 insertions(+), 184 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5ed7eacb9..9da72048e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -233,7 +233,7 @@ list(APPEND CLIENT_INCLUDE_DIRS ${VERSION_INFO_DIR}) # QML and related code files # Check files in the app's src directory and force a reconfigure if it # changes. -# Only include webengine resources if specified. +# Only include WebEngine resources if specified. if(WITH_WEBENGINE) set(GEN_QRC_ARGS "--with-webengine") endif() diff --git a/build.py b/build.py index 5bf1dfaf7..0c818d968 100755 --- a/build.py +++ b/build.py @@ -299,7 +299,7 @@ def run_dependencies(args): print("The win32 version does not install dependencies with this script.\nPlease continue with the --install instruction.") sys.exit(1) elif args.distribution == 'guix': - print(f"Building the profile defined in '{GUIX_MANIFEST}'...") + print(f"Building the profile defined in '{GUIX_MANIFEST}'…") execute_script([f'guix shell --manifest={GUIX_MANIFEST} -- true']) else: @@ -316,7 +316,7 @@ def run_init(args): client_hooks_dir = '.git/hooks' daemon_hooks_dir = '.git/modules/daemon/hooks' - print("Installing commit-msg hooks...") + print("Installing commit-msg hooks…") # Copy the commit-msg hook to all modules in the same way. for hooks_dir in [client_hooks_dir, daemon_hooks_dir]: if not os.path.exists(hooks_dir): @@ -324,7 +324,7 @@ def run_init(args): copy_file("./extras/scripts/commit-msg", os.path.join(hooks_dir, "commit-msg")) - print("Installing pre-commit hooks...") + print("Installing pre-commit hooks…") format_script = "./extras/scripts/format.py" # Prepend with the python executable if on Windows (not WSL). if sys.platform == 'win32': @@ -604,7 +604,7 @@ def run_run(args): client_process.wait() except KeyboardInterrupt: - print("\nCaught KeyboardInterrupt...") + print("\nCaught KeyboardInterrupt…") finally: if args.debug: @@ -614,7 +614,7 @@ def run_run(args): try: # Only kill the processes if they are running, as they # could have been closed by the user. - print("Killing processes...") + print("Killing processes…") if args.no_libwrap: jamid_log.close() if jamid_process.poll() is None: diff --git a/extras/packaging/gnu-linux/docker/Dockerfile_debian_testing b/extras/packaging/gnu-linux/docker/Dockerfile_debian_testing index 94a86e07c..4b8966ff0 100644 --- a/extras/packaging/gnu-linux/docker/Dockerfile_debian_testing +++ b/extras/packaging/gnu-linux/docker/Dockerfile_debian_testing @@ -12,7 +12,7 @@ RUN apt-get update --allow-releaseinfo-change && \ nasm # As of January 2024, the default compiler on Debian testing is GCC 13.2.0, which -# can't build one of Qt 6.6.1's dependencies, see: +# is unable to build one of Qt 6.6.1's dependencies, see: # https://github.com/qt/qtquick3d-assimp/commit/253f8bfa621a9fa6cd2c36291cdaa8c60c99322c # The linked commit above fixes the problem and is included in more recent versions of Qt. # For now, we use GCC 12 as a temporary workaround: diff --git a/extras/packaging/gnu-linux/docker/Dockerfile_debian_unstable b/extras/packaging/gnu-linux/docker/Dockerfile_debian_unstable index 1e8aa90ce..f63e1ef47 100644 --- a/extras/packaging/gnu-linux/docker/Dockerfile_debian_unstable +++ b/extras/packaging/gnu-linux/docker/Dockerfile_debian_unstable @@ -12,7 +12,7 @@ RUN apt-get update && \ wget # As of January 2024, the default compiler on Debian unstable is GCC 13.2.0, which -# can't build one of Qt 6.6.1's dependencies, see: +# is unable to build one of Qt 6.6.1's dependencies, see: # https://github.com/qt/qtquick3d-assimp/commit/253f8bfa621a9fa6cd2c36291cdaa8c60c99322c # The linked commit above fixes the problem and is included in more recent versions of Qt. # For now, we use GCC 12 as a temporary workaround: diff --git a/extras/packaging/gnu-linux/docker/Dockerfile_ubuntu_23.10 b/extras/packaging/gnu-linux/docker/Dockerfile_ubuntu_23.10 index 673a9a1ee..4f9fc867c 100644 --- a/extras/packaging/gnu-linux/docker/Dockerfile_ubuntu_23.10 +++ b/extras/packaging/gnu-linux/docker/Dockerfile_ubuntu_23.10 @@ -10,7 +10,7 @@ RUN apt-get update && \ python-is-python3 \ wget -# The default compiler on Ubuntu 23.10, GCC 13.2.0, can't build one of Qt 6.6.1's +# The default compiler on Ubuntu 23.10, GCC 13.2.0, is unable to build one of Qt 6.6.1's # dependencies, see: # https://github.com/qt/qtquick3d-assimp/commit/253f8bfa621a9fa6cd2c36291cdaa8c60c99322c # The linked commit above fixes the problem and is included in more recent versions of Qt. diff --git a/extras/scripts/format.py b/extras/scripts/format.py index 487db0e91..294b8dcf5 100755 --- a/extras/scripts/format.py +++ b/extras/scripts/format.py @@ -139,14 +139,14 @@ def main(): if args.type in ["cpp", "both"]: if command_exists("clang-format-" + CFVERSION): - CLANGFORMAT = "clang-format-" + CFVERSION + CLANGFORMAT = "clang-format-" + CFVERSION elif command_exists("clang-format"): - CLANGFORMAT = "clang-format" + CLANGFORMAT = "clang-format" if CLANGFORMAT is not None: print("Using source formatter: " + CLANGFORMAT) else: - print("clang-format not found. can't format source files") + print("clang-format not found, unable to format source files") if args.qt is not None and args.type in ["qml", "both"]: global QMLFORMAT # pylint: disable=global-statement @@ -154,7 +154,7 @@ def main(): if QMLFORMAT is not None: print("Using qmlformatter: " + QMLFORMAT) else: - print("qmlformat not found, can't format QML files") + print("qmlformat not found, unable to format QML files") if args.install: if CLANGFORMAT is not None or QMLFORMAT is not None: @@ -171,10 +171,10 @@ def main(): exit_if_no_files() else: if src_files and args.type in ["cpp", "both"] and CLANGFORMAT: - print("Formatting source files...") + print("Formatting source files…") clang_format_files(src_files) if qml_files and args.type in ["qml", "both"] and QMLFORMAT: - print("Formatting QML files...") + print("Formatting QML files…") qml_format_files(qml_files) diff --git a/extras/scripts/gen_qml_qrc.py b/extras/scripts/gen_qml_qrc.py index 2644ed6ae..5225b260c 100644 --- a/extras/scripts/gen_qml_qrc.py +++ b/extras/scripts/gen_qml_qrc.py @@ -1,92 +1,92 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright (C) 2022-2024 Savoir-faire Linux Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 -# USA. - -""" -Generate qrc file for qml and related code files recursively within the source -directory. -""" - -import os - -# These paths should be relative to the working directory of the -# script as set in the project CMakeLists, which should in turn be -# where the resources.qrc will be located (currently 'src/app'). -app_src_dir = os.path.join('..', '..', 'src', 'app') -resfile = os.path.join('qml.qrc') - - -def path_contains_dir(filepath, dir_str): - """ Return True if the given filepath contains the given directory. """ - # Split the filepath into its components - path_components = os.path.normpath(filepath).split(os.sep) - # Return True if the given directory is in the path - return dir_str in path_components - - -def posix_path(path): - """ - Force the use of POSIX path separators for the resource prefixes - and paths (useful only if versioning the qml.qrc file). - """ - return path.replace(os.sep, '/') - - -def gen_qml_qrc(with_webengine): - """ Generate the qml.qrc file. """ - print("Generating qml.qrc file ...") - with open(resfile, 'w', encoding='utf-8') as qrc: - qrc.write('\n') - for root, _, files in os.walk(app_src_dir): - # Skip the nowebengine directory if we can use webengine - if with_webengine and path_contains_dir(root, 'nowebengine'): - continue - # Skip the webengine directory if we can't use webengine - if not with_webengine and path_contains_dir(root, 'webengine'): - continue - filtered = [k for k in files if k.endswith('.qml') or - k.endswith('.js') or k.endswith('.html') or - k.endswith('.css') or k.endswith('.conf') or - k == 'qmldir'] - # if there are no files of interest in this directory, skip it - if not filtered: - continue - # For now, get the relative resource prefix for this directory, - # remove the leading slash, and add it as a comment to the line. - # Ideally, we should use the actual resource prefix instead of /, - # but this will require some refactoring of the QML code. - prefix = root.split(app_src_dir)[-1][1:] - qrc.write( - f'\t \n') - for file in filtered: - relpath = os.path.relpath( - os.path.join(root, file), app_src_dir) - qrc.write(f'\t\t{posix_path(relpath)}\n') - qrc.write('\t\n') - qrc.write('') - - -if __name__ == '__main__': - # We can't use webengine if we're building for macOS app store - import argparse - parser = argparse.ArgumentParser() - parser.add_argument('--with-webengine', action='store_true', - default=False, help='Include webengine resources') - args = parser.parse_args() - gen_qml_qrc(args.with_webengine) +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +# Copyright (C) 2022-2024 Savoir-faire Linux Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 +# USA. + +""" +Generate qrc file for qml and related code files recursively within the source +directory. +""" + +import os + +# These paths should be relative to the working directory of the +# script as set in the project CMakeLists, which should in turn be +# where the resources.qrc will be located (currently 'src/app'). +app_src_dir = os.path.join('..', '..', 'src', 'app') +resfile = os.path.join('qml.qrc') + + +def path_contains_dir(filepath, dir_str): + """ Return True if the given filepath contains the given directory. """ + # Split the filepath into its components + path_components = os.path.normpath(filepath).split(os.sep) + # Return True if the given directory is in the path + return dir_str in path_components + + +def posix_path(path): + """ + Force the use of POSIX path separators for the resource prefixes + and paths (useful only if versioning the qml.qrc file). + """ + return path.replace(os.sep, '/') + + +def gen_qml_qrc(with_webengine): + """ Generate the qml.qrc file. """ + print("Generating qml.qrc file…") + with open(resfile, 'w', encoding='utf-8') as qrc: + qrc.write('\n') + for root, _, files in os.walk(app_src_dir): + # Skip the nowebengine directory if we can use WebEngine + if with_webengine and path_contains_dir(root, 'nowebengine'): + continue + # Skip the webengine directory if WebEngine is unable to be used + if not with_webengine and path_contains_dir(root, 'webengine'): + continue + filtered = [k for k in files if k.endswith('.qml') or + k.endswith('.js') or k.endswith('.html') or + k.endswith('.css') or k.endswith('.conf') or + k == 'qmldir'] + # if there are no files of interest in this directory, skip it + if not filtered: + continue + # For now, get the relative resource prefix for this directory, + # remove the leading slash, and add it as a comment to the line. + # Ideally, we should use the actual resource prefix instead of /, + # but this will require some refactoring of the QML code. + prefix = root.split(app_src_dir)[-1][1:] + qrc.write( + f'\t \n') + for file in filtered: + relpath = os.path.relpath( + os.path.join(root, file), app_src_dir) + qrc.write(f'\t\t{posix_path(relpath)}\n') + qrc.write('\t\n') + qrc.write('') + + +if __name__ == '__main__': + # WebEngine is unable to be used if building for macOS App Store + import argparse + parser = argparse.ArgumentParser() + parser.add_argument('--with-webengine', action='store_true', + default=False, help='Include WebEngine resources') + args = parser.parse_args() + gen_qml_qrc(args.with_webengine) diff --git a/extras/scripts/gen_resources_qrc.py b/extras/scripts/gen_resources_qrc.py index 38d9b9176..26e623013 100644 --- a/extras/scripts/gen_resources_qrc.py +++ b/extras/scripts/gen_resources_qrc.py @@ -64,7 +64,7 @@ def gen_resources_qrc(with_webengine): qrc.write('\n') qml.write('pragma Singleton\nimport QtQuick\nQtObject {\n') for root, _, files in os.walk(resdir): - # Skip the webengine directory if we can't use webengine + # Skip the WebEngine directory if WebEngine is unable to used if not with_webengine and path_contains_dir(root, 'webengine'): continue prefix = root.rsplit(os.sep, 1)[-1] @@ -90,10 +90,10 @@ def gen_resources_qrc(with_webengine): if __name__ == '__main__': - # We can't use webengine if we're building for macOS app store + # WebEngine is unable to be used if building for macOS App Store import argparse parser = argparse.ArgumentParser() parser.add_argument('--with-webengine', action='store_true', - default=False, help='Include webengine resources') + default=False, help='Include WebEngine resources') args = parser.parse_args() gen_resources_qrc(args.with_webengine) diff --git a/extras/scripts/update-translations.py b/extras/scripts/update-translations.py index 06b4c2ac8..f007e14a9 100755 --- a/extras/scripts/update-translations.py +++ b/extras/scripts/update-translations.py @@ -3,9 +3,6 @@ ## ## Copyright (C) 2016-2024 Savoir-faire Linux Inc. ## -## Author: Edric Milaret -## Author: Guillaume Roguez -## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 3 of the License, or @@ -26,9 +23,9 @@ import shutil print("== Updating from sources") if os.system("lupdate jami.pro -no-obsolete"): - print("trying with 'lupdate-qt5'") + print("Attempting with 'lupdate-qt5'") if os.system("lupdate-qt5 jami.pro -no-obsolete"): - raise RuntimeError("unable to find any suitable lupdate Qt tool on this system. Stopping") + raise RuntimeError("Unable to find any suitable lupdate Qt tool on this system. Stopping…") print("== Pushing sources") os.system("tx push -s") diff --git a/src/app/avadapter.cpp b/src/app/avadapter.cpp index 613c088c1..422d04a49 100644 --- a/src/app/avadapter.cpp +++ b/src/app/avadapter.cpp @@ -165,7 +165,7 @@ AvAdapter::shareWayland(bool entireScreen) int err = portal->getPipewireFd(); if (err == EACCES) { - qInfo() << "Can't share screen: permission denied"; + qInfo() << "Unable to share screen: permission denied"; return; } else if (err != 0) { qWarning() << "Failed to get PipeWire fd. Error code:" << err; @@ -178,7 +178,7 @@ AvAdapter::shareWayland(bool entireScreen) .arg(portal->pipewireFd) .arg(portal->pipewireNode); #ifndef ENABLE_LIBWRAP - // If the daemon is running as a separate process, then it can't directly use the + // If the daemon is running as a separate process, then it is unable to directly use the // PipeWire file descriptor opened by the client, so it will attempt to duplicate // it using the pidfd_getfd system call. This requires the daemon process to have // ptrace permission on the client process. On some systems, this will be true by diff --git a/src/app/connectivitymonitor.cpp b/src/app/connectivitymonitor.cpp index c9024eb73..139a27689 100644 --- a/src/app/connectivitymonitor.cpp +++ b/src/app/connectivitymonitor.cpp @@ -173,10 +173,10 @@ static void logConnectionInfo(NMActiveConnection* connection) { if (connection) { - C_INFO << "primary network connection:" << nm_active_connection_get_uuid(connection) - << "default: " << (nm_active_connection_get_default(connection) ? "yes" : "no"); + C_INFO << "Primary network connection:" << nm_active_connection_get_uuid(connection) + << "default:" << (nm_active_connection_get_default(connection) ? "yes" : "no"); } else { - C_WARN << "no primary network connection detected, check network settings"; + C_WARN << "No primary network connection detected, check network settings"; } } @@ -193,7 +193,7 @@ nmClientCallback(G_GNUC_UNUSED GObject* source_object, GAsyncResult* result, Con { GError* error = nullptr; if (auto nm_client = nm_client_new_finish(result, &error)) { - C_INFO << "NetworkManager client initialized, version: " << nm_client_get_version(nm_client) + C_INFO << "NetworkManager client initialized, version:" << nm_client_get_version(nm_client) << ", daemon running:" << (nm_client_get_nm_running(nm_client) ? "yes" : "no") << ", networking enabled:" << (nm_client_networking_get_enabled(nm_client) ? "yes" : "no"); @@ -206,7 +206,7 @@ nmClientCallback(G_GNUC_UNUSED GObject* source_object, GAsyncResult* result, Con cm); } else { - C_WARN << "error initializing NetworkManager client: " << error->message; + C_WARN << "Error initializing NetworkManager client:" << error->message; g_clear_error(&error); } } diff --git a/src/app/currentconversation.cpp b/src/app/currentconversation.cpp index fa46c0004..e7f66aef0 100644 --- a/src/app/currentconversation.cpp +++ b/src/app/currentconversation.cpp @@ -152,7 +152,7 @@ CurrentConversation::updateData() updateProfile(convId); updateActiveCalls(accountId, convId); } catch (...) { - qWarning() << "An error occurred while updating current conversation data for" << convId; + qWarning() << "Error while updating current conversation data for" << convId; } } @@ -227,7 +227,7 @@ CurrentConversation::updateProfile(const QString& convId) try { if (auto optConv = convModel->getConversationForUid(convId)) { auto& convInfo = optConv->get(); - // Now, update call informations (rdvAccount/device) + // Now, update call information (rdvAccount/device) if (convInfo.infos.contains("rdvAccount")) { set_rdvAccount(convInfo.infos["rdvAccount"]); } else { @@ -270,7 +270,7 @@ CurrentConversation::connectModel() auto currentConversationModel = lrcInstance_->getCurrentConversationModel(); auto currentCallModel = lrcInstance_->getCurrentCallModel(); if (!currentConversationModel || !currentCallModel) { - C_DBG << "CurrentConversation: can't connect to unavailable models"; + C_DBG << "CurrentConversation: unable to connect to unavailable models"; return; } @@ -320,7 +320,7 @@ CurrentConversation::updateErrors(const QString& convId) } else if (code == 3) { newErrors.append(tr("An invalid message was detected")); } else if (code == 4) { - newErrors.append(tr("Not authorized to update conversation information")); + newErrors.append(tr("Insufficient permission to update conversation information")); } else if (code == 5) { newErrors.append(tr("An error occurred while committing a new message")); } else { diff --git a/src/app/mainapplication.cpp b/src/app/mainapplication.cpp index 64a2bd81a..f00e0ef5c 100644 --- a/src/app/mainapplication.cpp +++ b/src/app/mainapplication.cpp @@ -189,7 +189,7 @@ bool MainApplication::init() { // This 2-phase initialisation prevents ephemeral instances from - // performing unnecessary tasks, like initializing the webengine. + // performing unnecessary tasks, like initializing the WebEngine. engine_.reset(new QQmlApplicationEngine(this)); QWK::registerTypes(engine_.get()); diff --git a/src/app/platform/windows/pttlistener.cpp b/src/app/platform/windows/pttlistener.cpp index 86e64a5ad..da0665fce 100644 --- a/src/app/platform/windows/pttlistener.cpp +++ b/src/app/platform/windows/pttlistener.cpp @@ -210,7 +210,7 @@ PTTListener::Impl::qtKeyToVKey(Qt::Key key) return VK_MEDIA_PLAY_PAUSE; case Qt::Key_MediaStop: return VK_MEDIA_STOP; - // couldn't find those in VK_* + // unable to find those in VK_* // case Qt::Key_MediaLast: // case Qt::Key_MediaRecord: case Qt::Key_VolumeDown: diff --git a/src/app/screencastportal.cpp b/src/app/screencastportal.cpp index b0edf404d..d309632d9 100644 --- a/src/app/screencastportal.cpp +++ b/src/app/screencastportal.cpp @@ -150,7 +150,7 @@ ScreenCastPortal::onStartResponseReceivedCallback(GDBusConnection* connection, if (response) { g_variant_unref(result); - portal->abort(EACCES, "Failed to start screencast, denied or cancelled by user"); + portal->abort(EACCES, "Failed to start screencast, denied or canceled by user"); return; } @@ -204,7 +204,7 @@ ScreenCastPortal::start() request_token = "pipewiregrabStart"; request_path = g_strdup_printf(REQUEST_PATH, sender_name, request_token); - qInfo() << "Asking for monitor..."; + qInfo() << "Asking for monitor…"; ptr_dbus_call_data = subscribeToSignal(request_path, onStartResponseReceivedCallback); if (!ptr_dbus_call_data) { @@ -240,7 +240,7 @@ ScreenCastPortal::onSelectSourcesResponseReceivedCallback(GDBusConnection* conne g_variant_get(parameters, "(u@a{sv})", &response, &ret); g_variant_unref(ret); if (response) { - portal->abort(EACCES, "Failed to select screencast sources, denied or cancelled by user"); + portal->abort(EACCES, "Failed to select screencast sources, denied or canceled by user"); return; } @@ -308,7 +308,7 @@ ScreenCastPortal::onCreateSessionResponseReceivedCallback(GDBusConnection* conne if (response != 0) { g_variant_unref(result); - portal->abort(EACCES, "Failed to create screencast session, denied or cancelled by user"); + portal->abort(EACCES, "Failed to create screencast session, denied or canceled by user"); return; } @@ -455,7 +455,7 @@ ScreenCastPortal::getPipewireFd() g_main_loop_run(glib_main_loop); // The main loop will run until it's stopped by openPipewireRemote (if // all DBus method calls were successful), abort (in case of error) or - // on_cancelled_callback (if a DBus request is cancelled). + // on_cancelled_callback (if a DBus request is canceled). // In the latter two cases, pw_ctx->portal_error gets set to a nonzero value. if (portal_error) ret = portal_error; @@ -506,13 +506,13 @@ ScreenCastPortal::~ScreenCastPortal() g_clear_pointer(&sender_name, g_free); #ifndef ENABLE_LIBWRAP - // If the daemon is running as a separate process, then it can't directly use the + // If the daemon is running as a separate process, then it is unable to directly use the // PipeWire file descriptor opened by the client, so it will have to duplicate it. // The duplicated file descriptor will be closed by the daemon, but the original // file descriptor needs to be closed by the client. if (close(pipewireFd) != 0) { int err = errno; - qWarning() << "An error occurred while attempting to close PipeWire file descriptor: errno =" + qWarning() << "Error while attempting to close PipeWire file descriptor: errno =" << err; } else { qInfo() << "PipeWire file descriptor closed successfully."; diff --git a/src/app/utils.cpp b/src/app/utils.cpp index 94686139e..2c07a0cbf 100644 --- a/src/app/utils.cpp +++ b/src/app/utils.cpp @@ -76,7 +76,7 @@ Utils::remove_argument(char** argv, } }); - // If any occurrences were removed... + // If any occurrences were removed… if (new_end != argv + argc) { // Adjust the argument count. argc = std::distance(argv, new_end); @@ -87,7 +87,7 @@ void Utils::testVulkanSupport() { #if defined(Q_OS_WIN) - // Checks Vulkan support using the vulkan functions loaded directly + // Checks Vulkan support using the Vulkan functions loaded directly // from vulkan-1.dll. struct DllLoader { @@ -95,7 +95,7 @@ Utils::testVulkanSupport() : module(LoadLibraryA(filename.c_str())) { if (module == nullptr) { - throw std::runtime_error("Can't load module."); + throw std::runtime_error("Unable to load module."); } } ~DllLoader() @@ -123,7 +123,7 @@ Utils::testVulkanSupport() int VkInstanceCreateInfo[16] = {1}; auto result = vkCreateInstance(VkInstanceCreateInfo, 0, &instance); if (!instance || result != 0) { - throw std::runtime_error("Can't create Vulkan instance."); + throw std::runtime_error("Unable to create Vulkan instance."); } #endif } @@ -170,7 +170,7 @@ Utils::CreateStartupLink(const std::wstring& wstrAppName) #endif if (desktopPath.isEmpty() || !(QFile::exists(desktopPath))) { - qDebug() << "An error occurred while attempting to locate .desktop file at" + qDebug() << "Error while attempting to locate .desktop file at" << desktopPath; return false; } @@ -198,7 +198,7 @@ Utils::CreateStartupLink(const std::wstring& wstrAppName) if (QDir().mkdir(autoStartDir)) { qDebug() << "Created autostart directory:" << autoStartDir; } else { - qWarning() << "An error occurred while creating autostart directory:" + qWarning() << "Error while creating autostart directory:" << autoStartDir; return false; } @@ -302,7 +302,7 @@ Utils::removeOldVersions() * remove 1. the configuration reg keys for Ring-x64, 2. the startup links for Ring, * 3. the winsparkle reg keys. The NSIS uninstall reg keys for Jami-x64 are removed * by the MSI installer. - * Uninstallation of Ring, either 32 or 64 bit, is left to the user. + * Uninstallation of Ring, either 32-bit or 64-bit, is left to the user. * The current version of Jami will attempt to kill Ring.exe upon start if a startup * link is found. */ @@ -467,7 +467,7 @@ Utils::conversationAvatar(LRCInstance* instance, if (!photo.isNull()) { return scaleAndFrame(photo, size); } - qWarning() << "Couldn't load image from base 64 data for conversation " << convId; + qWarning() << "Unable to load image from Base64 data for conversation " << convId; } // Else, generate an avatar auto members = convModel->peersForConversation(convId); @@ -625,7 +625,7 @@ Utils::getProjectCredits() QObject::tr("We would like to thank our contributors, whose efforts over many years have made this software what it is."), QObject::tr("Developers"), QObject::tr("Media"), QObject::tr("Community Management"), QObject::tr("Special thanks to"), QObject::tr("This is a list of people who have made a significant investment of time,\ - with useful results, into Jami. Any such contributors who wish to be added to the list \ + with useful results, into Jami. Any such contributors who want to be added to the list \ should contact us.")); } @@ -866,7 +866,7 @@ Utils::QByteArrayFromFile(const QString& filename) if (file.open(QIODevice::ReadOnly)) { return file.readAll(); } - qDebug() << "QByteArrayFromFile: can't open file" << filename; + qDebug() << "QByteArrayFromFile: unable to open file" << filename; return {}; } diff --git a/src/libclient/accountmodel.cpp b/src/libclient/accountmodel.cpp index a1244eb45..ceb915d6f 100644 --- a/src/libclient/accountmodel.cpp +++ b/src/libclient/accountmodel.cpp @@ -105,7 +105,7 @@ public: void updateAccountDetails(account::Info& account); /** - * get a modifiable account informations associated to an accountId. + * get a modifiable account information associated to an accountId. * @param accountId. * @return a account::Info& structure. */ @@ -357,7 +357,7 @@ AccountModel::getAccountInfo(const QString& accountId) const { auto accountInfo = pimpl_->accounts.find(accountId); if (accountInfo == pimpl_->accounts.end()) - throw std::out_of_range("AccountModel::getAccountInfo, can't find account " + throw std::out_of_range("AccountModel::getAccountInfo, unable to find account " + accountId.toStdString()); return accountInfo->second.first; @@ -506,7 +506,7 @@ AccountModelPimpl::getAccountInfo(const QString& accountId) { auto account = accounts.find(accountId); if (account == accounts.end()) { - throw std::out_of_range("AccountModelPimpl::getAccountInfo, can't find " + throw std::out_of_range("AccountModelPimpl::getAccountInfo, unable to find " + accountId.toStdString()); } return account->second.first; @@ -557,7 +557,7 @@ AccountModelPimpl::slotAccountDetailsChanged(const QString& accountId, { auto account = accounts.find(accountId); if (account == accounts.end()) { - qWarning() << Q_FUNC_INFO << ": can't find " << accountId; + qWarning() << Q_FUNC_INFO << ": unable to find " << accountId; return; } auto& accountInfo = account->second.first; @@ -578,7 +578,7 @@ AccountModelPimpl::slotVolatileAccountDetailsChanged(const QString& accountId, { auto account = accounts.find(accountId); if (account == accounts.end()) { - LC_DBG << Q_FUNC_INFO << ": can't find " << accountId; + LC_DBG << Q_FUNC_INFO << ": unable to find " << accountId; return; } auto& accountInfo = account->second.first; @@ -713,7 +713,7 @@ AccountModelPimpl::slotAccountProfileReceived(const QString& accountId, if (account == accounts.end() || userPhoto.isEmpty()) return; // NOTE: This signal is still used for JAMS account where the avatar is - // retrieven from the server. In this case we MUST save it. + // retrieved from the server. In this case we MUST save it. auto& accountInfo = account->second.first; accountInfo.profileInfo.avatar = userPhoto; accountInfo.profileInfo.alias = displayName; @@ -744,7 +744,7 @@ AccountModelPimpl::addToAccounts(const QString& accountId) auto it = accounts.emplace(accountId, std::make_pair(account::Info(), db)); if (!it.second) { - LC_WARN << "failed to add new account: id already present in map"; + LC_WARN << "Failed to add new account: id already present in map"; return; } @@ -1123,7 +1123,7 @@ AccountModel::accountVCard(const QString& accountId, bool compressImage) const const QString AccountModel::bestNameForAccount(const QString& accountID) { - // Order: Alias, registeredName, uri + // Order: alias, registeredName, uri auto& accountInfo = getAccountInfo(accountID); auto alias = accountInfo.profileInfo.alias.simplified(); @@ -1142,7 +1142,7 @@ AccountModel::bestNameForAccount(const QString& accountID) const QString AccountModel::bestIdForAccount(const QString& accountID) { - // Order: RegisteredName, uri after best name + // Order: registeredName, uri after best name // return empty string if duplicated with best name auto& accountInfo = getAccountInfo(accountID); diff --git a/src/libclient/api/accountmodel.h b/src/libclient/api/accountmodel.h index e68b0cf8b..73b193ddf 100644 --- a/src/libclient/api/accountmodel.h +++ b/src/libclient/api/accountmodel.h @@ -66,7 +66,7 @@ public: Q_INVOKABLE size_t getAccountCount() const; /** - * get account informations associated to an accountId. + * get account information associated to an accountId. * @param accountId. * @return a const account::Info& structure. */ diff --git a/src/libclient/api/callmodel.h b/src/libclient/api/callmodel.h index e2d0fdc24..a57371935 100644 --- a/src/libclient/api/callmodel.h +++ b/src/libclient/api/callmodel.h @@ -53,7 +53,7 @@ class AccountModel; class CallParticipants; /** - * @brief Class that manages call informations. + * @brief Class that manages call information. */ class LIB_EXPORT CallModel : public QObject { @@ -78,7 +78,7 @@ public: * Create a new call with a contact * @param uri of the contact to call * @param isAudioOnly, set to false by default - * @return the call uid created. Empty string is returned if call couldn't be created. + * @return the call uid created. Empty string is returned if call is unable to be created. */ QString createCall(const QString& uri, bool isAudioOnly = false, @@ -387,7 +387,7 @@ public: const QList& getPendingConferencees(); /** - * Get informations on the rendered device + * Get information on the rendered device * @param call_id linked call to the renderer * @return the device rendered */ diff --git a/src/libclient/api/callparticipantsmodel.h b/src/libclient/api/callparticipantsmodel.h index 05efc92a7..0ff66679b 100644 --- a/src/libclient/api/callparticipantsmodel.h +++ b/src/libclient/api/callparticipantsmodel.h @@ -168,7 +168,7 @@ public: /** * @param index participant index - * @return informations of the participant in index + * @return information of the participant in index */ QJsonObject toQJsonObject(uint index) const; diff --git a/src/libclient/api/contactmodel.h b/src/libclient/api/contactmodel.h index ca74537cc..55d367cf2 100644 --- a/src/libclient/api/contactmodel.h +++ b/src/libclient/api/contactmodel.h @@ -79,7 +79,7 @@ public: * get contact information. * @param contactUri * @return the contact::Info structure for a contact - * @throws out_of_range exception if can't find the contact + * @throws out_of_range exception if it is unable to find the contact */ const contact::Info getContact(const QString& contactUri) const; ContactInfoMap getSearchResults() const; diff --git a/src/libclient/api/conversationmodel.h b/src/libclient/api/conversationmodel.h index 707ac3a75..c8078b764 100644 --- a/src/libclient/api/conversationmodel.h +++ b/src/libclient/api/conversationmodel.h @@ -73,7 +73,7 @@ struct AccountConversation typedef QVector> ConferenceableValue; /** - * @brief Class that manages conversation informations. + * @brief Class that manages conversation information. */ class LIB_EXPORT ConversationModel : public QObject { diff --git a/src/libclient/api/devicemodel.h b/src/libclient/api/devicemodel.h index 81bc12afd..82d911e8b 100644 --- a/src/libclient/api/devicemodel.h +++ b/src/libclient/api/devicemodel.h @@ -86,7 +86,7 @@ public: * Change the name of the current device * @param newName * @note will emit deviceUpdated when finished - * @note ring can't change the name of another device + * @note ring is unable to change the name of another device */ void setCurrentDeviceName(const QString& newName); diff --git a/src/libclient/avmodel.cpp b/src/libclient/avmodel.cpp index 56285fce8..984aacc6b 100644 --- a/src/libclient/avmodel.cpp +++ b/src/libclient/avmodel.cpp @@ -355,7 +355,7 @@ AVModel::getDeviceIdFromName(const QString& deviceName) const return settings.name == deviceName; }); if (iter == devices.end()) { - LC_WARN << "Couldn't find device: " << deviceName; + LC_WARN << "Unable to find device: " << deviceName; return {}; } return *iter; @@ -489,7 +489,7 @@ void AVModel::stopLocalRecorder(const QString& path) const { if (path.isEmpty()) { - LC_WARN << "stopLocalRecorder: can't stop non existing recording"; + LC_WARN << "stopLocalRecorder: unable to stop non existing recording"; return; } @@ -1058,7 +1058,7 @@ AVModelPimpl::removeRenderer(const QString& id) QWriteLocker lk(&renderersMutex_); auto it = renderers_.find(id); if (it == renderers_.end()) { - LC_DBG << "Cannot remove renderer. " << id << " not found"; + LC_DBG << "Unable to remove renderer. " << id << " not found"; return {}; } auto removed = std::move(it->second); diff --git a/src/libclient/callmodel.cpp b/src/libclient/callmodel.cpp index ff5985365..fc56d3f8d 100644 --- a/src/libclient/callmodel.cpp +++ b/src/libclient/callmodel.cpp @@ -280,7 +280,7 @@ CallModel::~CallModel() {} const call::Info& CallModel::getCallFromURI(const QString& uri, bool notOver) const { - // For a NON SIP account the scheme can be ring:. Sometimes it can miss, and will be certainly + // For a non-SIP account the scheme can be ring:. Sometimes it can miss, and will be certainly // replaced by jami://. // Just make the comparaison ignoring the scheme and check the rest. auto uriObj = URI(uri); @@ -402,7 +402,7 @@ CallModel::createCall(const QString& uri, bool isAudioOnly, VectorMapStringStrin pimpl_->waitForConference_ = uri; return {}; } - qWarning() << "no call placed between (account: " << owner.id << ", contact: " << uri + qWarning() << "No call placed between (account: " << owner.id << ", contact: " << uri << ")"; return ""; } @@ -805,7 +805,7 @@ CallModel::transferToCall(const QString& callId, const QString& callIdDest) cons void CallModel::joinCalls(const QString& callIdA, const QString& callIdB) const { - // Get call informations + // Get call information call::Info call1, call2; QString accountIdCall1 = {}, accountIdCall2 = {}; for (const auto& account_id : owner.accountModel->getAccountList()) { @@ -825,7 +825,7 @@ CallModel::joinCalls(const QString& callIdA, const QString& callIdB) const } } if (accountIdCall1.isEmpty() || accountIdCall2.isEmpty()) { - qWarning() << "Can't join inexistent calls."; + qWarning() << "Unable to join nonexistent calls."; return; } @@ -836,7 +836,7 @@ CallModel::joinCalls(const QString& callIdA, const QString& callIdB) const callIdB); if (!joined) { - qWarning() << "Conference: " << callIdA << " couldn't join conference " << callIdB; + qWarning() << "Conference: " << callIdA << " is unable to join conference " << callIdB; return; } if (accountIdCall1 != owner.id) { @@ -860,7 +860,7 @@ CallModel::joinCalls(const QString& callIdA, const QString& callIdB) const bool joined = CallManager::instance().addParticipant(accountCall, call, accountCall, conf); if (!joined) { - qWarning() << "Call: " << call << " couldn't join conference " << conf; + qWarning() << "Call: " << call << " is unable to join conference " << conf; return; } if (accountCall != owner.id) { @@ -1067,7 +1067,7 @@ CallModelPimpl::CallModelPimpl(const CallModel& linked, &CallModelPimpl::onRecordingStateChanged); #ifndef ENABLE_LIBWRAP - // Only necessary with dbus since the daemon runs separately + // Only necessary with D-Bus since the daemon runs separately initCallFromDaemon(); initConferencesFromDaemon(); #endif @@ -1139,8 +1139,8 @@ CallModelPimpl::initCallFromDaemon() callInfo->layout = participantsPtr->getLayout(); participantsModel.emplace(callId, std::move(participantsPtr)); calls.emplace(callId, std::move(callInfo)); - // NOTE/BUG: the videorenderer can't know that the client has restarted - // So, for now, a user will have to manually restart the medias until + // NOTE/BUG: the videorenderer is unable to know that the client has restarted + // So, for now, a user will have to manually restart the media until // this renderer is not redesigned. } } diff --git a/src/libclient/contactmodel.cpp b/src/libclient/contactmodel.cpp index 080cdef93..c77e61acf 100644 --- a/src/libclient/contactmodel.cpp +++ b/src/libclient/contactmodel.cpp @@ -95,12 +95,12 @@ public: void searchSipContact(const URI& query); /** - * Update temporary item to display a given message about a given uri. + * Update temporary item to display a given message about a given URI. */ void updateTemporaryMessage(const QString& mes); /** - * Check if equivalent uri exist in contact + * Check if equivalent URI exist in contact */ QString sipUriReceivedFilter(const QString& uri); @@ -446,7 +446,7 @@ ContactModel::searchContact(const QString& query) auto uriScheme = uri.schemeType(); if (static_cast(uriScheme) > 2 && owner.profileInfo.type == profile::Type::SIP) { - // sip account do not care if schemeType is NONE, or UNRECOGNIZED (enum value > 2) + // SIP account do not care if schemeType is NONE, or UNRECOGNIZED (enum value > 2) uriScheme = URI::SchemeType::SIP; } else if (uriScheme == URI::SchemeType::NONE && owner.profileInfo.type == profile::Type::JAMI) { uriScheme = URI::SchemeType::RING; @@ -485,7 +485,7 @@ ContactModelPimpl::searchContact(const URI& query) if (query.protocolHint() == URI::ProtocolHint::RING) { updateTemporaryMessage(""); - // no lookup, this is a ring infoHash + // No lookup, this is a ring infoHash for (auto& i : contacts) if (i.profileInfo.uri == uriId) return; @@ -991,7 +991,7 @@ ContactModelPimpl::slotRegisteredNameFound(const QString& accountId, updateTemporaryMessage(tr("Username not found")); break; case 3 /* ERROR */: - updateTemporaryMessage(tr("Couldn't lookup…")); + updateTemporaryMessage(tr("Unable to lookup…")); break; } return; @@ -1069,7 +1069,7 @@ ContactModelPimpl::slotNewAccountMessage(const QString& accountId, if (potentialContact.isEmpty()) { addToContacts(peerId, profile::Type::SIP, "", false); } else { - // equivalent uri exist, use that uri + // equivalent URI exist, use that URI peerId2 = potentialContact; } } else { @@ -1084,8 +1084,8 @@ ContactModelPimpl::slotNewAccountMessage(const QString& accountId, QString ContactModelPimpl::sipUriReceivedFilter(const QString& uri) { - // this function serves when the uri is not found in the contact list - // return "" means need to add new contact, else means equivalent uri exist + // this function serves when the URI is not found in the contact list + // return "" means need to add new contact, else means equivalent URI exist std::string uriCopy = uri.toStdString(); auto pos = uriCopy.find("@"); @@ -1132,7 +1132,7 @@ ContactModelPimpl::sipUriReceivedFilter(const QString& uri) // no need to check country dial-in codes return ""; } - // "@" is not found -> not possible since all response uri has one + // "@" is not found → impossible since all response URI has one return ""; } @@ -1189,7 +1189,7 @@ ContactModelPimpl::slotProfileReceived(const QString& accountId, return; if (linked.owner.profileInfo.uri == peer || peer == "") { - // as SIP account doesn't have a uri, we emit a signal with the accountId in the peer parameter + // as SIP account doesn't have a URI, we emit a signal with the accountId in the peer parameter const auto newProfileInfo = storage::getProfileData(accountId, ""); linked.owner.accountModel->setAlias(accountId, newProfileInfo["alias"], false); linked.owner.accountModel->setAvatar(accountId, newProfileInfo["avatar"], false);