From bc0af9268574f79da6c96d7d91e4048db3581272 Mon Sep 17 00:00:00 2001 From: Sergei Ilinykh Date: Fri, 15 Mar 2024 17:53:33 +0300 Subject: [PATCH] clang-format --- .travis.yml | 6 +- admin/psi-plus-nightly-version | 1 - plugins/include/accountinfoaccessinghost.h | 4 +- plugins/include/gctoolbariconaccessor.h | 2 +- plugins/include/iqfilteringhost.h | 4 +- plugins/include/menuaccessor.h | 4 +- plugins/include/pluginaccessinghost.h | 2 +- plugins/include/psimediaprovider.h | 4 +- plugins/include/toolbariconaccessor.h | 2 +- plugins/include/webkitaccessinghost.h | 2 +- src/AutoUpdater/guitest/testapp/main.cpp | 4 +- src/Certificates/CertificateDisplayDialog.cpp | 3 +- src/Certificates/CertificateErrorDialog.cpp | 11 +- src/Certificates/CertificateErrorDialog.h | 4 +- src/CocoaUtilities/CocoaTrayClick.cpp | 4 +- src/abstracttreeitem.h | 4 +- src/accountmanagedlg.cpp | 12 +- src/accountmanagedlg.h | 2 +- src/accountmodifydlg.h | 4 +- src/accountregdlg.cpp | 2 +- src/accountregdlg.h | 18 +-- src/accountscombobox.h | 2 +- src/actionlist.h | 8 +- src/activeprofiles_dbus.cpp | 5 +- src/activeprofiles_win.cpp | 4 +- src/activitycatalog.h | 4 +- src/activitydlg.cpp | 10 +- src/adduserdlg.cpp | 11 +- src/ahcexecutetask.cpp | 2 +- src/ahcformdlg.cpp | 2 +- src/ahcformdlg.h | 14 +-- src/ahcommand.h | 10 +- src/ahcommanddlg.cpp | 4 +- src/ahcommanddlg.h | 8 +- src/ahcservermanager.cpp | 4 +- src/ahcservermanager.h | 4 +- src/alerticon.cpp | 4 +- src/alerticon.h | 2 +- src/alertmanager.h | 4 +- src/applicationinfo.cpp | 17 +-- src/avatars.cpp | 12 +- src/avatars.h | 2 +- src/avcall/avcall.cpp | 28 ++--- src/avcall/calldlg.cpp | 8 +- src/avcall/jinglertp.cpp | 18 +-- src/bobfilecache.h | 2 +- src/bookmarkmanagedlg.h | 10 +- src/bookmarkmanager.cpp | 4 +- src/bookmarkmanager.h | 4 +- src/bosskey.h | 4 +- src/bytearrayreply.cpp | 4 +- src/captchadlg.cpp | 6 +- src/captchadlg.h | 4 +- src/changepwdlg.cpp | 4 +- src/changepwdlg.h | 2 +- src/chatdlg.cpp | 12 +- src/chatdlg.h | 6 +- src/chateditproxy.h | 2 +- src/chatsplitter.h | 4 +- src/chatview_te.cpp | 4 +- src/chatview_te.h | 4 +- src/chatview_webkit.cpp | 10 +- src/chatviewcommon.h | 2 +- src/chatviewtheme.cpp | 2 +- src/chatviewtheme.h | 4 +- src/chatviewtheme_p.h | 2 +- src/chatviewthemeprovider.h | 2 +- src/coloropt.cpp | 2 +- src/coloropt.h | 2 +- src/common.cpp | 8 +- src/common.h | 4 +- src/conferencebookmark.cpp | 3 +- src/conferencebookmark.h | 6 +- src/contactlistaccountmenu.cpp | 52 ++++---- src/contactlistdragmodel.h | 4 +- src/contactlistdragview.cpp | 12 +- src/contactlistdragview.h | 8 +- src/contactlistgroupmenu.cpp | 12 +- src/contactlistgroupmenu_p.h | 30 ++--- src/contactlistitem.cpp | 8 +- src/contactlistitem.h | 2 +- src/contactlistitemmenu.cpp | 2 +- src/contactlistitemmenu.h | 6 +- src/contactlistmodel.cpp | 6 +- src/contactlistmodel.h | 2 +- src/contactlistmodel_p.h | 6 +- src/contactlistmodelselection.cpp | 4 +- src/contactlistview.h | 2 +- src/contactlistviewdelegate.cpp | 12 +- src/contactlistviewdelegate_p.h | 8 +- src/contactmanager/contactmanagerdlg.cpp | 6 +- src/contactmanager/contactmanagerdlg.h | 4 +- src/contactmanager/contactmanagermodel.cpp | 10 +- src/contactmanager/contactmanagermodel.h | 2 +- src/contactmanager/contactmanagerview.cpp | 4 +- src/contactupdatesmanager.cpp | 3 +- src/contactupdatesmanager.h | 2 +- src/dbus.cpp | 6 +- src/discodlg.cpp | 22 ++-- src/discodlg.h | 2 +- src/edbflatfile.cpp | 6 +- src/edbflatfile.h | 4 +- src/edbsqlite.cpp | 6 +- src/edbsqlite.h | 6 +- src/eventdb.cpp | 4 +- src/eventdb.h | 4 +- src/eventdlg.cpp | 51 ++++---- src/eventdlg.h | 4 +- src/filecache.cpp | 15 ++- src/filecache.h | 8 +- src/filesharedlg.cpp | 10 +- src/filesharedlg.h | 8 +- src/filesharingdownloader.cpp | 19 ++- src/filesharinghttpproxy.cpp | 9 +- src/filesharinghttpproxy.h | 6 +- src/filesharingitem.cpp | 12 +- src/filesharingitem.h | 12 +- src/filesharingmanager.cpp | 6 +- src/filesharingmanager.h | 2 +- src/filesharingnamproxy.h | 6 +- src/filetransdlg.cpp | 51 ++++---- src/fileutil.cpp | 14 +-- src/gcuserview.cpp | 4 +- src/gcuserview.h | 4 +- src/geolocation.h | 4 +- src/geolocationdlg.cpp | 4 +- src/googleftmanager.cpp | 6 +- src/googleftmanager.h | 12 +- src/gpgprocess.cpp | 7 +- src/groupchatdlg.cpp | 38 +++--- src/groupchatdlg.h | 6 +- src/groupchattopicdlg.cpp | 6 +- src/groupchattopicdlg.h | 2 +- src/historycontactlistmodel.cpp | 3 +- src/historycontactlistmodel.h | 2 +- src/historydlg.cpp | 12 +- src/historydlg.h | 36 +++--- src/historyimp.cpp | 6 +- src/historyimp.h | 22 ++-- src/hoverabletreeview.cpp | 8 +- src/hoverabletreeview.h | 2 +- src/htmltextcontroller.cpp | 2 +- src/httpauthmanager.cpp | 2 +- src/infodlg.cpp | 20 +-- src/infodlg.h | 2 +- src/invitetogroupchatmenu.cpp | 2 +- src/irisprotocol/iris_discoinfoquerier.h | 2 +- src/jidutil.cpp | 2 +- src/jinglevoicecaller.cpp | 8 +- src/jinglevoicecaller.h | 14 +-- src/lastactivitytask.h | 2 +- src/main.cpp | 12 +- src/mainwin.cpp | 26 ++-- src/mainwin.h | 14 +-- src/mcmdmanager.cpp | 4 +- src/mcmdmanager.h | 2 +- src/mcmdsimplesite.h | 2 +- src/messageview.h | 10 +- src/miniclient.cpp | 4 +- src/miniclient.h | 8 +- src/mooddlg.cpp | 6 +- src/msgmle.cpp | 6 +- src/msgmle.h | 20 +-- src/mucaffiliationsmodel.cpp | 2 +- src/mucaffiliationsmodel.h | 2 +- src/mucaffiliationsproxymodel.cpp | 2 +- src/mucconfigdlg.cpp | 2 +- src/mucconfigdlg.h | 14 +-- src/mucjoindlg.h | 10 +- src/mucmanager.cpp | 2 +- src/mucmanager.h | 2 +- src/multifiletransferdlg.cpp | 11 +- src/multifiletransferitem.cpp | 4 +- src/multifiletransferitem.h | 2 +- src/options/opt_accounts.h | 2 +- src/options/opt_appearance.cpp | 2 +- src/options/opt_appearance.h | 4 +- src/options/opt_chat.h | 2 +- src/options/opt_events.h | 2 +- src/options/opt_iconset.cpp | 28 ++--- src/options/opt_iconset.h | 18 +-- src/options/opt_input.cpp | 10 +- src/options/opt_input.h | 4 +- src/options/opt_messages_common.cpp | 4 +- src/options/opt_messages_common.h | 2 +- src/options/opt_plugins.cpp | 2 +- src/options/opt_plugins.h | 4 +- src/options/opt_pluginwrapper.h | 2 +- src/options/opt_popups.cpp | 4 +- src/options/opt_popups.h | 2 +- src/options/opt_shortcuts.cpp | 18 +-- src/options/opt_sound.h | 4 +- src/options/opt_statusauto.cpp | 8 +- src/options/opt_statusgeneral.cpp | 8 +- src/options/opt_statusgeneral.h | 4 +- src/options/opt_statuspep.cpp | 4 +- src/options/opt_statuspep.h | 4 +- src/options/opt_theme.cpp | 4 +- src/options/opt_theme.h | 6 +- src/options/opt_toolbars.cpp | 12 +- src/options/opt_toolbars.h | 6 +- src/options/optionsdlgbase.cpp | 8 +- src/options/optionstab.cpp | 3 +- src/options/optionstab.h | 2 +- src/pepmanager.h | 2 +- src/pgpkeydlg.cpp | 6 +- src/pgpkeydlg.h | 4 +- src/pgputil.cpp | 4 +- src/pluginhost.cpp | 14 +-- src/pluginhost.h | 22 ++-- src/pluginmanager.cpp | 16 +-- src/pluginmanager.h | 6 +- src/popupmanager.cpp | 6 +- src/privacy/guitest/mockprivacymanager.cpp | 4 +- src/privacy/privacylist.h | 4 +- src/privacy/psiprivacymanager.cpp | 8 +- src/privacy/psiprivacymanager.h | 8 +- src/privacy/unittest/privacylistitemtest.cpp | 5 +- src/profiledlg.cpp | 6 +- src/profiles.h | 4 +- src/proxy.cpp | 12 +- src/proxy.h | 8 +- src/psi_profiles.cpp | 55 ++------ src/psiaccount.cpp | 37 +++--- src/psiaccount.h | 6 +- src/psiactionlist.cpp | 6 +- src/psichatdlg.cpp | 15 +-- src/psichatdlg.h | 12 +- src/psicon.cpp | 24 ++-- src/psicontact.cpp | 8 +- src/psicontact.h | 8 +- src/psicontactlist.cpp | 2 +- src/psicontactlist.h | 2 +- src/psicontactlistview.cpp | 7 +- src/psicontactmenu.cpp | 8 +- src/psicontactmenu_p.h | 62 +++++----- src/psidbusnotifier.cpp | 16 +-- src/psidbusnotifier.h | 6 +- src/psievent.cpp | 5 +- src/psievent.h | 16 +-- src/psigrowlnotifier.h | 4 +- src/psiiconset.cpp | 7 +- src/psiiconset.h | 2 +- src/psimedia/psimedia.cpp | 12 +- src/psimedia/psimedia_p.h | 8 +- src/psioptions.cpp | 43 ++----- src/psioptions.h | 4 +- src/psioptionseditor.cpp | 2 +- src/psioptionseditor.h | 28 ++--- src/psipopup.cpp | 10 +- src/psipopup.h | 2 +- src/psirosterwidget.cpp | 2 +- src/psirosterwidget.h | 12 +- src/psithememanager.h | 4 +- src/psithememodel.h | 4 +- src/psithemeprovider.h | 2 +- src/psitoolbar.h | 2 +- src/psitrayicon.h | 2 +- src/qwextend.cpp | 4 +- src/rc.cpp | 2 +- src/registrationdlg.cpp | 22 ++-- src/resourcemenu.cpp | 4 +- src/rosteravatarframe.h | 2 +- src/rtparse.cpp | 12 +- src/searchdlg.cpp | 24 ++-- src/sendbuttonmenu.h | 12 +- src/serverlistquerier.cpp | 8 +- src/statusdlg.cpp | 18 +-- src/statusmenu.cpp | 14 +-- src/statusmenu.h | 4 +- src/statuspreset.h | 2 +- src/sxe/sxemanager.cpp | 2 +- src/sxe/sxenewedit.cpp | 3 +- src/sxe/sxesession.cpp | 5 +- src/sxe/sxesession.h | 3 +- src/systeminfo.cpp | 12 +- src/systeminfo.h | 6 +- src/tabs/tabbablewidget.cpp | 2 +- src/tabs/tabbablewidget.h | 6 +- src/tabs/tabdlg.cpp | 4 +- src/tabs/tabdlg.h | 20 +-- src/tabs/tabmanager.h | 4 +- src/textutil.cpp | 32 ++--- src/theme.h | 16 +-- src/tools/advwidget/advwidget.cpp | 6 +- src/tools/crash/crash_sigsegv.cpp | 4 +- src/tools/iconset/anim.cpp | 2 +- src/tools/iconset/anim.h | 4 +- src/tools/iconset/iconset.cpp | 117 +++++++++--------- src/tools/iconset/iconset.h | 26 ++-- src/tools/iconset/unittest/testiconset.cpp | 6 +- .../optionstree/optionstest/optionstest.cpp | 3 +- src/tools/optionstree/optionstree.cpp | 4 +- src/tools/optionstree/optionstreemodel.cpp | 2 +- src/tools/optionstree/optionstreemodel.h | 2 +- src/tools/optionstree/optionstreereader.cpp | 16 +-- .../optionstreeviewtest.cpp | 4 +- .../unittest/OptionsTreeMainTest.cpp | 3 +- .../tunecontroller/filetunecontroller.cpp | 2 +- .../tunecontroller/itunestunecontroller.cpp | 2 +- .../tunecontroller/mpristunecontroller.cpp | 2 +- .../plugins/winamp/third-party/wa_ipc.h | 4 +- .../tunecontroller/tunecontrollermanager.cpp | 5 +- src/unittest/psipopup/testpsipopup.cpp | 6 +- src/userlist.h | 16 +-- src/vcardfactory.cpp | 6 +- src/vcardfactory.h | 2 +- src/vcardphotodlg.h | 8 +- src/voicecalldlg.h | 4 +- src/webview.cpp | 4 +- src/whiteboarding/wbdlg.h | 4 +- src/whiteboarding/wbitem.cpp | 10 +- src/whiteboarding/wbnewpath.cpp | 3 +- src/whiteboarding/wbnewpath.h | 2 +- src/whiteboarding/wbscene.h | 2 +- src/widgets/actionlineedit.cpp | 10 +- src/widgets/emojidb.cpp | 1 - src/widgets/emojiregistry.cpp | 9 +- src/widgets/emojiregistry.h | 4 +- src/widgets/fancylabel.cpp | 4 +- src/widgets/fancylabel.h | 6 +- src/widgets/fancypopup.cpp | 8 +- src/widgets/iconaction.cpp | 16 +-- src/widgets/iconselect.cpp | 14 +-- src/widgets/iconwidget.cpp | 10 +- src/widgets/psirichtext.cpp | 24 ++-- src/widgets/psirichtext.h | 2 +- src/widgets/psitabwidget.cpp | 7 +- src/widgets/psitabwidget.h | 14 +-- src/widgets/psitextview.cpp | 13 +- src/widgets/psitiplabel.cpp | 2 +- src/widgets/psitiplabel.h | 2 +- src/widgets/psitooltip.cpp | 2 +- src/widgets/psitooltip.h | 2 +- src/widgets/tabbar.cpp | 18 +-- src/widgets/thumbnailtoolbar.h | 2 +- src/widgets/typeaheadfind.cpp | 4 +- src/widgets/urlobject.h | 2 +- src/x11windowsystem.cpp | 48 +++---- src/x11windowsystem.h | 2 +- src/xdata_widget.cpp | 14 +-- src/xdata_widget.h | 12 +- src/xmlconsole.cpp | 2 +- src/xmlconsole.h | 2 +- tests/travis-ci/build-and-test.sh | 1 - tests/travis-ci/install-build-depends.sh | 1 - 346 files changed, 1367 insertions(+), 1498 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6db59975c..c037cb9e8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,15 +10,15 @@ jobs: - os: linux dist: bionic env: TARGET=linux64 CHAT_TYPE=basic DIST=bionic - + - os: linux dist: bionic env: TARGET=linux64 CHAT_TYPE=webkit DIST=bionic - + - os: linux dist: bionic env: TARGET=linux64 CHAT_TYPE=webengine DIST=bionic - + - os: osx osx_image: xcode12.3 env: TARGET=macos64 CHAT_TYPE=basic macOS=11.1 diff --git a/admin/psi-plus-nightly-version b/admin/psi-plus-nightly-version index cf830a589..c3464fba8 100755 --- a/admin/psi-plus-nightly-version +++ b/admin/psi-plus-nightly-version @@ -32,4 +32,3 @@ FEATURES="" [ "${1}" = "--webengine" ] && FEATURES=", webengine" echo "${PSI_TAG}.${PATCHES_NUM} (${DATE_STR}, ${PSI_HASH}${FEATURES})" - diff --git a/plugins/include/accountinfoaccessinghost.h b/plugins/include/accountinfoaccessinghost.h index a662d6f90..e4ee37d45 100644 --- a/plugins/include/accountinfoaccessinghost.h +++ b/plugins/include/accountinfoaccessinghost.h @@ -20,8 +20,8 @@ class AccountInfoAccessingHost { virtual QString getId(int account) = 0; // if account out of range return "-1" virtual QString getName(int account) = 0; // if account out of range return "" virtual QStringList getRoster(int account) = 0; // if account out of range return List with one element, value "-1" - virtual int findOnlineAccountForContact(const QString &jid) - const = 0; // gets all accounts and searches for specified contact in them. return -1 if account is not found + virtual int findOnlineAccountForContact(const QString &jid) const + = 0; // gets all accounts and searches for specified contact in them. return -1 if account is not found virtual QString getPgpKey(int account) = 0; virtual QMap getKnownPgpKeys(int account) = 0; }; diff --git a/plugins/include/gctoolbariconaccessor.h b/plugins/include/gctoolbariconaccessor.h index 194937728..276274c76 100644 --- a/plugins/include/gctoolbariconaccessor.h +++ b/plugins/include/gctoolbariconaccessor.h @@ -14,7 +14,7 @@ class GCToolbarIconAccessor { virtual ~GCToolbarIconAccessor() { } virtual QList getGCButtonParam() = 0; - virtual QAction * getGCAction(QObject *parent, int account, const QString &contact) = 0; + virtual QAction *getGCAction(QObject *parent, int account, const QString &contact) = 0; }; Q_DECLARE_INTERFACE(GCToolbarIconAccessor, "org.psi-im.GCToolbarIconAccessor/0.1"); diff --git a/plugins/include/iqfilteringhost.h b/plugins/include/iqfilteringhost.h index 02904801b..f723a4533 100644 --- a/plugins/include/iqfilteringhost.h +++ b/plugins/include/iqfilteringhost.h @@ -11,10 +11,10 @@ class IqFilteringHost { public: virtual ~IqFilteringHost() { } - virtual void addIqNamespaceFilter(const QString &ns, IqNamespaceFilter *filter) = 0; + virtual void addIqNamespaceFilter(const QString &ns, IqNamespaceFilter *filter) = 0; virtual void addIqNamespaceFilter(const QRegularExpression &ns, IqNamespaceFilter *filter) = 0; - virtual void removeIqNamespaceFilter(const QString &ns, IqNamespaceFilter *filter) = 0; + virtual void removeIqNamespaceFilter(const QString &ns, IqNamespaceFilter *filter) = 0; virtual void removeIqNamespaceFilter(const QRegularExpression &ns, IqNamespaceFilter *filter) = 0; }; diff --git a/plugins/include/menuaccessor.h b/plugins/include/menuaccessor.h index 0ce0f29c4..3f4416ff1 100644 --- a/plugins/include/menuaccessor.h +++ b/plugins/include/menuaccessor.h @@ -15,8 +15,8 @@ class MenuAccessor { virtual QList getAccountMenuParam() = 0; virtual QList getContactMenuParam() = 0; - virtual QAction * getContactAction(QObject *parent, int account, const QString &contact) = 0; - virtual QAction * getAccountAction(QObject *parent, int account) = 0; + virtual QAction *getContactAction(QObject *parent, int account, const QString &contact) = 0; + virtual QAction *getAccountAction(QObject *parent, int account) = 0; }; Q_DECLARE_INTERFACE(MenuAccessor, "org.psi-im.MenuAccessor/0.1"); diff --git a/plugins/include/pluginaccessinghost.h b/plugins/include/pluginaccessinghost.h index b19123b93..1714be499 100644 --- a/plugins/include/pluginaccessinghost.h +++ b/plugins/include/pluginaccessinghost.h @@ -9,7 +9,7 @@ class PluginAccessingHost { public: virtual ~PluginAccessingHost() { } - virtual QObject * getPlugin(const QString &name) = 0; + virtual QObject *getPlugin(const QString &name) = 0; virtual QVariantMap selfMetadata() const = 0; }; diff --git a/plugins/include/psimediaprovider.h b/plugins/include/psimediaprovider.h index 0fef6d664..a27ad6178 100644 --- a/plugins/include/psimediaprovider.h +++ b/plugins/include/psimediaprovider.h @@ -141,8 +141,8 @@ class Provider : public QObjectInterface { virtual QString creditName() const = 0; virtual QString creditText() const = 0; - virtual FeaturesContext * createFeatures() = 0; - virtual RtpSessionContext * createRtpSession() = 0; + virtual FeaturesContext *createFeatures() = 0; + virtual RtpSessionContext *createRtpSession() = 0; virtual AudioRecorderContext *createAudioRecorder() = 0; HINT_SIGNALS : HINT_METHOD(initialized()) diff --git a/plugins/include/toolbariconaccessor.h b/plugins/include/toolbariconaccessor.h index e93e31670..5b66b4c75 100644 --- a/plugins/include/toolbariconaccessor.h +++ b/plugins/include/toolbariconaccessor.h @@ -14,7 +14,7 @@ class ToolbarIconAccessor { virtual ~ToolbarIconAccessor() { } virtual QList getButtonParam() = 0; - virtual QAction * getAction(QObject *parent, int account, const QString &contact) = 0; + virtual QAction *getAction(QObject *parent, int account, const QString &contact) = 0; }; Q_DECLARE_INTERFACE(ToolbarIconAccessor, "org.psi-im.ToolbarIconAccessor/0.1"); diff --git a/plugins/include/webkitaccessinghost.h b/plugins/include/webkitaccessinghost.h index 458f449e9..976738ca1 100644 --- a/plugins/include/webkitaccessinghost.h +++ b/plugins/include/webkitaccessinghost.h @@ -26,7 +26,7 @@ class WebkitAccessingHost { // reloading. // installs global chat log data filter, where data is all the possible message types added to chatlog - virtual QString installChatLogJSDataFilter(const QString & js, + virtual QString installChatLogJSDataFilter(const QString &js, PsiPlugin::Priority priority = PsiPlugin::PriorityNormal) = 0; // uninstall global chat log data filter diff --git a/src/AutoUpdater/guitest/testapp/main.cpp b/src/AutoUpdater/guitest/testapp/main.cpp index 541e55eda..895754524 100644 --- a/src/AutoUpdater/guitest/testapp/main.cpp +++ b/src/AutoUpdater/guitest/testapp/main.cpp @@ -76,7 +76,7 @@ public slots: } private: - QTcpServer * tcpServer_; + QTcpServer *tcpServer_; QMap pages_; }; @@ -168,7 +168,7 @@ public slots: } private: - AutoUpdater * updater_; + AutoUpdater *updater_; SimpleHTTPServer *server_; QString appCastURL_, releaseNotesURL_, releaseURL_; }; diff --git a/src/Certificates/CertificateDisplayDialog.cpp b/src/Certificates/CertificateDisplayDialog.cpp index ecc453a8a..dd0b614a8 100644 --- a/src/Certificates/CertificateDisplayDialog.cpp +++ b/src/Certificates/CertificateDisplayDialog.cpp @@ -27,8 +27,7 @@ #include CertificateDisplayDialog::CertificateDisplayDialog(const QCA::Certificate &cert, int result, QCA::Validity validity, - QWidget *parent) : - QDialog(parent) + QWidget *parent) : QDialog(parent) { ui_.setupUi(this); setModal(true); diff --git a/src/Certificates/CertificateErrorDialog.cpp b/src/Certificates/CertificateErrorDialog.cpp index 2161594b6..1a209eafa 100644 --- a/src/Certificates/CertificateErrorDialog.cpp +++ b/src/Certificates/CertificateErrorDialog.cpp @@ -21,16 +21,15 @@ CertificateErrorDialog::CertificateErrorDialog(const QString &title, const QStri int result, QCA::Validity validity, const QString &domainOverride, QString &tlsOverrideDomain, QByteArray &tlsOverrideCert, QWidget *parent) : - QDialog(parent), - certificate_(cert), result_(result), validity_(validity), tlsOverrideDomain_(tlsOverrideDomain), + QDialog(parent), certificate_(cert), result_(result), validity_(validity), tlsOverrideDomain_(tlsOverrideDomain), tlsOverrideCert_(tlsOverrideCert), domainOverride_(domainOverride), host_(host) { setWindowTitle(title); - QVBoxLayout * _layout = new QVBoxLayout(this); + QVBoxLayout *_layout = new QVBoxLayout(this); QDialogButtonBox *btnBox = new QDialogButtonBox(this); - QPushButton * detailsButton = new QPushButton(QObject::tr("&Details..."), this); - QPushButton * continueButton = new QPushButton(QObject::tr("&Connect anyway"), this); - QPushButton * saveButton = new QPushButton( + QPushButton *detailsButton = new QPushButton(QObject::tr("&Details..."), this); + QPushButton *continueButton = new QPushButton(QObject::tr("&Connect anyway"), this); + QPushButton *saveButton = new QPushButton( domainOverride.isEmpty() ? QObject::tr("&Trust this certificate") : QObject::tr("&Trust this domain"), this); btnBox->addButton(detailsButton, QDialogButtonBox::NoRole); btnBox->addButton(continueButton, QDialogButtonBox::AcceptRole); diff --git a/src/Certificates/CertificateErrorDialog.h b/src/Certificates/CertificateErrorDialog.h index 114935f26..8374a064d 100644 --- a/src/Certificates/CertificateErrorDialog.h +++ b/src/Certificates/CertificateErrorDialog.h @@ -22,8 +22,8 @@ class CertificateErrorDialog : public QDialog { QCA::Certificate certificate_; int result_; QCA::Validity validity_; - QString & tlsOverrideDomain_; - QByteArray & tlsOverrideCert_; + QString &tlsOverrideDomain_; + QByteArray &tlsOverrideCert_; QString domainOverride_; QString host_; }; diff --git a/src/CocoaUtilities/CocoaTrayClick.cpp b/src/CocoaUtilities/CocoaTrayClick.cpp index 27f8c64a3..94baba26c 100644 --- a/src/CocoaUtilities/CocoaTrayClick.cpp +++ b/src/CocoaUtilities/CocoaTrayClick.cpp @@ -24,7 +24,7 @@ #include #include -//#define DEBUG_OUTPUT +// #define DEBUG_OUTPUT bool dockClickHandler(id /*self*/, SEL /*_cmd*/, ...) { @@ -42,7 +42,7 @@ CocoaTrayClick *CocoaTrayClick::instance() CocoaTrayClick::CocoaTrayClick() : QObject(qApp) { - typedef objc_object *(*object_type)(struct objc_object * self, SEL _cmd); + typedef objc_object *(*object_type)(struct objc_object *self, SEL _cmd); object_type objc_msgSendObject = (object_type)objc_msgSend; Class cls = objc_getClass("NSApplication"); diff --git a/src/abstracttreeitem.h b/src/abstracttreeitem.h index eba027e06..a3e26967a 100644 --- a/src/abstracttreeitem.h +++ b/src/abstracttreeitem.h @@ -40,7 +40,7 @@ class AbstractTreeItem { void appendChild(AbstractTreeItem *child); void removeChild(AbstractTreeItem *child); - AbstractTreeItem * child(int row) const; + AbstractTreeItem *child(int row) const; int childCount() const; AbstractTreeItemList children() const; @@ -49,6 +49,6 @@ class AbstractTreeItem { virtual QString toString() const { return QString(); /* no default implementation */ } private: - AbstractTreeItem * _parent; + AbstractTreeItem *_parent; AbstractTreeItemList _children; }; diff --git a/src/accountmanagedlg.cpp b/src/accountmanagedlg.cpp index 4b2f2cc04..17e0e53fe 100644 --- a/src/accountmanagedlg.cpp +++ b/src/accountmanagedlg.cpp @@ -22,6 +22,7 @@ #include "accountadddlg.h" #include "common.h" #include "iconaction.h" +#include "iris/xmpp_tasks.h" #include "miniclient.h" #include "psiaccount.h" #include "psicon.h" @@ -29,7 +30,6 @@ #include "psiiconset.h" #include "shortcutmanager.h" #include "ui_accountremove.h" -#include "iris/xmpp_tasks.h" #include #include @@ -75,7 +75,7 @@ private slots: class Private; Private *d; - MiniClient * client; + MiniClient *client; QPushButton *pb_close_; QPushButton *pb_remove_; }; @@ -135,7 +135,7 @@ void AccountRemoveDlg::done(int r) { if (busy->isActive()) { QMessageBox messageBox(QMessageBox::Information, CAP(tr("Warning")), - tr("Are you sure you want to cancel the unregistration?")); + tr("Are you sure you want to cancel the unregistration?")); QPushButton *cancel = messageBox.addButton(tr("&No"), QMessageBox::RejectRole); QPushButton *accept = messageBox.addButton(tr("&Yes"), QMessageBox::AcceptRole); messageBox.setDefaultButton(accept); @@ -171,7 +171,7 @@ void AccountRemoveDlg::remove() } QMessageBox messageBox(QMessageBox::Information, CAP(tr("Warning")), - tr("Are you sure you want to remove %1 ?").arg(d->acc.name)); + tr("Are you sure you want to remove %1 ?").arg(d->acc.name)); QPushButton *cancel = messageBox.addButton(QMessageBox::Cancel); QPushButton *remove = messageBox.addButton(tr("&Remove"), QMessageBox::AcceptRole); messageBox.setDefaultButton(remove); @@ -294,7 +294,7 @@ void AccountManageTree::dropEvent(QDropEvent *event) if (tree) { QList accountsList; - const auto & items = tree->findItems("*", Qt::MatchWildcard); + const auto &items = tree->findItems("*", Qt::MatchWildcard); for (QTreeWidgetItem *ami : items) { accountsList.append(static_cast(ami)->pa.data()); } @@ -387,7 +387,7 @@ void AccountManageDlg::remove() if (i->pa->isActive()) { QMessageBox messageBox(QMessageBox::Information, CAP(tr("Error")), - tr("Please disconnect before removing the account.")); + tr("Please disconnect before removing the account.")); QPushButton *cancel = messageBox.addButton(QMessageBox::Cancel); QPushButton *disconnect = messageBox.addButton(tr("&Disconnect"), QMessageBox::AcceptRole); messageBox.setDefaultButton(disconnect); diff --git a/src/accountmanagedlg.h b/src/accountmanagedlg.h index 9b908ae47..b2b0184e5 100644 --- a/src/accountmanagedlg.h +++ b/src/accountmanagedlg.h @@ -64,7 +64,7 @@ private slots: void accountRemoved(PsiAccount *); private: - PsiCon * psi; + PsiCon *psi; QAction *removeAction_; }; diff --git a/src/accountmodifydlg.h b/src/accountmodifydlg.h index b30b30c37..4b1a36eac 100644 --- a/src/accountmodifydlg.h +++ b/src/accountmodifydlg.h @@ -77,8 +77,8 @@ private slots: bool checkSSL(); private: - PsiCon * psi; - PsiAccount * pa; + PsiCon *psi; + PsiAccount *pa; ProxyChooser *pc; UserAccount acc; diff --git a/src/accountregdlg.cpp b/src/accountregdlg.cpp index 83dfcf14e..26bc8a55f 100644 --- a/src/accountregdlg.cpp +++ b/src/accountregdlg.cpp @@ -19,6 +19,7 @@ #include "accountregdlg.h" +#include "iris/xmpp_tasks.h" #include "jidutil.h" #include "miniclient.h" #include "proxy.h" @@ -27,7 +28,6 @@ #include "serverlistquerier.h" #include "textutil.h" #include "xdata_widget.h" -#include "iris/xmpp_tasks.h" #include #include diff --git a/src/accountregdlg.h b/src/accountregdlg.h index 49b92dcd1..417dee3aa 100644 --- a/src/accountregdlg.h +++ b/src/accountregdlg.h @@ -20,9 +20,9 @@ #ifndef ACCOUNTREGDLG_H #define ACCOUNTREGDLG_H +#include "iris/xmpp_jid.h" #include "profiles.h" #include "ui_accountreg.h" -#include "iris/xmpp_jid.h" #include #include @@ -48,10 +48,10 @@ class AccountRegDlg : public QDialog { AccountRegDlg(PsiCon *psi, QWidget *parent = nullptr); ~AccountRegDlg(); - const XMPP::Jid & jid() const { return jid_; } - const QString & pass() const { return pass_; } + const XMPP::Jid &jid() const { return jid_; } + const QString &pass() const { return pass_; } bool useHost() const { return opt_host_; } - const QString & host() const { return host_; } + const QString &host() const { return host_; } int port() const { return port_; } UserAccount::SSLFlag ssl() const { return ssl_; } QString proxy() const { return proxy_; } @@ -86,12 +86,12 @@ protected slots: private: Ui::AccountReg ui_; - PsiCon * psi; - QScrollArea * fields_container_; - XDataWidget * fields_; - ProxyChooser * proxy_chooser_; + PsiCon *psi; + QScrollArea *fields_container_; + XDataWidget *fields_; + ProxyChooser *proxy_chooser_; ServerListQuerier *serverlist_querier_; - MiniClient * client_; + MiniClient *client_; bool isOld_; // Account settings diff --git a/src/accountscombobox.h b/src/accountscombobox.h index e59eea7b7..6fffa8e30 100644 --- a/src/accountscombobox.h +++ b/src/accountscombobox.h @@ -48,7 +48,7 @@ private slots: void updateAccounts(); private: - PsiCon * controller_; + PsiCon *controller_; PsiAccount *account_; bool onlineOnly_; diff --git a/src/actionlist.h b/src/actionlist.h index a521a91a6..ec4234821 100644 --- a/src/actionlist.h +++ b/src/actionlist.h @@ -37,8 +37,8 @@ class ActionList : public QObject { QString name() const; int id() const; - IconAction * action(const QString &name) const; - IconAction * copyAction(const QString &name, QObject *parent = nullptr) const; + IconAction *action(const QString &name) const; + IconAction *copyAction(const QString &name, QObject *parent = nullptr) const; const QStringList &actions() const; void addAction(const QString &name, IconAction *action); @@ -61,8 +61,8 @@ class MetaActionList : public QObject { MetaActionList(); ~MetaActionList(); - ActionList * actionList(const QString &name) const; - ActionList * actionList(const QString &name, int id) const; + ActionList *actionList(const QString &name) const; + ActionList *actionList(const QString &name, int id) const; QList actionLists(const unsigned int id) const; QStringList actionLists() const; diff --git a/src/activeprofiles_dbus.cpp b/src/activeprofiles_dbus.cpp index c71637a6f..688366cbe 100644 --- a/src/activeprofiles_dbus.cpp +++ b/src/activeprofiles_dbus.cpp @@ -100,8 +100,7 @@ QString ActiveProfiles::Private::dbusName(QString prof) { QString name = PSIDBUSNAME; name += "."; - name - += encodeAlNumD(ApplicationInfo::homeDir(ApplicationInfo::ConfigLocation)).right(qMax(0, 200 - name.size())); + name += encodeAlNumD(ApplicationInfo::homeDir(ApplicationInfo::ConfigLocation)).right(qMax(0, 200 - name.size())); if (!prof.isEmpty()) { name += "."; name += encodeAlNumD(prof).right(qMax(0, 250 - name.size())); @@ -201,7 +200,7 @@ bool ActiveProfiles::openUri(const QString &profile, const QString &uri) const bool ActiveProfiles::raise(const QString &profile, bool withUI) const { - QLabel * lab = nullptr; + QLabel *lab = nullptr; QDBusMessage msg = QDBusMessage::createMethodCall(d->dbusName(profile), "/Main", PSIDBUSMAINIF, "raise"); if (withUI) { lab = new QLabel(tr("This psi profile is already running...
please wait...")); diff --git a/src/activeprofiles_win.cpp b/src/activeprofiles_win.cpp index 41974e4c6..e5b0abc00 100644 --- a/src/activeprofiles_win.cpp +++ b/src/activeprofiles_win.cpp @@ -167,13 +167,13 @@ bool ActiveProfiles::Private::nativeEvent(const QByteArray &eventType, void *mes { [[maybe_unused]] static const auto expectedType = QByteArray("windows_generic_MSG"); Q_ASSERT(eventType == expectedType); - auto msg = static_cast(message); + auto msg = static_cast(message); if (msg->message == WM_COPYDATA) { *result = FALSE; COPYDATASTRUCT *cd = (COPYDATASTRUCT *)msg->lParam; if (cd->dwData == stringListMessage) { - char * data = (char *)cd->lpData; + char *data = (char *)cd->lpData; const char *end = data + cd->cbData - 1; // handle this error here, not to worry later diff --git a/src/activitycatalog.h b/src/activitycatalog.h index 52fb3a2f4..4fa7f47c5 100644 --- a/src/activitycatalog.h +++ b/src/activitycatalog.h @@ -36,8 +36,8 @@ class ActivityCatalog : public QObject { Entry(Activity::Type, Activity::SpecificType, const QString &, const QString &); Activity::Type type() const; Activity::SpecificType specificType() const; - const QString & value() const; - const QString & text() const; + const QString &value() const; + const QString &text() const; bool isNull() const; private: diff --git a/src/activitydlg.cpp b/src/activitydlg.cpp index a181d6542..cefeffecd 100644 --- a/src/activitydlg.cpp +++ b/src/activitydlg.cpp @@ -20,12 +20,12 @@ #include "activitydlg.h" #include "activitycatalog.h" -#include "pepmanager.h" -#include "psiaccount.h" #include "iconset.h" #include "iris/xmpp_client.h" #include "iris/xmpp_pubsubitem.h" #include "iris/xmpp_task.h" +#include "pepmanager.h" +#include "psiaccount.h" ActivityDlg::ActivityDlg(QList list) : QDialog(nullptr), pa_(list) { @@ -42,7 +42,7 @@ ActivityDlg::ActivityDlg(QList list) : QDialog(nullptr), pa_(list) connect(ui_.pb_ok, SIGNAL(clicked()), SLOT(setActivity())); ui_.cb_general_type->addItem(tr("")); - PsiAccount * pa = pa_.first(); + PsiAccount *pa = pa_.first(); Activity::Type at = pa->activity().type(); int i = 1; for (const ActivityCatalog::Entry &e : ActivityCatalog::instance()->entries()) { @@ -67,10 +67,10 @@ void ActivityDlg::loadSpecificActivities(const QString &generalActivityStr) return; } else { ui_.cb_specific_type->addItem(tr("")); - PsiAccount * pa = pa_.first(); + PsiAccount *pa = pa_.first(); Activity::SpecificType at = pa->activity().specificType(); int i = 1; - ActivityCatalog * ac = ActivityCatalog::instance(); + ActivityCatalog *ac = ActivityCatalog::instance(); for (const ActivityCatalog::Entry &e : ac->entries()) { if (e.specificType() != Activity::UnknownSpecific) { // The entry e is for a 'specific' type. diff --git a/src/adduserdlg.cpp b/src/adduserdlg.cpp index 64dc703d5..ac4102886 100644 --- a/src/adduserdlg.cpp +++ b/src/adduserdlg.cpp @@ -22,13 +22,13 @@ #include "busywidget.h" #include "common.h" #include "infodlg.h" +#include "iris/xmpp_client.h" +#include "iris/xmpp_tasks.h" +#include "iris/xmpp_vcard.h" #include "psiaccount.h" #include "psiiconset.h" #include "tasklist.h" #include "vcardfactory.h" -#include "iris/xmpp_client.h" -#include "iris/xmpp_tasks.h" -#include "iris/xmpp_vcard.h" #include #include @@ -46,14 +46,13 @@ class AddUserDlg::Private { PsiAccount *pa = nullptr; BusyWidget *busy = nullptr; JT_Gateway *jt = nullptr; - TaskList * tasks = nullptr; + TaskList *tasks = nullptr; QStringList services; }; AddUserDlg::AddUserDlg(const QStringList &services, const QStringList &names, const QStringList &groups, - PsiAccount *pa) : - QDialog(nullptr) + PsiAccount *pa) : QDialog(nullptr) { init(groups, pa); d->services = services; diff --git a/src/ahcexecutetask.cpp b/src/ahcexecutetask.cpp index 72df42314..6a9f3dafe 100644 --- a/src/ahcexecutetask.cpp +++ b/src/ahcexecutetask.cpp @@ -20,8 +20,8 @@ #include "ahcexecutetask.h" #include "ahcformdlg.h" -#include "psiaccount.h" #include "iris/xmpp_xmlcommon.h" +#include "psiaccount.h" using namespace XMPP; diff --git a/src/ahcformdlg.cpp b/src/ahcformdlg.cpp index af843c0b6..448ce6f96 100644 --- a/src/ahcformdlg.cpp +++ b/src/ahcformdlg.cpp @@ -22,9 +22,9 @@ #include "ahcexecutetask.h" #include "ahcommand.h" #include "busywidget.h" +#include "iris/xmpp_client.h" #include "psiaccount.h" #include "xdata_widget.h" -#include "iris/xmpp_client.h" #include #include diff --git a/src/ahcformdlg.h b/src/ahcformdlg.h index bf19d4ee0..38c93d34b 100644 --- a/src/ahcformdlg.h +++ b/src/ahcformdlg.h @@ -20,9 +20,9 @@ #ifndef AHCFORMDLG_H #define AHCFORMDLG_H -#include "ui_ahcformdlg.h" #include "iris/xmpp_jid.h" #include "iris/xmpp_xdata.h" +#include "ui_ahcformdlg.h" #include #include @@ -57,12 +57,12 @@ protected slots: private: Ui::AHCFormDlg _ui; - PsiCon * _psi; - QPushButton * _pb_prev; - QPushButton * _pb_next; - QPushButton * _pb_complete; - QPushButton * _pb_cancel; - XDataWidget * _xdata; + PsiCon *_psi; + QPushButton *_pb_prev; + QPushButton *_pb_next; + QPushButton *_pb_complete; + QPushButton *_pb_cancel; + XDataWidget *_xdata; XMPP::Jid _receiver; QString node_; diff --git a/src/ahcommand.h b/src/ahcommand.h index b19cc9d45..56e0e5896 100644 --- a/src/ahcommand.h +++ b/src/ahcommand.h @@ -82,17 +82,17 @@ class AHCommand { AHCommand &operator=(const AHCommand &other); // Inspectors - const QString & node() const; + const QString &node() const; bool hasData() const; const XMPP::XData &data() const; - const ActionList & actions() const; + const ActionList &actions() const; Action defaultAction() const; Status status() const; Action action() const; - const QString & sessionId() const; - const AHCError & error() const; + const QString &sessionId() const; + const AHCError &error() const; bool hasNote() const; - const Note & note() const; + const Note ¬e() const; // XML conversion QDomElement toXml(QDomDocument *doc, bool submit) const; diff --git a/src/ahcommanddlg.cpp b/src/ahcommanddlg.cpp index 67509ddb7..f41431e8c 100644 --- a/src/ahcommanddlg.cpp +++ b/src/ahcommanddlg.cpp @@ -22,9 +22,9 @@ #include "ahcexecutetask.h" #include "ahcformdlg.h" #include "busywidget.h" -#include "psiaccount.h" #include "iris/xmpp_client.h" #include "iris/xmpp_xmlcommon.h" +#include "psiaccount.h" #include #include @@ -105,7 +105,7 @@ bool JT_AHCGetList::take(const QDomElement &e) class AHCExecuteTaskWrapper : public QObject { Q_OBJECT - PsiCon * psi; + PsiCon *psi; AHCExecuteTask *task; public: diff --git a/src/ahcommanddlg.h b/src/ahcommanddlg.h index 1d536f125..2690e2f80 100644 --- a/src/ahcommanddlg.h +++ b/src/ahcommanddlg.h @@ -20,8 +20,8 @@ #ifndef AHCOMMANDDLG_H #define AHCOMMANDDLG_H -#include "ui_ahcommanddlg.h" #include "iris/xmpp_jid.h" +#include "ui_ahcommanddlg.h" #include #include @@ -56,11 +56,11 @@ protected slots: private: Ui::AHCommandDlg ui_; - PsiAccount * pa_; + PsiAccount *pa_; XMPP::Jid receiver_; QList commands_; - QPushButton * pb_close; - QPushButton * pb_execute; + QPushButton *pb_close; + QPushButton *pb_execute; }; #endif // AHCOMMANDDLG_H diff --git a/src/ahcservermanager.cpp b/src/ahcservermanager.cpp index 94a5235ea..f03a22708 100644 --- a/src/ahcservermanager.cpp +++ b/src/ahcservermanager.cpp @@ -21,12 +21,12 @@ #include "ahcommand.h" #include "ahcommandserver.h" -#include "psiaccount.h" -#include "xdata_widget.h" #include "iris/xmpp_client.h" #include "iris/xmpp_tasks.h" #include "iris/xmpp_xdata.h" #include "iris/xmpp_xmlcommon.h" +#include "psiaccount.h" +#include "xdata_widget.h" #include #include diff --git a/src/ahcservermanager.h b/src/ahcservermanager.h index 8be6737a2..5b79f6a17 100644 --- a/src/ahcservermanager.h +++ b/src/ahcservermanager.h @@ -41,14 +41,14 @@ class AHCServerManager { typedef QList ServerList; ServerList commands(const XMPP::Jid &) const; void execute(const AHCommand &command, const XMPP::Jid &requester, QString id); - PsiAccount * account() const { return pa_; } + PsiAccount *account() const { return pa_; } bool hasServer(const QString &node, const XMPP::Jid &) const; protected: AHCommandServer *findServer(const QString &node) const; private: - PsiAccount * pa_; + PsiAccount *pa_; JT_AHCServer *server_task_; ServerList servers_; }; diff --git a/src/alerticon.cpp b/src/alerticon.cpp index 04b75ab1f..a370c7a95 100644 --- a/src/alerticon.cpp +++ b/src/alerticon.cpp @@ -105,8 +105,8 @@ public slots: void pixmapChanged(); public: - AlertIcon * ai; - PsiIcon * real; + AlertIcon *ai; + PsiIcon *real; bool isActivated; Impix impix; static QString alertStyle; diff --git a/src/alerticon.h b/src/alerticon.h index 152e2c29e..bdb05a5c5 100644 --- a/src/alerticon.h +++ b/src/alerticon.h @@ -39,7 +39,7 @@ class AlertIcon : public PsiIcon { QPixmap pixmap(const QSize &desiredSize = QSize()) const override; QImage image(const QSize &desiredSize = QSize()) const override; QIcon icon() const override; - const Impix & impix() const override; + const Impix &impix() const override; int frameNumber() const override; const QString &name() const override; diff --git a/src/alertmanager.h b/src/alertmanager.h index 41d260009..58ca6e9d5 100644 --- a/src/alertmanager.h +++ b/src/alertmanager.h @@ -39,7 +39,7 @@ class AlertManager : public QObject { void dialogRegister(QWidget *w, int prio); void dialogUnregister(QWidget *w); - QWidget * findDialog(const QMetaObject &mo) const; + QWidget *findDialog(const QMetaObject &mo) const; template inline T findDialog() const { return static_cast(findDialog(((T)0)->staticMetaObject)); } void findDialogs(const QMetaObject &mo, QList *list) const; @@ -63,7 +63,7 @@ private slots: QWidget *widget; int priority; }; - PsiCon * psi_; + PsiCon *psi_; QList list_; }; diff --git a/src/applicationinfo.cpp b/src/applicationinfo.cpp index adb71539f..cb1d00b4a 100644 --- a/src/applicationinfo.cpp +++ b/src/applicationinfo.cpp @@ -86,8 +86,7 @@ QStringList ApplicationInfo::getCertificateStoreDirs() #if defined(Q_OS_LINUX) && defined(SHARE_SUFF) additionalPath, #endif - ApplicationInfo::resourcesDir() + "/certs", - ApplicationInfo::homeDir(ApplicationInfo::DataLocation) + "/certs" + ApplicationInfo::resourcesDir() + "/certs", ApplicationInfo::homeDir(ApplicationInfo::DataLocation) + "/certs" }; return dirs; } @@ -104,10 +103,7 @@ QStringList ApplicationInfo::dataDirs() #if defined(Q_OS_LINUX) && defined(SHARE_SUFF) additionalPath, #endif - ":", - ".", - homeDir(DataLocation), - resourcesDir() + ":", ".", homeDir(DataLocation), resourcesDir() }; return dirs; } @@ -124,8 +120,7 @@ QStringList ApplicationInfo::pluginDirs() #if defined(Q_OS_LINUX) && defined(SHARE_SUFF) additionalPath, #endif - ApplicationInfo::resourcesDir() + "/plugins", - homeDir(ApplicationInfo::DataLocation) + "/plugins", + ApplicationInfo::resourcesDir() + "/plugins", homeDir(ApplicationInfo::DataLocation) + "/plugins", libDir() + "/plugins" }; return dirs; @@ -151,9 +146,9 @@ QString ApplicationInfo::resourcesDir() // System routine locates resource files. We "know" that Psi.icns is // in the Resources directory. QString resourcePath; - CFBundleRef mainBundle = CFBundleGetMainBundle(); + CFBundleRef mainBundle = CFBundleGetMainBundle(); #ifdef PSI_PLUS - const char *appIconName = "application-plus.icns"; + const char *appIconName = "application-plus.icns"; #else const char *appIconName = "application.icns"; #endif @@ -166,7 +161,7 @@ QString ApplicationInfo::resourcesDir() resourcePath = resourcePathCString; } else { // CFStringGetCStringPtr failed; use fallback conversion CFIndex bufferLength = CFStringGetLength(resourcePathStringRef) + 1; - char * resourcePathCString = new char[bufferLength]; + char *resourcePathCString = new char[bufferLength]; Boolean conversionSuccess = CFStringGetCString(resourcePathStringRef, resourcePathCString, bufferLength, kCFStringEncodingASCII); if (conversionSuccess) { diff --git a/src/avatars.cpp b/src/avatars.cpp index 147da58c0..5ef1674d6 100644 --- a/src/avatars.cpp +++ b/src/avatars.cpp @@ -29,10 +29,6 @@ #include "applicationinfo.h" #include "filecache.h" #include "iconset.h" -#include "pepmanager.h" -#include "pixmaputil.h" -#include "psiaccount.h" -#include "vcardfactory.h" #include "iris/xmpp_client.h" #include "iris/xmpp_hash.h" #include "iris/xmpp_pubsubitem.h" @@ -40,6 +36,10 @@ #include "iris/xmpp_tasks.h" #include "iris/xmpp_vcard.h" #include "iris/xmpp_xmlcommon.h" +#include "pepmanager.h" +#include "pixmaputil.h" +#include "psiaccount.h" +#include "vcardfactory.h" #include #include @@ -56,7 +56,7 @@ // we have retine nowdays and various other huge resolutions.96px is not that big already. // it would be better to scale images according to monitor properties #define MAX_AVATAR_SIZE 96 -//#define MAX_AVATAR_DISPLAY_SIZE 64 +// #define MAX_AVATAR_DISPLAY_SIZE 64 //------------------------------------------------------------------------------ @@ -924,7 +924,7 @@ void AvatarFactory::vcardUpdated(const Jid &j, bool isMuc) void AvatarFactory::itemPublished(const Jid &jid, const QString &n, const PubSubItem &item) { - AvatarCache * cache = AvatarCache::instance(); + AvatarCache *cache = AvatarCache::instance(); QString jidFull = jid.full(); // it's always bare AvatarCache::OpResult result = AvatarCache::Changed; diff --git a/src/avatars.h b/src/avatars.h index 1174a196e..17c01c419 100644 --- a/src/avatars.h +++ b/src/avatars.h @@ -73,7 +73,7 @@ class AvatarFactory : public QObject { // QPixmap getAvatarByHash(const QString& hash); static AvatarData avatarDataByHash(const QByteArray &hash); UserHashes userHashes(const Jid &jid) const; - PsiAccount * account() const; + PsiAccount *account() const; void setSelfAvatar(const QString &fileName); void importManualAvatar(const Jid &j, const QString &fileName); diff --git a/src/avcall/avcall.cpp b/src/avcall/avcall.cpp index 1fa29e627..1def30ac6 100644 --- a/src/avcall/avcall.cpp +++ b/src/avcall/avcall.cpp @@ -40,7 +40,7 @@ // threaded mode is unstable. Enable it at your own risk. // most likely moveToThread below has to be handled carefully to call changeThread of Ice176 -//#define USE_THREAD +// #define USE_THREAD static MediaConfiguration *g_config = new MediaConfiguration; @@ -87,12 +87,10 @@ class AvTransmit : public QObject { public: PsiMedia::RtpChannel *audio, *video; - JingleRtpChannel * transport; + JingleRtpChannel *transport; AvTransmit(PsiMedia::RtpChannel *_audio, PsiMedia::RtpChannel *_video, JingleRtpChannel *_transport, - QObject *parent = nullptr) : - QObject(parent), - audio(_audio), video(_video), transport(_transport) + QObject *parent = nullptr) : QObject(parent), audio(_audio), video(_video), transport(_transport) { if (audio) { audio->setParent(this); @@ -173,7 +171,7 @@ class AvTransmitHandler : public QObject { public: AvTransmit *avTransmit; - QThread * previousThread; + QThread *previousThread; explicit AvTransmitHandler(QObject *parent = nullptr) : QObject(parent), avTransmit(nullptr), previousThread(nullptr) @@ -227,9 +225,9 @@ class AvCallManagerPrivate : public QObject { Q_OBJECT public: - AvCallManager * q = nullptr; - PsiAccount * pa = nullptr; - JingleRtpManager * rtpManager = nullptr; + AvCallManager *q = nullptr; + PsiAccount *pa = nullptr; + JingleRtpManager *rtpManager = nullptr; XMPP::Jingle::ICE::Manager *irisJingleICEManager = nullptr; QList sessions; QList pending; @@ -247,10 +245,10 @@ class AvCallPrivate : public QObject { Q_OBJECT public: - AvCall * q; + AvCall *q; AvCallManagerPrivate *manager; bool incoming; - JingleRtp * sess; + JingleRtp *sess; PsiMedia::RtpSession rtp; XMPP::Jid peer; AvCall::Mode mode; @@ -260,8 +258,8 @@ class AvCallPrivate : public QObject { bool transmitAudio; bool transmitVideo; bool transmitting; - AvTransmit * avTransmit; - AvTransmitThread * avTransmitThread; + AvTransmit *avTransmit; + AvTransmitThread *avTransmitThread; explicit AvCallPrivate(AvCall *_q) : QObject(_q), q(_q), manager(nullptr), sess(nullptr), transmitAudio(false), transmitVideo(false), @@ -513,7 +511,7 @@ private slots: if (transmitAudio && !rtp.localAudioPayloadInfo().isEmpty()) { QList pis; - const auto & lAPInfo = rtp.localAudioPayloadInfo(); + const auto &lAPInfo = rtp.localAudioPayloadInfo(); for (const PsiMedia::PayloadInfo &pi : lAPInfo) { JingleRtpPayloadType pt = payloadInfoToPayloadType(pi); pis << pt; @@ -524,7 +522,7 @@ private slots: if (transmitVideo && !rtp.localVideoPayloadInfo().isEmpty()) { QList pis; - const auto & lVPInfo = rtp.localVideoPayloadInfo(); + const auto &lVPInfo = rtp.localVideoPayloadInfo(); for (const PsiMedia::PayloadInfo &pi : lVPInfo) { JingleRtpPayloadType pt = payloadInfoToPayloadType(pi); pis << pt; diff --git a/src/avcall/calldlg.cpp b/src/avcall/calldlg.cpp index 79d7ea0b3..ec23cc918 100644 --- a/src/avcall/calldlg.cpp +++ b/src/avcall/calldlg.cpp @@ -37,15 +37,15 @@ class CallDlg::Private : public QObject { Q_OBJECT public: - CallDlg * q; + CallDlg *q; Ui::Call ui; - PsiAccount * pa; + PsiAccount *pa; bool incoming; bool active; bool activated; - AvCall * sess; + AvCall *sess; PsiMedia::VideoWidget *vw_remote; - QTimer * timer; + QTimer *timer; QTime call_duration; explicit Private(CallDlg *_q) : QObject(_q), q(_q), active(false), activated(false), sess(nullptr), timer(nullptr) diff --git a/src/avcall/jinglertp.cpp b/src/avcall/jinglertp.cpp index 80067930a..cfee67a88 100644 --- a/src/avcall/jinglertp.cpp +++ b/src/avcall/jinglertp.cpp @@ -236,10 +236,10 @@ class JingleRtpChannelPrivate : public QObject { JingleRtpChannel *q; QMutex m; - XMPP::UdpPortReserver * portReserver; - XMPP::Ice176 * iceA; - XMPP::Ice176 * iceV; - QTimer * rtpActivityTimer; + XMPP::UdpPortReserver *portReserver; + XMPP::Ice176 *iceA; + XMPP::Ice176 *iceV; + QTimer *rtpActivityTimer; QList in; explicit JingleRtpChannelPrivate(JingleRtpChannel *_q); @@ -261,7 +261,7 @@ class JingleRtpManagerPrivate : public QObject { public: JingleRtpManager *q; - XMPP::Client * client; + XMPP::Client *client; QHostAddress selfAddr; QString extHost; QString stunBindHost; @@ -279,7 +279,7 @@ class JingleRtpManagerPrivate : public QObject { int basePort; QList sessions; QList pending; - JT_PushJingleRtp * push_task; + JT_PushJingleRtp *push_task; JingleRtpManagerPrivate(XMPP::Client *_client, JingleRtpManager *_q); ~JingleRtpManagerPrivate() override; @@ -321,8 +321,8 @@ class JingleRtpPrivate : public QObject { QHostAddress extAddr; QHostAddress stunBindAddr, stunRelayUdpAddr, stunRelayTcpAddr; int stunBindPort = 0, stunRelayUdpPort = 0, stunRelayTcpPort = 0; - XMPP::Ice176 * iceA = nullptr; - XMPP::Ice176 * iceV = nullptr; + XMPP::Ice176 *iceA = nullptr; + XMPP::Ice176 *iceV = nullptr; JingleRtpChannel *rtpChannel = nullptr; class IceStatus { @@ -709,7 +709,7 @@ class JingleRtpPrivate : public QObject { if (!stunRelayTcpAddr.isNull() && stunRelayTcpPort > 0 && !manager->stunRelayTcpUser.isEmpty()) printf("TURN w/ TCP service: %s;%d\n", qPrintable(stunRelayTcpAddr.toString()), stunRelayTcpPort); - auto const & listenAddrs = XMPP::Ice176::availableNetworkAddresses(); + auto const &listenAddrs = XMPP::Ice176::availableNetworkAddresses(); QList localAddrs; QStringList strList; diff --git a/src/bobfilecache.h b/src/bobfilecache.h index 23c322e10..7fc3aa092 100644 --- a/src/bobfilecache.h +++ b/src/bobfilecache.h @@ -37,7 +37,7 @@ class BoBFileCache : public BoBCache { private: BoBFileCache(); - FileCache * _fileCache; + FileCache *_fileCache; static BoBFileCache *_instance; }; diff --git a/src/bookmarkmanagedlg.h b/src/bookmarkmanagedlg.h index 3b3466691..15d64ef93 100644 --- a/src/bookmarkmanagedlg.h +++ b/src/bookmarkmanagedlg.h @@ -20,8 +20,8 @@ #ifndef BOOKMARKMANAGEDLG_H #define BOOKMARKMANAGEDLG_H -#include "ui_bookmarkmanage.h" #include "iris/xmpp_jid.h" +#include "ui_bookmarkmanage.h" #include @@ -70,11 +70,11 @@ private slots: private: Ui::BookmarkManage ui_; - PsiAccount * account_; + PsiAccount *account_; QStandardItemModel *model_; - QPushButton * addButton_; - QPushButton * removeButton_; - QPushButton * joinButton_; + QPushButton *addButton_; + QPushButton *removeButton_; + QPushButton *joinButton_; ConferenceBookmark bookmarkFor(const QModelIndex &index) const; }; diff --git a/src/bookmarkmanager.cpp b/src/bookmarkmanager.cpp index 46c06bd20..0d7a0f33e 100644 --- a/src/bookmarkmanager.cpp +++ b/src/bookmarkmanager.cpp @@ -19,11 +19,11 @@ #include "bookmarkmanager.h" -#include "psiaccount.h" -#include "psioptions.h" #include "iris/xmpp_client.h" #include "iris/xmpp_task.h" #include "iris/xmpp_xmlcommon.h" +#include "psiaccount.h" +#include "psioptions.h" // ----------------------------------------------------------------------------- diff --git a/src/bookmarkmanager.h b/src/bookmarkmanager.h index e6517709d..8e20b8e8c 100644 --- a/src/bookmarkmanager.h +++ b/src/bookmarkmanager.h @@ -37,7 +37,7 @@ class BookmarkManager : public QObject { bool isAvailable() const; bool isBookmarked(const XMPP::Jid &); - const QList & urls() const; + const QList &urls() const; const QList &conferences() const; int indexOfConference(const XMPP::Jid &) const; QString conferenceName(const XMPP::Jid &) const; // convenient method @@ -64,7 +64,7 @@ private slots: void setIsAvailable(bool available); private: - PsiAccount * account_; + PsiAccount *account_; bool accountAvailable_; bool isAvailable_; QList urls_; diff --git a/src/bosskey.h b/src/bosskey.h index 1266516bc..1f7932045 100644 --- a/src/bosskey.h +++ b/src/bosskey.h @@ -40,6 +40,6 @@ public slots: bool isHidden_; QList> hiddenWidgets_; QVariantHash tmpOptions_; - PsiOptions * psiOptions; - MainWin * win_; + PsiOptions *psiOptions; + MainWin *win_; }; diff --git a/src/bytearrayreply.cpp b/src/bytearrayreply.cpp index 094b2b67f..76d6dc320 100644 --- a/src/bytearrayreply.cpp +++ b/src/bytearrayreply.cpp @@ -22,9 +22,7 @@ #include ByteArrayReply::ByteArrayReply(const QNetworkRequest &request, const QByteArray &ba, const QString &mimeType, - QObject *parent) : - QNetworkReply(parent), - origLen(ba.size()), data(ba), buffer(&data) + QObject *parent) : QNetworkReply(parent), origLen(ba.size()), data(ba), buffer(&data) { setRequest(request); setOpenMode(QIODevice::ReadOnly); diff --git a/src/captchadlg.cpp b/src/captchadlg.cpp index 87bf82095..5611b6b30 100644 --- a/src/captchadlg.cpp +++ b/src/captchadlg.cpp @@ -1,11 +1,11 @@ #include "captchadlg.h" -#include "psiaccount.h" -#include "ui_captchadlg.h" -#include "xdata_widget.h" #include "iris/xmpp_captcha.h" #include "iris/xmpp_client.h" #include "iris/xmpp_tasks.h" +#include "psiaccount.h" +#include "ui_captchadlg.h" +#include "xdata_widget.h" using namespace XMPP; diff --git a/src/captchadlg.h b/src/captchadlg.h index 8ed678fa0..9cb3eba5f 100644 --- a/src/captchadlg.h +++ b/src/captchadlg.h @@ -23,9 +23,9 @@ public slots: void done(int r); private: - Ui::CaptchaDlg * ui; + Ui::CaptchaDlg *ui; XMPP::CaptchaChallenge challenge; - XDataWidget * dataWidget; + XDataWidget *dataWidget; }; #endif // CAPTCHADLG_H diff --git a/src/changepwdlg.cpp b/src/changepwdlg.cpp index 3174825f4..6c4b22b35 100644 --- a/src/changepwdlg.cpp +++ b/src/changepwdlg.cpp @@ -22,11 +22,11 @@ #include "accountmodifydlg.h" #include "busywidget.h" #include "iconwidget.h" +#include "iris/xmpp_client.h" +#include "iris/xmpp_tasks.h" #include "profiles.h" #include "psiaccount.h" #include "psioptions.h" -#include "iris/xmpp_client.h" -#include "iris/xmpp_tasks.h" #include #include diff --git a/src/changepwdlg.h b/src/changepwdlg.h index b385e91cf..7fe18c776 100644 --- a/src/changepwdlg.h +++ b/src/changepwdlg.h @@ -47,7 +47,7 @@ private slots: void setWidgetsEnabled(bool enabled); Ui::ChangePassword ui_; - PsiAccount * pa; + PsiAccount *pa; }; #endif // CHANGEPWDLG_H diff --git a/src/chatdlg.cpp b/src/chatdlg.cpp index 09cd5cb7a..c0ac70fe5 100644 --- a/src/chatdlg.cpp +++ b/src/chatdlg.cpp @@ -36,6 +36,9 @@ #ifdef PSI_PLUGINS #include "pluginmanager.h" #endif +#include "iris/xmpp_caps.h" +#include "iris/xmpp_htmlelement.h" +#include "iris/xmpp_message.h" #include "psiaccount.h" #include "psichatdlg.h" #include "psicon.h" @@ -47,9 +50,6 @@ #include "tabdlg.h" #include "textutil.h" #include "userlist.h" -#include "iris/xmpp_caps.h" -#include "iris/xmpp_htmlelement.h" -#include "iris/xmpp_message.h" #include #include @@ -668,9 +668,9 @@ void ChatDlg::doSend() if (warnSend_) { warnSend_ = false; int n = QMessageBox::information(this, tr("Warning"), - tr("

Encryption was recently disabled by the remote contact. " - "Are you sure you want to send this message without encryption?

"), - QMessageBox::Yes | QMessageBox::No); + tr("

Encryption was recently disabled by the remote contact. " + "Are you sure you want to send this message without encryption?

"), + QMessageBox::Yes | QMessageBox::No); if (n != 0) { return; } diff --git a/src/chatdlg.h b/src/chatdlg.h index cdc7c17c7..4e2025ec0 100644 --- a/src/chatdlg.h +++ b/src/chatdlg.h @@ -49,7 +49,7 @@ using namespace XMPP; struct UserStatus { UserStatus() : userListItem(nullptr), statusType(XMPP::Status::Offline) { } - UserListItem * userListItem; + UserListItem *userListItem; XMPP::Status::Type statusType; QString status; int priority = 0; @@ -78,7 +78,7 @@ class ChatDlg : public TabbableWidget { void ensureTabbedCorrectly() override; public: - PsiAccount * account() const; + PsiAccount *account() const; void setInputText(const QString &text); Jid realJid() const; bool autoSelectContact() const { return autoSelectContact_; } @@ -208,7 +208,7 @@ protected slots: Jid realJid_; // Message Events & Chat States - QTimer * composingTimer_; + QTimer *composingTimer_; bool isComposing_; bool sendComposingEvents_; bool historyState; diff --git a/src/chateditproxy.h b/src/chateditproxy.h index ab631d624..bd919f44e 100644 --- a/src/chateditproxy.h +++ b/src/chateditproxy.h @@ -57,7 +57,7 @@ class ChatEditProxy : public QWidget { bool lineEditEnabled_; ChatEdit *textEdit_; - QLayout * layout_; + QLayout *layout_; }; #endif // CHATEDITPROXY_H diff --git a/src/chatsplitter.h b/src/chatsplitter.h index a2ea7afb9..705edb5ad 100644 --- a/src/chatsplitter.h +++ b/src/chatsplitter.h @@ -57,8 +57,8 @@ private slots: bool splitterEnabled_; QList children_; - QSplitter * splitter_; - QLayout * layout_; + QSplitter *splitter_; + QLayout *layout_; }; #endif // CHATSPLITTER_H diff --git a/src/chatview_te.cpp b/src/chatview_te.cpp index 5927db631..6f0d268b0 100644 --- a/src/chatview_te.cpp +++ b/src/chatview_te.cpp @@ -43,9 +43,9 @@ #include #endif -//#define CORRECTION_DEBUG +// #define CORRECTION_DEBUG -static const char * informationalColorOpt = "options.ui.look.colors.messages.informational"; +static const char *informationalColorOpt = "options.ui.look.colors.messages.informational"; static const QRegularExpression underlineFixRE("(]*>"); diff --git a/src/chatview_te.h b/src/chatview_te.h index e9289c92d..09a4b99ee 100644 --- a/src/chatview_te.h +++ b/src/chatview_te.h @@ -66,7 +66,7 @@ class ChatView : public PsiTextView, public ChatViewCommon { void deferredScroll(); void doTrackBar(); ChatView *textWidget(); - QWidget * realTextWidget(); + QWidget *realTextWidget(); void updateAvatar(const XMPP::Jid &jid, ChatViewCommon::UserType utype); public slots: @@ -111,7 +111,7 @@ private slots: XMPP::Jid jid_; QString name_; QPointer dialog_; - QAction * actQuote_; + QAction *actQuote_; }; #endif // CHATVIEW_TE_H diff --git a/src/chatview_webkit.cpp b/src/chatview_webkit.cpp index afc388ee3..a90b126eb 100644 --- a/src/chatview_webkit.cpp +++ b/src/chatview_webkit.cpp @@ -33,7 +33,7 @@ #include "pluginmanager.h" #endif #include "psiaccount.h" -//#include "psiapplication.h" +// #include "psiapplication.h" #include "psicon.h" #include "psioptions.h" #include "psithememanager.h" @@ -93,7 +93,7 @@ class ChatViewPrivate { static QString closeIconTags(const QString &richText) { static QRegularExpression mIcon("(]+>)"); - QString s(richText); + QString s(richText); s.replace(mIcon, "\\1"); return s; } @@ -111,7 +111,7 @@ class ChatViewPrivate { auto id = XMPP::Hash::from(idStr); auto item = account_->psi()->fileSharingManager()->item(id); - ret.append(QStringView{msg}.mid(post, match.capturedStart(0) - post)); + ret.append(QStringView { msg }.mid(post, match.capturedStart(0) - post)); if (item) { auto vm = item->metaData(); QString attrs; @@ -132,7 +132,7 @@ class ChatViewPrivate { } post = match.capturedEnd(0); } - ret.append(QStringView{msg}.mid(post)); + ret.append(QStringView { msg }.mid(post)); return ret; } }; @@ -503,7 +503,7 @@ void ChatView::contextMenuEvent(QContextMenuEvent *e) Q_UNUSED(e) qDebug("Can't check menu hit point. Calling default handler"); #else - QUrl linkUrl; + QUrl linkUrl; #ifdef WEBENGINE QWebEngineContextMenuData cmd = d->webView->page()->contextMenuData(); linkUrl = cmd.linkUrl(); diff --git a/src/chatviewcommon.h b/src/chatviewcommon.h index a61ae7690..8c211d7f2 100644 --- a/src/chatviewcommon.h +++ b/src/chatviewcommon.h @@ -42,7 +42,7 @@ class ChatViewCommon { QDateTime _lastMsgTime; private: - QList & generatePalette(); + QList &generatePalette(); bool compatibleColors(const QColor &, const QColor &); int _nickNumber; QMap _nicks; diff --git a/src/chatviewtheme.cpp b/src/chatviewtheme.cpp index a3b6f8647..f28208803 100644 --- a/src/chatviewtheme.cpp +++ b/src/chatviewtheme.cpp @@ -236,7 +236,7 @@ bool ChatViewThemePrivate::applyToSession(ChatViewThemeSession *session) } QWebChannel *channel = page->webChannel(); - QObject * oldUtil = nullptr; + QObject *oldUtil = nullptr; if (channel) { oldUtil = channel->registeredObjects().value(QLatin1String("srvUtil")); oldUtil->deleteLater(); diff --git a/src/chatviewtheme.h b/src/chatviewtheme.h index b5928faaa..6da09c5bc 100644 --- a/src/chatviewtheme.h +++ b/src/chatviewtheme.h @@ -41,9 +41,9 @@ class ChatViewThemeSession : public QObject { virtual ~ChatViewThemeSession(); inline const QString &sessionId() const { return sessId; } - virtual WebView * webView() = 0; + virtual WebView *webView() = 0; // returns: data, content-type - virtual bool getContents(const QUrl & url, + virtual bool getContents(const QUrl &url, std::function callback) = 0; QString propsAsJsonString(); diff --git a/src/chatviewtheme_p.h b/src/chatviewtheme_p.h index 9874dcedc..113c01b5a 100644 --- a/src/chatviewtheme_p.h +++ b/src/chatviewtheme_p.h @@ -40,7 +40,7 @@ class WebView; class ChatViewJSLoader : public QObject { Q_OBJECT - ChatViewThemePrivate * theme; + ChatViewThemePrivate *theme; QString _loadError; QHash _sessions; diff --git a/src/chatviewthemeprovider.h b/src/chatviewthemeprovider.h index 210e39115..1911a5ff5 100644 --- a/src/chatviewthemeprovider.h +++ b/src/chatviewthemeprovider.h @@ -33,7 +33,7 @@ class ChatViewThemeProvider : public PsiThemeProvider { public: ChatViewThemeProvider(PsiCon *); - const char * type() const { return "chatview"; } + const char *type() const { return "chatview"; } const QStringList themeIds() const; Theme theme(const QString &id); diff --git a/src/coloropt.cpp b/src/coloropt.cpp index 3b7753330..e71a1c969 100644 --- a/src/coloropt.cpp +++ b/src/coloropt.cpp @@ -29,7 +29,7 @@ ColorOpt::ColorOpt() : QObject(nullptr) connect(PsiOptions::instance(), SIGNAL(destroyed()), SLOT(reset())); typedef struct { - const char * opt; + const char *opt; QPalette::ColorRole role; } SourceType; SourceType source[] = { { "contactlist.status.online", QPalette::Text }, diff --git a/src/coloropt.h b/src/coloropt.h index 2ae424ecf..4ce4d94e2 100644 --- a/src/coloropt.h +++ b/src/coloropt.h @@ -35,7 +35,7 @@ class ColorData { class ColorOpt : public QObject { Q_OBJECT public: - static ColorOpt * instance(); + static ColorOpt *instance(); QColor color(const QString &opt, const QColor &defaultColor = QColor()) const; QPalette::ColorRole colorRole(const QString &opt) const; diff --git a/src/common.cpp b/src/common.cpp index 517e1698d..99579b2dd 100644 --- a/src/common.cpp +++ b/src/common.cpp @@ -45,14 +45,14 @@ #include #include #include -#if QT_VERSION < QT_VERSION_CHECK(6,0,0) +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) #include #else #include #endif +#include #include #include -#include #ifdef __GLIBC__ #include @@ -60,7 +60,7 @@ #ifdef HAVE_KEYCHAIN #include #endif -//#include +// #include #ifdef Q_OS_MAC #include // for HIToolbox/InternetConfig #include @@ -425,7 +425,7 @@ void reorderGridLayout(QGridLayout *layout, int maxCols) TabbableWidget *findActiveTab() { - QWidget * chat = QApplication::activeWindow(); + QWidget *chat = QApplication::activeWindow(); TabbableWidget *tw = nullptr; if (chat) { TabDlg *td = qobject_cast(chat); diff --git a/src/common.h b/src/common.h index 564570254..8a8f08c36 100644 --- a/src/common.h +++ b/src/common.h @@ -20,8 +20,8 @@ #ifndef COMMON_H #define COMMON_H -#include "statuspreset.h" #include "iris/xmpp_status.h" +#include "statuspreset.h" #include #include @@ -165,7 +165,7 @@ TabbableWidget *findActiveTab(); #include "x11windowsystem.h" #define X11WM_CLASS(x) \ { \ - X11WindowSystem::instance()->x11wmClass(winId(), (x)); \ + X11WindowSystem::instance()->x11wmClass(winId(), (x)); \ }; #else #define X11WM_CLASS(x) /* dummy */ diff --git a/src/conferencebookmark.cpp b/src/conferencebookmark.cpp index a4176cf8b..5406b1a19 100644 --- a/src/conferencebookmark.cpp +++ b/src/conferencebookmark.cpp @@ -29,8 +29,7 @@ ConferenceBookmark::ConferenceBookmark(const QString &name, const XMPP::Jid &jid, JoinType auto_join, const QString &nick, const QString &password) : - name_(name), - jid_(jid), auto_join_(auto_join), nick_(nick), password_(password) + name_(name), jid_(jid), auto_join_(auto_join), nick_(nick), password_(password) { } diff --git a/src/conferencebookmark.h b/src/conferencebookmark.h index b5c430bfe..c98869f2c 100644 --- a/src/conferencebookmark.h +++ b/src/conferencebookmark.h @@ -37,13 +37,13 @@ class ConferenceBookmark { static QStringList joinTypeNames(); - const QString & name() const; + const QString &name() const; const XMPP::Jid &jid() const; JoinType autoJoin() const; bool needJoin() const; void setAutoJoin(JoinType type); - const QString & nick() const; - const QString & password() const; + const QString &nick() const; + const QString &password() const; bool isNull() const; diff --git a/src/contactlistaccountmenu.cpp b/src/contactlistaccountmenu.cpp index 53755193b..e79368c04 100644 --- a/src/contactlistaccountmenu.cpp +++ b/src/contactlistaccountmenu.cpp @@ -24,45 +24,45 @@ #include "common.h" #include "contactmanager/contactmanagerdlg.h" #include "iconaction.h" +#include "iris/xmpp_serverinfomanager.h" #include "mucjoindlg.h" #include "pluginmanager.h" #include "privacy/privacydlg.h" #include "psiaccount.h" #include "psiiconset.h" #include "psioptions.h" -#include "iris/xmpp_serverinfomanager.h" #include class ContactListAccountMenu::Private : public QObject { Q_OBJECT - PsiAccount * account; + PsiAccount *account; AccountStatusMenu *statusMenu_; - QAction * moodAction_; - QAction * activityAction_; - QAction * geolocationAction_; - QAction * setAvatarAction_; - QMenu * avatarMenu_; - QAction * unsetAvatarAction_; - QAction * contactManagerAction_; - QMenu * bookmarksMenu_; - QAction * bookmarksManageAction_; + QAction *moodAction_; + QAction *activityAction_; + QAction *geolocationAction_; + QAction *setAvatarAction_; + QMenu *avatarMenu_; + QAction *unsetAvatarAction_; + QAction *contactManagerAction_; + QMenu *bookmarksMenu_; + QAction *bookmarksManageAction_; QList bookmarksJoinActions_; - QAction * addContactAction_; - QAction * serviceDiscoveryAction_; - QAction * newMessageAction_; - QAction * xmlConsoleAction_; - QAction * privacyListsAction_; - QAction * modifyAccountAction_; - QMenu * adminMenu_; - QAction * adminOnlineUsersAction_; - QAction * adminSendServerMessageAction_; - QAction * adminSetMotdAction_; - QAction * adminUpdateMotdAction_; - QAction * adminDeleteMotdAction_; - QAction * doGroupChatAction_; - QMenu * pluginsMenu_; + QAction *addContactAction_; + QAction *serviceDiscoveryAction_; + QAction *newMessageAction_; + QAction *xmlConsoleAction_; + QAction *privacyListsAction_; + QAction *modifyAccountAction_; + QMenu *adminMenu_; + QAction *adminOnlineUsersAction_; + QAction *adminSendServerMessageAction_; + QAction *adminSetMotdAction_; + QAction *adminUpdateMotdAction_; + QAction *adminDeleteMotdAction_; + QAction *doGroupChatAction_; + QMenu *pluginsMenu_; public: Private(ContactListAccountMenu *menu, PsiAccount *_account) : QObject(nullptr), account(_account) @@ -312,7 +312,7 @@ private slots: if (!account) return; - QAction * joinAction = static_cast(sender()); + QAction *joinAction = static_cast(sender()); ConferenceBookmark c = account->bookmarkManager()->conferences()[joinAction->property("bookmark").toInt()]; account->actionJoin(c, true); } diff --git a/src/contactlistdragmodel.h b/src/contactlistdragmodel.h index 4135bc206..d4143b011 100644 --- a/src/contactlistdragmodel.h +++ b/src/contactlistdragmodel.h @@ -43,7 +43,7 @@ class ContactListModelOperationList { }; struct ContactOperation { - PsiContact * contact; + PsiContact *contact; QList operations; }; @@ -73,7 +73,7 @@ class ContactListDragModel : public ContactListModel { Qt::DropActions supportedDropActions() const; Qt::ItemFlags flags(const QModelIndex &index) const; QStringList mimeTypes() const; - QMimeData * mimeData(const QModelIndexList &indexes) const; + QMimeData *mimeData(const QModelIndexList &indexes) const; bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent); void renameGroup(ContactListItem *group, const QString &newName); diff --git a/src/contactlistdragview.cpp b/src/contactlistdragview.cpp index 6d069809f..657159178 100644 --- a/src/contactlistdragview.cpp +++ b/src/contactlistdragview.cpp @@ -288,7 +288,7 @@ bool ContactListDragView::supportsDropOnIndex(QDropEvent *e, const QModelIndex & } ContactListModelSelection selection(e->mimeData()); - ContactListDragModel * model = qobject_cast(realModel()); + ContactListDragModel *model = qobject_cast(realModel()); if (!selection.haveRosterSelection()) model = nullptr; @@ -396,9 +396,9 @@ void ContactListDragView::dropEvent(QDropEvent *e) viewport()->update(); } -QAbstractItemView::DropIndicatorPosition ContactListDragView::dropPosition(QDropEvent * e, +QAbstractItemView::DropIndicatorPosition ContactListDragView::dropPosition(QDropEvent *e, const ContactListModelSelection &selection, - const QModelIndex & index) const + const QModelIndex &index) const { if ((selection.groups().count() > 0 || selection.accounts().count() > 0) && selection.contacts().count() == 0) { // TODO: return OnItem in case the special modifiers are pressed @@ -474,7 +474,7 @@ void ContactListDragView::reorderGroups(QDropEvent *e, const QModelIndex &index) } QModelIndex ContactListDragView::itemToReorderGroup(const ContactListModelSelection &selection, - const QModelIndex & index) const + const QModelIndex &index) const { ContactListDragModel *model = qobject_cast(realModel()); Q_ASSERT(model); @@ -520,7 +520,7 @@ QModelIndex ContactListDragView::itemToReorderGroup(const ContactListModelSelect QRect ContactListDragView::groupReorderDropRect(DropIndicatorPosition dropIndicatorPosition, const ContactListModelSelection &selection, - const QModelIndex & index) const + const QModelIndex &index) const { QModelIndex group = itemToReorderGroup(selection, index); QRect r(groupVisualRect(group)); @@ -625,7 +625,7 @@ void ContactListDragView::removeSelection() QList contacts; QStringList contactNames; - QMimeData * mimeData = selection(); + QMimeData *mimeData = selection(); QModelIndexList indexes = qobject_cast(realModel())->indexesFor(mimeData); delete mimeData; diff --git a/src/contactlistdragview.h b/src/contactlistdragview.h index faded9fff..577925f21 100644 --- a/src/contactlistdragview.h +++ b/src/contactlistdragview.h @@ -107,17 +107,17 @@ private slots: void finishedEditing(); private: - QMimeData * backedUpSelection_; + QMimeData *backedUpSelection_; QString backedUpEditorValue_; - QAction * removeAction_; + QAction *removeAction_; QRect dropIndicatorRect_; DropIndicatorPosition dropIndicatorPosition_; Qt::KeyboardModifiers keyboardModifiers_; bool dirty_; - QMimeData * pressedIndex_; + QMimeData *pressedIndex_; QPoint pressPosition_; bool pressedIndexWasSelected_; - QMenu * viewportMenu_; + QMenu *viewportMenu_; bool editing; void backupCurrentSelection(); diff --git a/src/contactlistgroupmenu.cpp b/src/contactlistgroupmenu.cpp index e4a0e71f3..a1ad8082e 100644 --- a/src/contactlistgroupmenu.cpp +++ b/src/contactlistgroupmenu.cpp @@ -18,11 +18,11 @@ */ #include "contactlistgroupmenu_p.h" -#include "psiaccount.h" +#include "groupchatdlg.h" #include "iconaction.h" -#include "shortcutmanager.h" +#include "psiaccount.h" #include "psicontact.h" -#include "groupchatdlg.h" +#include "shortcutmanager.h" #include @@ -210,10 +210,10 @@ void ContactListGroupMenu::Private::customStatus() if (!group) return; - PsiAccount * pa = group->contacts().constFirst()->account(); - StatusSetDlg * w = new StatusSetDlg(pa->psi(), makeLastStatus(pa->status().type()), lastPriorityNotEmpty()); + PsiAccount *pa = group->contacts().constFirst()->account(); + StatusSetDlg *w = new StatusSetDlg(pa->psi(), makeLastStatus(pa->status().type()), lastPriorityNotEmpty()); QList list; - const auto & contacts = group->contacts(); + const auto &contacts = group->contacts(); for (PsiContact *contact : contacts) { if (contact->isPrivate()) continue; diff --git a/src/contactlistgroupmenu_p.h b/src/contactlistgroupmenu_p.h index 2fdda07bc..975337740 100644 --- a/src/contactlistgroupmenu_p.h +++ b/src/contactlistgroupmenu_p.h @@ -23,9 +23,9 @@ #include "contactlistgroupmenu.h" #include "contactlistitem.h" #include "contactlistmodel.h" +#include "iris/xmpp_tasks.h" #include "psicontactlist.h" #include "statusdlg.h" -#include "iris/xmpp_tasks.h" #include @@ -53,18 +53,18 @@ public slots: public: ContactListGroupMenu *q; - ContactListItem * group; - QAction * renameAction_; - QAction * removeGroupAndContactsAction_; - QAction * sendMessageAction_; - QAction * removeGroupWithoutContactsAction_; - QMenu * authMenu_; - QAction * actionAuth_; - QAction * actionAuthRequest_; - QAction * actionAuthRemove_; - QAction * actionCustomStatus_; - QAction * actionMucHide_; - QAction * actionMucShow_; - QAction * actionMucLeave_; - QAction * actionHide_; + ContactListItem *group; + QAction *renameAction_; + QAction *removeGroupAndContactsAction_; + QAction *sendMessageAction_; + QAction *removeGroupWithoutContactsAction_; + QMenu *authMenu_; + QAction *actionAuth_; + QAction *actionAuthRequest_; + QAction *actionAuthRemove_; + QAction *actionCustomStatus_; + QAction *actionMucHide_; + QAction *actionMucShow_; + QAction *actionMucLeave_; + QAction *actionHide_; }; diff --git a/src/contactlistitem.cpp b/src/contactlistitem.cpp index 761849768..e1b689356 100644 --- a/src/contactlistitem.cpp +++ b/src/contactlistitem.cpp @@ -290,7 +290,7 @@ QList ContactListItem::contacts() ContactListItem *ContactListItem::findAccount(PsiAccount *account) { AbstractTreeItemList children = AbstractTreeItem::children(); - ContactListItem * res = nullptr; + ContactListItem *res = nullptr; for (const auto &child : children) { ContactListItem *item = static_cast(child); if (item->isAccount() && item->account() == account) { @@ -313,7 +313,7 @@ ContactListItem *ContactListItem::findGroup(const QString &groupName) } AbstractTreeItemList children = AbstractTreeItem::children(); - ContactListItem * res = nullptr; + ContactListItem *res = nullptr; for (const auto &child : children) { ContactListItem *item = static_cast(child); @@ -336,7 +336,7 @@ ContactListItem *ContactListItem::findGroup(const QString &groupName) ContactListItem *ContactListItem::findGroup(ContactListItem::SpecialGroupType specialGroupType) { AbstractTreeItemList children = AbstractTreeItem::children(); - ContactListItem * res = nullptr; + ContactListItem *res = nullptr; for (const auto &child : children) { ContactListItem *item = static_cast(child); if (item->isGroup() && item->specialGroupType() == specialGroupType) { @@ -351,7 +351,7 @@ ContactListItem *ContactListItem::findGroup(ContactListItem::SpecialGroupType sp ContactListItem *ContactListItem::findContact(PsiContact *contact) { AbstractTreeItemList children = AbstractTreeItem::children(); - ContactListItem * res = nullptr; + ContactListItem *res = nullptr; for (const auto &child : children) { ContactListItem *item = static_cast(child); if (item->contact() == contact) { diff --git a/src/contactlistitem.h b/src/contactlistitem.h index a86129334..9e959a840 100644 --- a/src/contactlistitem.h +++ b/src/contactlistitem.h @@ -122,7 +122,7 @@ class ContactListItem : public AbstractTreeItem { bool _editing; bool _selfValid; // hack hack! just to find one crash in roster. remove this and QPointer wrapper below when fixed QPointer _contact; - PsiAccount * _account; + PsiAccount *_account; bool _expanded; QString _internalName; QString _displayName; diff --git a/src/contactlistitemmenu.cpp b/src/contactlistitemmenu.cpp index f31a9300e..b33798977 100644 --- a/src/contactlistitemmenu.cpp +++ b/src/contactlistitemmenu.cpp @@ -84,7 +84,7 @@ void ContactListItemMenu::removeActions(QStringList actionNames) QList ContactListItemMenu::availableActions() const { QList result; - const auto & acts = actions(); + const auto &acts = actions(); for (QAction *action : acts) if (!action->isSeparator()) result << action; diff --git a/src/contactlistitemmenu.h b/src/contactlistitemmenu.h index deb040732..f8d70c445 100644 --- a/src/contactlistitemmenu.h +++ b/src/contactlistitemmenu.h @@ -43,12 +43,12 @@ class ContactListItemMenu : public QMenu { protected: QKeySequence shortcut(const QString &name) const; QList shortcuts(const QString &name) const; - ContactListModel * model() const; + ContactListModel *model() const; private: - ContactListItem * item_; + ContactListItem *item_; ContactListModel *model_; - QLabel * _lblTitle; + QLabel *_lblTitle; }; #endif // CONTACTLISTITEMMENU_H diff --git a/src/contactlistmodel.cpp b/src/contactlistmodel.cpp index ebb0537f7..6a21f5b27 100644 --- a/src/contactlistmodel.cpp +++ b/src/contactlistmodel.cpp @@ -61,7 +61,7 @@ void ContactListModel::Private::realAddContact(PsiContact *contact) ContactListItem *root = static_cast(q->root()); ; if (accountsEnabled) { - PsiAccount * account = contact->account(); + PsiAccount *account = contact->account(); ContactListItem *accountItem = root->findAccount(account); if (!accountItem) { @@ -359,7 +359,7 @@ void ContactListModel::Private::contactUpdated() // Check for groups changing // Maybe very difficult and should be simplified? QList groupItems; - const auto & indexes = monitoredContacts.values(contact); + const auto &indexes = monitoredContacts.values(contact); for (const QPersistentModelIndex &index : indexes) { ContactListItem *item = q->toItem(index); ContactListItem *parent = item->parent(); @@ -545,7 +545,7 @@ QModelIndexList ContactListModel::indexesFor(const PsiContact *contact) const { Q_ASSERT(contact); QModelIndexList result; - const auto & indexes = d->monitoredContacts.values(const_cast(contact)); + const auto &indexes = d->monitoredContacts.values(const_cast(contact)); for (const auto &index : indexes) { result << index; } diff --git a/src/contactlistmodel.h b/src/contactlistmodel.h index 1cd6f5b79..c11f1b8a2 100644 --- a/src/contactlistmodel.h +++ b/src/contactlistmodel.h @@ -101,7 +101,7 @@ class ContactListModel : public AbstractTreeModel { void renameSelectedItem(); - PsiContact * contactFor(const QModelIndex &index) const; + PsiContact *contactFor(const QModelIndex &index) const; QModelIndexList indexesFor(const PsiContact *contact) const; // reimplemented diff --git a/src/contactlistmodel_p.h b/src/contactlistmodel_p.h index 178e83fec..58e124490 100644 --- a/src/contactlistmodel_p.h +++ b/src/contactlistmodel_p.h @@ -48,11 +48,11 @@ private slots: void cleanUpAccount(PsiAccount *account); public: - ContactListModel * q; + ContactListModel *q; bool groupsEnabled; bool accountsEnabled; - PsiContactList * contactList; - QTimer * commitTimer; + PsiContactList *contactList; + QTimer *commitTimer; QDateTime commitTimerStartTime; QMultiHash monitoredContacts; // always keeps all the contacts QHash operationQueue; diff --git a/src/contactlistmodelselection.cpp b/src/contactlistmodelselection.cpp index 62c9c5da3..211aa88f2 100644 --- a/src/contactlistmodelselection.cpp +++ b/src/contactlistmodelselection.cpp @@ -20,10 +20,10 @@ #include "contactlistmodelselection.h" #include "contactlistitem.h" +#include "iris/xmpp_xmlcommon.h" #include "psiaccount.h" #include "psicontact.h" #include "textutil.h" -#include "iris/xmpp_xmlcommon.h" #include #include @@ -198,7 +198,7 @@ void ContactListModelSelection::debugSelection(const QMimeData *data, const QStr { qWarning("*** debugSelection %s", qPrintable(name)); ContactListModelSelection selection(data); - const auto & contacts = selection.contacts(); + const auto &contacts = selection.contacts(); for (const ContactListModelSelection::Contact &c : contacts) { qWarning("\tc: '%s' group: '%s' account: '%s'", qPrintable(c.jid), qPrintable(c.group), qPrintable(c.account)); } diff --git a/src/contactlistview.h b/src/contactlistview.h index 5f87fd406..1a285e510 100644 --- a/src/contactlistview.h +++ b/src/contactlistview.h @@ -41,7 +41,7 @@ class ContactListView : public HoverableTreeView { QModelIndex realIndex(const QModelIndex &index) const; QModelIndexList proxyIndexes(const QModelIndexList &indexes) const; QModelIndex proxyIndex(const QModelIndex &index) const; - ContactListItem * itemProxy(const QModelIndex &index) const; + ContactListItem *itemProxy(const QModelIndex &index) const; void setEditingIndex(const QModelIndex &index, bool editing) const; void activate(const QModelIndex &index); diff --git a/src/contactlistviewdelegate.cpp b/src/contactlistviewdelegate.cpp index d6065867c..3e573c7e4 100644 --- a/src/contactlistviewdelegate.cpp +++ b/src/contactlistviewdelegate.cpp @@ -42,7 +42,7 @@ #define ANIM_INTERVAL 300 /* msecs */ #define PSI_HIDPI computeScaleFactor(contactList) -//#define PSI_HIDPI (2) // for testing purposes +// #define PSI_HIDPI (2) // for testing purposes static const QString contactListFontOptionPath(QStringLiteral("options.ui.look.font.contactlist")); static const QString slimGroupsOptionPath(QStringLiteral("options.ui.look.contactlist.use-slim-group-headings")); @@ -428,7 +428,7 @@ void ContactListViewDelegate::Private::rosterIconsSizeChanged(int size) QPixmap ContactListViewDelegate::Private::statusPixmap(const QModelIndex &index, const QSize &desiredSize) { - ContactListItem * item = qvariant_cast(index.data(ContactListModel::ContactListItemRole)); + ContactListItem *item = qvariant_cast(index.data(ContactListModel::ContactListItemRole)); ContactListItem::Type type = item->type(); if (type == ContactListItem::Type::ContactType || type == ContactListItem::Type::AccountType) { @@ -973,7 +973,7 @@ void ContactListViewDelegate::Private::drawGroup(QPainter *painter, const QModel #if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0) int x = r.left() + fontMetrics_.horizontalAdvance(text) + 8; #else - int x = r.left() + fontMetrics_.width(text) + 8; + int x = r.left() + fontMetrics_.width(text) + 8; #endif painter->setPen(QPen(_headerBackgroundColor, 2)); painter->drawLine(x, h, r.right(), h); @@ -1158,7 +1158,7 @@ QRect ContactListViewDelegate::Private::getEditorGeometry(const QStyleOptionView { QRect rect; - ContactListItem * item = qvariant_cast(index.data(ContactListModel::ContactListItemRole)); + ContactListItem *item = qvariant_cast(index.data(ContactListModel::ContactListItemRole)); ContactListItem::Type type = item->type(); switch (type) { @@ -1233,7 +1233,7 @@ void ContactListViewDelegate::paint(QPainter *painter, const QStyleOptionViewIte d->iconState = d->opt.state & QStyle::State_Open ? QIcon::On : QIcon::Off; - ContactListItem * item = qvariant_cast(index.data(ContactListModel::ContactListItemRole)); + ContactListItem *item = qvariant_cast(index.data(ContactListModel::ContactListItemRole)); ContactListItem::Type type = item->type(); switch (type) { @@ -1344,7 +1344,7 @@ void ContactListViewDelegate::setModelData(QWidget *editor, QAbstractItemModel * bool ContactListViewDelegate::eventFilter(QObject *object, QEvent *event) { if (event->type() == QEvent::KeyPress) { - QWidget * editor = qobject_cast(object); + QWidget *editor = qobject_cast(object); QKeyEvent *keyEvent = static_cast(event); if (keyEvent->key() == Qt::Key_Up) { d->setEditorCursorPosition(editor, 0); diff --git a/src/contactlistviewdelegate_p.h b/src/contactlistviewdelegate_p.h index 994f7cbff..d45031cf1 100644 --- a/src/contactlistviewdelegate_p.h +++ b/src/contactlistviewdelegate_p.h @@ -66,8 +66,8 @@ public slots: static const int NickConcealerWidth = 10; static const int PepIconsGap = 1; - ContactListViewDelegate * q; - ContactListView * contactList; + ContactListViewDelegate *q; + ContactListView *contactList; HoverableStyleOptionViewItem opt; QIcon::Mode iconMode; QIcon::State iconState; @@ -77,8 +77,8 @@ public slots: int statusIconSize_; int avatarRadius_; - QTimer * alertTimer_; - QTimer * animTimer; + QTimer *alertTimer_; + QTimer *animTimer; QFont font_, statusFont_; QFontMetrics fontMetrics_, statusFontMetrics_; bool statusSingle_; diff --git a/src/contactmanager/contactmanagerdlg.cpp b/src/contactmanager/contactmanagerdlg.cpp index f317b297d..461e79b68 100644 --- a/src/contactmanager/contactmanagerdlg.cpp +++ b/src/contactmanager/contactmanagerdlg.cpp @@ -19,13 +19,13 @@ #include "contactmanagerdlg.h" -//#include "contactview.h" +// #include "contactview.h" +#include "iris/xmpp_client.h" +#include "iris/xmpp_tasks.h" #include "psiaccount.h" #include "psiiconset.h" #include "userlist.h" #include "vcardfactory.h" -#include "iris/xmpp_client.h" -#include "iris/xmpp_tasks.h" #include #include diff --git a/src/contactmanager/contactmanagerdlg.h b/src/contactmanager/contactmanagerdlg.h index c92bf872b..2d72fc2ba 100644 --- a/src/contactmanager/contactmanagerdlg.h +++ b/src/contactmanager/contactmanagerdlg.h @@ -48,8 +48,8 @@ class ContactManagerDlg : public QDialog { void importRoster(); Ui::ContactManagerDlg ui_; - PsiAccount * pa_; - ContactManagerModel * um; + PsiAccount *pa_; + ContactManagerModel *um; private slots: void doSelect(); diff --git a/src/contactmanager/contactmanagermodel.cpp b/src/contactmanager/contactmanagermodel.cpp index 1979bc5da..848f117e2 100644 --- a/src/contactmanager/contactmanagermodel.cpp +++ b/src/contactmanager/contactmanagermodel.cpp @@ -20,10 +20,10 @@ #include "contactmanagermodel.h" #include "QDebug" -#include "psiaccount.h" -#include "userlist.h" #include "iris/xmpp_client.h" #include "iris/xmpp_tasks.h" +#include "psiaccount.h" +#include "userlist.h" ContactManagerModel::ContactManagerModel(QObject *parent, PsiAccount *pa) : QAbstractTableModel(parent), pa_(pa) { @@ -241,9 +241,9 @@ QList ContactManagerModel::checkedUsers() void ContactManagerModel::invertByMatch(int columnIndex, int matchType, const QString &str) { - emit layoutAboutToBeChanged(); - Role columnRole = roles[columnIndex]; - QString data; + emit layoutAboutToBeChanged(); + Role columnRole = roles[columnIndex]; + QString data; QRegularExpression reg; if (matchType == ContactManagerModel::RegexpMatch) { reg = QRegularExpression(str); diff --git a/src/contactmanager/contactmanagermodel.h b/src/contactmanager/contactmanagermodel.h index 6863fe2d5..6d90401e2 100644 --- a/src/contactmanager/contactmanagermodel.h +++ b/src/contactmanager/contactmanagermodel.h @@ -71,7 +71,7 @@ class ContactManagerModel : public QAbstractTableModel { void stopBatch() { emit layoutChanged(); } private: - PsiAccount * pa_; + PsiAccount *pa_; QList _userList; QStringList columnNames; QList roles; diff --git a/src/contactmanager/contactmanagerview.cpp b/src/contactmanager/contactmanagerview.cpp index 0a3687a79..940bc28be 100644 --- a/src/contactmanager/contactmanagerview.cpp +++ b/src/contactmanager/contactmanagerview.cpp @@ -40,7 +40,7 @@ void ContactManagerView::init() void ContactManagerView::contextMenuEvent(QContextMenuEvent *e) { - QMenu * popup = new QMenu(this); + QMenu *popup = new QMenu(this); QList actions; actions << new QAction(IconsetFactory::icon("psi/cm_check").icon(), tr("Check"), popup) << new QAction(IconsetFactory::icon("psi/cm_uncheck").icon(), tr("Uncheck"), popup) @@ -51,7 +51,7 @@ void ContactManagerView::contextMenuEvent(QContextMenuEvent *e) if (result) { iresult = actions.indexOf(result); [[maybe_unused]] const QVariant value(2); - const auto & checks = selectionModel()->selectedRows(0); + const auto &checks = selectionModel()->selectedRows(0); for (const QModelIndex &check : checks) { switch (iresult) { case 0: // check diff --git a/src/contactupdatesmanager.cpp b/src/contactupdatesmanager.cpp index 46c52cde7..5b9de36ea 100644 --- a/src/contactupdatesmanager.cpp +++ b/src/contactupdatesmanager.cpp @@ -146,7 +146,6 @@ void ContactUpdatesManager::update() ContactUpdatesManager::ContactUpdateAction::ContactUpdateAction(ContactUpdatesManager::ContactUpdateActionType _type, PsiAccount *_account, const Jid &_jid) : - type(_type), - account(_account), jid(_jid) + type(_type), account(_account), jid(_jid) { } diff --git a/src/contactupdatesmanager.h b/src/contactupdatesmanager.h index 974fa2091..e23670fd9 100644 --- a/src/contactupdatesmanager.h +++ b/src/contactupdatesmanager.h @@ -53,7 +53,7 @@ private slots: XMPP::Jid jid; }; QList updates_; - QTimer * updateTimer_; + QTimer *updateTimer_; void removeAuthRequestEventsFor(PsiAccount *account, const XMPP::Jid &jid, bool denyAuthRequests); void removeToastersFor(PsiAccount *account, const XMPP::Jid &jid); diff --git a/src/dbus.cpp b/src/dbus.cpp index dadadc825..2cdb5f368 100644 --- a/src/dbus.cpp +++ b/src/dbus.cpp @@ -39,15 +39,15 @@ PsiConAdapter::PsiConAdapter(PsiCon *psicon_) : QDBusAbstractAdaptor(psicon_) { PsiConAdapter::~PsiConAdapter() { } -void PsiConAdapter::openURI(QString uri) { emit ActiveProfiles::instance()->openUriRequested(uri); } +void PsiConAdapter::openURI(QString uri) { emit ActiveProfiles::instance() -> openUriRequested(uri); } void PsiConAdapter::setStatus(QString status, QString message) { - emit ActiveProfiles::instance()->setStatusRequested(status, message); + emit ActiveProfiles::instance() -> setStatusRequested(status, message); } // FIXME libguniqueapp uses activate -void PsiConAdapter::raise() { emit ActiveProfiles::instance()->raiseRequested(); } +void PsiConAdapter::raise() { emit ActiveProfiles::instance() -> raiseRequested(); } void PsiConAdapter::sleep() { psicon->doSleep(); } diff --git a/src/discodlg.cpp b/src/discodlg.cpp index 7007227f7..d3e602f9d 100644 --- a/src/discodlg.cpp +++ b/src/discodlg.cpp @@ -24,6 +24,7 @@ #include "busywidget.h" #include "common.h" #include "iconaction.h" +#include "iris/xmpp_tasks.h" #include "psiaccount.h" #include "psicon.h" #include "psiiconset.h" @@ -31,7 +32,6 @@ #include "psitooltip.h" #include "stretchwidget.h" #include "tasklist.h" -#include "iris/xmpp_tasks.h" #include #include @@ -166,8 +166,8 @@ class DiscoConnector : public QObject { }; struct DiscoData { - PsiAccount * pa; - TaskList * tasks; + PsiAccount *pa; + TaskList *tasks; DiscoConnector *d; }; @@ -251,13 +251,13 @@ private slots: private: DiscoItem di; - DiscoData * d; + DiscoData *d; bool isRoot; bool alreadyItems, alreadyInfo; bool autoItems; // used in updateItemsFinished bool autoInfo; QString errorInfo; - DiscoExtraItem * moreItem; + DiscoExtraItem *moreItem; SubsetsClientManager subsets; void copyItem(const DiscoItem &); @@ -489,8 +489,8 @@ void DiscoListItem::updateItemsFinished(const DiscoList &list) treeWidget()->setUpdatesEnabled(false); QHash children; - DiscoBaseItem * child = static_cast(QTreeWidgetItem::child(0)); - DiscoListItem * item; + DiscoBaseItem *child = static_cast(QTreeWidgetItem::child(0)); + DiscoListItem *item; for (int i = 1; child; ++i) { if (!moreItem && child->type() != MoreItemsType) { item = static_cast(child); @@ -781,7 +781,7 @@ bool DiscoListView::maybeTip(const QPoint &pos) bool DiscoListView::eventFilter(QObject *o, QEvent *e) { if (e->type() == QEvent::ToolTip && o->isWidgetType()) { - QWidget * w = static_cast(o); + QWidget *w = static_cast(o); QHelpEvent *he = static_cast(e); maybeTip(w->mapToGlobal(he->pos())); return true; @@ -844,7 +844,7 @@ class DiscoDlg::Private : public QObject { DiscoData data; - QToolBar * toolBar; + QToolBar *toolBar; IconAction *actBrowse, *actBack, *actForward, *actRefresh, *actStop; // custom actions, that will be added to toolbar and context menu @@ -1185,7 +1185,7 @@ void DiscoDlg::Private::itemDoubleclicked(QTreeWidgetItem *item) if (!item || item->type() == MoreItemsType) return; - DiscoListItem * it = static_cast(item); + DiscoListItem *it = static_cast(item); const DiscoItem d = it->item(); const Features &f = d.features(); @@ -1287,7 +1287,7 @@ bool DiscoDlg::Private::eventFilter(QObject *object, QEvent *event) actQueryVersion->addTo(&p); // popup with all available features - QMenu * fm = new QMenu(&p); + QMenu *fm = new QMenu(&p); QHash actions; { QList::Iterator it = ids.begin(); diff --git a/src/discodlg.h b/src/discodlg.h index dc0c5e2cd..6e59ecdf7 100644 --- a/src/discodlg.h +++ b/src/discodlg.h @@ -20,8 +20,8 @@ #ifndef DISCODLG_H #define DISCODLG_H -#include "ui_disco.h" #include "iris/xmpp_jid.h" +#include "ui_disco.h" #include diff --git a/src/edbflatfile.cpp b/src/edbflatfile.cpp index 6a5a1aefa..d54376002 100644 --- a/src/edbflatfile.cpp +++ b/src/edbflatfile.cpp @@ -21,11 +21,11 @@ #include "applicationinfo.h" #include "common.h" +#include "iris/xmpp_jid.h" #include "jidutil.h" #include "psiaccount.h" #include "psicon.h" #include "psicontactlist.h" -#include "iris/xmpp_jid.h" #include #include @@ -271,7 +271,7 @@ void EDBFlatFile::performRequests() if (e) { if (e->type() == PsiEvent::Message) { MessageEvent::Ptr me = e.staticCast(); - const Message & m = me->message(); + const Message &m = me->message(); if (m.body().indexOf(r->findStr, 0, Qt::CaseInsensitive) != -1) { EDBItemPtr ei = EDBItemPtr(new EDBItem(e, QString::number(id))); result.append(ei); @@ -655,7 +655,7 @@ QString EDBFlatFile::File::eventToLine(const PsiEvent::Ptr &e) if (e->type() == PsiEvent::Message) { MessageEvent::Ptr me = e.staticCast(); - const Message & m = me->message(); + const Message &m = me->message(); const UrlList urls = m.urlList(); if (!m.subject().isEmpty()) diff --git a/src/edbflatfile.h b/src/edbflatfile.h index f1fe20ca9..dc169e5f9 100644 --- a/src/edbflatfile.h +++ b/src/edbflatfile.h @@ -21,8 +21,8 @@ #define EDBFLATFILE_H #include "eventdb.h" -#include "psievent.h" #include "iris/xmpp_jid.h" +#include "psievent.h" #include #include @@ -87,7 +87,7 @@ private slots: QString fname; QFile f; bool valid; - QTimer * t; + QTimer *t; class Private; Private *d; diff --git a/src/edbsqlite.cpp b/src/edbsqlite.cpp index fe86d1d27..5f00eae73 100644 --- a/src/edbsqlite.cpp +++ b/src/edbsqlite.cpp @@ -18,7 +18,7 @@ */ #include "applicationinfo.h" -//#include "common.h" +// #include "common.h" #include "edbsqlite.h" #include "historyimp.h" #include "jidutil.h" @@ -412,7 +412,7 @@ bool EDBSqLite::appendEvent(const QString &accId, const XMPP::Jid &jid, const Ps if (e->type() == PsiEvent::Message) { MessageEvent::Ptr me = e.staticCast(); - const Message & m = me->message(); + const Message &m = me->message(); dTime = m.timeStamp(); if (m.type() == "chat") nType = 1; @@ -448,7 +448,7 @@ bool EDBSqLite::appendEvent(const QString &accId, const XMPP::Jid &jid, const Ps query->bindValue(":direction", nDirection); if (nType == 0 || nType == 1 || nType == 4 || nType == 5) { MessageEvent::Ptr me = e.staticCast(); - const Message & m = me->message(); + const Message &m = me->message(); QString lang = m.lang(); query->bindValue(":subject", m.subject(lang)); query->bindValue(":m_text", m.body(lang)); diff --git a/src/edbsqlite.h b/src/edbsqlite.h index 339079186..d0fb69e04 100644 --- a/src/edbsqlite.h +++ b/src/edbsqlite.h @@ -22,8 +22,8 @@ #include "edbflatfile.h" #include "eventdb.h" -#include "psievent.h" #include "iris/xmpp_jid.h" +#include "psievent.h" #include #include @@ -141,8 +141,8 @@ class EDBSqLite : public EDB { unsigned int maxUncommitedRecs; int maxUncommitedSecs; unsigned int commitByTimeoutSecs; - QTimer * commitTimer; - EDBFlatFile * mirror_; + QTimer *commitTimer; + EDBFlatFile *mirror_; QList rlist; QHash jidsCache; QueryStorage queryes; diff --git a/src/eventdb.cpp b/src/eventdb.cpp index d9267cfe9..758ae4eb0 100644 --- a/src/eventdb.cpp +++ b/src/eventdb.cpp @@ -53,7 +53,7 @@ class EDBHandle::Private { public: Private() = default; - EDB * edb = nullptr; + EDB *edb = nullptr; int beginRow_ = 0; EDBResult r; bool busy = false; @@ -148,7 +148,7 @@ class EDB::Private { QList list; int reqid_base = 0; - PsiCon * psi = nullptr; + PsiCon *psi = nullptr; }; EDB::EDB(PsiCon *psi) diff --git a/src/eventdb.h b/src/eventdb.h index 2a77cc8a0..cc78b3672 100644 --- a/src/eventdb.h +++ b/src/eventdb.h @@ -20,9 +20,9 @@ #ifndef EVENTDB_H #define EVENTDB_H +#include "iris/xmpp_jid.h" #include "psicon.h" #include "psievent.h" -#include "iris/xmpp_jid.h" #include #include @@ -112,7 +112,7 @@ class EDB : public QObject { virtual int erase(const QString &accId, const XMPP::Jid &) = 0; void resultReady(int, EDBResult, int); void writeFinished(int, bool); - PsiCon * psi(); + PsiCon *psi(); private: class Private; diff --git a/src/eventdlg.cpp b/src/eventdlg.cpp index 6a4a811c9..a81c5189f 100644 --- a/src/eventdlg.cpp +++ b/src/eventdlg.cpp @@ -29,6 +29,8 @@ #include "iconlabel.h" #include "iconselect.h" #include "icontoolbutton.h" +#include "iris/xmpp_htmlelement.h" +#include "iris/xmpp_serverinfomanager.h" #include "jidutil.h" #include "psiaccount.h" #include "psicon.h" @@ -43,8 +45,6 @@ #include "textutil.h" #include "userlist.h" #include "xdata_widget.h" -#include "iris/xmpp_htmlelement.h" -#include "iris/xmpp_serverinfomanager.h" #include #include @@ -250,8 +250,7 @@ class AttachViewItem : public QListWidgetItem { } AttachViewItem(const QString &_gc, const QString &from, const QString &reason, const QString &_password, - AttachView *par) : - QListWidgetItem(par) + AttachView *par) : QListWidgetItem(par) { type = 1; gc = _gc; @@ -430,34 +429,34 @@ class EventDlg::Private : public QObject { PsiIcon *nextAnim() const { return nextAnim_; } - EventDlg * dlg = nullptr; - PsiCon * psi = nullptr; + EventDlg *dlg = nullptr; + PsiCon *psi = nullptr; PsiAccount *pa = nullptr; - QLabel * lb_identity = nullptr; - QLabel * lb_time = nullptr; - QLabel * lb_count = nullptr; + QLabel *lb_identity = nullptr; + QLabel *lb_time = nullptr; + QLabel *lb_count = nullptr; AccountsComboBox *cb_ident = nullptr; - QComboBox * cb_type = nullptr; - AccountLabel * lb_ident = nullptr; - IconLabel * lb_status = nullptr; - ELineEdit * le_to = nullptr; - QLineEdit * le_from = nullptr; - QLineEdit * le_subj = nullptr; - IconToolButton * tb_url = nullptr, *tb_info = nullptr, *tb_history = nullptr, *tb_icon = nullptr; + QComboBox *cb_type = nullptr; + AccountLabel *lb_ident = nullptr; + IconLabel *lb_status = nullptr; + ELineEdit *le_to = nullptr; + QLineEdit *le_from = nullptr; + QLineEdit *le_subj = nullptr; + IconToolButton *tb_url = nullptr, *tb_info = nullptr, *tb_history = nullptr, *tb_icon = nullptr; IconButton *pb_next = nullptr, *pb_close = nullptr, *pb_quote = nullptr, *pb_deny = nullptr, *pb_send = nullptr, *pb_reply = nullptr, *pb_chat = nullptr, *pb_auth = nullptr, *pb_http_confirm = nullptr, *pb_http_deny = nullptr, *pb_form_submit = nullptr, *pb_form_cancel = nullptr; - QCheckBox * ck_all_auth = nullptr; + QCheckBox *ck_all_auth = nullptr; PsiTextView *mle = nullptr; - AttachView * attachView = nullptr; - QTimer * whois = nullptr; - PsiIcon * anim = nullptr; - QWidget * w_http_id = nullptr; - QLineEdit * le_http_id = nullptr; - QWidget * xdata_form = nullptr; + AttachView *attachView = nullptr; + QTimer *whois = nullptr; + PsiIcon *anim = nullptr; + QWidget *w_http_id = nullptr; + QLineEdit *le_http_id = nullptr; + QWidget *xdata_form = nullptr; XDataWidget *xdata = nullptr; - QLabel * xdata_instruction = nullptr; + QLabel *xdata_instruction = nullptr; PsiHttpAuthRequest httpAuthRequest; RosterExchangeItems rosterExchangeItems; @@ -1553,7 +1552,7 @@ void EventDlg::updateContact(const Jid &jid) if (d->jid.compare(jid, false)) { QString rname = d->jid.resource(); QList ul = d->pa->findRelevant(d->jid); - UserListItem * u = nullptr; + UserListItem *u = nullptr; int status = -1; if (!ul.isEmpty()) { u = ul.first(); @@ -1672,7 +1671,7 @@ void EventDlg::updateEvent(const PsiEvent::Ptr &e) if (e->type() == PsiEvent::Message || e->type() == PsiEvent::HttpAuth) { MessageEvent::Ptr me = e.staticCast(); - const Message & m = me->message(); + const Message &m = me->message(); // HTTP auth request buttons if (e->type() == PsiEvent::HttpAuth) { diff --git a/src/eventdlg.h b/src/eventdlg.h index 15bc780f8..ece29e7db 100644 --- a/src/eventdlg.h +++ b/src/eventdlg.h @@ -21,11 +21,11 @@ #define EVENTDLG_H #include "advwidget.h" +#include "iris/xmpp_rosterx.h" +#include "iris/xmpp_url.h" #include "psievent.h" #include "ui_addurl.h" #include "userlist.h" -#include "iris/xmpp_rosterx.h" -#include "iris/xmpp_url.h" #include #include diff --git a/src/filecache.cpp b/src/filecache.cpp index bbb918b3d..9bd1bbd71 100644 --- a/src/filecache.cpp +++ b/src/filecache.cpp @@ -21,8 +21,8 @@ #include "applicationinfo.h" #include "fileutil.h" -#include "optionstree.h" #include "iris/xmpp_hash.h" +#include "optionstree.h" #include #include @@ -32,8 +32,7 @@ FileCacheItem::FileCacheItem(FileCache *parent, const QList &sums, const QVariantMap &metadata, const QDateTime &dt, unsigned int maxAge, quint64 size, const QByteArray &data) : - QObject(parent), - _sums(sums), _metadata(metadata), _ctime(dt), _maxAge(maxAge), _size(size), _data(data), + QObject(parent), _sums(sums), _metadata(metadata), _ctime(dt), _maxAge(maxAge), _size(size), _data(data), _flags(quint16(size > 0 ? 0 : OnDisk)) /* empty is never saved to disk. let's say it's there already */ { Q_ASSERT(sums.size() > 0); @@ -148,8 +147,8 @@ FileCache::FileCache(const QString &cacheDir, QObject *parent) : bool needCleanup = false; const auto &prefixes = _registry->getChildOptionNames("", true, true); for (const QString &prefix : prefixes) { - auto section = prefix.section('.', -1); - QByteArray id = QByteArray::fromHex(QStringView{section}.mid(1).toLatin1()); + auto section = prefix.section('.', -1); + QByteArray id = QByteArray::fromHex(QStringView { section }.mid(1).toLatin1()); if (id.isEmpty()) continue; auto hAlgo = _registry->getOption(prefix + ".ha", QString()).toString(); @@ -170,8 +169,8 @@ FileCache::FileCache(const QString &cacheDir, QObject *parent) : auto ind = s.indexOf('+'); if (ind == -1) continue; - auto type = XMPP::Hash::parseType(QStringView{s}.left(ind)); - auto ba = QByteArray::fromHex(QStringView{s}.mid(ind + 1).toLatin1()); + auto type = XMPP::Hash::parseType(QStringView { s }.left(ind)); + auto ba = QByteArray::fromHex(QStringView { s }.mid(ind + 1).toLatin1()); XMPP::Hash hash(type, ba); if (hash.isValid() && ba.size()) { item->addHashSum(hash); @@ -314,7 +313,7 @@ void FileCache::sync(bool finishSession) QList onDiskItems; qint64 sumMemorySize = 0; qint64 sumFileSize = 0; - FileCacheItem * item; + FileCacheItem *item; QHashIterator it(_items); while (it.hasNext()) { diff --git a/src/filecache.h b/src/filecache.h index 5c1342bb0..f9d2014c3 100644 --- a/src/filecache.h +++ b/src/filecache.h @@ -148,7 +148,7 @@ class FileCache : public QObject { * @param maxAge Session/Forever or just seconds to live * @return a new cache item. Not yet synchronized to disk */ - FileCacheItem * append(const QList &sums, const QByteArray &data, + FileCacheItem *append(const QList &sums, const QByteArray &data, const QVariantMap &metadata = QVariantMap(), unsigned int maxAge = Forever); inline FileCacheItem *append(const XMPP::Hash &id, const QByteArray &data, const QVariantMap &metadata = QVariantMap(), unsigned int maxAge = Forever) @@ -157,7 +157,7 @@ class FileCache : public QObject { } // similar to append but instead of `data` moves file to the cache directory - FileCacheItem * moveToCache(const QList &sums, const QFileInfo &file, + FileCacheItem *moveToCache(const QList &sums, const QFileInfo &file, const QVariantMap &metadata = QVariantMap(), unsigned int maxAge = Forever); inline FileCacheItem *moveToCache(const XMPP::Hash &id, const QFileInfo &file, const QVariantMap &metadata = QVariantMap(), unsigned int maxAge = Forever) @@ -200,8 +200,8 @@ public slots: unsigned int _fileCacheSize; unsigned int _defaultMaxAge; SyncPolicy _syncPolicy; - QTimer * _syncTimer; - OptionsTree * _registry; + QTimer *_syncTimer; + OptionsTree *_registry; QHash _pendingRegisterItems; bool _registryChanged; diff --git a/src/filesharedlg.cpp b/src/filesharedlg.cpp index 745cac8e9..65ba4030d 100644 --- a/src/filesharedlg.cpp +++ b/src/filesharedlg.cpp @@ -23,6 +23,8 @@ #include "filesharingmanager.h" #include "fileutil.h" #include "iris/httpfileupload.h" +#include "iris/xmpp_client.h" +#include "iris/xmpp_message.h" #include "multifiletransferdelegate.h" #include "multifiletransferitem.h" #include "multifiletransfermodel.h" @@ -30,8 +32,6 @@ #include "psicon.h" #include "textutil.h" #include "ui_filesharedlg.h" -#include "iris/xmpp_client.h" -#include "iris/xmpp_message.h" #include #include @@ -44,8 +44,7 @@ FileShareDlg::FileShareDlg(PsiAccount *acc, const XMPP::Jid &myJid, const QList &items, const Callback &callback, QWidget *parent) : - QDialog(parent), - ui(new Ui::FileShareDlg), account(acc), myJid(myJid), publishedCallback(callback) + QDialog(parent), ui(new Ui::FileShareDlg), account(acc), myJid(myJid), publishedCallback(callback) { setAttribute(Qt::WA_DeleteOnClose); ui->setupUi(this); @@ -73,8 +72,7 @@ FileShareDlg::FileShareDlg(PsiAccount *acc, const XMPP::Jid &myJid, const QList< } QImage preview; - if (items.count() > 1 - || (preview = items[0]->preview(this->screen()->geometry().size() / 2)).isNull()) { + if (items.count() > 1 || (preview = items[0]->preview(this->screen()->geometry().size() / 2)).isNull()) { ui->lv_files->show(); ui->pixmapRatioLabel->hide(); } else { diff --git a/src/filesharedlg.h b/src/filesharedlg.h index 823cccd19..17801beb0 100644 --- a/src/filesharedlg.h +++ b/src/filesharedlg.h @@ -20,8 +20,8 @@ #ifndef FILESHAREDLG_H #define FILESHAREDLG_H -#include "xmpp/jid/jid.h" #include "iris/xmpp_reference.h" +#include "xmpp/jid/jid.h" #include @@ -58,11 +58,11 @@ private slots: void showImage(const QImage &img); void finish(); - Ui::FileShareDlg * ui; - PsiAccount * account; + Ui::FileShareDlg *ui; + PsiAccount *account; XMPP::Jid myJid; QImage image; - MultiFileTransferModel * filesModel; + MultiFileTransferModel *filesModel; QList readyPublishers; Callback publishedCallback; int inProgressCount = 0; diff --git a/src/filesharingdownloader.cpp b/src/filesharingdownloader.cpp index b22149af5..852a503ab 100644 --- a/src/filesharingdownloader.cpp +++ b/src/filesharingdownloader.cpp @@ -22,15 +22,15 @@ #include "filesharingmanager.h" #include "fileutil.h" #include "httputil.h" -#include "jidutil.h" #include "iris/jingle-session.h" +#include "iris/xmpp_client.h" +#include "iris/xmpp_hash.h" +#include "iris/xmpp_jid.h" +#include "jidutil.h" #include "networkaccessmanager.h" #include "psiaccount.h" #include "psicon.h" #include "userlist.h" -#include "iris/xmpp_client.h" -#include "iris/xmpp_hash.h" -#include "iris/xmpp_jid.h" #include #include @@ -118,8 +118,7 @@ class JingleFileShareDownloader : public AbstractFileShareDownloader { public: JingleFileShareDownloader(PsiAccount *acc_, const QString &uri, const XMPP::Jingle::FileTransfer::File &file, const QList &jids, QObject *parent) : - AbstractFileShareDownloader(acc_, uri, parent), - file(file), jids(jids) + AbstractFileShareDownloader(acc_, uri, parent), file(file), jids(jids) { } @@ -395,8 +394,8 @@ class BOBFileShareDownloader : public AbstractFileShareDownloader { class FileShareDownloader::Private : public QObject { Q_OBJECT public: - FileShareDownloader * q = nullptr; - PsiAccount * acc = nullptr; + FileShareDownloader *q = nullptr; + PsiAccount *acc = nullptr; QList sums; Jingle::FileTransfer::File file; QList jids; @@ -529,9 +528,7 @@ class FileShareDownloader::Private : public QObject { FileShareDownloader::FileShareDownloader(PsiAccount *acc, const QList &sums, const Jingle::FileTransfer::File &file, const QList &jids, - const QStringList &uris, QObject *parent) : - QIODevice(parent), - d(new Private) + const QStringList &uris, QObject *parent) : QIODevice(parent), d(new Private) { d->q = this; d->acc = acc; diff --git a/src/filesharinghttpproxy.cpp b/src/filesharinghttpproxy.cpp index 72d37bf90..092dd1f0f 100644 --- a/src/filesharinghttpproxy.cpp +++ b/src/filesharinghttpproxy.cpp @@ -36,8 +36,7 @@ FileSharingHttpProxy::FileSharingHttpProxy(PsiAccount *acc, const QString &sourceIdHex, qhttp::server::QHttpRequest *req, qhttp::server::QHttpResponse *res) : - QObject(res), - item(acc->psi()->fileSharingManager()->item(XMPP::Hash::from(sourceIdHex))), acc(acc), request(req), + QObject(res), item(acc->psi()->fileSharingManager()->item(XMPP::Hash::from(sourceIdHex))), acc(acc), request(req), response(res) { auto baseUrl = acc->psi()->webServer()->serverUrl().toString(); @@ -110,7 +109,7 @@ int FileSharingHttpProxy::parseHttpRangeRequest() return qhttp::ESTATUS_BAD_REQUEST; } - bool ok; + bool ok; quint64 start; quint64 end; @@ -124,7 +123,7 @@ int FileSharingHttpProxy::parseHttpRangeRequest() } if (rangeBounds[1].size()) { // if we have end end = rangeBounds[1].toLongLong(&ok); // then parse it - if (!ok || start > end) { // if something not parsed or range is invalid + if (!ok || start > end) { // if something not parsed or range is invalid return qhttp::ESTATUS_BAD_REQUEST; } @@ -188,7 +187,7 @@ void FileSharingHttpProxy::proxyCache() emit request->end(); return; // handled with error } - QFile * file = new QFile(item->fileName(), response); + QFile *file = new QFile(item->fileName(), response); QFileInfo fi(*file); if (!file->open(QIODevice::ReadOnly)) { response->setStatusCode(qhttp::ESTATUS_NOT_FOUND); diff --git a/src/filesharinghttpproxy.h b/src/filesharinghttpproxy.h index e40beaa4d..2c6dea1b2 100644 --- a/src/filesharinghttpproxy.h +++ b/src/filesharinghttpproxy.h @@ -54,9 +54,9 @@ private slots: void proxyCache(); private: - FileSharingItem * item = nullptr; - PsiAccount * acc; - qhttp::server::QHttpRequest * request; + FileSharingItem *item = nullptr; + PsiAccount *acc; + qhttp::server::QHttpRequest *request; qhttp::server::QHttpResponse *response; QPointer downloader; qint64 requestedStart = 0; diff --git a/src/filesharingitem.cpp b/src/filesharingitem.cpp index ee69a73ff..a646dcc1b 100644 --- a/src/filesharingitem.cpp +++ b/src/filesharingitem.cpp @@ -22,11 +22,11 @@ #include "filesharingmanager.h" #include "fileutil.h" #include "iris/httpfileupload.h" -#include "psiaccount.h" -#include "userlist.h" #include "iris/xmpp_client.h" #include "iris/xmpp_reference.h" #include "iris/xmpp_thumbs.h" +#include "psiaccount.h" +#include "userlist.h" #include #include @@ -53,8 +53,7 @@ FileSharingItem::FileSharingItem(FileCacheItem *cache, PsiAccount *acc, FileShar FileSharingItem::FileSharingItem(const MediaSharing &ms, const Jid &from, PsiAccount *acc, FileSharingManager *manager) : - _acc(acc), - _manager(manager), _fileType(FileType::RemoteFile) + _acc(acc), _manager(manager), _fileType(FileType::RemoteFile) { _sums = ms.file.computedHashes(); if (initFromCache()) { @@ -130,8 +129,7 @@ FileSharingItem::FileSharingItem(const QString &fileName, PsiAccount *acc, FileS FileSharingItem::FileSharingItem(const QString &mime, const QByteArray &data, const QVariantMap &metaData, PsiAccount *acc, FileSharingManager *manager) : - QObject(manager), - _acc(acc), _manager(manager), _fileType(FileType::TempFile), _flags(SizeKnown), + QObject(manager), _acc(acc), _manager(manager), _fileType(FileType::TempFile), _flags(SizeKnown), _modifyTime(QDateTime::currentDateTimeUtc()), _metaData(metaData) { _sums.append(Hash::from(Hash::Sha1, data)); @@ -186,7 +184,7 @@ bool FileSharingItem::initFromCache(FileCacheItem *cache) _sums = cache->sums(); auto urisvl = md.value(QString::fromLatin1("uris")); -#if QT_VERSION < QT_VERSION_CHECK(6,0,0) +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) if (urisvl.type() == QVariant::StringList) #else if (urisvl.typeId() == QMetaType::QStringList) diff --git a/src/filesharingitem.h b/src/filesharingitem.h index ef64a2e1c..a1401eca5 100644 --- a/src/filesharingitem.h +++ b/src/filesharingitem.h @@ -77,17 +77,17 @@ class FileSharingItem : public QObject { QImage preview(const QSize &maxSize) const; QString displayName() const; QString fileName() const; - inline const QString & mimeType() const { return _mimeType; } - inline const HashSums & sums() const { return _sums; } + inline const QString &mimeType() const { return _mimeType; } + inline const HashSums &sums() const { return _sums; } inline QVariantMap metaData() const { return _metaData; } inline quint64 fileSize() const { return _fileSize; } inline bool isSizeKnown() const { return bool(_flags & SizeKnown); } inline const QStringList &uris() const { return _uris; } // reborn flag updates ttl for the item - FileCacheItem * cache(bool reborn = false) const; + FileCacheItem *cache(bool reborn = false) const; inline bool isCached() const { return cache() != nullptr; } - PsiAccount * account() const; + PsiAccount *account() const; inline const QStringList log() const { return _log; } XMPP::Reference toReference(const XMPP::Jid &selfJid) const; @@ -121,8 +121,8 @@ class FileSharingItem : public QObject { void logChanged(); private: - PsiAccount * _acc = nullptr; - FileSharingManager * _manager = nullptr; + PsiAccount *_acc = nullptr; + FileSharingManager *_manager = nullptr; FileShareDownloader *_downloader = nullptr; FileType _fileType; Flags _flags; diff --git a/src/filesharingmanager.cpp b/src/filesharingmanager.cpp index d60e72c53..d55f40b19 100644 --- a/src/filesharingmanager.cpp +++ b/src/filesharingmanager.cpp @@ -48,7 +48,7 @@ // ====================================================================== class FileSharingManager::Private { public: - FileCache * cache; + FileCache *cache; QHash items; void rememberItem(FileSharingItem *item) @@ -312,8 +312,8 @@ XMPP::Hash FileSharingDeviceOpener::urlToSourceId(const QUrl &url) if (url.scheme() != QLatin1String("share")) return XMPP::Hash(); - QString path = url.path(); - auto sourceId = QStringView{path}; + QString path = url.path(); + auto sourceId = QStringView { path }; if (sourceId.startsWith('/')) sourceId = sourceId.mid(1); return XMPP::Hash::from(sourceId); diff --git a/src/filesharingmanager.h b/src/filesharingmanager.h index 23edb7ffc..a3523c47e 100644 --- a/src/filesharingmanager.h +++ b/src/filesharingmanager.h @@ -109,7 +109,7 @@ class FileSharingDeviceOpener : public ITEMediaOpener { virtual ~FileSharingDeviceOpener() { } static XMPP::Hash urlToSourceId(const QUrl &url); - QIODevice * open(QUrl &url) override; + QIODevice *open(QUrl &url) override; void close(QIODevice *dev) override; QVariant metadata(const QUrl &url) override; diff --git a/src/filesharingnamproxy.h b/src/filesharingnamproxy.h index 386ce6744..24f082c31 100644 --- a/src/filesharingnamproxy.h +++ b/src/filesharingnamproxy.h @@ -31,15 +31,15 @@ class QFile; class FileSharingNAMReply : public QNetworkReply { Q_OBJECT - FileSharingItem * item = nullptr; - PsiAccount * acc; + FileSharingItem *item = nullptr; + PsiAccount *acc; QPointer downloader; qint64 requestedStart = 0; quint64 requestedSize = 0; // if == 0 then all the remaining qint64 bytesLeft = -1; // -1 - unknown bool isRanged = false; bool headersSent = false; - QFile * cachedFile = nullptr; + QFile *cachedFile = nullptr; public: FileSharingNAMReply(PsiAccount *acc, const QString &sourceIdHex, const QNetworkRequest &req); diff --git a/src/filetransdlg.cpp b/src/filetransdlg.cpp index 345eed4bb..742be8306 100644 --- a/src/filetransdlg.cpp +++ b/src/filetransdlg.cpp @@ -3,8 +3,10 @@ #include "accountlabel.h" #include "accountscombobox.h" #include "busywidget.h" -#include "iris/filetransfer.h" #include "fileutil.h" +#include "iris/filetransfer.h" +#include "iris/s5b.h" +#include "iris/xmpp_tasks.h" #include "jidutil.h" #include "psiaccount.h" #include "psicon.h" @@ -13,10 +15,8 @@ #include "psioptions.h" #include "psitextview.h" #include "psitooltip.h" -#include "iris/s5b.h" #include "textutil.h" #include "userlist.h" -#include "iris/xmpp_tasks.h" #include #include @@ -94,7 +94,7 @@ static bool active_file_check(const QString &s) //---------------------------------------------------------------------------- class FileTransferHandler::Private { public: - PsiAccount * pa; + PsiAccount *pa; FileTransfer *ft; BSConnection *c; Jid peer; @@ -449,13 +449,13 @@ void FileTransferHandler::mapSignals() class FileRequestDlg::Private { public: - PsiCon * psi; - PsiAccount * pa; - AccountsComboBox * cb_ident; - QLabel * lb_identity; - AccountLabel * lb_ident; - QLabel * lb_time; - PsiTextView * te; + PsiCon *psi; + PsiAccount *pa; + AccountsComboBox *cb_ident; + QLabel *lb_identity; + AccountLabel *lb_ident; + QLabel *lb_time; + PsiTextView *te; Jid jid; FileTransferHandler *ft; QString fileName; @@ -488,7 +488,7 @@ FileRequestDlg::FileRequestDlg(const Jid &jid, PsiCon *psi, PsiAccount *pa, cons d->lb_ident = nullptr; updateIdentity(pa); - QFrame * hb = new QFrame(this); + QFrame *hb = new QFrame(this); QHBoxLayout *hbLayout = new QHBoxLayout(hb); hbLayout->setContentsMargins(0, 0, 0, 0); d->lb_identity = new QLabel(tr("Identity: "), hb); @@ -575,7 +575,7 @@ FileRequestDlg::FileRequestDlg(const QDateTime &ts, FileTransfer *ft, PsiAccount d->fileSize = ft->fileSize(); d->cb_ident = nullptr; - QFrame * hb = new QFrame(this); + QFrame *hb = new QFrame(this); QHBoxLayout *hbLayout = new QHBoxLayout(hb); hbLayout->setContentsMargins(0, 0, 0, 0); d->lb_identity = new QLabel(tr("Identity: "), hb); @@ -833,7 +833,7 @@ void FileRequestDlg::ft_connected() { d->t.stop(); busy->stop(); - FileTransDlg * w = d->pa->psi()->ftdlg(); + FileTransDlg *w = d->pa->psi()->ftdlg(); FileTransferHandler *h = d->ft; d->ft = nullptr; closeDialogs(this); @@ -1003,8 +1003,7 @@ class FileTransItem : public QListWidgetItem { ColumnWidthManager *cm; FileTransItem(QListWidget *parent, const QString &_name, const QString &_path, qlonglong _size, - const QString &_peer, bool _sending) : - QListWidgetItem(parent) + const QString &_peer, bool _sending) : QListWidgetItem(parent) { done = false; sending = _sending; @@ -1498,9 +1497,9 @@ class TransferMapping { class FileTransDlg::Private { public: - FileTransDlg * parent; - PsiCon * psi; - FileTransView * lv; + FileTransDlg *parent; + PsiCon *psi; + FileTransView *lv; QList transferList; QTimer t; @@ -1515,7 +1514,7 @@ class FileTransDlg::Private { bool found = false; for (int i = 0; i < lv->count(); i++) { QListWidgetItem *it = lv->item(i); - FileTransItem * fi = static_cast(it); + FileTransItem *fi = static_cast(it); if (fi->id == n) { found = true; break; @@ -1532,7 +1531,7 @@ class FileTransDlg::Private { { for (int i = 0; i < lv->count(); i++) { QListWidgetItem *it = lv->item(i); - FileTransItem * fi = static_cast(it); + FileTransItem *fi = static_cast(it); if (fi->id == id) return fi; } @@ -1544,7 +1543,7 @@ class FileTransDlg::Private { QList list; for (int i = 0; i < lv->count(); i++) { QListWidgetItem *it = lv->item(i); - FileTransItem * fi = static_cast(it); + FileTransItem *fi = static_cast(it); if (fi->done) list.append(fi); } @@ -1755,7 +1754,7 @@ void FileTransDlg::takeTransfer(FileTransferHandler *h, int p, qlonglong sent) TransferMapping *i = new TransferMapping; i->h = h; i->id = addItem(h->fileName(), h->filePath(), h->fileIcon(), h->fileSize(), peer, - (h->mode() == FileTransferHandler::Sending)); + (h->mode() == FileTransferHandler::Sending)); i->p = p; i->sent = sent; d->transferList.append(i); @@ -1778,7 +1777,7 @@ void FileTransDlg::clearFinished() // remove related transfer mappings QList::iterator it = list.begin(); for (; it != list.end(); ++it) { - FileTransItem * fi = *it; + FileTransItem *fi = *it; TransferMapping *i = d->findMapping(fi->id); d->transferList.removeAll(i); delete i; @@ -1826,7 +1825,7 @@ void FileTransDlg::updateItems() void FileTransDlg::itemCancel(int id) { - FileTransItem * fi = d->findItem(id); + FileTransItem *fi = d->findItem(id); TransferMapping *i = d->findMapping(id); d->transferList.removeAll(i); delete i; @@ -1841,7 +1840,7 @@ void FileTransDlg::itemOpenDest(int id) void FileTransDlg::itemClear(int id) { - FileTransItem * fi = d->findItem(id); + FileTransItem *fi = d->findItem(id); TransferMapping *i = d->findMapping(id); d->transferList.removeAll(i); delete i; diff --git a/src/fileutil.cpp b/src/fileutil.cpp index fc743aaa3..ac543d436 100644 --- a/src/fileutil.cpp +++ b/src/fileutil.cpp @@ -194,7 +194,7 @@ QString FileUtil::mimeToFileExt(const QString &mime) QString FileUtil::cleanFileName(const QString &s) { - //#ifdef Q_OS_WIN + // #ifdef Q_OS_WIN QString badchars = "\\/|?*:\"<>"; QString str; str.reserve(s.size()); @@ -207,9 +207,9 @@ QString FileUtil::cleanFileName(const QString &s) if (str.isEmpty()) str = "unnamed"; return str; - //#else - // return s; - //#endif + // #else + // return s; + // #endif } void FileUtil::openFolder(const QString &path) @@ -221,9 +221,7 @@ void FileUtil::openFolder(const QString &path) QProcess::execute("/usr/bin/osascript", QStringList() << "-e" << QString("tell application \"Finder\" to reveal POSIX file \"%1\"").arg(path)); - QProcess::execute("/usr/bin/osascript", - QStringList() << "-e" - << "tell application \"Finder\" to activate"); + QProcess::execute("/usr/bin/osascript", QStringList() << "-e" << "tell application \"Finder\" to activate"); #else // we cannot select a file here, because no file browser really supports it... const QFileInfo fileInfo(path); @@ -237,7 +235,7 @@ void FileUtil::setModificationTime(const QString &filename, const QDateTime &mti #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) qint64 secs = mtime.toSecsSinceEpoch(); #else - qint64 secs = mtime.toTime_t(); + qint64 secs = mtime.toTime_t(); #endif #ifdef Q_OS_WIN _utimbuf t; diff --git a/src/gcuserview.cpp b/src/gcuserview.cpp index b3b191776..f60726822 100644 --- a/src/gcuserview.cpp +++ b/src/gcuserview.cpp @@ -24,13 +24,13 @@ #include "coloropt.h" #include "common.h" #include "groupchatdlg.h" +#include "iris/xmpp_caps.h" +#include "iris/xmpp_muc.h" #include "psiaccount.h" #include "psiiconset.h" #include "psioptions.h" #include "psitooltip.h" #include "userlist.h" -#include "iris/xmpp_caps.h" -#include "iris/xmpp_muc.h" #include #include diff --git a/src/gcuserview.h b/src/gcuserview.h index a841165df..e3507f114 100644 --- a/src/gcuserview.h +++ b/src/gcuserview.h @@ -71,7 +71,7 @@ class GCUserModel : public QAbstractItemModel { // reimplemented QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; - QMimeData * mimeData(const QModelIndexList &indexes) const; + QMimeData *mimeData(const QModelIndexList &indexes) const; Qt::DropActions supportedDragActions() const; QModelIndex parent(const QModelIndex &child) const; int rowCount(const QModelIndex &parent) const; @@ -88,7 +88,7 @@ public slots: private: QList contacts[LastGroupRole]; // splitted into groups - PsiAccount * _account; + PsiAccount *_account; Jid _selfJid; QString _selfNick; MUCContact::Ptr _selfContact; diff --git a/src/geolocation.h b/src/geolocation.h index 150b4bef9..e7aa704d6 100644 --- a/src/geolocation.h +++ b/src/geolocation.h @@ -40,8 +40,8 @@ class GeoLocation { const Maybe &error() const; const Maybe &lat() const; const Maybe &lon() const; - const QString & datum() const; - const QString & description() const; + const QString &datum() const; + const QString &description() const; bool isNull() const; diff --git a/src/geolocationdlg.cpp b/src/geolocationdlg.cpp index 91078baff..ba72fce14 100644 --- a/src/geolocationdlg.cpp +++ b/src/geolocationdlg.cpp @@ -21,11 +21,11 @@ #include "geolocation.h" #include "iconset.h" -#include "pepmanager.h" -#include "psiaccount.h" #include "iris/xmpp_client.h" #include "iris/xmpp_pubsubitem.h" #include "iris/xmpp_task.h" +#include "pepmanager.h" +#include "psiaccount.h" #include diff --git a/src/googleftmanager.cpp b/src/googleftmanager.cpp index e44ee2ca0..6b79108b4 100644 --- a/src/googleftmanager.cpp +++ b/src/googleftmanager.cpp @@ -358,7 +358,7 @@ void GoogleFTManager::receiveStanza(const QString &sstanza) session_manager_->OnIncomingMessage(e); } -talk_base::PhysicalSocketServer * GoogleFTManager::socket_server_ = NULL; -talk_base::Thread * GoogleFTManager::thread_ = NULL; -talk_base::NetworkManager * GoogleFTManager::network_manager_ = NULL; +talk_base::PhysicalSocketServer *GoogleFTManager::socket_server_ = NULL; +talk_base::Thread *GoogleFTManager::thread_ = NULL; +talk_base::NetworkManager *GoogleFTManager::network_manager_ = NULL; talk_base::scoped_ptr GoogleFTManager::port_allocator_; diff --git a/src/googleftmanager.h b/src/googleftmanager.h index a3206b32e..05c4dbc35 100644 --- a/src/googleftmanager.h +++ b/src/googleftmanager.h @@ -71,8 +71,8 @@ class GoogleFileTransfer : public QObject /*: public XMPP::AbstractFileTransfer* void progressChanged(qlonglong, const QString &); private: - cricket::FileShareSession * session_; - GoogleFTManager * manager_; + cricket::FileShareSession *session_; + GoogleFTManager *manager_; GoogleFileTransferListener *listener_; }; @@ -99,12 +99,12 @@ protected slots: private: bool initialized_; - XMPP::Client * client_; + XMPP::Client *client_; GoogleSessionListener *listener_; - static talk_base::PhysicalSocketServer * socket_server_; - static talk_base::Thread * thread_; - static talk_base::NetworkManager * network_manager_; + static talk_base::PhysicalSocketServer *socket_server_; + static talk_base::Thread *thread_; + static talk_base::NetworkManager *network_manager_; static talk_base::scoped_ptr port_allocator_; talk_base::scoped_ptr session_manager_; talk_base::scoped_ptr file_share_session_client_; diff --git a/src/gpgprocess.cpp b/src/gpgprocess.cpp index c42142e99..7707b39e8 100644 --- a/src/gpgprocess.cpp +++ b/src/gpgprocess.cpp @@ -120,12 +120,12 @@ QString GpgProcess::findBin() const #ifdef Q_OS_WIN QString pathSep = ";"; #else - QString pathSep = ":"; + QString pathSep = ":"; #endif #if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) QStringList paths = QString::fromLocal8Bit(qgetenv("PATH")).split(pathSep, Qt::SkipEmptyParts); #else - QStringList paths = QString::fromLocal8Bit(qgetenv("PATH")).split(pathSep, QString::SkipEmptyParts); + QStringList paths = QString::fromLocal8Bit(qgetenv("PATH")).split(pathSep, QString::SkipEmptyParts); #endif #ifdef Q_OS_MAC // On Mac OS bundled always uses system default PATH @@ -133,8 +133,7 @@ QString GpgProcess::findBin() const // contain gpg // Mac GPG and brew use /usr/local/bin // MacPorts uses /opt/local/bin - paths << "/usr/local/bin" - << "/opt/local/bin"; + paths << "/usr/local/bin" << "/opt/local/bin"; #endif paths.removeDuplicates(); diff --git a/src/groupchatdlg.cpp b/src/groupchatdlg.cpp index b9fef9232..b655e2065 100644 --- a/src/groupchatdlg.cpp +++ b/src/groupchatdlg.cpp @@ -48,6 +48,9 @@ #ifdef PSI_PLUGINS #include "pluginmanager.h" #endif +#include "iris/xmpp_caps.h" +#include "iris/xmpp_message.h" +#include "iris/xmpp_tasks.h" #include "popupmanager.h" #include "psiaccount.h" #include "psiactionlist.h" @@ -69,9 +72,6 @@ #include "urlobject.h" #include "userlist.h" #include "vcardfactory.h" -#include "iris/xmpp_caps.h" -#include "iris/xmpp_message.h" -#include "iris/xmpp_tasks.h" #include #include @@ -226,9 +226,9 @@ class GCMainDlg::Private : public QObject, public MCmdProviderIface { ActionList *actions; IconAction *act_bookmark, *act_pastesend; TypeAheadFindBar *typeahead; - //#ifdef WHITEBOARDING - // IconAction *act_whiteboard; - //#endif + // #ifdef WHITEBOARDING + // IconAction *act_whiteboard; + // #endif QAction *act_send, *act_scrollup, *act_scrolldown, *act_close; QAction *act_mini_cmd, *act_nick, *act_hide, *act_copy_muc_jid; QAction *act_minimize; @@ -946,10 +946,10 @@ GCMainDlg::GCMainDlg(PsiAccount *pa, const Jid &j, TabManager *tabManager) : Tab d->actions->addAction(name, action); } - //#ifdef WHITEBOARDING - // d->act_whiteboard = new IconAction(tr("Open a Whiteboard"), "psi/whiteboard", tr("Open a &Whiteboard"), 0, - // this); connect(d->act_whiteboard, SIGNAL(triggered()), SLOT(openWhiteboard())); - //#endif + // #ifdef WHITEBOARDING + // d->act_whiteboard = new IconAction(tr("Open a Whiteboard"), "psi/whiteboard", tr("Open a &Whiteboard"), 0, + // this); connect(d->act_whiteboard, SIGNAL(triggered()), SLOT(openWhiteboard())); + // #endif d->act_nick = new QAction(this); d->act_nick->setText(tr("Change Nickname...")); @@ -991,9 +991,9 @@ GCMainDlg::GCMainDlg(PsiAccount *pa, const Jid &j, TabManager *tabManager) : Tab int s = PsiIconset::instance()->system().iconSize(); ui_.toolbar->setIconSize(QSize(s, s)); - //#ifdef WHITEBOARDING - // ui_.toolbar->addAction(d->act_whiteboard); - //#endif + // #ifdef WHITEBOARDING + // ui_.toolbar->addAction(d->act_whiteboard); + // #endif ui_.toolbar->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Maximum); // Common actions @@ -2101,8 +2101,10 @@ void GCMainDlg::message(const Message &_m, const PsiEvent::Ptr &e) MessageView tv = MessageView::subjectMessage(topic, sysMsg); tv.setDateTime(m.timeStamp()); - ui_.le_topic->setText( - topic.replace("\n\n", " || ").replace("\n", " | ").replace("\t", " ").replace(QRegularExpression("\\s{2,}"), " ")); + ui_.le_topic->setText(topic.replace("\n\n", " || ") + .replace("\n", " | ") + .replace("\t", " ") + .replace(QRegularExpression("\\s{2,}"), " ")); ui_.le_topic->setCursorPosition(0); ui_.le_topic->setToolTip(QString("

%1

").arg(subjectTooltip)); @@ -2498,9 +2500,9 @@ void GCMainDlg::buildMenu() d->pm_settings->addAction(d->actions->action("gchat_info")); d->pm_settings->addAction(d->actions->action("gchat_clear")); d->pm_settings->addAction(d->actions->action("gchat_configure")); - //#ifdef WHITEBOARDING - // d->act_whiteboard->addTo( d->pm_settings ); - //#endif + // #ifdef WHITEBOARDING + // d->act_whiteboard->addTo( d->pm_settings ); + // #endif d->pm_settings->addSeparator(); d->pm_settings->addAction(d->actions->action("gchat_icon")); diff --git a/src/groupchatdlg.h b/src/groupchatdlg.h index ee5f574ff..d2ef50577 100644 --- a/src/groupchatdlg.h +++ b/src/groupchatdlg.h @@ -57,7 +57,7 @@ class GCMainDlg : public TabbableWidget { void message(const Message &, const PsiEvent::Ptr &e = PsiEvent::Ptr()); void joined(); void setPassword(const QString &); - const QString & nick() const; + const QString &nick() const; const QDateTime &lastMsgTime() const; bool isLastMessageAlert() const; @@ -71,7 +71,7 @@ class GCMainDlg : public TabbableWidget { // reimplemented virtual TabbableWidget::State state() const; virtual int unreadMessageCount() const; - const QString & getDisplayName() const; + const QString &getDisplayName() const; virtual QString desiredCaption() const; virtual void setVSplitterPosition(int log, int chat); @@ -149,7 +149,7 @@ private slots: friend class Private; private: - Private * d; + Private *d; Ui::GroupChatDlg ui_; bool lastWasEncrypted_ = false; diff --git a/src/groupchattopicdlg.cpp b/src/groupchattopicdlg.cpp index a01a521d3..6c22d598a 100644 --- a/src/groupchattopicdlg.cpp +++ b/src/groupchattopicdlg.cpp @@ -36,7 +36,7 @@ GroupchatTopicDlg::GroupchatTopicDlg(GCMainDlg *parent) : m_addLangUi->cmbLang->addItem(tr("Any Language"), 0); QMap langs; - const auto & locales + const auto &locales = QLocale::matchingLocales(QLocale::AnyLanguage, QLocale::AnyScript, QLocale::AnyCountry); for (auto const &loc : locales) { if (loc != QLocale::c()) { @@ -61,7 +61,7 @@ GroupchatTopicDlg::GroupchatTopicDlg(GCMainDlg *parent) : id.country = quint16(m_addLangUi->cmbCountry->currentData().toInt()); bool found = false; for (int i = 0; i < m_ui->twLang->count(); i++) { - QPlainTextEdit * edit = static_cast(m_ui->twLang->widget(i)); + QPlainTextEdit *edit = static_cast(m_ui->twLang->widget(i)); LanguageManager::LangId tabId = edit->property("langId").value(); if (id == tabId) { m_ui->twLang->setCurrentIndex(i); @@ -96,7 +96,7 @@ QMap GroupchatTopicDlg::subjectMap() const { QMap ret; for (int i = 0; i < m_ui->twLang->count(); i++) { - QPlainTextEdit * edit = static_cast(m_ui->twLang->widget(i)); + QPlainTextEdit *edit = static_cast(m_ui->twLang->widget(i)); LanguageManager::LangId id = edit->property("langId").value(); QString text = edit->toPlainText(); ret.insert(id, text); diff --git a/src/groupchattopicdlg.h b/src/groupchattopicdlg.h index dccb24cbc..ffaf32799 100644 --- a/src/groupchattopicdlg.h +++ b/src/groupchattopicdlg.h @@ -25,7 +25,7 @@ class GroupchatTopicDlg : public QDialog { void changeEvent(QEvent *e); private: - Ui::GroupchatTopicDlg * m_ui; + Ui::GroupchatTopicDlg *m_ui; Ui::GroupChatTopicAddLangDlg *m_addLangUi; QPointer addLangDlg; diff --git a/src/historycontactlistmodel.cpp b/src/historycontactlistmodel.cpp index 0b02469db..e38987b53 100644 --- a/src/historycontactlistmodel.cpp +++ b/src/historycontactlistmodel.cpp @@ -261,8 +261,7 @@ HistoryContactListModel::TreeItem::TreeItem(ItemType type, const QString &text, HistoryContactListModel::TreeItem::TreeItem(ItemType type, const QString &text, const QString &tooltip, const QString &id, int pos) : - _parent(nullptr), - _type(type), _text(text), _tooltip(tooltip), _id(id), _position(pos) + _parent(nullptr), _type(type), _text(text), _tooltip(tooltip), _id(id), _position(pos) { } diff --git a/src/historycontactlistmodel.h b/src/historycontactlistmodel.h index e7825f7d5..3e21a93b0 100644 --- a/src/historycontactlistmodel.h +++ b/src/historycontactlistmodel.h @@ -65,7 +65,7 @@ class HistoryContactListModel : public QAbstractItemModel { QString text(bool tooltip = false) const { return tooltip ? _tooltip : _text; } private: - TreeItem * _parent; + TreeItem *_parent; ItemType _type; QString _text; QString _tooltip; diff --git a/src/historydlg.cpp b/src/historydlg.cpp index ee2e55f9c..477b3d292 100644 --- a/src/historydlg.cpp +++ b/src/historydlg.cpp @@ -403,9 +403,9 @@ void DisplayProxy::displayWithSearchCursor(const QString &acc_id, const Jid &jid bool DisplayProxy::isMessage(const QTextCursor &cursor) const { int pos = cursor.positionInBlock(); - if (pos > 22) { // the timestamp length + if (pos > 22) { // the timestamp length auto text = cursor.block().text(); - if (QStringView{text}.left(pos - 1).indexOf(QLatin1String{"> "}) != -1) // skip nickname + if (QStringView { text }.left(pos - 1).indexOf(QLatin1String { "> " }) != -1) // skip nickname return true; } return false; @@ -534,7 +534,7 @@ void DisplayProxy::displayResult(const EDBResult &r, int dir) EDBItemPtr item = r.value(i); PsiEvent::Ptr e(item->event()); if (e->type() == PsiEvent::Message) { - PsiAccount * pa = (acc) ? acc : e->account(); + PsiAccount *pa = (acc) ? acc : e->account(); QString from = getNick(e->account(), e->from()); MessageEvent::Ptr me = e.staticCast(); QString msg = me->message().body(); @@ -582,7 +582,7 @@ class HistoryDlg::Private { public: Jid jid; PsiAccount *pa; - PsiCon * psi; + PsiCon *psi; #ifndef Q_OS_LINUX bool autoCopyText; #endif @@ -948,7 +948,7 @@ void HistoryDlg::exportHistory() } QTextStream stream(&f); - EDB * edb = nullptr; + EDB *edb = nullptr; QString us; // PsiAccount *pa = nullptr; if (d->pa) { @@ -1059,7 +1059,7 @@ void HistoryDlg::doMenu() return; openSelectedContact(); - QMenu * m = new QMenu(); + QMenu *m = new QMenu(); QAction *chat = m->addAction(IconsetFactory::icon("psi/chat").icon(), tr("&Open chat"), this, SLOT(openChat())); QAction *exp = m->addAction(IconsetFactory::icon("psi/save").icon(), tr("&Export history"), this, SLOT(exportHistory())); diff --git a/src/historydlg.h b/src/historydlg.h index 8b7de4468..935190488 100644 --- a/src/historydlg.h +++ b/src/historydlg.h @@ -63,17 +63,17 @@ private slots: void handlePadding(const EDBResult &r); private: - int general_pos; - int total_found; - bool active; - int direction; - QString s_string; - QHash map; - QVector list; - PsiCon * psi; - DisplayProxy * dp; - QString acc_; - XMPP::Jid jid_; + int general_pos; + int total_found; + bool active; + int direction; + QString s_string; + QHash map; + QVector list; + PsiCon *psi; + DisplayProxy *dp; + QString acc_; + XMPP::Jid jid_; enum RequestType { ReqFind, ReqPadding }; RequestType reqType; }; @@ -132,7 +132,7 @@ private slots: } searchParams; enum RequestType { ReqNone, ReqDate, ReqEarliest, ReqLatest, ReqNext, ReqPrevious }; RequestType reqType; - PsiCon * psi; + PsiCon *psi; PsiTextView *viewWid; bool formatting; bool emoticons; @@ -183,7 +183,7 @@ private slots: QFont fontForOption(const QString &option); void resetWidgets(); void listAccounts(); - UserListItem * currentUserListItem() const; + UserListItem *currentUserListItem() const; void stopRequest(); void showProgress(int max); void incrementProgress(); @@ -192,18 +192,18 @@ private slots: void selectDefaultContact(const QModelIndex &prefer_parent = QModelIndex(), int prefer_row = 0); void saveFocus(); void restoreFocus(); - EDBHandle * getEDBHandle(); + EDBHandle *getEDBHandle(); QString getCurrentAccountId() const; HistoryContactListModel *contactListModel(); void setShortcuts(); class Private; - Private * d; + Private *d; Ui::HistoryDlg ui_; HistoryContactListModel *_contactListModel; - QWidget * lastFocus; - DisplayProxy * displayProxy; - SearchProxy * searchProxy; + QWidget *lastFocus; + DisplayProxy *displayProxy; + SearchProxy *searchProxy; }; #endif // HISTORYDLG_H diff --git a/src/historyimp.cpp b/src/historyimp.cpp index 98b36415e..bf3e5d3ac 100644 --- a/src/historyimp.cpp +++ b/src/historyimp.cpp @@ -215,15 +215,15 @@ void HistoryImport::showDialog() QVBoxLayout *mainLayout = new QVBoxLayout(dlg); stackedWidget = new QStackedWidget(dlg); - QWidget * page1 = new QWidget(); + QWidget *page1 = new QWidget(); QGridLayout *page1Layout = new QGridLayout(page1); - QLabel * lbMessage = new QLabel(page1); + QLabel *lbMessage = new QLabel(page1); lbMessage->setWordWrap(true); lbMessage->setText(tr("Found %1 files for import.\nContinue?").arg(importList.size())); page1Layout->addWidget(lbMessage, 0, 0, 1, 1); stackedWidget->addWidget(page1); - QWidget * page2 = new QWidget(); + QWidget *page2 = new QWidget(); QHBoxLayout *page2Layout = new QHBoxLayout(page2); QGridLayout *page2GridLayout = new QGridLayout(); page2GridLayout->addWidget(new QLabel(tr("Status:"), page2), 0, 0, 1, 1); diff --git a/src/historyimp.h b/src/historyimp.h index 5d62d1561..3c12191e4 100644 --- a/src/historyimp.h +++ b/src/historyimp.h @@ -56,23 +56,23 @@ class HistoryImport : public QObject { int importDuration(); private: - PsiCon * psi_; + PsiCon *psi_; QList importList; - EDB * srcEdb; - EDB * dstEdb; - EDBHandle * hErase; - EDBHandle * hRead; - EDBHandle * hWrite; + EDB *srcEdb; + EDB *dstEdb; + EDBHandle *hErase; + EDBHandle *hRead; + EDBHandle *hWrite; QDateTime startTime; QDateTime stopTime; bool active; int result_; quint64 recordsCount; - QDialog * dlg; - QLabel * lbStatus; - QProgressBar * progressBar; - QStackedWidget * stackedWidget; - QPushButton * btnOk; + QDialog *dlg; + QLabel *lbStatus; + QProgressBar *progressBar; + QStackedWidget *stackedWidget; + QPushButton *btnOk; private: void clear(); diff --git a/src/hoverabletreeview.cpp b/src/hoverabletreeview.cpp index f83430265..34e2afb9c 100644 --- a/src/hoverabletreeview.cpp +++ b/src/hoverabletreeview.cpp @@ -57,10 +57,10 @@ HoverableStyleOptionViewItem::HoverableStyleOptionViewItem(const QStyleOptionVie HoverableStyleOptionViewItem &HoverableStyleOptionViewItem::operator=(const QStyleOptionViewItem &other) { - HoverableStyleOptionViewItemBaseClass::operator =(other); - const HoverableStyleOptionViewItem * hoverable = qstyleoption_cast(&other); - this->hovered = hoverable ? hoverable->hovered : false; - this->hoveredPosition = hoverable ? hoverable->hoveredPosition : QPoint(); + HoverableStyleOptionViewItemBaseClass::operator=(other); + const HoverableStyleOptionViewItem *hoverable = qstyleoption_cast(&other); + this->hovered = hoverable ? hoverable->hovered : false; + this->hoveredPosition = hoverable ? hoverable->hoveredPosition : QPoint(); return *this; } diff --git a/src/hoverabletreeview.h b/src/hoverabletreeview.h index 3ef0889ed..5796814ac 100644 --- a/src/hoverabletreeview.h +++ b/src/hoverabletreeview.h @@ -39,7 +39,7 @@ class HoverableStyleOptionViewItem : public HoverableStyleOptionViewItemBaseClas *this = other; } HoverableStyleOptionViewItem(const QStyleOptionViewItem &other); - HoverableStyleOptionViewItem & operator=(const QStyleOptionViewItem &other); + HoverableStyleOptionViewItem &operator=(const QStyleOptionViewItem &other); inline HoverableStyleOptionViewItem &operator=(const HoverableStyleOptionViewItem &other) { return *this = static_cast(other); diff --git a/src/htmltextcontroller.cpp b/src/htmltextcontroller.cpp index 1b2e0b4ed..933158874 100644 --- a/src/htmltextcontroller.cpp +++ b/src/htmltextcontroller.cpp @@ -63,7 +63,7 @@ class HTMLTextMenu : public QMenu { void setMenuState(QList list) { foreach (HTMLTextController::TextEditState state, - list) { switch (state) { case HTMLTextController::StateBold : actBold->setChecked(true); + list) { switch (state) { case HTMLTextController::StateBold : actBold -> setChecked(true); break; case HTMLTextController::StateItalic: actItalic->setChecked(true); diff --git a/src/httpauthmanager.cpp b/src/httpauthmanager.cpp index 0e0b5edeb..e0a181118 100644 --- a/src/httpauthmanager.cpp +++ b/src/httpauthmanager.cpp @@ -19,12 +19,12 @@ #include "httpauthmanager.h" -#include "psihttpauthrequest.h" #include "iris/xmpp_client.h" #include "iris/xmpp_message.h" #include "iris/xmpp_stream.h" #include "iris/xmpp_task.h" #include "iris/xmpp_xmlcommon.h" +#include "psihttpauthrequest.h" class HttpAuthListener : public XMPP::Task { Q_OBJECT diff --git a/src/infodlg.cpp b/src/infodlg.cpp index f008faac2..8bb8bd141 100644 --- a/src/infodlg.cpp +++ b/src/infodlg.cpp @@ -26,6 +26,10 @@ #include "fileutil.h" #include "iconset.h" #include "iconwidget.h" +#include "iris/xmpp_client.h" +#include "iris/xmpp_serverinfomanager.h" +#include "iris/xmpp_tasks.h" +#include "iris/xmpp_vcard.h" #include "lastactivitytask.h" #include "msgmle.h" #include "psiaccount.h" @@ -35,10 +39,6 @@ #include "userlist.h" #include "vcardfactory.h" #include "vcardphotodlg.h" -#include "iris/xmpp_client.h" -#include "iris/xmpp_serverinfomanager.h" -#include "iris/xmpp_tasks.h" -#include "iris/xmpp_vcard.h" #include #include @@ -145,11 +145,11 @@ class InfoWidget::Private { int actionType = 0; Jid jid; VCard vcard; - PsiAccount * pa = nullptr; + PsiAccount *pa = nullptr; bool busy = false; bool te_edited = false; bool cacheVCard = false; - JT_VCard * jt = nullptr; + JT_VCard *jt = nullptr; QByteArray photo; QDate bday; QString dateTextFormat; @@ -160,10 +160,10 @@ class InfoWidget::Private { QPointer noBdayButton; QPointer bdayPopup; QPointer calendar; - QLineEdit * le_givenname = nullptr; - QLineEdit * le_middlename = nullptr; - QLineEdit * le_familyname = nullptr; - QAction * homepageAction = nullptr; + QLineEdit *le_givenname = nullptr; + QLineEdit *le_middlename = nullptr; + QLineEdit *le_familyname = nullptr; + QAction *homepageAction = nullptr; // Fake UserListItem for groupchat contacts. // One day this dialog should be rewritten not to talk directly to psiaccount, diff --git a/src/infodlg.h b/src/infodlg.h index cc9a288c2..377238c5d 100644 --- a/src/infodlg.h +++ b/src/infodlg.h @@ -41,7 +41,7 @@ class InfoWidget : public QWidget { ~InfoWidget(); bool aboutToClose(); /* call this when you are going to close parent dialog */ PsiAccount *account() const; - const Jid & jid() const; + const Jid &jid() const; protected: // reimplemented diff --git a/src/invitetogroupchatmenu.cpp b/src/invitetogroupchatmenu.cpp index 564a85387..21c92db54 100644 --- a/src/invitetogroupchatmenu.cpp +++ b/src/invitetogroupchatmenu.cpp @@ -52,5 +52,5 @@ void InviteToGroupChatMenu::actionActivated() { QAction *action = static_cast(sender()); emit inviteToGroupchat(controller_->contactList()->getAccount(action->property("account").toString()), - action->property("groupChat").toString()); + action->property("groupChat").toString()); } diff --git a/src/irisprotocol/iris_discoinfoquerier.h b/src/irisprotocol/iris_discoinfoquerier.h index 2dfffac84..9929359f6 100644 --- a/src/irisprotocol/iris_discoinfoquerier.h +++ b/src/irisprotocol/iris_discoinfoquerier.h @@ -1,8 +1,8 @@ #ifndef IRIS_DISCOINFOQUERIER_H #define IRIS_DISCOINFOQUERIER_H -#include "protocol/discoinfoquerier.h" #include "iris/xmpp_client.h" +#include "protocol/discoinfoquerier.h" #include #include diff --git a/src/jidutil.cpp b/src/jidutil.cpp index 2a051ca02..402a62f83 100644 --- a/src/jidutil.cpp +++ b/src/jidutil.cpp @@ -19,8 +19,8 @@ #include "jidutil.h" -#include "psioptions.h" #include "iris/xmpp_jid.h" +#include "psioptions.h" using namespace XMPP; diff --git a/src/jinglevoicecaller.cpp b/src/jinglevoicecaller.cpp index cdce8923b..515998434 100644 --- a/src/jinglevoicecaller.cpp +++ b/src/jinglevoicecaller.cpp @@ -351,8 +351,8 @@ void JingleVoiceCaller::receiveStanza(const QString &stanza) } } -cricket::SocketServer * JingleVoiceCaller::socket_server_ = NULL; -cricket::Thread * JingleVoiceCaller::thread_ = NULL; -cricket::NetworkManager * JingleVoiceCaller::network_manager_ = NULL; +cricket::SocketServer *JingleVoiceCaller::socket_server_ = NULL; +cricket::Thread *JingleVoiceCaller::thread_ = NULL; +cricket::NetworkManager *JingleVoiceCaller::network_manager_ = NULL; cricket::BasicPortAllocator *JingleVoiceCaller::port_allocator_ = NULL; -cricket::SocketAddress * JingleVoiceCaller::stun_addr_ = NULL; +cricket::SocketAddress *JingleVoiceCaller::stun_addr_ = NULL; diff --git a/src/jinglevoicecaller.h b/src/jinglevoicecaller.h index 98c491047..04e29687b 100644 --- a/src/jinglevoicecaller.h +++ b/src/jinglevoicecaller.h @@ -73,14 +73,14 @@ protected slots: private: bool initialized_; - static cricket::SocketServer * socket_server_; - static cricket::Thread * thread_; - static cricket::NetworkManager * network_manager_; + static cricket::SocketServer *socket_server_; + static cricket::Thread *thread_; + static cricket::NetworkManager *network_manager_; static cricket::BasicPortAllocator *port_allocator_; - static cricket::SocketAddress * stun_addr_; - cricket::SessionManager * session_manager_; - cricket::PhoneSessionClient * phone_client_; - JingleClientSlots * slots_; + static cricket::SocketAddress *stun_addr_; + cricket::SessionManager *session_manager_; + cricket::PhoneSessionClient *phone_client_; + JingleClientSlots *slots_; QMap calls_; }; diff --git a/src/lastactivitytask.h b/src/lastactivitytask.h index 2d2a8d30e..9f46a65ed 100644 --- a/src/lastactivitytask.h +++ b/src/lastactivitytask.h @@ -35,7 +35,7 @@ class LastActivityTask : public XMPP::Task { bool take(const QDomElement &); const XMPP::Jid &jid() const; - const QString & status() const; + const QString &status() const; const QDateTime &time() const; private: diff --git a/src/main.cpp b/src/main.cpp index 88d27f85c..d3153c8c9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -283,11 +283,11 @@ void PsiMain::sessionStart() connect(pcon, SIGNAL(quit(int)), SLOT(sessionQuit(int))); if (cmdline.contains("uri")) { - emit ActiveProfiles::instance()->openUriRequested(cmdline.value("uri")); + emit ActiveProfiles::instance() -> openUriRequested(cmdline.value("uri")); cmdline.remove("uri"); } if (cmdline.contains("status") || cmdline.contains("status-message")) { - emit ActiveProfiles::instance()->setStatusRequested(cmdline.value("status"), cmdline.value("status-message")); + emit ActiveProfiles::instance() -> setStatusRequested(cmdline.value("status"), cmdline.value("status-message")); cmdline.remove("status"); cmdline.remove("status-message"); } @@ -596,7 +596,7 @@ PSI_EXPORT_FUNC int main(int argc, char *argv[]) Q_IMPORT_PLUGIN(qca_ossl) #endif -//#if defined(Q_OS_WIN) && defined(QT_STATICPLUGIN) -// Q_IMPORT_PLUGIN(qjpeg) -// Q_IMPORT_PLUGIN(qgif) -//#endif +// #if defined(Q_OS_WIN) && defined(QT_STATICPLUGIN) +// Q_IMPORT_PLUGIN(qjpeg) +// Q_IMPORT_PLUGIN(qgif) +// #endif diff --git a/src/mainwin.cpp b/src/mainwin.cpp index 1da55dec9..52c104281 100644 --- a/src/mainwin.cpp +++ b/src/mainwin.cpp @@ -31,6 +31,7 @@ #include "eventnotifier.h" #include "geolocationdlg.h" #include "globalstatusmenu.h" +#include "iris/xmpp_serverinfomanager.h" #include "mainwin_p.h" #include "mooddlg.h" #include "mucjoindlg.h" @@ -51,7 +52,6 @@ #include "tabdlg.h" #include "tabmanager.h" #include "textutil.h" -#include "iris/xmpp_serverinfomanager.h" #include #include @@ -917,17 +917,8 @@ void MainWin::buildOptionsMenu() helpMenu->setIcon(IconsetFactory::icon("psi/help").icon()); QStringList actions; - actions << "help_readme" - << "separator" - << "help_online_wiki" - << "help_online_home" - << "help_online_forum" - << "help_psi_muc" - << "help_report_bug" - << "diagnostics" - << "separator" - << "help_about" - << "help_about_qt"; + actions << "help_readme" << "separator" << "help_online_wiki" << "help_online_home" << "help_online_forum" + << "help_psi_muc" << "help_report_bug" << "diagnostics" << "separator" << "help_about" << "help_about_qt"; d->updateMenu(actions, helpMenu); @@ -964,9 +955,7 @@ void MainWin::buildMainMenu() void MainWin::buildToolsMenu() { QStringList actions; - actions << "menu_file_transfer" - << "separator" - << "menu_xml_console"; + actions << "menu_file_transfer" << "separator" << "menu_xml_console"; d->updateMenu(actions, d->toolsMenu); } @@ -983,8 +972,7 @@ void MainWin::buildGeneralMenu(QMenu *menu) #ifdef GROUPCHAT << "menu_join_groupchat" #endif - << "menu_options" - << "menu_file_transfer"; + << "menu_options" << "menu_file_transfer"; if (PsiOptions::instance()->getOption("options.ui.menu.main.change-profile").toBool()) { actions << "menu_change_profile"; } @@ -1458,7 +1446,7 @@ void MainWin::keyPressEvent(QKeyEvent *e) QWidget::keyPressEvent(e); } -#if QT_VERSION < QT_VERSION_CHECK(6,0,0) +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) void MainWin::enterEvent(QEvent *e) #else void MainWin::enterEvent(QEnterEvent *e) @@ -1965,4 +1953,4 @@ void MainWin::resizeEvent(QResizeEvent *e) } } -//#endif +// #endif diff --git a/src/mainwin.h b/src/mainwin.h index f861b6537..e2a117e13 100644 --- a/src/mainwin.h +++ b/src/mainwin.h @@ -71,14 +71,14 @@ class MainWin : public AdvancedWidget { protected: // reimplemented - bool eventFilter(QObject *o, QEvent *e); - void resizeEvent(QResizeEvent *e); - void closeEvent(QCloseEvent *); - void changeEvent(QEvent *event); -#if QT_VERSION < QT_VERSION_CHECK(6,0,0) - void enterEvent(QEvent *e); + bool eventFilter(QObject *o, QEvent *e); + void resizeEvent(QResizeEvent *e); + void closeEvent(QCloseEvent *); + void changeEvent(QEvent *event); +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + void enterEvent(QEvent *e); #else - void enterEvent(QEnterEvent *e); + void enterEvent(QEnterEvent *e); #endif void leaveEvent(QEvent *e); void keyPressEvent(QKeyEvent *); diff --git a/src/mcmdmanager.cpp b/src/mcmdmanager.cpp index 231412bca..913a9fe55 100644 --- a/src/mcmdmanager.cpp +++ b/src/mcmdmanager.cpp @@ -107,8 +107,8 @@ QStringList MCmdManager::parseCommand(const QString command, int pos, int &part, QString MCmdManager::serializeCommand(const QStringList &list) { - QString retval; - bool needspace = false; + QString retval; + bool needspace = false; QRegularExpression specials("([\"\'\\\\ ])"); for (QString item : list) { item.replace(specials, "\\\\1"); diff --git a/src/mcmdmanager.h b/src/mcmdmanager.h index 231d0e5ac..7165a1253 100644 --- a/src/mcmdmanager.h +++ b/src/mcmdmanager.h @@ -80,7 +80,7 @@ class MCmdManager : public MCmdManagerIface { QString serializeCommand(const QStringList &list); QList providers_; - MCmdStateIface * state_; + MCmdStateIface *state_; MCmdUiSiteIface *uiSite_; }; diff --git a/src/mcmdsimplesite.h b/src/mcmdsimplesite.h index e768cda20..49523e6fe 100644 --- a/src/mcmdsimplesite.h +++ b/src/mcmdsimplesite.h @@ -41,7 +41,7 @@ class MCmdSimpleSite : public MCmdUiSiteIface { void setInput(QTextEdit *i); protected: - QLabel * promptWidget; + QLabel *promptWidget; QTextEdit *inputWidget; bool open; QString mini_msg_swap; diff --git a/src/messageview.h b/src/messageview.h index d9f1e883c..63f5f56c9 100644 --- a/src/messageview.h +++ b/src/messageview.h @@ -117,16 +117,16 @@ class MessageView { inline int statusPriority() const { return _statusPriority; } inline void setNick(const QString &nick) { _nick = nick; } - inline const QString & nick() const { return _nick; } + inline const QString &nick() const { return _nick; } inline void setMessageId(const QString &id) { _messageId = id; } - inline const QString & messageId() const { return _messageId; } + inline const QString &messageId() const { return _messageId; } inline void setUserId(const QString &id) { _userId = id; } - inline const QString & userId() const { return _userId; } + inline const QString &userId() const { return _userId; } inline void setDateTime(const QDateTime &dt) { _dateTime = dt; } - inline const QDateTime & dateTime() const { return _dateTime; } + inline const QDateTime &dateTime() const { return _dateTime; } inline QMap urls() const { return _urls; } inline void setReplaceId(const QString &id) { _replaceId = id; } - inline const QString & replaceId() const { return _replaceId; } + inline const QString &replaceId() const { return _replaceId; } inline void setCarbonDirection(XMPP::Message::CarbonDir c) { _carbon = c; } inline XMPP::Message::CarbonDir carbonDirection() const { return _carbon; } inline void addReference(FileSharingItem *fsi) { _references.append(fsi); } diff --git a/src/miniclient.cpp b/src/miniclient.cpp index b53735f54..293c13a03 100644 --- a/src/miniclient.cpp +++ b/src/miniclient.cpp @@ -22,12 +22,12 @@ #include "Certificates/CertificateHelpers.h" #include "applicationinfo.h" #include "bobfilecache.h" -#include "proxy.h" -#include "psiaccount.h" #include "iris/xmpp.h" #include "iris/xmpp_client.h" #include "iris/xmpp_clientstream.h" #include "iris/xmpp_tasks.h" +#include "proxy.h" +#include "psiaccount.h" #include #include diff --git a/src/miniclient.h b/src/miniclient.h index 23da73f4f..64df7dd4b 100644 --- a/src/miniclient.h +++ b/src/miniclient.h @@ -74,10 +74,10 @@ private slots: private: XMPP::AdvancedConnector *conn; - XMPP::ClientStream * stream; - QCA::TLS * tls; - XMPP::QCATLSHandler * tlsHandler; - XMPP::Client * _client; + XMPP::ClientStream *stream; + QCA::TLS *tls; + XMPP::QCATLSHandler *tlsHandler; + XMPP::Client *_client; XMPP::Jid j; QString pass; bool auth, force_ssl, error_disconnect; diff --git a/src/mooddlg.cpp b/src/mooddlg.cpp index 189c1bf1a..fca06a895 100644 --- a/src/mooddlg.cpp +++ b/src/mooddlg.cpp @@ -19,13 +19,13 @@ #include "mooddlg.h" +#include "iris/xmpp_client.h" +#include "iris/xmpp_pubsubitem.h" +#include "iris/xmpp_task.h" #include "moodcatalog.h" #include "pepmanager.h" #include "psiaccount.h" #include "psiiconset.h" -#include "iris/xmpp_client.h" -#include "iris/xmpp_pubsubitem.h" -#include "iris/xmpp_task.h" MoodDlg::MoodDlg(QList list) : QDialog(nullptr), pa_(list) { diff --git a/src/msgmle.cpp b/src/msgmle.cpp index 50210504e..5d030fa3e 100644 --- a/src/msgmle.cpp +++ b/src/msgmle.cpp @@ -102,9 +102,9 @@ public slots: } else if (charsAdded > 1) { // Insert a piece of text return; } else { - QRegularExpression capitalizeAfter("(?:^[^.][.]+\\s+)|(?:\\s*[^.]{2,}[.]+\\s+)|(?:[!?]\\s+)"); + QRegularExpression capitalizeAfter("(?:^[^.][.]+\\s+)|(?:\\s*[^.]{2,}[.]+\\s+)|(?:[!?]\\s+)"); QRegularExpressionMatch match; - int index = te_->toPlainText().lastIndexOf(capitalizeAfter, 0, &match); + int index = te_->toPlainText().lastIndexOf(capitalizeAfter, 0, &match); if (index != -1 && index == pos - match.capturedLength()) { capitalizeNext_ = true; } @@ -328,7 +328,7 @@ void ChatEdit::contextMenuEvent(QContextMenuEvent *e) QTextCursor tc = cursorForPosition(last_click_); tc.movePosition(QTextCursor::StartOfWord, QTextCursor::MoveAnchor); tc.movePosition(QTextCursor::EndOfWord, QTextCursor::KeepAnchor); - QString selected_word = tc.selectedText(); + QString selected_word = tc.selectedText(); static QRegularExpression numbers("^\\d+$"); if (!selected_word.isEmpty() && !numbers.match(selected_word).hasMatch() && !SpellChecker::instance()->isCorrect(selected_word)) { diff --git a/src/msgmle.h b/src/msgmle.h index adeb4472e..fe8a3f1ba 100644 --- a/src/msgmle.h +++ b/src/msgmle.h @@ -62,7 +62,7 @@ class ChatEdit : public QTextEdit { XMPP::HTMLElement toHTMLElement(); bool isCorrection() { return correction; } void setLastMessageId(const QString &id) { lastId = id; } - const QString & lastMessageId() { return lastId; } + const QString &lastMessageId() { return lastId; } void resetCorrection() { correction = false; @@ -114,22 +114,22 @@ protected slots: void setRecButtonIcon(); private: - QWidget * dialog_ = nullptr; + QWidget *dialog_ = nullptr; bool check_spelling_ = false; std::unique_ptr spellhighlighter_; QPoint last_click_; int previous_position_ = 0; QStringList typedMsgsHistory; int typedMsgsIndex = 0; - QAction * act_showMessagePrev = nullptr; - QAction * act_showMessageNext = nullptr; - QAction * act_showMessageFirst = nullptr; - QAction * act_showMessageLast = nullptr; - QAction * act_changeCase = nullptr; - QAction * actPasteAsQuote_ = nullptr; + QAction *act_showMessagePrev = nullptr; + QAction *act_showMessageNext = nullptr; + QAction *act_showMessageFirst = nullptr; + QAction *act_showMessageLast = nullptr; + QAction *act_changeCase = nullptr; + QAction *actPasteAsQuote_ = nullptr; QString currentText; - HTMLTextController * controller_ = nullptr; - CapitalLettersController * capitalizer_ = nullptr; + HTMLTextController *controller_ = nullptr; + CapitalLettersController *capitalizer_ = nullptr; bool correction = false; QString lastId; QPointer layout_; diff --git a/src/mucaffiliationsmodel.cpp b/src/mucaffiliationsmodel.cpp index fc0f834f4..319a82887 100644 --- a/src/mucaffiliationsmodel.cpp +++ b/src/mucaffiliationsmodel.cpp @@ -124,7 +124,7 @@ QStringList MUCAffiliationsModel::mimeTypes() const QMimeData *MUCAffiliationsModel::mimeData(const QModelIndexList &indexes) const { - QMimeData * mimeData = new QMimeData(); + QMimeData *mimeData = new QMimeData(); QByteArray encodedData; QDataStream stream(&encodedData, QIODevice::WriteOnly); for (const QModelIndex &index : indexes) { diff --git a/src/mucaffiliationsmodel.h b/src/mucaffiliationsmodel.h index 7699f6a3d..5480e6d30 100644 --- a/src/mucaffiliationsmodel.h +++ b/src/mucaffiliationsmodel.h @@ -38,7 +38,7 @@ class MUCAffiliationsModel : public QStandardItemModel { virtual Qt::DropActions supportedDropActions() const; bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent); QStringList mimeTypes() const; - QMimeData * mimeData(const QModelIndexList &indexes) const; + QMimeData *mimeData(const QModelIndexList &indexes) const; void resetAffiliationLists(); void setAffiliationListEnabled(XMPP::MUCItem::Affiliation, bool = true); diff --git a/src/mucaffiliationsproxymodel.cpp b/src/mucaffiliationsproxymodel.cpp index 578288279..c0f29d91a 100644 --- a/src/mucaffiliationsproxymodel.cpp +++ b/src/mucaffiliationsproxymodel.cpp @@ -15,7 +15,7 @@ bool MUCAffiliationsProxyModel::filterAcceptsRow(int sourceRow, const QModelInde if (!idx.parent().isValid()) return true; -#if QT_VERSION < QT_VERSION_CHECK(6,0,0) +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) return filterRegExp().indexIn(idx.data().toString()) >= 0; #else return filterRegularExpression().match(idx.data().toString()).hasMatch(); diff --git a/src/mucconfigdlg.cpp b/src/mucconfigdlg.cpp index 67885e0ee..3e53cb15f 100644 --- a/src/mucconfigdlg.cpp +++ b/src/mucconfigdlg.cpp @@ -20,13 +20,13 @@ #include "mucconfigdlg.h" #include "infodlg.h" +#include "iris/xmpp_vcard.h" #include "mucaffiliationsmodel.h" #include "mucaffiliationsproxymodel.h" #include "mucmanager.h" #include "psiaccount.h" #include "vcardfactory.h" #include "xdata_widget.h" -#include "iris/xmpp_vcard.h" #include #include diff --git a/src/mucconfigdlg.h b/src/mucconfigdlg.h index a0f046da6..a394ad2bb 100644 --- a/src/mucconfigdlg.h +++ b/src/mucconfigdlg.h @@ -20,8 +20,8 @@ #ifndef MUCCONFIG_H #define MUCCONFIG_H -#include "ui_mucconfig.h" #include "iris/xmpp_muc.h" +#include "ui_mucconfig.h" #include @@ -76,12 +76,12 @@ protected slots: Ui::MUCConfig ui_; MUCItem::Role role_; MUCItem::Affiliation affiliation_; - MUCManager * manager_; - QScrollArea * data_container_; - XDataWidget * data_; - InfoWidget * vcard_; - MUCAffiliationsModel * affiliations_model_; - MUCAffiliationsProxyModel * affiliations_proxy_model_; + MUCManager *manager_; + QScrollArea *data_container_; + XDataWidget *data_; + InfoWidget *vcard_; + MUCAffiliationsModel *affiliations_model_; + MUCAffiliationsProxyModel *affiliations_proxy_model_; QList pending_requests_; }; diff --git a/src/mucjoindlg.h b/src/mucjoindlg.h index c4d900de1..ca4670ba1 100644 --- a/src/mucjoindlg.h +++ b/src/mucjoindlg.h @@ -20,8 +20,8 @@ #ifndef MUCJOINDLG_H #define MUCJOINDLG_H -#include "ui_mucjoin.h" #include "iris/xmpp_jid.h" +#include "ui_mucjoin.h" #include #include @@ -66,12 +66,12 @@ private slots: private: Ui::MUCJoin ui_; - PsiCon * controller_; - PsiAccount * account_; - QPushButton * joinButton_; + PsiCon *controller_; + PsiAccount *account_; + QPushButton *joinButton_; XMPP::Jid jid_; MucJoinReason reason_; - QTimer * timer_; + QTimer *timer_; bool nickAlreadyCompleted_; void disableWidgets(); diff --git a/src/mucmanager.cpp b/src/mucmanager.cpp index 4a9cceb8d..f2c8f526b 100644 --- a/src/mucmanager.cpp +++ b/src/mucmanager.cpp @@ -28,11 +28,11 @@ #include "mucmanager.h" -#include "psiaccount.h" #include "iris/xmpp_client.h" #include "iris/xmpp_task.h" #include "iris/xmpp_xdata.h" #include "iris/xmpp_xmlcommon.h" +#include "psiaccount.h" #include diff --git a/src/mucmanager.h b/src/mucmanager.h index c9a636669..65fbb79e7 100644 --- a/src/mucmanager.h +++ b/src/mucmanager.h @@ -67,7 +67,7 @@ class MUCManager : public QObject { void getItemsByAffiliation(MUCItem::Affiliation); void destroy(const QString &reason = QString(), const Jid &venue = Jid()); XMPP::Client *client() const; - PsiAccount * account() const; + PsiAccount *account() const; // Basic operations void kick(const QString &, const QString & = QString()); diff --git a/src/multifiletransferdlg.cpp b/src/multifiletransferdlg.cpp index 8fd855c25..1b9988c11 100644 --- a/src/multifiletransferdlg.cpp +++ b/src/multifiletransferdlg.cpp @@ -25,6 +25,7 @@ #include "iris/jingle-ft.h" #include "iris/jingle-session.h" #include "iris/jingle.h" +#include "iris/xmpp_tasks.h" #include "multifiletransferdelegate.h" #include "multifiletransferitem.h" #include "multifiletransfermodel.h" @@ -35,7 +36,6 @@ #include "ui_multifiletransferdlg.h" #include "userlist.h" #include "xmpp/jid/jid.h" -#include "iris/xmpp_tasks.h" #include #include @@ -50,15 +50,14 @@ #include #include - using namespace XMPP; class MultiFileTransferDlg::Private { public: - PsiAccount * account; + PsiAccount *account; Jid peer; QPointer session; - MultiFileTransferModel * model = nullptr; + MultiFileTransferModel *model = nullptr; bool isOutgoing = false; }; @@ -310,7 +309,7 @@ void MultiFileTransferDlg::initIncoming(XMPP::Jingle::Session *session) } else if (appToAccept.size()) { auto app = appToAccept.first(); auto fn = FileUtil::getSaveFileName(this, tr("Save As"), FileUtil::cleanFileName(app->file().name()), - tr("All files (*)")); + tr("All files (*)")); if (!fn.isEmpty()) { QFileInfo fi(fn); if (fi.exists()) { @@ -382,7 +381,7 @@ void MultiFileTransferDlg::addTransferContent(MultiFileTransferItem *item) p.save(&buffer, "PNG"); thumb = XMPP::Thumbnail(ba, "image/png", quint32(p.width()), quint32(p.height())); } - app->setFile(QFileInfo{item->filePath()}, item->description(), thumb); + app->setFile(QFileInfo { item->filePath() }, item->description(), thumb); d->session->addContent(app); } diff --git a/src/multifiletransferitem.cpp b/src/multifiletransferitem.cpp index 56aa64e5a..9f65f0122 100644 --- a/src/multifiletransferitem.cpp +++ b/src/multifiletransferitem.cpp @@ -45,9 +45,7 @@ struct MultiFileTransferItem::Private { }; MultiFileTransferItem::MultiFileTransferItem(MultiFileTransferModel::Direction direction, const QString &displayName, - quint64 fullSize, QObject *parent) : - QObject(parent), - d(new Private) + quint64 fullSize, QObject *parent) : QObject(parent), d(new Private) { d->direction = direction; d->displayName = displayName; diff --git a/src/multifiletransferitem.h b/src/multifiletransferitem.h index 1f8bb2797..40058c4f0 100644 --- a/src/multifiletransferitem.h +++ b/src/multifiletransferitem.h @@ -31,7 +31,7 @@ class MultiFileTransferItem : public QObject { QObject *parent); ~MultiFileTransferItem(); - const QString & displayName() const; + const QString &displayName() const; quint64 fullSize() const; quint64 currentSize() const; quint64 offset() const; // initial offset diff --git a/src/options/opt_accounts.h b/src/options/opt_accounts.h index 62ec96d04..b78b69627 100644 --- a/src/options/opt_accounts.h +++ b/src/options/opt_accounts.h @@ -19,7 +19,7 @@ class OptionsTabAccounts : public MetaOptionsTab { private: QWidget *w_; - PsiCon * psi_; + PsiCon *psi_; }; #endif // OPT_ACCOUNTS_H diff --git a/src/options/opt_appearance.cpp b/src/options/opt_appearance.cpp index fc56a42c6..42a6b10c5 100644 --- a/src/options/opt_appearance.cpp +++ b/src/options/opt_appearance.cpp @@ -206,7 +206,7 @@ QWidget *OptionsTabAppearanceGeneral::widget() QString s = tr("Specifies the text color for a contact name in the main window when that user is \"%1\"."); struct ColorWidgetData { - QCheckBox * cbox; + QCheckBox *cbox; QToolButton *button; QString option; QString descr; diff --git a/src/options/opt_appearance.h b/src/options/opt_appearance.h index 9c137e0ed..ee0daae66 100644 --- a/src/options/opt_appearance.h +++ b/src/options/opt_appearance.h @@ -75,9 +75,9 @@ private slots: void chooseFont(QAbstractButton *button); private: - QWidget * w = nullptr, *parentWidget = nullptr; + QWidget *w = nullptr, *parentWidget = nullptr; QButtonGroup *bg_color = nullptr; - FontLabel * le_font[4] = { nullptr, nullptr, nullptr, nullptr }; + FontLabel *le_font[4] = { nullptr, nullptr, nullptr, nullptr }; QButtonGroup *bg_font = nullptr; typedef QHash> ColorWidgetsMap; diff --git a/src/options/opt_chat.h b/src/options/opt_chat.h index 76aba765b..615051183 100644 --- a/src/options/opt_chat.h +++ b/src/options/opt_chat.h @@ -17,7 +17,7 @@ class OptionsTabChat : public OptionsTab { void restoreOptions(); private: - QWidget * w; + QWidget *w; QButtonGroup *bg_defAct; }; diff --git a/src/options/opt_events.h b/src/options/opt_events.h index 22c908433..271ab34dc 100644 --- a/src/options/opt_events.h +++ b/src/options/opt_events.h @@ -17,7 +17,7 @@ class OptionsTabEvents : public OptionsTab { bool stretchable() const; private: - QWidget * w; + QWidget *w; QList list_alerts; }; diff --git a/src/options/opt_iconset.cpp b/src/options/opt_iconset.cpp index 5da2fc81e..1f7935a52 100644 --- a/src/options/opt_iconset.cpp +++ b/src/options/opt_iconset.cpp @@ -205,7 +205,7 @@ class IconsetLoadEvent : public QEvent { private: IconsetLoadThread *p; - Iconset * is; + Iconset *is; }; //---------------------------------------------------------------------------- @@ -254,7 +254,7 @@ class IconsetLoadThread : public QThread { void postEvent(QEvent *); private: - QObject * parent; + QObject *parent; QString addPath; QStringList failedList; QStringList excludeList; @@ -405,7 +405,7 @@ void OptionsTabIconsetSystem::applyOptions() return; IconsetSystemUI *d = static_cast(w); - const Iconset * is = d->iss_system->iconset(); + const Iconset *is = d->iss_system->iconset(); if (is) { QFileInfo fi(is->fileName()); PsiOptions::instance()->setOption("options.iconsets.system", fi.fileName()); @@ -484,7 +484,7 @@ bool OptionsTabIconsetSystem::event(QEvent *e) void OptionsTabIconsetSystem::previewIconset() { IconsetSystemUI *d = static_cast(w); - const Iconset * is = d->iss_system->iconset(); + const Iconset *is = d->iss_system->iconset(); if (is) { isDetails(*is, parentWidget->parentWidget(), psi); } @@ -657,7 +657,7 @@ bool OptionsTabIconsetEmoticons::event(QEvent *e) void OptionsTabIconsetEmoticons::previewIconset() { - IconsetEmoUI * d = static_cast(w); + IconsetEmoUI *d = static_cast(w); const Iconset *is = d->iss_emoticons->iconset(); if (is) { isDetails(*is, parentWidget->parentWidget(), psi); @@ -943,7 +943,7 @@ bool OptionsTabIconsetActivity::event(QEvent *e) void OptionsTabIconsetActivity::previewIconset() { IconsetActivityUI *d = static_cast(w); - const Iconset * is = d->iss_activity->iconset(); + const Iconset *is = d->iss_activity->iconset(); if (is) { isDetails(*is, parentWidget->parentWidget(), psi); } @@ -1086,7 +1086,7 @@ bool OptionsTabIconsetAffiliations::event(QEvent *e) void OptionsTabIconsetAffiliations::previewIconset() { IconsetAffiliationUI *d = static_cast(w); - const Iconset * is = d->iss_affiliation->iconset(); + const Iconset *is = d->iss_affiliation->iconset(); if (is) { isDetails(*is, parentWidget->parentWidget(), psi); } @@ -1230,7 +1230,7 @@ bool OptionsTabIconsetClients::event(QEvent *e) void OptionsTabIconsetClients::previewIconset() { IconsetClientUI *d = static_cast(w); - const Iconset * is = d->iss_clients->iconset(); + const Iconset *is = d->iss_clients->iconset(); if (is) { isDetails(*is, parentWidget->parentWidget(), psi); } @@ -1523,7 +1523,7 @@ void OptionsTabIconsetRoster::setData(PsiCon *psicon, QWidget *p) void OptionsTabIconsetRoster::defaultDetails() { IconsetRosterUI *d = static_cast(w); - const Iconset * is = d->iss_defRoster->iconset(); + const Iconset *is = d->iss_defRoster->iconset(); if (is) { isDetails(*is, parentWidget->parentWidget(), psi); } @@ -1532,7 +1532,7 @@ void OptionsTabIconsetRoster::defaultDetails() void OptionsTabIconsetRoster::servicesDetails() { IconsetRosterUI *d = static_cast(w); - const Iconset * is = d->iss_servicesRoster->iconset(); + const Iconset *is = d->iss_servicesRoster->iconset(); if (is) { isDetails(*is, parentWidget->parentWidget(), psi); } @@ -1541,7 +1541,7 @@ void OptionsTabIconsetRoster::servicesDetails() void OptionsTabIconsetRoster::customDetails() { IconsetRosterUI *d = static_cast(w); - const Iconset * is = d->iss_customRoster->iconset(); + const Iconset *is = d->iss_customRoster->iconset(); if (is) { isDetails(*is, parentWidget->parentWidget(), psi); } @@ -1584,7 +1584,7 @@ void OptionsTabIconsetRoster::isServices_selectionChanged(QTreeWidgetItem *it) emit noDirty(true); for (int row = 0; row < d->iss_servicesRoster->count(); row++) { IconWidgetItem *item = static_cast(d->iss_servicesRoster->item(row)); - const Iconset * is = item->iconset(); + const Iconset *is = item->iconset(); if (is) { QFileInfo fi(is->fileName()); if (fi.fileName() == name) { @@ -1642,7 +1642,7 @@ void OptionsTabIconsetRoster::isCustom_selectionChanged(QTreeWidgetItem *it) for (int row = 0; row < d->iss_customRoster->count(); row++) { IconWidgetItem *item = static_cast(d->iss_customRoster->item(row)); - const Iconset * is = item->iconset(); + const Iconset *is = item->iconset(); if (is) { QFileInfo fi(is->fileName()); if (fi.fileName() == name) { @@ -1680,7 +1680,7 @@ void OptionsTabIconsetRoster::isCustom_add() qWarning("OptionsTabIconsetRoster::isCustom_add(): 'def' is null!"); QTreeWidgetItem *item = new QTreeWidgetItem(d->tw_customRoster); - const Iconset * i = PsiIconset::instance()->roster[def]; + const Iconset *i = PsiIconset::instance()->roster[def]; if (i) { item->setText(1, i->name()); diff --git a/src/options/opt_iconset.h b/src/options/opt_iconset.h index f53734bd1..1a0afa0ff 100644 --- a/src/options/opt_iconset.h +++ b/src/options/opt_iconset.h @@ -31,7 +31,7 @@ private slots: private: QWidget *w, *parentWidget; - PsiCon * psi; + PsiCon *psi; int numIconsets, iconsetsLoaded; IconsetLoadThread *thread; @@ -58,7 +58,7 @@ private slots: private: QWidget *w, *parentWidget; - PsiCon * psi; + PsiCon *psi; int numIconsets, iconsetsLoaded; IconsetLoadThread *thread; @@ -85,7 +85,7 @@ private slots: private: QWidget *w, *parentWidget; - PsiCon * psi; + PsiCon *psi; int numIconsets, iconsetsLoaded; IconsetLoadThread *thread; @@ -112,7 +112,7 @@ private slots: private: QWidget *w, *parentWidget; - PsiCon * psi; + PsiCon *psi; int numIconsets, iconsetsLoaded; IconsetLoadThread *thread; @@ -139,7 +139,7 @@ private slots: private: QWidget *w, *parentWidget; - PsiCon * psi; + PsiCon *psi; int numIconsets, iconsetsLoaded; IconsetLoadThread *thread; @@ -166,7 +166,7 @@ private slots: private: QWidget *w, *parentWidget; - PsiCon * psi; + PsiCon *psi; int numIconsets, iconsetsLoaded; IconsetLoadThread *thread; @@ -205,9 +205,9 @@ private slots: void cancelThread(); private: - QWidget * w; - QWidget * parentWidget; - PsiCon * psi; + QWidget *w; + QWidget *parentWidget; + PsiCon *psi; int numIconsets, iconsetsLoaded; IconsetLoadThread *thread; diff --git a/src/options/opt_input.cpp b/src/options/opt_input.cpp index c49deda2d..33d11c28f 100644 --- a/src/options/opt_input.cpp +++ b/src/options/opt_input.cpp @@ -61,8 +61,8 @@ void OptionsTabInput::applyOptions() return; } - OptInputUI * d = static_cast(w_); - PsiOptions * o = PsiOptions::instance(); + OptInputUI *d = static_cast(w_); + PsiOptions *o = PsiOptions::instance(); SpellChecker *s = SpellChecker::instance(); bool isEnabled = d->isSpellCheck->isChecked(); @@ -176,10 +176,10 @@ void OptionsTabInput::setChecked() return; } - OptInputUI * d = static_cast(w_); + OptInputUI *d = static_cast(w_); QTreeWidgetItemIterator it(d->availDicts); while (*it) { - QTreeWidgetItem * item = *it; + QTreeWidgetItem *item = *it; LanguageManager::LangId langId = item->data(FullName, Qt::UserRole).value(); Qt::CheckState state = loadedDicts_.contains(langId) ? Qt::Checked : Qt::Unchecked; if (state != item->checkState(FullName)) { @@ -224,7 +224,7 @@ bool OptionsTabInput::isTreeViewEmpty() { if (!w_) return true; - OptInputUI * d = static_cast(w_); + OptInputUI *d = static_cast(w_); QTreeWidgetItemIterator it(d->availDicts); return !bool(*it); } diff --git a/src/options/opt_input.h b/src/options/opt_input.h index 708be7afd..7ac36cb3b 100644 --- a/src/options/opt_input.h +++ b/src/options/opt_input.h @@ -32,8 +32,8 @@ private slots: void itemChanged(QTreeWidgetItem *item, int column); private: - QWidget * w_; - PsiCon * psi_; + QWidget *w_; + PsiCon *psi_; QSet availableDicts_; QSet loadedDicts_; QSet defaultLangs_; diff --git a/src/options/opt_messages_common.cpp b/src/options/opt_messages_common.cpp index 8cdac5a4e..951bc4b9d 100644 --- a/src/options/opt_messages_common.cpp +++ b/src/options/opt_messages_common.cpp @@ -58,7 +58,7 @@ void OptionsTabMsgCommon::applyOptions() } OptMsgCommonUI *d = static_cast(w_); - PsiOptions * o = PsiOptions::instance(); + PsiOptions *o = PsiOptions::instance(); o->setOption("options.ui.message.show-character-count", d->ck_showCounter->isChecked()); o->setOption("options.html.chat.render", d->ck_contactsMessageFormatting->isChecked()); o->setOption("options.media.audio-message", d->ck_audioMessage->isChecked()); @@ -111,7 +111,7 @@ void OptionsTabMsgCommon::restoreOptions() } OptMsgCommonUI *d = static_cast(w_); - PsiOptions * o = PsiOptions::instance(); + PsiOptions *o = PsiOptions::instance(); d->ck_showCounter->setChecked(o->getOption("options.ui.message.show-character-count").toBool()); d->ck_contactsMessageFormatting->setChecked(o->getOption("options.html.chat.render").toBool()); d->ck_showTabButtons->setChecked(o->getOption("options.ui.tabs.show-tab-buttons").toBool()); diff --git a/src/options/opt_messages_common.h b/src/options/opt_messages_common.h index ff5333623..9b07c5036 100644 --- a/src/options/opt_messages_common.h +++ b/src/options/opt_messages_common.h @@ -20,7 +20,7 @@ class OptionsTabMsgCommon : public OptionsTab { private: QWidget *w_; - PsiCon * psi_; + PsiCon *psi_; }; #endif // OPT_MESSAGES_COMMON_H diff --git a/src/options/opt_plugins.cpp b/src/options/opt_plugins.cpp index b6e0771ff..b3c294c8d 100644 --- a/src/options/opt_plugins.cpp +++ b/src/options/opt_plugins.cpp @@ -237,7 +237,7 @@ void OptionsTabPlugins::settingsClicked(QTreeWidgetItem *item) OptPluginsUI *d = static_cast(w); const QSize dialogSize = PsiOptions::instance()->getOption("options.ui.save.plugin-settings-dialog-size", QSize(600, 400)).toSize(); - const QString & shortName = item->data(C_NAME, Qt::UserRole).toString(); + const QString &shortName = item->data(C_NAME, Qt::UserRole).toString(); PluginsOptionsDlg *sw = d->findChild(shortName); if (!sw) { sw = new PluginsOptionsDlg(shortName, psi, d); diff --git a/src/options/opt_plugins.h b/src/options/opt_plugins.h index 028af7b5c..3a6b78a92 100644 --- a/src/options/opt_plugins.h +++ b/src/options/opt_plugins.h @@ -27,10 +27,10 @@ class OptionsTabPlugins : public OptionsTab { bool stretchable() const; private: - QWidget * w = nullptr; + QWidget *w = nullptr; QPointer infoDialog; Ui::PluginInfoDialog ui_; - PsiCon * psi = nullptr; + PsiCon *psi = nullptr; private slots: void listPlugins(); diff --git a/src/options/opt_pluginwrapper.h b/src/options/opt_pluginwrapper.h index 8a8d1e0e6..4b5d3f4f5 100644 --- a/src/options/opt_pluginwrapper.h +++ b/src/options/opt_pluginwrapper.h @@ -40,7 +40,7 @@ class OptionsTabPluginWrapper : public OptionsTab { QIcon tabIcon() const override; - QWidget * w = nullptr; + QWidget *w = nullptr; OAH_PluginOptionsTab *plugin; }; diff --git a/src/options/opt_popups.cpp b/src/options/opt_popups.cpp index efbd5701c..937996bc9 100644 --- a/src/options/opt_popups.cpp +++ b/src/options/opt_popups.cpp @@ -24,7 +24,7 @@ #include "psioptions.h" #include "ui_opt_popups.h" -//#include +// #include #include class OptPopupsUI : public QWidget, public Ui::OptPopups { @@ -128,7 +128,7 @@ void OptionsTabPopups::restoreOptions() d->ck_everyMucMessage->setChecked( o->getOption("options.ui.notifications.passive-popups.notify-every-muc-message").toBool()); - QWidget * areaWidget = new QWidget(w); + QWidget *areaWidget = new QWidget(w); QVBoxLayout *vBox = new QVBoxLayout(areaWidget); for (const QString &option : popup_->optionsNamesList()) { QHBoxLayout *l = new QHBoxLayout; diff --git a/src/options/opt_popups.h b/src/options/opt_popups.h index 13a0397fa..3c5fb3dbd 100644 --- a/src/options/opt_popups.h +++ b/src/options/opt_popups.h @@ -40,7 +40,7 @@ public slots: virtual void setData(PsiCon *psi, QWidget *); private: - QWidget * w; + QWidget *w; PopupManager *popup_; }; diff --git a/src/options/opt_shortcuts.cpp b/src/options/opt_shortcuts.cpp index 9224c9d9e..47b52f027 100644 --- a/src/options/opt_shortcuts.cpp +++ b/src/options/opt_shortcuts.cpp @@ -94,7 +94,7 @@ void OptionsTabShortcuts::applyOptions() return; OptShortcutsUI *d = static_cast(w); - PsiOptions * options = PsiOptions::instance(); + PsiOptions *options = PsiOptions::instance(); int toplevelItemsCount = d->treeShortcuts->topLevelItemCount(); int shortcutItemsCount; @@ -178,8 +178,8 @@ void OptionsTabShortcuts::readShortcuts(const PsiOptions *options) } int toplevelItemsCount = d->treeShortcuts->topLevelItemCount(); - QTreeWidgetItem * shortcutItem; - QTreeWidgetItem * keyItem; + QTreeWidgetItem *shortcutItem; + QTreeWidgetItem *keyItem; QString optionsPath; QString comment; QList shortcuts; @@ -266,7 +266,7 @@ void OptionsTabShortcuts::onAdd() */ void OptionsTabShortcuts::addTo(QTreeWidgetItem *shortcutItem) { - OptShortcutsUI * d = static_cast(w); + OptShortcutsUI *d = static_cast(w); QList selectedItems = d->treeShortcuts->selectedItems(); QTreeWidgetItem *newKeyItem = new QTreeWidgetItem(shortcutItem); @@ -286,7 +286,7 @@ void OptionsTabShortcuts::addTo(QTreeWidgetItem *shortcutItem) */ void OptionsTabShortcuts::onRemove() { - OptShortcutsUI * d = static_cast(w); + OptShortcutsUI *d = static_cast(w); QList selectedItems = d->treeShortcuts->selectedItems(); if (selectedItems.count() == 0) @@ -319,7 +319,7 @@ void OptionsTabShortcuts::onRemove() */ void OptionsTabShortcuts::onEdit() { - OptShortcutsUI * d = static_cast(w); + OptShortcutsUI *d = static_cast(w); QList selectedItems = d->treeShortcuts->selectedItems(); if (selectedItems.count() == 0) @@ -364,7 +364,7 @@ void OptionsTabShortcuts::grep() */ void OptionsTabShortcuts::onItemSelectionChanged() { - OptShortcutsUI * d = static_cast(w); + OptShortcutsUI *d = static_cast(w); QList selectedItems = d->treeShortcuts->selectedItems(); Kind itemKind; @@ -423,8 +423,8 @@ void OptionsTabShortcuts::onItemDoubleClicked(QTreeWidgetItem *item, int column) */ void OptionsTabShortcuts::onNewShortcutKey(const QKeySequence &key) { - OptShortcutsUI * d = static_cast(w); - QTreeWidgetItem * keyItem; + OptShortcutsUI *d = static_cast(w); + QTreeWidgetItem *keyItem; QList selectedItems = d->treeShortcuts->selectedItems(); Kind itemKind; diff --git a/src/options/opt_sound.h b/src/options/opt_sound.h index de7d4112d..63a9dceca 100644 --- a/src/options/opt_sound.h +++ b/src/options/opt_sound.h @@ -28,11 +28,11 @@ private slots: void setData(PsiCon *, QWidget *); private: - QWidget * w = nullptr, *parentWidget = nullptr; + QWidget *w = nullptr, *parentWidget = nullptr; QList sounds_; QMap modify_buttons_; QMap play_buttons_; - QButtonGroup * bg_se = nullptr, *bg_sePlay = nullptr; + QButtonGroup *bg_se = nullptr, *bg_sePlay = nullptr; }; #endif // OPT_SOUND_H diff --git a/src/options/opt_statusauto.cpp b/src/options/opt_statusauto.cpp index f6dd3df11..5d396a83f 100644 --- a/src/options/opt_statusauto.cpp +++ b/src/options/opt_statusauto.cpp @@ -42,8 +42,8 @@ QWidget *OptionsTabStatusAuto::widget() d->ck_asXa->setToolTip(s); d->sb_asXa->setToolTip(s); s = tr("Makes Psi automatically set your status to \"offline\" if your" - " computer is idle for the specified amount of time." - " This will disconnect you from the XMPP server."); + " computer is idle for the specified amount of time." + " This will disconnect you from the XMPP server."); PsiOptions *o = PsiOptions::instance(); int dpCount = 6; if (!o->getOption("options.ui.menu.status.chat").toBool()) { @@ -88,7 +88,7 @@ void OptionsTabStatusAuto::applyOptions() return; OptStatusAutoUI *d = static_cast(w); - PsiOptions * o = PsiOptions::instance(); + PsiOptions *o = PsiOptions::instance(); o->setOption("options.status.auto-away.away-after", d->sb_asAway->value()); o->setOption("options.status.auto-away.not-availible-after", d->sb_asXa->value()); @@ -118,7 +118,7 @@ void OptionsTabStatusAuto::restoreOptions() return; OptStatusAutoUI *d = static_cast(w); - PsiOptions * o = PsiOptions::instance(); + PsiOptions *o = PsiOptions::instance(); d->sb_asAway->setMinimum(0); d->sb_asAway->setMaximum(INT_MAX); diff --git a/src/options/opt_statusgeneral.cpp b/src/options/opt_statusgeneral.cpp index 6b5bbd750..051eaf851 100644 --- a/src/options/opt_statusgeneral.cpp +++ b/src/options/opt_statusgeneral.cpp @@ -89,7 +89,7 @@ void OptionsTabStatusGeneral::applyOptions() return; OptStatusGeneralUI *d = static_cast(w); - OptionsTree * o = PsiOptions::instance(); + OptionsTree *o = PsiOptions::instance(); if (d->gbSelectedPreset->isEnabled()) { statusPresetRejected(); @@ -134,7 +134,7 @@ void OptionsTabStatusGeneral::restoreOptions() return; OptStatusGeneralUI *d = static_cast(w); - OptionsTree * o = PsiOptions::instance(); + OptionsTree *o = PsiOptions::instance(); // TODO: Restore function is calling 3 times! Do something with it! Or maybe it's normal? d->lw_presets->clear(); @@ -285,7 +285,7 @@ void OptionsTabStatusGeneral::statusMenusIndexChanged(int index) void OptionsTabStatusGeneral::showMenuForPreset(const QPoint &point) { OptStatusGeneralUI *d = static_cast(w); - QListWidgetItem * item = d->lw_presets->itemAt(point); + QListWidgetItem *item = d->lw_presets->itemAt(point); if (item) { // paranoia: we must be sure item is selected d->lw_presets->setCurrentItem(item); @@ -319,7 +319,7 @@ void OptionsTabStatusGeneral::cleanupSelectedPresetGroup() void OptionsTabStatusGeneral::statusPresetAccepted() { OptStatusGeneralUI *d = static_cast(w); - QListWidgetItem * item = d->lw_presets->currentItem(); + QListWidgetItem *item = d->lw_presets->currentItem(); if (!item) return; diff --git a/src/options/opt_statusgeneral.h b/src/options/opt_statusgeneral.h index a6dc30b7b..82a0ad402 100644 --- a/src/options/opt_statusgeneral.h +++ b/src/options/opt_statusgeneral.h @@ -43,9 +43,9 @@ private slots: void switchPresetMode(bool toEdit); void cleanupSelectedPresetGroup(); - QWidget * w = nullptr, *parentWidget = nullptr; + QWidget *w = nullptr, *parentWidget = nullptr; QMap presets; - QMenu * spContextMenu = nullptr; + QMenu *spContextMenu = nullptr; }; #endif // OPT_STATUSGENERAL_H diff --git a/src/options/opt_statuspep.cpp b/src/options/opt_statuspep.cpp index cfacc4261..85d6bbbb4 100644 --- a/src/options/opt_statuspep.cpp +++ b/src/options/opt_statuspep.cpp @@ -45,7 +45,7 @@ void OptionsTabStatusPep::applyOptions() } OptStatusPepUI *d = static_cast(w_); - PsiOptions * o = PsiOptions::instance(); + PsiOptions *o = PsiOptions::instance(); bool publishTune = d->groupBox->isChecked(); o->setOption(tunePublishOptionPath, publishTune); if (publishTune) { @@ -74,7 +74,7 @@ void OptionsTabStatusPep::restoreOptions() } OptStatusPepUI *d = static_cast(w_); - PsiOptions * o = PsiOptions::instance(); + PsiOptions *o = PsiOptions::instance(); tuneFilters_ = o->getOption(tuneUrlFilterOptionPath).toString(); d->tuneExtensions->setText(tuneFilters_); QStringList controllers = psi_->tuneManager()->controllerNames(); diff --git a/src/options/opt_statuspep.h b/src/options/opt_statuspep.h index 839500fcd..54074d14f 100644 --- a/src/options/opt_statuspep.h +++ b/src/options/opt_statuspep.h @@ -23,8 +23,8 @@ protected slots: void changeVisibleState(bool state); private: - QWidget * w_; - PsiCon * psi_; + QWidget *w_; + PsiCon *psi_; QStringList blackList_; QString tuneFilters_; bool controllersChanged_; diff --git a/src/options/opt_theme.cpp b/src/options/opt_theme.cpp index fdec1c53f..11c604b9b 100644 --- a/src/options/opt_theme.cpp +++ b/src/options/opt_theme.cpp @@ -150,7 +150,7 @@ void OptionsTabAppearanceTheme::showThemeScreenshot() if (!w || !sender()->inherits("QToolButton")) return; OptAppearanceThemeUI *d = static_cast(w); - QToolButton * btn = static_cast(sender()); + QToolButton *btn = static_cast(sender()); if (btn) { if (screenshotDialog) delete (screenshotDialog); @@ -168,7 +168,7 @@ void OptionsTabAppearanceTheme::showThemeScreenshot() screenshotDialog->setWindowIcon(QIcon(IconsetFactory::iconPtr("psi/logo_128")->icon())); QBoxLayout *box = new QBoxLayout(QBoxLayout::LeftToRight, screenshotDialog); - QLabel * image = new QLabel(screenshotDialog); + QLabel *image = new QLabel(screenshotDialog); if (!scr.isNull()) { image->setPixmap(scr); } else { diff --git a/src/options/opt_theme.h b/src/options/opt_theme.h index b4512eab7..8485f8428 100644 --- a/src/options/opt_theme.h +++ b/src/options/opt_theme.h @@ -61,10 +61,10 @@ private slots: QString getThemeId(const QString &objName) const; private: - QWidget * w = nullptr; - PsiThemeModel * unsortedModel = nullptr; + QWidget *w = nullptr; + PsiThemeModel *unsortedModel = nullptr; QSortFilterProxyModel *themesModel = nullptr; - PsiThemeProvider * provider = nullptr; + PsiThemeProvider *provider = nullptr; QPointer screenshotDialog; }; diff --git a/src/options/opt_toolbars.cpp b/src/options/opt_toolbars.cpp index 52a8aae8e..6ffd08ce5 100644 --- a/src/options/opt_toolbars.cpp +++ b/src/options/opt_toolbars.cpp @@ -58,7 +58,7 @@ class OptionsTabToolbars::Private { PsiActionList::ActionsType currentType() { PsiActionList::ActionsType type; - LookFeelToolbarsUI * d = static_cast(q->w); + LookFeelToolbarsUI *d = static_cast(q->w); if (d->cb_toolbars->currentIndex() == CHAT_TOOLBAR) { type = class2idChat(); @@ -428,7 +428,7 @@ void OptionsTabToolbars::toolbarSelectionChanged(int item) { // Fill the TreeWidget with toolbar-specific actions - QTreeWidget * tw = d->tw_availActions; + QTreeWidget *tw = d->tw_availActions; QTreeWidgetItem *lastRoot = nullptr; QList lists = psi->actionList()->actionLists(p->currentType()); @@ -572,7 +572,7 @@ void OptionsTabToolbars::toolbarNameChanged() void OptionsTabToolbars::toolbarActionUp() { LookFeelToolbarsUI *d = static_cast(w); - QListWidgetItem * item = d->lw_selectedActions->currentItem(); + QListWidgetItem *item = d->lw_selectedActions->currentItem(); if (!item) return; @@ -594,7 +594,7 @@ void OptionsTabToolbars::toolbarActionUp() void OptionsTabToolbars::toolbarActionDown() { LookFeelToolbarsUI *d = static_cast(w); - QListWidgetItem * item = d->lw_selectedActions->currentItem(); + QListWidgetItem *item = d->lw_selectedActions->currentItem(); if (!item) return; @@ -616,7 +616,7 @@ void OptionsTabToolbars::toolbarActionDown() void OptionsTabToolbars::toolbarAddAction() { LookFeelToolbarsUI *d = static_cast(w); - QTreeWidgetItem * item = d->tw_availActions->currentItem(); + QTreeWidgetItem *item = d->tw_availActions->currentItem(); if (!item || item->data(0, Qt::UserRole).toString().isEmpty()) return; @@ -628,7 +628,7 @@ void OptionsTabToolbars::toolbarAddAction() void OptionsTabToolbars::toolbarRemoveAction() { LookFeelToolbarsUI *d = static_cast(w); - QListWidgetItem * item = d->lw_selectedActions->currentItem(); + QListWidgetItem *item = d->lw_selectedActions->currentItem(); if (!item) return; diff --git a/src/options/opt_toolbars.h b/src/options/opt_toolbars.h index b6eca30f5..9ada08a3e 100644 --- a/src/options/opt_toolbars.h +++ b/src/options/opt_toolbars.h @@ -51,9 +51,9 @@ private slots: private: void updateArrows(); - QWidget * w = nullptr; - QWidget * parent = nullptr; - PsiCon * psi = nullptr; + QWidget *w = nullptr; + QWidget *parent = nullptr; + PsiCon *psi = nullptr; bool noDirty; IconButton *pb_apply = nullptr; diff --git a/src/options/optionsdlgbase.cpp b/src/options/optionsdlgbase.cpp index 16924f1a7..9156ba26d 100644 --- a/src/options/optionsdlgbase.cpp +++ b/src/options/optionsdlgbase.cpp @@ -109,8 +109,8 @@ class OptionsTabsDelegate : public QItemDelegate { { if (option.state & QStyle::State_HasFocus && rect.isValid()) { QStyleOptionFocusRect o; - o.QStyleOption:: operator=(option); - o.rect = rect.adjusted(0, 0, 0, -1); + o.QStyleOption::operator=(option); + o.rect = rect.adjusted(0, 0, 0, -1); QPalette::ColorGroup cg = (option.state & QStyle::State_Enabled) ? QPalette::Normal : QPalette::Disabled; o.backgroundColor = option.palette.color( cg, (option.state & QStyle::State_Selected) ? QPalette::Highlight : QPalette::Window); @@ -179,8 +179,8 @@ private slots: void connectDataChanged(QWidget *); public: - OptionsDlgBase * dlg; - PsiCon * psi; + OptionsDlgBase *dlg; + PsiCon *psi; bool dirty, noDirty; QHash id2widget; QList tabs; diff --git a/src/options/optionstab.cpp b/src/options/optionstab.cpp index a9410fd6e..0d3e74974 100644 --- a/src/options/optionstab.cpp +++ b/src/options/optionstab.cpp @@ -14,8 +14,7 @@ OptionsTab::OptionsTab(QObject *parent, const char *name) : QObject(parent) { setObjectName(name); } OptionsTab::OptionsTab(QObject *parent, QByteArray _id, QByteArray _parentId, QString _name, QString _desc, - QString _tabIconName, QString _iconName) : - QObject(parent) + QString _tabIconName, QString _iconName) : QObject(parent) { setObjectName(_name); v_id = _id; diff --git a/src/options/optionstab.h b/src/options/optionstab.h index c5d27ede1..64a7cd8c4 100644 --- a/src/options/optionstab.h +++ b/src/options/optionstab.h @@ -70,7 +70,7 @@ public slots: private: void init(); - QWidget * w; + QWidget *w; QList tabs; }; diff --git a/src/pepmanager.h b/src/pepmanager.h index 8b93d1d3b..cc4a08865 100644 --- a/src/pepmanager.h +++ b/src/pepmanager.h @@ -83,7 +83,7 @@ protected slots: // void saveSubscriptions(); private: - XMPP::Client * client_; + XMPP::Client *client_; ServerInfoManager *serverInfo_; // QStringList nodes_, ensured_nodes_; diff --git a/src/pgpkeydlg.cpp b/src/pgpkeydlg.cpp index 0008c8b45..02ba13189 100644 --- a/src/pgpkeydlg.cpp +++ b/src/pgpkeydlg.cpp @@ -58,7 +58,7 @@ class KeyViewProxyModel : public QSortFilterProxyModel { { for (int column = 0; column <= 1; ++column) { QModelIndex index = sourceModel()->index(sourceRow, column, sourceParent); -#if QT_VERSION < QT_VERSION_CHECK(6,0,0) +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) if (index.data(Qt::DisplayRole).toString().contains(filterRegExp())) #else if (index.data(Qt::DisplayRole).toString().contains(filterRegularExpression())) @@ -119,7 +119,7 @@ PGPKeyDlg::PGPKeyDlg(Type t, const QString &defaultKeyID, QWidget *parent) : QDi const QStringList &&keysList = keysRaw.split("\n"); for (const QString &line : keysList) { const QString &&type = line.section(':', 0, 0); - QStandardItem * root = m_model->invisibleRootItem(); + QStandardItem *root = m_model->invisibleRootItem(); if (type == "pub" || type == "sec") { uid = line.section(':', 9, 9); // Used ID @@ -194,7 +194,7 @@ void PGPKeyDlg::do_accept() QModelIndex realIndex = m_proxy->mapToSource(fakeIndex); QStandardItem *item = m_model->itemFromIndex(realIndex); - KeyViewItem * i = dynamic_cast(item); + KeyViewItem *i = dynamic_cast(item); if (!i) { QMessageBox::information(this, tr("Error"), tr("Please select a key.")); return; diff --git a/src/pgpkeydlg.h b/src/pgpkeydlg.h index 2ca971b4b..81716815c 100644 --- a/src/pgpkeydlg.h +++ b/src/pgpkeydlg.h @@ -55,8 +55,8 @@ private slots: private: Ui::PGPKey m_ui; QString m_keyId; - QPushButton * m_pb_dtext; - QStandardItemModel * m_model; + QPushButton *m_pb_dtext; + QStandardItemModel *m_model; QSortFilterProxyModel *m_proxy; }; diff --git a/src/pgputil.cpp b/src/pgputil.cpp index 9af9b67c8..9ff91c62d 100644 --- a/src/pgputil.cpp +++ b/src/pgputil.cpp @@ -183,7 +183,7 @@ QString PGPUtil::getFingerprint(const QString &key) gpg.waitForFinished(); QString fingerprint; - const QString && out = QString::fromUtf8(gpg.readAllStandardOutput()); + const QString &&out = QString::fromUtf8(gpg.readAllStandardOutput()); const QStringList &&lines = out.split("\n"); for (const QString &line : lines) { const QString &&type = line.section(':', 0, 0); @@ -217,7 +217,7 @@ QString PGPUtil::chooseKey(PGPKeyDlg::Type type, const QString &key, const QStri PGPUtil::SecureMessageSignature PGPUtil::parseSecureMessageSignature(const QString &stdOutString) { SecureMessageSignature out; - const QStringList && strings = stdOutString.split("\n"); + const QStringList &&strings = stdOutString.split("\n"); for (const QString &line : strings) { const QString &&type = line.section(' ', 1, 1); if (type == QStringLiteral("GOODSIG")) { diff --git a/src/pluginhost.cpp b/src/pluginhost.cpp index 8807d8fc6..35cab9fd8 100644 --- a/src/pluginhost.cpp +++ b/src/pluginhost.cpp @@ -48,7 +48,7 @@ #include "translationmanager.h" #include "webkitaccessor.h" #include "widgets/iconaction.h" -//#include "xmpp_message.h" +// #include "xmpp_message.h" #include #include @@ -214,7 +214,7 @@ void PluginHost::updateMetadata() QString data = md.value(QLatin1String("icon")).toString(); if (data.startsWith("base64:")) { - rawIcon_ = QByteArray::fromBase64(QStringView{data}.mid(6).toLatin1()); + rawIcon_ = QByteArray::fromBase64(QStringView { data }.mid(6).toLatin1()); QPixmap pix; pix.loadFromData(rawIcon_); icon_ = QIcon(pix); @@ -983,7 +983,7 @@ void PluginHost::addIcon(const QString &name, const QByteArray &ba) QTextEdit *PluginHost::getEditBox() { - QTextEdit * ed = nullptr; + QTextEdit *ed = nullptr; TabbableWidget *tw = findActiveTab(); if (tw) { QWidget *chatEditProxy = tw->findChild("mle"); @@ -1141,7 +1141,7 @@ void PluginHost::addToolBarButton(QObject *parent, QWidget *toolbar, int account for (int i = 0; i < buttons_.size(); ++i) { QVariantHash param = buttons_.at(i); QString th = param.value("tooltip").value(); - IconAction * button = new IconAction(th, param.value("icon").value(), th, 0, parent); + IconAction *button = new IconAction(th, param.value("icon").value(), th, 0, parent); connect(button, SIGNAL(triggered()), param.value("reciver").value(), param.value("slot").value().toLatin1()); connect(enableHandler, &QObject::destroyed, button, &QObject::deleteLater); @@ -1167,7 +1167,7 @@ void PluginHost::addGCToolBarButton(QObject *parent, QWidget *toolbar, int accou for (int i = 0; i < gcbuttons_.size(); ++i) { QVariantHash param = gcbuttons_.at(i); QString th = param.value("tooltip").value(); - IconAction * button = new IconAction(th, param.value("icon").value(), th, 0, parent); + IconAction *button = new IconAction(th, param.value("icon").value(), th, 0, parent); connect(button, SIGNAL(triggered()), param.value("reciver").value(), param.value("slot").value().toLatin1()); connect(enableHandler, &QObject::destroyed, button, &QObject::deleteLater); @@ -1214,7 +1214,7 @@ void PluginHost::addAccountMenu(QMenu *menu, int account) if (!accMenu_.isEmpty()) { for (int i = 0; i < accMenu_.size(); ++i) { QVariantHash param = accMenu_.at(i); - IconAction * act + IconAction *act = new IconAction(param.value("name").value(), menu, param.value("icon").value()); act->setProperty("account", QVariant(account)); connect(act, SIGNAL(triggered()), param.value("reciver").value(), @@ -1235,7 +1235,7 @@ void PluginHost::addContactMenu(QMenu *menu, int account, const QString &jid) if (!contactMenu_.isEmpty()) { for (int i = 0; i < contactMenu_.size(); ++i) { QVariantHash param = contactMenu_.at(i); - IconAction * act + IconAction *act = new IconAction(param.value("name").value(), menu, param.value("icon").value()); act->setProperty("account", QVariant(account)); act->setProperty("jid", QVariant(jid)); diff --git a/src/pluginhost.h b/src/pluginhost.h index c0b223474..a0d911d9a 100644 --- a/src/pluginhost.h +++ b/src/pluginhost.h @@ -74,12 +74,12 @@ class PluginHost : public QObject, PluginHost(PluginManager *manager, const QString &pluginFile); virtual ~PluginHost(); - PluginHost(const PluginHost &) = delete; + PluginHost(const PluginHost &) = delete; PluginHost &operator=(const PluginHost &) = delete; bool isValid() const; const QString &path() const; - QWidget * optionsWidget() const; + QWidget *optionsWidget() const; // cached basic info const QString &name() const; @@ -88,7 +88,7 @@ class PluginHost : public QObject, const QString &vendor() const; const QString &description() const; int priority() const; - const QIcon & icon() const; + const QIcon &icon() const; QStringList pluginFeatures() const; @@ -257,12 +257,12 @@ class PluginHost : public QObject, // PluginAccessingHost - QObject * getPlugin(const QString &name) override; + QObject *getPlugin(const QString &name) override; QVariantMap selfMetadata() const override; // WebkitAccessingHost RenderType chatLogRenderType() const override; - QString installChatLogJSDataFilter(const QString & js, + QString installChatLogJSDataFilter(const QString &js, PsiPlugin::Priority priority = PsiPlugin::PriorityNormal) override; void uninstallChatLogJSDataFilter(const QString &id) override; void executeChatLogJavaScript(QWidget *log, const QString &js) override; @@ -279,7 +279,7 @@ class PluginHost : public QObject, void disabled(); private: - PluginManager * manager_ = nullptr; + PluginManager *manager_ = nullptr; QPointer plugin_; QString file_; QString name_; @@ -290,9 +290,9 @@ class PluginHost : public QObject, int priority_ = 0; QByteArray rawIcon_; QIcon icon_; - QPluginLoader * loader_ = nullptr; + QPluginLoader *loader_ = nullptr; QPointer enableHandler = nullptr; - Iconset * iconset_ = nullptr; + Iconset *iconset_ = nullptr; bool hasToolBarButton_ = false; bool hasGCToolBarButton_ = false; @@ -302,10 +302,10 @@ class PluginHost : public QObject, bool hasInfo_ = false; QString infoString_; - QMultiMap iqNsFilters_; + QMultiMap iqNsFilters_; QMultiMap iqNsxFilters_; - QList buttons_; - QList gcbuttons_; + QList buttons_; + QList gcbuttons_; QList accMenu_; QList contactMenu_; diff --git a/src/pluginmanager.cpp b/src/pluginmanager.cpp index c8e6ec70d..1c8e90f7c 100644 --- a/src/pluginmanager.cpp +++ b/src/pluginmanager.cpp @@ -12,6 +12,10 @@ #include "groupchatdlg.h" #include "iqfilter.h" #include "iqnamespacefilter.h" +#include "iris/xmpp_caps.h" +#include "iris/xmpp_client.h" +#include "iris/xmpp_message.h" +#include "iris/xmpp_task.h" #include "messageview.h" #include "optionaccessor.h" #include "optionsdlg.h" @@ -26,10 +30,6 @@ #include "psiplugin.h" #include "stanzafilter.h" #include "stanzasender.h" -#include "iris/xmpp_caps.h" -#include "iris/xmpp_client.h" -#include "iris/xmpp_message.h" -#include "iris/xmpp_task.h" #include #include @@ -692,7 +692,7 @@ QString PluginManager::getPgpKey(int account) const QMap PluginManager::getKnownPgpKeys(int account) const { QMap out; - PsiAccount * pa = accountIds_.account(account); + PsiAccount *pa = accountIds_.account(account); if (pa) { UserAccount acc = pa->userAccount(); for (const auto &item : std::as_const(acc.pgpKnownKeys)) { @@ -779,10 +779,10 @@ void PluginManager::initPopupForJid(int account, const QString &jid, const QStri { XMPP::Jid j(jid); const PsiIcon *ico = IconsetFactory::iconPtr(icon); - PsiAccount * pa = accountIds_.account(account); + PsiAccount *pa = accountIds_.account(account); if (pa) { UserListItem *i = pa->findFirstRelevant(j); - PsiIcon * statusIco = PsiIconset::instance()->statusPtr(i); + PsiIcon *statusIco = PsiIconset::instance()->statusPtr(i); const QPixmap pix = pa->avatarFactory()->getAvatar(j); psi_->popupManager()->doPopup(pa, j, ico, title, pix, statusIco, text, true, PopupManager::PopupType(type)); return; @@ -1011,7 +1011,7 @@ bool PluginManager::appendMsgView(int account, const QString &jid, const Message PsiAccount *acc = accountIds_.account(account); if (acc) { XMPP::Jid j(jid); - ChatDlg * chatDlg = acc->findChatDialogEx(j); + ChatDlg *chatDlg = acc->findChatDialogEx(j); if (!chatDlg) { chatDlg = acc->findChatDialog(j, false); } diff --git a/src/pluginmanager.h b/src/pluginmanager.h index 7328ce9c4..ea54a1ca4 100644 --- a/src/pluginmanager.h +++ b/src/pluginmanager.h @@ -15,7 +15,7 @@ #include #include -//#define PLUGINS_NO_DEBUG +// #define PLUGINS_NO_DEBUG class MessageView; class PluginHost; @@ -128,7 +128,7 @@ class PluginManager : public QObject { private: PluginManager(); - PsiCon * psi_; + PsiCon *psi_; void loadAllPlugins(); bool verifyStanza(const QString &stanza); QList updatePluginsList(); @@ -156,7 +156,7 @@ class PluginManager : public QObject { QList settingsTabs_; // to be inserted into global list QMultiMap> _messageViewJSFilters; // priority -> - QTimer * _messageViewJSFiltersTimer = nullptr; + QTimer *_messageViewJSFiltersTimer = nullptr; class StreamWatcher; bool incomingXml(int account, const QDomElement &eventXml); diff --git a/src/popupmanager.cpp b/src/popupmanager.cpp index c81a313d0..e87f54427 100644 --- a/src/popupmanager.cpp +++ b/src/popupmanager.cpp @@ -19,11 +19,11 @@ #include "popupmanager.h" +#include "iris/xmpp_jid.h" #include "psiaccount.h" #include "psicon.h" #include "psioptions.h" #include "psipopupinterface.h" -#include "iris/xmpp_jid.h" #include #include @@ -52,7 +52,7 @@ class PopupManager::Private { PsiPopupInterface *popup(const QString &name) { - PsiPopupInterface * ppi = nullptr; + PsiPopupInterface *ppi = nullptr; PsiPopupPluginInterface *plugin = nullptr; if (popups_.contains(name)) { plugin = popups_.value(name); @@ -99,7 +99,7 @@ class PopupManager::Private { return defaultTimeout * 1000; } - PsiCon * psi_; + PsiCon *psi_; int lastCustomType_; QList options_; QMap popups_; diff --git a/src/privacy/guitest/mockprivacymanager.cpp b/src/privacy/guitest/mockprivacymanager.cpp index a008b76a9..d69d1cf3d 100644 --- a/src/privacy/guitest/mockprivacymanager.cpp +++ b/src/privacy/guitest/mockprivacymanager.cpp @@ -29,9 +29,7 @@ void MockPrivacyManager::requestListNames() { qDebug() << "requestListNames()"; QStringList lists; - lists << "a" - << "b" - << "c"; + lists << "a" << "b" << "c"; emit listsReceived("a", "c", lists); } diff --git a/src/privacy/privacylist.h b/src/privacy/privacylist.h index 3827d58aa..600f0615d 100644 --- a/src/privacy/privacylist.h +++ b/src/privacy/privacylist.h @@ -33,12 +33,12 @@ class PrivacyList { PrivacyList(const QString &name, const QList &items = QList()); PrivacyList(const QDomElement &); - const QString & name() const { return name_; } + const QString &name() const { return name_; } void setName(const QString &name) { name_ = name; } bool isEmpty() const { return items_.isEmpty(); } void clear() { items_.clear(); } const QList &items() const { return items_; } - const PrivacyListItem & item(int index) const { return items_.at(index); } + const PrivacyListItem &item(int index) const { return items_.at(index); } void removeItem(int index) { items_.removeAt(index); } void insertItem(int index, const PrivacyListItem &item); void appendItem(const PrivacyListItem &item); diff --git a/src/privacy/psiprivacymanager.cpp b/src/privacy/psiprivacymanager.cpp index 579b04e66..8ca83b513 100644 --- a/src/privacy/psiprivacymanager.cpp +++ b/src/privacy/psiprivacymanager.cpp @@ -19,15 +19,15 @@ #include "psiprivacymanager.h" #include "contactupdatesmanager.h" +#include "iris/xmpp_jid.h" +#include "iris/xmpp_task.h" +#include "iris/xmpp_tasks.h" +#include "iris/xmpp_xmlcommon.h" #include "privacylist.h" #include "privacymanager.h" #include "psiaccount.h" #include "psicon.h" #include "userlist.h" -#include "iris/xmpp_jid.h" -#include "iris/xmpp_task.h" -#include "iris/xmpp_tasks.h" -#include "iris/xmpp_xmlcommon.h" #include #include diff --git a/src/privacy/psiprivacymanager.h b/src/privacy/psiprivacymanager.h index be0e51641..2c59727fe 100644 --- a/src/privacy/psiprivacymanager.h +++ b/src/privacy/psiprivacymanager.h @@ -20,8 +20,8 @@ #ifndef PSIPRIVACYMANAGER_H #define PSIPRIVACYMANAGER_H -#include "privacymanager.h" #include "iris/xmpp_jid.h" +#include "privacymanager.h" #include #include @@ -74,7 +74,7 @@ protected slots: void block_getDefaultList_error(); private: - XMPP::Task * rootTask_; + XMPP::Task *rootTask_; PrivacyListListener *listener_; bool getDefault_waiting_; @@ -111,7 +111,7 @@ private slots: void privacyListChanged(const QString &name); private: - PsiAccount * account_; + PsiAccount *account_; bool accountAvailable_; bool isAvailable_; QHash lists_; @@ -121,7 +121,7 @@ private slots: void setIsAvailable(bool available); void createBlockedList(); - PrivacyList * blockedList() const; + PrivacyList *blockedList() const; PrivacyListItem blockItemFor(const XMPP::Jid &jid) const; QStringList blockedContacts() const; diff --git a/src/privacy/unittest/privacylistitemtest.cpp b/src/privacy/unittest/privacylistitemtest.cpp index 9671f0905..80524809c 100644 --- a/src/privacy/unittest/privacylistitemtest.cpp +++ b/src/privacy/unittest/privacylistitemtest.cpp @@ -219,10 +219,7 @@ void PrivacyListItemTest::testFromXml_IQChild() void PrivacyListItemTest::testFromXml_AllChildren() { QStringList children; - children << "message" - << "presence-in" - << "presence-out" - << "iq"; + children << "message" << "presence-in" << "presence-out" << "iq"; PrivacyListItem item = createItemFromXmlWithChildren(children); diff --git a/src/profiledlg.cpp b/src/profiledlg.cpp index ab7b52320..845654b5f 100644 --- a/src/profiledlg.cpp +++ b/src/profiledlg.cpp @@ -226,9 +226,9 @@ void ProfileManageDlg::slotProfileRename() while (1) { bool ok = false; name = QInputDialog::getText(this, CAP(tr("Rename Profile")), - tr("Please enter a new name for the profile. Keep it simple.\nOnly use letters " - "or numbers. No punctuation or spaces."), - QLineEdit::Normal, name, &ok); + tr("Please enter a new name for the profile. Keep it simple.\nOnly use letters " + "or numbers. No punctuation or spaces."), + QLineEdit::Normal, name, &ok); if (!ok) return; diff --git a/src/profiles.h b/src/profiles.h index cba6f7f61..8039cbd88 100644 --- a/src/profiles.h +++ b/src/profiles.h @@ -22,11 +22,11 @@ #include "applicationinfo.h" #include "common.h" -#include "proxy.h" -#include "varlist.h" #include "iris/xmpp_clientstream.h" #include "iris/xmpp_jid.h" #include "iris/xmpp_roster.h" +#include "proxy.h" +#include "varlist.h" #include #include diff --git a/src/proxy.cpp b/src/proxy.cpp index 752accaa2..d8375122a 100644 --- a/src/proxy.cpp +++ b/src/proxy.cpp @@ -21,8 +21,8 @@ #include "common.h" #include "iconwidget.h" -#include "psioptions.h" #include "iris/xmpp_xmlcommon.h" +#include "psioptions.h" #include #include @@ -107,7 +107,7 @@ class ProxyDlg::Private : public QObject { TypeRole = Qt::UserRole + 8 }; - ProxyDlg * q; + ProxyDlg *q; ProxyItemList list; Private(ProxyDlg *dialog) : QObject(dialog), q(dialog) @@ -327,8 +327,8 @@ class ProxyChooser::Private { public: Private() = default; - QComboBox * cb_proxy = nullptr; - QPushButton * pb_edit = nullptr; + QComboBox *cb_proxy = nullptr; + QPushButton *pb_edit = nullptr; ProxyManager *m = nullptr; }; @@ -469,8 +469,8 @@ class ProxyManager::Private { QPointer pd; QList prevMap; QString lastEdited; - OptionsTree * o = nullptr; - ProxyForObject * po = nullptr; + OptionsTree *o = nullptr; + ProxyForObject *po = nullptr; void itemToOptions(ProxyItem pi) { diff --git a/src/proxy.h b/src/proxy.h index 6ca841d1c..0a35bdba1 100644 --- a/src/proxy.h +++ b/src/proxy.h @@ -21,7 +21,7 @@ #define PROXYDLG_H #include "ui_proxy.h" -//#include "ui_proxyedit.h" +// #include "ui_proxyedit.h" #include #include @@ -64,7 +64,7 @@ class ProxyDlg : public QDialog { friend class Private; private: - Private * d; + Private *d; Ui::Proxy ui_; }; @@ -120,8 +120,8 @@ private slots: private: void loadItem(const QString &obj); - OptionsTree * ot_; - ProxyChooser * pc_; + OptionsTree *ot_; + ProxyChooser *pc_; QPointer cb_; QMap items_; QMap tmp_; diff --git a/src/psi_profiles.cpp b/src/psi_profiles.cpp index 0b34ac589..47ee00f74 100644 --- a/src/psi_profiles.cpp +++ b/src/psi_profiles.cpp @@ -26,11 +26,11 @@ #ifdef PSI_PLUGINS #include "pluginmanager.h" #endif +#include "iris/xmpp_xmlcommon.h" #include "psioptions.h" #include "psitoolbar.h" #include "shortcutmanager.h" #include "varlist.h" -#include "iris/xmpp_xmlcommon.h" #include #include @@ -101,25 +101,11 @@ void UserAccount::reset() proxy_pass = ""; stunHosts.clear(); - stunHosts << "stun.l.google.com:19302" - << "stun.ekiga.net" - << "provserver.televolution.net" - << "stun1.voiceeclipse.net" - << "stun.callwithus.com" - << "stun.counterpath.net" - << "stun.endigovoip.com" - << "stun.ideasip.com" - << "stun.internetcalls.com" - << "stun.noc.ams-ix.net" - << "stun.phonepower.com" - << "stun.phoneserve.com" - << "stun.rnktel.com" - << "stun.softjoys.com" - << "stun.sipgate.net" - << "stun.sipgate.net:10000" - << "stun.stunprotocol.org" - << "stun.voipbuster.com" - << "stun.voxgratia.org"; + stunHosts << "stun.l.google.com:19302" << "stun.ekiga.net" << "provserver.televolution.net" + << "stun1.voiceeclipse.net" << "stun.callwithus.com" << "stun.counterpath.net" << "stun.endigovoip.com" + << "stun.ideasip.com" << "stun.internetcalls.com" << "stun.noc.ams-ix.net" << "stun.phonepower.com" + << "stun.phoneserve.com" << "stun.rnktel.com" << "stun.softjoys.com" << "stun.sipgate.net" + << "stun.sipgate.net:10000" << "stun.stunprotocol.org" << "stun.voipbuster.com" << "stun.voxgratia.org"; stunHost = stunHosts[0]; @@ -497,21 +483,10 @@ void OptionsMigration::lateMigration() chatToolbar.on = PsiOptions::instance()->getOption("options.ui.chat.central-toolbar").toBool(); PsiOptions::instance()->removeOption("options.ui.chat.central-toolbar"); chatToolbar.name = "Chat"; - chatToolbar.keys << "chat_clear" - << "chat_find" - << "chat_html_text" - << "chat_add_contact" - << "chat_share_files"; + chatToolbar.keys << "chat_clear" << "chat_find" << "chat_html_text" << "chat_add_contact" << "chat_share_files"; chatToolbar.keys += pluginsKeys; - chatToolbar.keys << "spacer" - << "chat_icon" - << "chat_file" - << "chat_pgp" - << "chat_info" - << "chat_history" - << "chat_voice" - << "chat_active_contacts" - << "chat_templates"; + chatToolbar.keys << "spacer" << "chat_icon" << "chat_file" << "chat_pgp" << "chat_info" << "chat_history" + << "chat_voice" << "chat_active_contacts" << "chat_templates"; if (PsiOptions::instance()->getOption("options.ui.chat.disable-paste-send").toBool()) { chatToolbar.keys.removeAt(chatToolbar.keys.indexOf("chat_ps")); @@ -521,16 +496,10 @@ void OptionsMigration::lateMigration() groupchatToolbar.on = chatToolbar.on; groupchatToolbar.name = "Groupchat"; - groupchatToolbar.keys << "gchat_info" - << "gchat_clear" - << "gchat_find" - << "gchat_html_text" - << "gchat_configure" - << "gchat_share_files" - << "gchat_templates"; + groupchatToolbar.keys << "gchat_info" << "gchat_clear" << "gchat_find" << "gchat_html_text" << "gchat_configure" + << "gchat_share_files" << "gchat_templates"; groupchatToolbar.keys += pluginsKeys; - groupchatToolbar.keys << "spacer" - << "gchat_icon"; + groupchatToolbar.keys << "spacer" << "gchat_icon"; if (PsiOptions::instance()->getOption("options.ui.chat.disable-paste-send").toBool()) { groupchatToolbar.keys.removeAt(groupchatToolbar.keys.indexOf("gchat_ps")); diff --git a/src/psiaccount.cpp b/src/psiaccount.cpp index 5bad18399..73b7e4ea2 100644 --- a/src/psiaccount.cpp +++ b/src/psiaccount.cpp @@ -44,7 +44,6 @@ #include "bobfilecache.h" #include "bookmarkmanagedlg.h" #include "bookmarkmanager.h" -#include "iris/bsocket.h" #include "captchadlg.h" #include "changepwdlg.h" #include "chatdlg.h" @@ -56,14 +55,15 @@ #include "filesharingmanager.h" #include "fileutil.h" #include "geolocationdlg.h" +#include "iris/bsocket.h" #ifdef GOOGLE_FT #include "googleftmanager.h" #endif #include "gpgtransaction.h" #include "historydlg.h" #include "httpauthmanager.h" -#include "iris/httpfileupload.h" #include "infodlg.h" +#include "iris/httpfileupload.h" #include "irisprotocol/iris_discoinfoquerier.h" #include "jidutil.h" #ifdef HAVE_JINGLE @@ -75,7 +75,7 @@ #include "networkaccessmanager.h" #include "passdialog.h" #include "pepmanager.h" -//#include "physicallocation.h" +// #include "physicallocation.h" #ifdef PSI_PLUGINS #include "pluginmanager.h" #endif @@ -90,11 +90,16 @@ #include "psioptions.h" #include "psiprivacymanager.h" #include "qwextend.h" -//#include "qssl.h" +// #include "qssl.h" +#include "iris/s5b.h" +#include "iris/xmpp_caps.h" +#include "iris/xmpp_captcha.h" +#include "iris/xmpp_serverinfomanager.h" +#include "iris/xmpp_tasks.h" +#include "iris/xmpp_xmlcommon.h" #include "rc.h" #include "registrationdlg.h" #include "rosteritemexchangetask.h" -#include "iris/s5b.h" #include "searchdlg.h" #include "statusdlg.h" #include "systeminfo.h" @@ -108,11 +113,6 @@ #include "voicecalldlg.h" #include "voicecaller.h" #include "xmlconsole.h" -#include "iris/xmpp_caps.h" -#include "iris/xmpp_captcha.h" -#include "iris/xmpp_serverinfomanager.h" -#include "iris/xmpp_tasks.h" -#include "iris/xmpp_xmlcommon.h" #ifdef FILETRANSFER #include "filetransdlg.h" #include "iris/filetransfer.h" @@ -1538,12 +1538,9 @@ void PsiAccount::updateFeatures() #endif #ifdef USE_PEP - features << "http://jabber.org/protocol/mood" - << "http://jabber.org/protocol/activity"; - features << "http://jabber.org/protocol/tune" - << "http://jabber.org/protocol/geoloc"; - features << "urn:xmpp:avatar:data" - << "urn:xmpp:avatar:metadata"; + features << "http://jabber.org/protocol/mood" << "http://jabber.org/protocol/activity"; + features << "http://jabber.org/protocol/tune" << "http://jabber.org/protocol/geoloc"; + features << "urn:xmpp:avatar:data" << "urn:xmpp:avatar:metadata"; #endif if (AvCallManager::isSupported()) { features << "urn:xmpp:jingle:transports:ice-udp:1"; @@ -4085,7 +4082,7 @@ void PsiAccount::sendFiles(const Jid &j, const QStringList &fileList) if (u && u->isAvailable()) j2 = j2.withResource((*u->userResourceList().priority()).name()); } - //#if 0 + // #if 0 Features f = client()->capsManager()->features(j2); if (f.hasJingleFT()) { // we have to check supported transprts as well. but s5b is mandatory @@ -4094,9 +4091,9 @@ void PsiAccount::sendFiles(const Jid &j, const QStringList &fileList) w->show(); return; } - //#endif - // Create a dialog for each file in the list. Once the xfer dialog itself - // supports multiple files, only the 'else' branch needs to stay. + // #endif + // Create a dialog for each file in the list. Once the xfer dialog itself + // supports multiple files, only the 'else' branch needs to stay. if (!fileList.isEmpty()) { for (auto const &f : fileList) { FileRequestDlg *w = new FileRequestDlg(j2, d->psi, this, QStringList(f)); diff --git a/src/psiaccount.h b/src/psiaccount.h index abf74697e..6732b8076 100644 --- a/src/psiaccount.h +++ b/src/psiaccount.h @@ -28,13 +28,13 @@ #include "activity.h" #include "filesharingdownloader.h" #include "geolocation.h" -#include "mood.h" -#include "psiactions.h" -#include "psievent.h" #include "iris/xmpp_encryptionhandler.h" #include "iris/xmpp_reference.h" #include "iris/xmpp_rosterx.h" #include "iris/xmpp_status.h" +#include "mood.h" +#include "psiactions.h" +#include "psievent.h" #include #include diff --git a/src/psiactionlist.cpp b/src/psiactionlist.cpp index e2f9aa36d..ac611b786 100644 --- a/src/psiactionlist.cpp +++ b/src/psiactionlist.cpp @@ -136,8 +136,7 @@ PsiActionList::Private::~Private() { list->clear(); } ActionList *PsiActionList::Private::createActionList(QString name, int id, ActionNames *actionlist) { - static const QStringList skipList = QStringList() << "separator" - << "spacer"; + static const QStringList skipList = QStringList() << "separator" << "spacer"; ActionList *actions = new ActionList(name, id, false); @@ -273,8 +272,7 @@ void PsiActionList::Private::createMainWin() IconAction *actToolbars = new IconAction(tr("Configure Toolbars"), "psi/toolbars", tr("Configure Tool&bars"), 0, this); - IconAction *actAccounts - = new IconAction(tr("Manage Accounts"), "psi/account", tr("&Manage Accounts"), 0, this); + IconAction *actAccounts = new IconAction(tr("Manage Accounts"), "psi/account", tr("&Manage Accounts"), 0, this); IconAction *actChangeProfile = new IconAction(tr("Change Profile"), "psi/profile", tr("&Change Profile"), 0, this); diff --git a/src/psichatdlg.cpp b/src/psichatdlg.cpp index de069b8ad..2ef000783 100644 --- a/src/psichatdlg.cpp +++ b/src/psichatdlg.cpp @@ -37,6 +37,8 @@ #include "iconlabel.h" #include "iconselect.h" #include "iconwidget.h" +#include "iris/xmpp_caps.h" +#include "iris/xmpp_tasks.h" #include "jidutil.h" #include "lastactivitytask.h" #include "messageview.h" @@ -55,8 +57,6 @@ #include "textutil.h" #include "userlist.h" #include "widgets/pixmapratiolabel.h" -#include "iris/xmpp_caps.h" -#include "iris/xmpp_tasks.h" #ifdef PSI_PLUGINS #include "filesharedlg.h" #include "pluginmanager.h" @@ -155,12 +155,7 @@ class PsiChatDlg::ChatDlgMCmdProvider : public QObject, public MCmdProviderIface QStringList all; if (state->getName() == MCMDCHAT) { if (item == 0) { - all << "version" - << "idle" - << "clear" - << "vcard" - << "auth" - << "compact"; + all << "version" << "idle" << "clear" << "vcard" << "auth" << "compact"; } } QStringList res; @@ -981,7 +976,7 @@ void PsiChatDlg::doClearButton() switch (QMessageBox::warning( this, tr("Warning"), tr("Are you sure you want to clear the chat window?\n(note: does not affect saved history)"), - QMessageBox::Yes, QMessageBox::YesAll, QMessageBox::No)) { + QMessageBox::Yes | QMessageBox::YesAll | QMessageBox::No)) { case QMessageBox::No: break; case QMessageBox::YesAll: @@ -1037,7 +1032,7 @@ void PsiChatDlg::buildMenu() #endif } -void PsiChatDlg::updateCounter() { ui_.lb_count->setNum(chatEdit()->toPlainText().length()); } +void PsiChatDlg::updateCounter() { ui_.lb_count->setNum(int(chatEdit()->toPlainText().length())); } bool PsiChatDlg::isPgpEncryptionEnabled() const { return actions_->action("chat_pgp")->isChecked(); } diff --git a/src/psichatdlg.h b/src/psichatdlg.h index 7ff6d8224..4c52517f1 100644 --- a/src/psichatdlg.h +++ b/src/psichatdlg.h @@ -119,15 +119,15 @@ private slots: QMenu *pm_settings_; - ActionList * actions_; - QAction * act_mini_cmd_; - QAction * act_minimize_; + ActionList *actions_; + QAction *act_mini_cmd_; + QAction *act_minimize_; TypeAheadFindBar *typeahead_; ActionLineEdit *le_autojid; - IconAction * act_autojid; - IconAction * act_active_contacts; - IconAction * act_pastesend_; + IconAction *act_autojid; + IconAction *act_active_contacts; + IconAction *act_pastesend_; MCmdManager mCmdManager_; MCmdSimpleSite mCmdSite_; diff --git a/src/psicon.cpp b/src/psicon.cpp index 434543215..638e353a7 100644 --- a/src/psicon.cpp +++ b/src/psicon.cpp @@ -46,10 +46,10 @@ #endif #include "iconselect.h" #include "idle/idle.h" +#include "iris/jingle-s5b.h" #include "iris/processquit.h" #include "iris/tcpportreserver.h" #include "jidutil.h" -#include "iris/jingle-s5b.h" #include "mainwin.h" #include "mucjoindlg.h" #include "networkaccessmanager.h" @@ -70,11 +70,11 @@ #ifdef PSIMNG #include "psimng.h" #endif +#include "iris/s5b.h" #include "psioptions.h" #include "psirichtext.h" #include "psithememanager.h" #include "psitoolbar.h" -#include "iris/s5b.h" #include "shortcutmanager.h" #include "spellchecker/spellchecker.h" #include "statusdlg.h" @@ -116,7 +116,6 @@ #include #include -#include #include #include #include @@ -255,7 +254,7 @@ class PsiCon::Private : public QObject { std::pair uriToShareSource(const QString &path) { - auto pathParts = QStringView{path}.mid(sizeof("/psi/account")).split('/'); + auto pathParts = QStringView { path }.mid(sizeof("/psi/account")).split('/'); if (pathParts.size() < 3 || pathParts[1] != QLatin1String("sharedfile") || pathParts[2].isEmpty()) // /sharedfile/ return { nullptr, QString() }; @@ -384,7 +383,7 @@ bool PsiCon::init() if (!ActiveProfiles::instance()->setThisProfile(activeProfile)) return false; -#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) +#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) qApp->setFallbackSessionManagementEnabled(false); #endif connect(qApp, SIGNAL(commitDataRequest(QSessionManager &)), SLOT(forceSavePreferences(QSessionManager &))); @@ -849,12 +848,9 @@ QStringList PsiCon::xmppFatures() const #ifdef GROUPCHAT << "http://jabber.org/protocol/muc" #endif - << "http://jabber.org/protocol/mood" - << "http://jabber.org/protocol/activity" - << "http://jabber.org/protocol/tune" - << "http://jabber.org/protocol/geoloc" - << "urn:xmpp:avatar:data" - << "urn:xmpp:avatar:metadata"; + << "http://jabber.org/protocol/mood" << "http://jabber.org/protocol/activity" + << "http://jabber.org/protocol/tune" << "http://jabber.org/protocol/geoloc" + << "urn:xmpp:avatar:data" << "urn:xmpp:avatar:metadata"; static QList fmap = QList() << OptFeatureMap("options.service-discovery.last-activity", QStringList() << "jabber:iq:last") @@ -1470,8 +1466,10 @@ void PsiCon::optionChanged(const QString &option) } if (option == tuneControllerFilterOptionPath || option == tunePublishOptionPath) { if (PsiOptions::instance()->getOption(tunePublishOptionPath).toBool()) { - d->tuneManager->updateControllers( - PsiOptions::instance()->getOption(tuneControllerFilterOptionPath).toString().split(QRegularExpression("[,]\\s*"))); + d->tuneManager->updateControllers(PsiOptions::instance() + ->getOption(tuneControllerFilterOptionPath) + .toString() + .split(QRegularExpression("[,]\\s*"))); } else { d->tuneManager->updateControllers(d->tuneManager->controllerNames()); } diff --git a/src/psicontact.cpp b/src/psicontact.cpp index 85ccff691..cc712756e 100644 --- a/src/psicontact.cpp +++ b/src/psicontact.cpp @@ -56,10 +56,10 @@ class PsiContact::Private : public Alertable { delete animTimer_; } - PsiContact * q; - PsiAccount * account_; - QTimer * statusTimer_; - QTimer * animTimer_; + PsiContact *q; + PsiAccount *account_; + QTimer *statusTimer_; + QTimer *animTimer_; UserListItem u_; QString name_; Status status_; diff --git a/src/psicontact.h b/src/psicontact.h index 8489b9c39..bbe08b25c 100644 --- a/src/psicontact.h +++ b/src/psicontact.h @@ -20,8 +20,8 @@ #pragma once #include "contactlistitemmenu.h" -#include "psicontactlist.h" #include "iris/xmpp_vcard.h" +#include "psicontactlist.h" #include @@ -44,8 +44,8 @@ class PsiContact : public QObject { PsiContact(const UserListItem &u, PsiAccount *account, bool isSelf = false); ~PsiContact(); - PsiAccount * account() const; - const UserListItem & userListItem() const; + PsiAccount *account() const; + const UserListItem &userListItem() const; const UserResourceList &userResourceList() const; void update(const UserListItem &u); @@ -80,7 +80,7 @@ class PsiContact : public QObject { bool isFake() const; // reimplemented - const QString & name() const; + const QString &name() const; QString comparisonName() const; void setName(const QString &name); ContactListItemMenu *contextMenu(ContactListModel *model); diff --git a/src/psicontactlist.cpp b/src/psicontactlist.cpp index b2edfadee..1b49ace88 100644 --- a/src/psicontactlist.cpp +++ b/src/psicontactlist.cpp @@ -20,12 +20,12 @@ #include "psicontactlist.h" #include "accountadddlg.h" +#include "iris/xmpp_serverinfomanager.h" #include "psiaccount.h" #include "psicon.h" #include "psicontact.h" #include "psievent.h" #include "psioptions.h" -#include "iris/xmpp_serverinfomanager.h" #include diff --git a/src/psicontactlist.h b/src/psicontactlist.h index 5702c91a4..7a1418f13 100644 --- a/src/psicontactlist.h +++ b/src/psicontactlist.h @@ -165,7 +165,7 @@ private slots: PsiAccount *loadAccount(const UserAccount &); PsiAccount *tryQueueLowestEventId(bool includeDND); - PsiCon * psi_; + PsiCon *psi_; QList accounts_, enabledAccounts_; QList contacts_; diff --git a/src/psicontactlistview.cpp b/src/psicontactlistview.cpp index 3c256e035..ce8a7522c 100644 --- a/src/psicontactlistview.cpp +++ b/src/psicontactlistview.cpp @@ -30,7 +30,6 @@ #include "psitooltip.h" #include -#include #include #include #include @@ -84,7 +83,7 @@ private slots: topParent->layout()->setEnabled(false); // try to reduce some flicker const QRect topParentRect = topParent->frameGeometry(); - const QRect desktop = qApp->desktop()->availableGeometry(topParent); + const QRect desktop = topParent->screen()->availableGeometry(); int newHeight = topParent->height() + dh; if (newHeight > desktop.height()) { @@ -123,7 +122,7 @@ public slots: bool determineAutoRosterSizeGrowSide() { const QRect topParent = lv->window()->frameGeometry(); - const QRect desktop = qApp->desktop()->availableGeometry(lv->window()); + const QRect desktop = lv->window()->screen()->availableGeometry(); int top_offs = abs(desktop.top() - topParent.top()); int bottom_offs = abs(desktop.bottom() - topParent.bottom()); @@ -134,7 +133,7 @@ public slots: public: bool allowAutoresize; PsiContactListView *lv; - QTimer * recalculateSizeTimer; + QTimer *recalculateSizeTimer; }; PsiContactListView::PsiContactListView(QWidget *parent) : ContactListDragView(parent) diff --git a/src/psicontactmenu.cpp b/src/psicontactmenu.cpp index 74f7830ac..0c6c98308 100644 --- a/src/psicontactmenu.cpp +++ b/src/psicontactmenu.cpp @@ -25,6 +25,7 @@ #include "iconaction.h" #include "iconset.h" #include "invitetogroupchatmenu.h" +#include "iris/xmpp_tasks.h" #include "pluginmanager.h" #include "psiaccount.h" #include "psicon.h" @@ -34,7 +35,6 @@ #include "psiprivacymanager.h" #include "shortcutmanager.h" #include "userlist.h" -#include "iris/xmpp_tasks.h" #include #include @@ -534,8 +534,8 @@ void PsiContactMenu::Private::authRemove() int n = QMessageBox::information( nullptr, tr("Remove"), - tr("Are you sure you want to remove authorization from %1?").arg(contact_->name()), tr("&Yes"), - tr("&No")); + tr("Are you sure you want to remove authorization from %1?").arg(contact_->name()), + QMessageBox::Yes | QMessageBox::No); if (n == 0) contact_->account()->actionAuthRemove(contact_->jid()); @@ -662,7 +662,7 @@ PsiContactMenu::~PsiContactMenu() { delete d; } QList PsiContactMenu::availableActions() const { QList result; - const auto & acts = ContactListItemMenu::availableActions(); + const auto &acts = ContactListItemMenu::availableActions(); for (QAction *a : acts) { // if (a != d->removeAction_) result << a; diff --git a/src/psicontactmenu_p.h b/src/psicontactmenu_p.h index 823f1f8d3..8a57a7828 100644 --- a/src/psicontactmenu_p.h +++ b/src/psicontactmenu_p.h @@ -73,7 +73,7 @@ public slots: public: QPointer contact_; - PsiContactMenu * menu_; + PsiContactMenu *menu_; QAction *renameAction_; QAction *removeAction_; @@ -82,40 +82,40 @@ public slots: QAction *transportLogonAction_; QAction *transportLogoffAction_; QAction *receiveIncomingEventAction_; - QMenu * msgMenu_; + QMenu *msgMenu_; QAction *sendMessageAction_; - QMenu * sendMessageToMenu_; + QMenu *sendMessageToMenu_; QAction *openChatAction_; - QMenu * openChatToMenu_; + QMenu *openChatToMenu_; #ifdef WHITEBOARDING QAction *openWhiteboardAction_; - QMenu * openWhiteboardToMenu_; + QMenu *openWhiteboardToMenu_; #endif - ResourceMenu * executeCommandMenu_; - ResourceMenu * activeChatsMenu_; - QAction * voiceCallAction_; - QAction * sendFileAction_; - QAction * customStatusAction_; + ResourceMenu *executeCommandMenu_; + ResourceMenu *activeChatsMenu_; + QAction *voiceCallAction_; + QAction *sendFileAction_; + QAction *customStatusAction_; InviteToGroupChatMenu *inviteToGroupchatMenu_; - GroupMenu * groupMenu_; - QMenu * authMenu_; - QAction * authResendAction_; - QAction * authRerequestAction_; - QAction * authRemoveAction_; - QMenu * pictureMenu_; - QAction * pictureAssignAction_; - QAction * pictureClearAction_; - QAction * vcardAction_; - QAction * historyAction_; - QAction * mucHideAction_; - QAction * mucShowAction_; - QAction * mucLeaveAction_; - QAction * blockAction_; - QAction * visibleAction_; - QAction * _copyUserJid; - QAction * _copyMucJid; - QAction * mucAddToBookmarks; - QAction * _separator1; - QAction * _separator2; - QMenu * _advancedMenu; + GroupMenu *groupMenu_; + QMenu *authMenu_; + QAction *authResendAction_; + QAction *authRerequestAction_; + QAction *authRemoveAction_; + QMenu *pictureMenu_; + QAction *pictureAssignAction_; + QAction *pictureClearAction_; + QAction *vcardAction_; + QAction *historyAction_; + QAction *mucHideAction_; + QAction *mucShowAction_; + QAction *mucLeaveAction_; + QAction *blockAction_; + QAction *visibleAction_; + QAction *_copyUserJid; + QAction *_copyMucJid; + QAction *mucAddToBookmarks; + QAction *_separator1; + QAction *_separator2; + QMenu *_advancedMenu; }; diff --git a/src/psidbusnotifier.cpp b/src/psidbusnotifier.cpp index 9b651fb7c..7eebe47f7 100644 --- a/src/psidbusnotifier.cpp +++ b/src/psidbusnotifier.cpp @@ -69,17 +69,17 @@ class iiibiiay { iiibiiay() { } static const decltype(qDBusRegisterMetaType()) id; - int width; - int height; - int rowstride; - bool hasAlpha; - int bitsPerSample; - int channels; - QByteArray image; + int width; + int height; + int rowstride; + bool hasAlpha; + int bitsPerSample; + int channels; + QByteArray image; }; Q_DECLARE_METATYPE(iiibiiay) -const decltype(qDBusRegisterMetaType()) iiibiiay::id{qDBusRegisterMetaType()}; +const decltype(qDBusRegisterMetaType()) iiibiiay::id { qDBusRegisterMetaType() }; QDBusArgument &operator<<(QDBusArgument &a, const iiibiiay &i) { diff --git a/src/psidbusnotifier.h b/src/psidbusnotifier.h index 81f98d083..b1ade18fb 100644 --- a/src/psidbusnotifier.h +++ b/src/psidbusnotifier.h @@ -29,8 +29,8 @@ #define QT_STATICPLUGIN #endif -#include "psipopupinterface.h" #include "iris/xmpp_jid.h" +#include "psipopupinterface.h" class QDBusPendingCallWatcher; class QTimer; @@ -60,9 +60,9 @@ private slots: private: Jid jid_; uint id_; - PsiAccount * account_; + PsiAccount *account_; PsiEvent::Ptr event_; - QTimer * lifeTimer_; + QTimer *lifeTimer_; static QStringList caps_; }; diff --git a/src/psievent.cpp b/src/psievent.cpp index 4a8eede45..f320237f0 100644 --- a/src/psievent.cpp +++ b/src/psievent.cpp @@ -25,11 +25,11 @@ #include "dummystream.h" #include "iris/filetransfer.h" #include "iris/jingle-session.h" +#include "iris/xmpp_xmlcommon.h" #include "psiaccount.h" #include "psicon.h" #include "psicontactlist.h" #include "psioptions.h" -#include "iris/xmpp_xmlcommon.h" #include #include @@ -429,8 +429,7 @@ QString HttpAuthEvent::description() const { return tr("HTTP Authentication Requ // RosterExchangeEvent //---------------------------------------------------------------------------- RosterExchangeEvent::RosterExchangeEvent(const Jid &j, const RosterExchangeItems &i, const QString &text, - PsiAccount *acc) : - PsiEvent(acc) + PsiAccount *acc) : PsiEvent(acc) { v_from = j; v_items = i; diff --git a/src/psievent.h b/src/psievent.h index b57378ba7..c9e7320c9 100644 --- a/src/psievent.h +++ b/src/psievent.h @@ -20,10 +20,10 @@ #ifndef PSIEVENT_H #define PSIEVENT_H -#include "psihttpauthrequest.h" #include "iris/xmpp_jid.h" #include "iris/xmpp_message.h" #include "iris/xmpp_rosterx.h" +#include "psihttpauthrequest.h" #include #include @@ -234,8 +234,8 @@ class FileEvent : public PsiEvent { int type() const { return File; } XMPP::Jid from() const; void setFrom(const XMPP::Jid &); - XMPP::FileTransfer * takeFileTransfer(); - XMPP::Jingle::Session * takeJingleSession(); + XMPP::FileTransfer *takeFileTransfer(); + XMPP::Jingle::Session *takeJingleSession(); virtual int priority() const; @@ -259,9 +259,9 @@ class RosterExchangeEvent : public PsiEvent { int type() const { return RosterExchange; } XMPP::Jid from() const; void setFrom(const XMPP::Jid &); - const XMPP::RosterExchangeItems & rosterExchangeItems() const; + const XMPP::RosterExchangeItems &rosterExchangeItems() const; void setRosterExchangeItems(const XMPP::RosterExchangeItems &); - const QString & text() const; + const QString &text() const; void setText(const QString &text); virtual int priority() const; @@ -323,7 +323,7 @@ class AvCallEvent : public PsiEvent { int type() const { return AvCallType; } XMPP::Jid from() const; void setFrom(const XMPP::Jid &); - AvCall * takeAvCall(); + AvCall *takeAvCall(); virtual int priority() const; @@ -397,8 +397,8 @@ class EventQueue : public QObject { private: QList list_; - PsiCon * psi_; - PsiAccount * account_; + PsiCon *psi_; + PsiAccount *account_; bool enabled_; }; diff --git a/src/psigrowlnotifier.h b/src/psigrowlnotifier.h index 2eb89b4e6..17a0cc2a1 100644 --- a/src/psigrowlnotifier.h +++ b/src/psigrowlnotifier.h @@ -67,8 +67,8 @@ private slots: PsiGrowlNotifier(); void tryDeleteContext(NotificationContext *context); - static PsiGrowlNotifier * instance_; - GrowlNotifier * gn_; + static PsiGrowlNotifier *instance_; + GrowlNotifier *gn_; QList contexts_; }; diff --git a/src/psiiconset.cpp b/src/psiiconset.cpp index 1d46c85d2..2e52dd3d2 100644 --- a/src/psiiconset.cpp +++ b/src/psiiconset.cpp @@ -100,7 +100,7 @@ class PsiIconset::Private { struct StatusIconsets { struct IconsetItem { QRegularExpression regexp; - QString iconset; + QString iconset; }; bool useServicesIcons = false; QList list; @@ -185,7 +185,8 @@ class PsiIconset::Private { // second level -- transport icon if (jid.node().isEmpty() || status_icons.useServicesIcons) { for (const StatusIconsets::IconsetItem &item : std::as_const(status_icons.list)) { - if (item.regexp.pattern().isEmpty() ? jid.node().isEmpty() : (item.regexp.match(jid.domain()).hasMatch())) { + if (item.regexp.pattern().isEmpty() ? jid.node().isEmpty() + : (item.regexp.match(jid.domain()).hasMatch())) { const Iconset *is = psi->roster.value(item.iconset); if (is) { PsiIcon *i = const_cast(is->icon(iconName)); @@ -809,7 +810,7 @@ PsiIcon *PsiIconset::event2icon(const PsiEvent::Ptr &e) QString icon; if (e->type() == PsiEvent::Message) { MessageEvent::Ptr me = e.staticCast(); - const Message & m = me->message(); + const Message &m = me->message(); if (m.type() == "headline") icon = "psi/headline"; else if (m.type() == "chat" || m.type() == "groupchat") diff --git a/src/psiiconset.h b/src/psiiconset.h index 3b5431474..f5a7fad5a 100644 --- a/src/psiiconset.h +++ b/src/psiiconset.h @@ -47,7 +47,7 @@ class PsiIconset : public QObject { Iconset activities; Iconset clients; Iconset affiliations; - const Iconset & system() const; + const Iconset &system() const; void stripFirstAnimFrame(Iconset *); static void removeAnimation(Iconset *); diff --git a/src/psimedia/psimedia.cpp b/src/psimedia/psimedia.cpp index 403bb698f..186abeaf3 100644 --- a/src/psimedia/psimedia.cpp +++ b/src/psimedia/psimedia.cpp @@ -640,7 +640,7 @@ void RtpSession::stop() { d->c->stop(); } QList RtpSession::localAudioPayloadInfo() const { QList out; - const auto & lAPInfo = d->c->localAudioPayloadInfo(); + const auto &lAPInfo = d->c->localAudioPayloadInfo(); for (const PPayloadInfo &pp : lAPInfo) out += importPayloadInfo(pp); return out; @@ -649,7 +649,7 @@ QList RtpSession::localAudioPayloadInfo() const QList RtpSession::localVideoPayloadInfo() const { QList out; - const auto & lVPInfo = d->c->localVideoPayloadInfo(); + const auto &lVPInfo = d->c->localVideoPayloadInfo(); for (const PPayloadInfo &pp : lVPInfo) out += importPayloadInfo(pp); return out; @@ -658,7 +658,7 @@ QList RtpSession::localVideoPayloadInfo() const QList RtpSession::remoteAudioPayloadInfo() const { QList out; - const auto & rAPInfo = d->c->remoteAudioPayloadInfo(); + const auto &rAPInfo = d->c->remoteAudioPayloadInfo(); for (const PPayloadInfo &pp : rAPInfo) out += importPayloadInfo(pp); return out; @@ -667,7 +667,7 @@ QList RtpSession::remoteAudioPayloadInfo() const QList RtpSession::remoteVideoPayloadInfo() const { QList out; - const auto & rVPInfo = d->c->remoteVideoPayloadInfo(); + const auto &rVPInfo = d->c->remoteVideoPayloadInfo(); for (const PPayloadInfo &pp : rVPInfo) out += importPayloadInfo(pp); return out; @@ -676,7 +676,7 @@ QList RtpSession::remoteVideoPayloadInfo() const QList RtpSession::audioParams() const { QList out; - const auto & audioParams = d->c->audioParams(); + const auto &audioParams = d->c->audioParams(); for (const PAudioParams &pp : audioParams) out += importAudioParams(pp); return out; @@ -685,7 +685,7 @@ QList RtpSession::audioParams() const QList RtpSession::videoParams() const { QList out; - const auto & videoParams = d->c->videoParams(); + const auto &videoParams = d->c->videoParams(); for (const PVideoParams &pp : videoParams) out += importVideoParams(pp); return out; diff --git a/src/psimedia/psimedia_p.h b/src/psimedia/psimedia_p.h index 897d87186..2fa0a9588 100644 --- a/src/psimedia/psimedia_p.h +++ b/src/psimedia/psimedia_p.h @@ -63,7 +63,7 @@ class VideoWidgetPrivate : public QObject, public VideoWidgetContext { #endif -Provider * provider(); +Provider *provider(); QList importDevices(const QList &in); QList importAudioModes(const QList &in); QList importVideoModes(const QList &in); @@ -72,7 +72,7 @@ class Features::Private : public QObject { Q_OBJECT public: - Features * q; + Features *q; FeaturesContext *c = nullptr; QList audioOutputDevices; @@ -128,7 +128,7 @@ class RtpChannelPrivate : public QObject { Q_OBJECT public: - RtpChannel * q; + RtpChannel *q; RtpChannelContext *c; bool enabled; int readyReadListeners; @@ -178,7 +178,7 @@ class RtpSessionPrivate : public QObject { Q_OBJECT public: - RtpSession * q; + RtpSession *q; RtpSessionContext *c; RtpChannel audioRtpChannel; RtpChannel videoRtpChannel; diff --git a/src/psioptions.cpp b/src/psioptions.cpp index 0ecd1b7ef..d17c3eed0 100644 --- a/src/psioptions.cpp +++ b/src/psioptions.cpp @@ -24,12 +24,12 @@ #ifdef PSI_PLUGINS #include "pluginmanager.h" #endif -#include "psitoolbar.h" -#include "statuspreset.h" #include "iris/xmpp_client.h" #include "iris/xmpp_jid.h" #include "iris/xmpp_task.h" #include "iris/xmpp_xmlcommon.h" +#include "psitoolbar.h" +#include "statuspreset.h" #include #include @@ -163,52 +163,29 @@ bool PsiOptions::newProfile() ToolbarPrefs chatToolbar; chatToolbar.on = true; chatToolbar.name = "Chat"; - chatToolbar.keys << "chat_clear" - << "chat_find" - << "chat_html_text" - << "chat_add_contact"; + chatToolbar.keys << "chat_clear" << "chat_find" << "chat_html_text" << "chat_add_contact"; chatToolbar.keys += pluginsKeys; - chatToolbar.keys << "spacer" - << "chat_icon" - << "chat_file" - << "chat_pgp" - << "chat_info" - << "chat_history" - << "chat_voice" - << "chat_share_files" - << "chat_active_contacts" - << "chat_templates"; + chatToolbar.keys << "spacer" << "chat_icon" << "chat_file" << "chat_pgp" << "chat_info" << "chat_history" + << "chat_voice" << "chat_share_files" << "chat_active_contacts" << "chat_templates"; ToolbarPrefs groupchatToolbar; groupchatToolbar.on = true; groupchatToolbar.name = "Groupchat"; - groupchatToolbar.keys << "gchat_info" - << "gchat_clear" - << "gchat_find" - << "gchat_html_text" - << "gchat_configure" - << "gchat_set_topic" - << "gchat_templates" - << "gchat_share_files"; + groupchatToolbar.keys << "gchat_info" << "gchat_clear" << "gchat_find" << "gchat_html_text" << "gchat_configure" + << "gchat_set_topic" << "gchat_templates" << "gchat_share_files"; groupchatToolbar.keys += pluginsKeys; - groupchatToolbar.keys << "spacer" - << "gchat_icon"; + groupchatToolbar.keys << "spacer" << "gchat_icon"; ToolbarPrefs buttons; buttons.name = tr("Buttons"); buttons.on = true; - buttons.keys << "button_options" - << "button_status"; + buttons.keys << "button_options" << "button_status"; buttons.dock = Qt3Dock_Bottom; ToolbarPrefs showContacts; showContacts.on = true; showContacts.name = tr("Show contacts"); - showContacts.keys << "menu_options" - << "menu_add_contact" - << "view_groups" - << "menu_disco" - << "menu_play_sounds" + showContacts.keys << "menu_options" << "menu_add_contact" << "view_groups" << "menu_disco" << "menu_play_sounds" << "menu_xml_console"; QList toolbars = { chatToolbar, groupchatToolbar, buttons, showContacts }; diff --git a/src/psioptions.h b/src/psioptions.h index e92351519..e832ccafa 100644 --- a/src/psioptions.h +++ b/src/psioptions.h @@ -36,7 +36,7 @@ class PsiOptions : public OptionsTree //, QObject { Q_OBJECT public: - static PsiOptions * instance(); + static PsiOptions *instance(); static const PsiOptions *defaults(); static void reset(); @@ -58,7 +58,7 @@ private slots: private: QString autoFile_; - QTimer * autoSaveTimer_; + QTimer *autoSaveTimer_; static PsiOptions *instance_; static PsiOptions *defaults_; }; diff --git a/src/psioptionseditor.cpp b/src/psioptionseditor.cpp index 47bf132cc..f9cddf1ee 100644 --- a/src/psioptionseditor.cpp +++ b/src/psioptionseditor.cpp @@ -27,7 +27,7 @@ protected slots: protected: struct supportedType { - const char * name; + const char *name; QVariant::Type typ; }; static supportedType supportedTypes[]; diff --git a/src/psioptionseditor.h b/src/psioptionseditor.h index 639f39663..76bd15c9a 100644 --- a/src/psioptionseditor.h +++ b/src/psioptionseditor.h @@ -34,22 +34,22 @@ private slots: void keyPressEvent(QKeyEvent *e); private: - PsiOptions * o_; - QTreeView * tv_; + PsiOptions *o_; + QTreeView *tv_; int tv_colWidth; - OptionsTreeModel * tm_; + OptionsTreeModel *tm_; QSortFilterProxyModel *tpm_; - QCheckBox * cb_; - QLabel * lb_type; - QLabel * lb_path; - QLabel * lb_comment; - QLabel * lb_filter; - QPushButton * pb_delete; - QPushButton * pb_reset; - QPushButton * pb_edit; - QPushButton * pb_new; - QToolButton * pb_detach; - QLineEdit * le_filter; + QCheckBox *cb_; + QLabel *lb_type; + QLabel *lb_path; + QLabel *lb_comment; + QLabel *lb_filter; + QPushButton *pb_delete; + QPushButton *pb_reset; + QPushButton *pb_edit; + QPushButton *pb_new; + QToolButton *pb_detach; + QLineEdit *le_filter; }; #endif // PSIOPTIONSEDITOR_H diff --git a/src/psipopup.cpp b/src/psipopup.cpp index 5dc7975ff..804c2cbe0 100644 --- a/src/psipopup.cpp +++ b/src/psipopup.cpp @@ -73,16 +73,16 @@ private slots: void popupClicked(int); public: - PsiCon * psi; - PsiAccount * account; - FancyPopup * popup; - PsiPopup * psiPopup; + PsiCon *psi; + PsiAccount *account; + FancyPopup *popup; + PsiPopup *psiPopup; QString id; PopupManager::PopupType popupType; Jid jid; Status status; PsiEvent::Ptr event; - PsiIcon * titleIcon; + PsiIcon *titleIcon; bool display; bool doAlertIcon; }; diff --git a/src/psipopup.h b/src/psipopup.h index 26166c275..a784807c4 100644 --- a/src/psipopup.h +++ b/src/psipopup.h @@ -44,7 +44,7 @@ class PsiPopup : public QObject, public PsiPopupInterface { static void deleteAll(); private: - void setData(const Jid &, const Resource &, const UserListItem * = nullptr, + void setData(const Jid &, const Resource &, const UserListItem * = nullptr, const PsiEvent::Ptr &event = PsiEvent::Ptr()); void setData(const QPixmap &avatar, const PsiIcon *icon, const QString &text); void setJid(const Jid &j); diff --git a/src/psirosterwidget.cpp b/src/psirosterwidget.cpp index 88ecb0c35..736379e32 100644 --- a/src/psirosterwidget.cpp +++ b/src/psirosterwidget.cpp @@ -79,7 +79,7 @@ class PsiRosterFilterProxyModel : public QSortFilterProxyModel { } for (const QString &str : std::as_const(data)) { -#if QT_VERSION < QT_VERSION_CHECK(6,0,0) +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) if (str.contains(filterRegExp())) #else if (str.contains(filterRegularExpression())) diff --git a/src/psirosterwidget.h b/src/psirosterwidget.h index 6e35742a6..7db4102d1 100644 --- a/src/psirosterwidget.h +++ b/src/psirosterwidget.h @@ -60,14 +60,14 @@ private slots: private: QPointer contactList_; - QStackedWidget * stackedWidget_; - QWidget * contactListPage_; - QWidget * filterPage_; - PsiContactListView * contactListPageView_; + QStackedWidget *stackedWidget_; + QWidget *contactListPage_; + QWidget *filterPage_; + PsiContactListView *contactListPageView_; PsiFilteredContactListView *filterPageView_; - QLineEdit * filterEdit_; + QLineEdit *filterEdit_; - ContactListDragModel * contactListModel_; + ContactListDragModel *contactListModel_; QSortFilterProxyModel *filterModel_; }; diff --git a/src/psithememanager.h b/src/psithememanager.h index 7a6e1b2f1..850a40b8e 100644 --- a/src/psithememanager.h +++ b/src/psithememanager.h @@ -33,8 +33,8 @@ class PsiThemeManager : public QObject { ~PsiThemeManager(); void registerProvider(PsiThemeProvider *provider, bool required = false); - PsiThemeProvider * unregisterProvider(const QString &type); - PsiThemeProvider * provider(const QString &type); + PsiThemeProvider *unregisterProvider(const QString &type); + PsiThemeProvider *provider(const QString &type); QList registeredProviders() const; bool loadAll(); diff --git a/src/psithememodel.h b/src/psithememodel.h index 4968a012e..d36051deb 100644 --- a/src/psithememodel.h +++ b/src/psithememodel.h @@ -65,8 +65,8 @@ private slots: private: struct Loader; - Loader * loader = nullptr; - PsiThemeProvider * provider = nullptr; + Loader *loader = nullptr; + PsiThemeProvider *provider = nullptr; QFutureWatcher themeWatcher; QFuture themesFuture; QList themesInfo; diff --git a/src/psithemeprovider.h b/src/psithemeprovider.h index f1d8e67db..205213acc 100644 --- a/src/psithemeprovider.h +++ b/src/psithemeprovider.h @@ -37,7 +37,7 @@ class PsiThemeProvider : public QObject { inline PsiCon *psi() const { return _psi; } - virtual const char * type() const = 0; + virtual const char *type() const = 0; virtual Theme theme(const QString &id) = 0; // make new theme virtual const QStringList themeIds() const = 0; virtual bool loadCurrent() = 0; diff --git a/src/psitoolbar.h b/src/psitoolbar.h index 5239178ac..e78452cb6 100644 --- a/src/psitoolbar.h +++ b/src/psitoolbar.h @@ -49,7 +49,7 @@ class PsiToolBar : public QToolBar { private: MetaActionList *actionList_; - QAction * customizeAction_; + QAction *customizeAction_; QString base_; }; diff --git a/src/psitrayicon.h b/src/psitrayicon.h index 7a9323c9c..ef913d56c 100644 --- a/src/psitrayicon.h +++ b/src/psitrayicon.h @@ -39,7 +39,7 @@ private slots: bool eventFilter(QObject *, QEvent *); private: - PsiIcon * icon_; + PsiIcon *icon_; QSystemTrayIcon *trayicon_; quintptr realIcon_; }; diff --git a/src/qwextend.cpp b/src/qwextend.cpp index 44a48d179..2f41fbe49 100644 --- a/src/qwextend.cpp +++ b/src/qwextend.cpp @@ -70,7 +70,7 @@ void reparent_good(QWidget *that, Qt::WindowFlags f, bool showIt) bool enable = that->isEnabled(); // remember status Qt::FocusPolicy fp = that->focusPolicy(); QSize s = that->size(); - QPixmap * bgp = (QPixmap *)that->backgroundPixmap(); + QPixmap *bgp = (QPixmap *)that->backgroundPixmap(); QColor bgc = that->bg_col; // save colors QString capt = that->caption(); that->widget_flags = f; @@ -82,7 +82,7 @@ void reparent_good(QWidget *that, Qt::WindowFlags f, bool showIt) const QObjectList *chlist = that->children(); if (chlist) { // reparent children QObjectListIt it(*chlist); - QObject * obj; + QObject *obj; while ((obj = it.current())) { if (obj->isWidgetType()) { QWidget *w = (QWidget *)obj; diff --git a/src/rc.cpp b/src/rc.cpp index 459ab0712..663f16260 100644 --- a/src/rc.cpp +++ b/src/rc.cpp @@ -23,11 +23,11 @@ #include "ahcservermanager.h" #include "groupchatdlg.h" #include "iconaction.h" +#include "iris/xmpp_xdata.h" #include "psiaccount.h" #include "psiactionlist.h" #include "psicon.h" #include "psioptions.h" -#include "iris/xmpp_xdata.h" using namespace XMPP; diff --git a/src/registrationdlg.cpp b/src/registrationdlg.cpp index d182136e3..da54432ea 100644 --- a/src/registrationdlg.cpp +++ b/src/registrationdlg.cpp @@ -21,14 +21,14 @@ #include "busywidget.h" #include "common.h" -#include "jidutil.h" -#include "psiaccount.h" -#include "textutil.h" -#include "xdata_widget.h" #include "iris/xmpp_client.h" #include "iris/xmpp_tasks.h" #include "iris/xmpp_xdata.h" #include "iris/xmpp_xmlcommon.h" +#include "jidutil.h" +#include "psiaccount.h" +#include "textutil.h" +#include "xdata_widget.h" #include #include @@ -120,18 +120,18 @@ class RegistrationDlg::Private { Jid jid; PsiAccount *pa = nullptr; - QPushButton * pb_close = nullptr, *pb_reg = nullptr; + QPushButton *pb_close = nullptr, *pb_reg = nullptr; QPointer jt; int type = 0; - BusyWidget * busy = nullptr; - QLabel * lb_top = nullptr; - QWidget * gr_form = nullptr; - QGridLayout * gr_form_layout = nullptr; + BusyWidget *busy = nullptr; + QLabel *lb_top = nullptr; + QWidget *gr_form = nullptr; + QGridLayout *gr_form_layout = nullptr; Form form; QList lb_field; QList le_field; - XDataWidget * xdata = nullptr; + XDataWidget *xdata = nullptr; }; RegistrationDlg::RegistrationDlg(const Jid &jid, PsiAccount *pa) : QDialog(nullptr) @@ -292,7 +292,7 @@ void RegistrationDlg::processLegacyForm(const XMPP::Form &form) setInstructions(d->jid.full(), form.instructions()); for (const auto &f : std::as_const(d->form)) { - QLabel * lb = new QLabel(f.fieldName(), d->gr_form); + QLabel *lb = new QLabel(f.fieldName(), d->gr_form); QLineEdit *le = new QLineEdit(d->gr_form); d->gr_form_layout->addWidget(lb); // FIXME d->gr_form_layout->addWidget(le); // FIXME diff --git a/src/resourcemenu.cpp b/src/resourcemenu.cpp index 4016b4e69..37134136a 100644 --- a/src/resourcemenu.cpp +++ b/src/resourcemenu.cpp @@ -19,11 +19,11 @@ #include "resourcemenu.h" +#include "iris/xmpp_status.h" #include "psiaccount.h" #include "psicontact.h" #include "psiiconset.h" #include "userlist.h" -#include "iris/xmpp_status.h" /** * \class ResourceMenu @@ -94,7 +94,7 @@ void ResourceMenu::contactUpdated() const auto &names = contact_->account()->hiddenChats(contact_->jid()); for (const QString &resourceName : names) { XMPP::Status::Type status; - const UserResourceList & rl = contact_->userResourceList(); + const UserResourceList &rl = contact_->userResourceList(); UserResourceList::ConstIterator uit = rl.find(resourceName); if (uit != rl.end() || (uit = rl.priority()) != rl.end()) status = makeSTATUS((*uit).status()); diff --git a/src/rosteravatarframe.h b/src/rosteravatarframe.h index 8faada91f..f134c3ec1 100644 --- a/src/rosteravatarframe.h +++ b/src/rosteravatarframe.h @@ -54,7 +54,7 @@ public slots: private: Ui::RosterAvatarFrame ui_; QString statusMessage_; - QMenu * statusMenu_; + QMenu *statusMenu_; QPixmap avatarPixmap; void drawAvatar(); diff --git a/src/rtparse.cpp b/src/rtparse.cpp index e3baec0dc..64610f25f 100644 --- a/src/rtparse.cpp +++ b/src/rtparse.cpp @@ -45,12 +45,12 @@ QString RTParse::next() // if we're at a tag, append it to the output if (in.at(v_at) == '<') { QStringView s; - int n = in.indexOf('>', v_at); + int n = in.indexOf('>', v_at); if (n == -1) { - s = QStringView{in}.mid(v_at); + s = QStringView { in }.mid(v_at); } else { ++n; - s = QStringView{in}.mid(v_at, n - v_at); + s = QStringView { in }.mid(v_at, n - v_at); } v_at += s.length(); out += s; @@ -58,12 +58,12 @@ QString RTParse::next() // now find the next tag, and grab the text in between QStringView s; - int x = in.indexOf('<', v_at); + int x = in.indexOf('<', v_at); if (x == -1) { - s = QStringView{in}.mid(v_at); + s = QStringView { in }.mid(v_at); v_atEnd = true; } else { - s = QStringView{in}.mid(v_at, x - v_at); + s = QStringView { in }.mid(v_at, x - v_at); } v_at += s.length(); // printf("chunk = '%s'\n", s.latin1()); diff --git a/src/searchdlg.cpp b/src/searchdlg.cpp index aa351d23a..9f9e831de 100644 --- a/src/searchdlg.cpp +++ b/src/searchdlg.cpp @@ -18,14 +18,14 @@ */ #include "searchdlg.h" -#include "jidutil.h" -#include "psiaccount.h" -#include "textutil.h" -#include "xdata_widget.h" #include "iris/xmpp_client.h" #include "iris/xmpp_tasks.h" #include "iris/xmpp_xdata.h" #include "iris/xmpp_xmlcommon.h" +#include "jidutil.h" +#include "psiaccount.h" +#include "textutil.h" +#include "xdata_widget.h" #include #include @@ -134,21 +134,21 @@ class SearchDlg::Private { return result; } - SearchDlg * dlg; - PsiAccount * pa = nullptr; + SearchDlg *dlg; + PsiAccount *pa = nullptr; Jid jid; Form form; - BusyWidget * busy = nullptr; + BusyWidget *busy = nullptr; QPointer jt; - QWidget * gr_form = nullptr; - QGridLayout * gr_form_layout = nullptr; + QWidget *gr_form = nullptr; + QGridLayout *gr_form_layout = nullptr; int type = 0; QList lb_field; QList le_field; - XDataWidget * xdata = nullptr; + XDataWidget *xdata = nullptr; XData xdata_form; - QScrollArea * scrollArea = nullptr; + QScrollArea *scrollArea = nullptr; }; SearchDlg::SearchDlg(const Jid &jid, PsiAccount *pa) : QDialog(nullptr) @@ -339,7 +339,7 @@ void SearchDlg::jt_finished() lb_instructions->setText(str); for (const auto &f : std::as_const(d->form)) { - QLabel * lb = new QLabel(f.fieldName(), d->gr_form); + QLabel *lb = new QLabel(f.fieldName(), d->gr_form); QLineEdit *le = new QLineEdit(d->gr_form); d->gr_form_layout->addWidget(lb); // FIXME d->gr_form_layout->addWidget(le); // FIXME diff --git a/src/sendbuttonmenu.h b/src/sendbuttonmenu.h index eeb153973..de6e42f60 100644 --- a/src/sendbuttonmenu.h +++ b/src/sendbuttonmenu.h @@ -15,12 +15,12 @@ class SendButtonTemplatesEditor : public QDialog { private: Ui::SendButtonTemplatesEditor ui_; // QString t; - QAction * addChildTemplAction; - QAction * addChildSeparatorAction; - QAction * editAction; - QAction * removeAction; - QAction * upAction; - QAction * downAction; + QAction *addChildTemplAction; + QAction *addChildSeparatorAction; + QAction *editAction; + QAction *removeAction; + QAction *upAction; + QAction *downAction; void swapItem(int); QStringList genTemplatesList(QTreeWidgetItem *item, QString base_path = ""); diff --git a/src/serverlistquerier.cpp b/src/serverlistquerier.cpp index 15231bc2d..3d4ea874d 100644 --- a/src/serverlistquerier.cpp +++ b/src/serverlistquerier.cpp @@ -76,10 +76,10 @@ void ServerListQuerier::get_finished() } } #else - QStringList servers; - QString contents = QString::fromUtf8(reply->readAll()); - int index = 0; - QRegularExpression re("data-original-title=\"([^\"]+)\""); + QStringList servers; + QString contents = QString::fromUtf8(reply->readAll()); + int index = 0; + QRegularExpression re("data-original-title=\"([^\"]+)\""); QRegularExpressionMatch match; while ((index = contents.indexOf(re, index + 1, &match)) != -1) { servers.append(match.captured(1)); diff --git a/src/statusdlg.cpp b/src/statusdlg.cpp index e056088dd..d4c7db2f4 100644 --- a/src/statusdlg.cpp +++ b/src/statusdlg.cpp @@ -84,15 +84,15 @@ class StatusSetDlg::Private { public: Private() = default; - PsiCon * psi = nullptr; - PsiAccount * pa = nullptr; + PsiCon *psi = nullptr; + PsiAccount *pa = nullptr; Status s; bool withPriority = false; - ChatEdit * te = nullptr; - StatusComboBox * cb_type = nullptr; - QComboBox * cb_preset = nullptr; - QLineEdit * le_priority = nullptr; - QCheckBox * save = nullptr; + ChatEdit *te = nullptr; + StatusComboBox *cb_type = nullptr; + QComboBox *cb_preset = nullptr; + QLineEdit *le_priority = nullptr; + QCheckBox *save = nullptr; Jid j; QList jl; setStatusEnum setStatusMode; @@ -244,8 +244,8 @@ void StatusSetDlg::doButton() // Get preset bool ok = false; text = QInputDialog::getText(this, CAP(tr("New Status Preset")), - tr("Please enter a name for the new status preset:"), QLineEdit::Normal, text, - &ok); + tr("Please enter a name for the new status preset:"), QLineEdit::Normal, text, + &ok); if (!ok) return; diff --git a/src/statusmenu.cpp b/src/statusmenu.cpp index 4dec467d9..959d02fde 100644 --- a/src/statusmenu.cpp +++ b/src/statusmenu.cpp @@ -20,10 +20,10 @@ #include "statusmenu.h" #include "common.h" +#include "iris/xmpp_status.h" #include "psiaccount.h" #include "psiiconset.h" #include "psioptions.h" -#include "iris/xmpp_status.h" #include @@ -99,8 +99,8 @@ void StatusMenu::clear() void StatusMenu::addPresets(IconActionGroup *parent) { - QObject * parentMenu = parent ? parent : static_cast(this); - PsiOptions * o = PsiOptions::instance(); + QObject *parentMenu = parent ? parent : static_cast(this); + PsiOptions *o = PsiOptions::instance(); QVariantList presets = o->mapKeyList("options.status.presets", true); bool showEditPresets = o->getOption("options.status.show-edit-presets").toBool(); if ((showEditPresets || presets.count() > 0) && !parent) @@ -161,9 +161,9 @@ void StatusMenu::statusChanged(const Status &status) void StatusMenu::presetActivated() { - QAction * action = static_cast(sender()); + QAction *action = static_cast(sender()); QString name = action->property("preset").toString(); - PsiOptions * o = PsiOptions::instance(); + PsiOptions *o = PsiOptions::instance(); QString base = o->mapLookup("options.status.presets", name); XMPP::Status status; status.setType(o->getOption(base + ".status").toString()); @@ -200,7 +200,7 @@ XMPP::Status::Type StatusMenu::actionStatus(const QAction *action) const void StatusMenu::statusActivated() { - QAction * action = static_cast(sender()); + QAction *action = static_cast(sender()); XMPP::Status::Type status = actionStatus(action); emit statusSelected(status, false); } @@ -209,7 +209,7 @@ bool StatusMenu::eventFilter(QObject *obj, QEvent *event) { if (event->type() == QEvent::MouseButtonRelease) { QMouseEvent *e = static_cast(event); // We sure event is QMouseEvent - QMenu * menu = dynamic_cast(obj); // Event filter can be installed on anything, so do dynamic_cast + QMenu *menu = dynamic_cast(obj); // Event filter can be installed on anything, so do dynamic_cast assert(menu != nullptr); // Dynamic cast on wrong type will return 0 QAction *action = menu->actionAt(e->pos()); if (action && e->button() == Qt::RightButton) { diff --git a/src/statusmenu.h b/src/statusmenu.h index 7fa6e5e2c..5dba953f6 100644 --- a/src/statusmenu.h +++ b/src/statusmenu.h @@ -21,8 +21,8 @@ #define STATUSMENU_H #include "iconaction.h" -#include "psicon.h" #include "iris/xmpp_status.h" +#include "psicon.h" #include #include @@ -30,7 +30,7 @@ class StatusMenu : public QMenu { Q_OBJECT protected: - PsiCon * psi; + PsiCon *psi; QList statusActs, presetActs; bool eventFilter(QObject *obj, QEvent *event); diff --git a/src/statuspreset.h b/src/statuspreset.h index c5373ade1..8f5acadbd 100644 --- a/src/statuspreset.h +++ b/src/statuspreset.h @@ -20,9 +20,9 @@ #ifndef STATUSPRESET_H #define STATUSPRESET_H +#include "iris/xmpp_status.h" #include "maybe.h" #include "optionstree.h" -#include "iris/xmpp_status.h" #include diff --git a/src/sxe/sxemanager.cpp b/src/sxe/sxemanager.cpp index 68dc1f7ef..a1ecad380 100644 --- a/src/sxe/sxemanager.cpp +++ b/src/sxe/sxemanager.cpp @@ -18,9 +18,9 @@ */ #include "sxemanager.h" +#include "iris/xmpp_caps.h" #include "psiaccount.h" #include "psioptions.h" -#include "iris/xmpp_caps.h" #include diff --git a/src/sxe/sxenewedit.cpp b/src/sxe/sxenewedit.cpp index 6425c550c..9ff47e31c 100644 --- a/src/sxe/sxenewedit.cpp +++ b/src/sxe/sxenewedit.cpp @@ -26,8 +26,7 @@ //---------------------------------------------------------------------------- SxeNewEdit::SxeNewEdit(const QString rid, const QDomNode &node, const QString parent, double primaryWeight, - bool remote) : - SxeEdit(rid, remote) + bool remote) : SxeEdit(rid, remote) { parent_ = parent; primaryWeight_ = primaryWeight; diff --git a/src/sxe/sxesession.cpp b/src/sxe/sxesession.cpp index cb6401137..ec0fafd8a 100644 --- a/src/sxe/sxesession.cpp +++ b/src/sxe/sxesession.cpp @@ -35,9 +35,8 @@ enum { MAXCHDATA = 1024 }; SxeSession::SxeSession(SxeManager *manager, const Jid &target, const QString &session, const Jid &ownJid, bool groupChat, bool serverSupport, const QList &features) : - QObject(manager), - session_(session), target_(target), ownJid_(ownJid), groupChat_(groupChat), serverSupport_(serverSupport), - queueing_(false), importing_(false), features_(features), uuidMaxPostfix_(0) + QObject(manager), session_(session), target_(target), ownJid_(ownJid), groupChat_(groupChat), + serverSupport_(serverSupport), queueing_(false), importing_(false), features_(features), uuidMaxPostfix_(0) { setUUIDPrefix(); diff --git a/src/sxe/sxesession.h b/src/sxe/sxesession.h index 31463add1..664301b7a 100644 --- a/src/sxe/sxesession.h +++ b/src/sxe/sxesession.h @@ -203,7 +203,8 @@ private slots: /*! \brief Generates SxeRemoveEdits for \a node and its children. */ void generateRemoves(const QDomNode &node); /*! \brief Recursive helper method for arranging edits for the snapshot. */ - void arrangeEdits(QMultiHash &ridByParent, QList &output, const QString &iterator); + void arrangeEdits(QMultiHash &ridByParent, QList &output, + const QString &iterator); /*! \brief Insert node with the given primaryWeight. * Returns node if the node was already in the document. Otherwise returns the created node. */ const QDomNode insertNode(const QDomNode &node, const QString &parentId, double primaryWeight); diff --git a/src/systeminfo.cpp b/src/systeminfo.cpp index 5b78d7fdf..01cbebc22 100644 --- a/src/systeminfo.cpp +++ b/src/systeminfo.cpp @@ -182,16 +182,14 @@ SystemInfo::SystemInfo() : QObject(QCoreApplication::instance()) // Detect #if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) && !defined(Q_OS_HAIKU) // attempt to get LSB version before trying the distro-specific approach - os_str_ = lsbRelease(QStringList() << "--description" - << "--short"); + os_str_ = lsbRelease(QStringList() << "--description" << "--short"); if (os_str_.isEmpty()) { os_str_ = unixHeuristicDetect(); } os_name_str_ = os_str_; - os_version_str_ = lsbRelease(QStringList() << "--release" - << "--short"); + os_version_str_ = lsbRelease(QStringList() << "--release" << "--short"); if (os_version_str_.isEmpty()) { os_version_str_ = QSysInfo::productVersion(); @@ -214,13 +212,13 @@ SystemInfo::SystemInfo() : QObject(QCoreApplication::instance()) os_str_.clear(); #if QT_VERSION >= QT_VERSION_CHECK(5, 12, 5) const auto current = QOperatingSystemVersion::current(); - os_name_str_ = current.name(); - os_version_str_ = QString::number(current.majorVersion()); + os_name_str_ = current.name(); + os_version_str_ = QString::number(current.majorVersion()); if (current.minorVersion() >= 0) os_version_str_ += "." + QString::number(current.minorVersion()); if (current.microVersion() > 0) os_version_str_ += "." + QString::number(current.microVersion()); - + if (current > QOperatingSystemVersion::MacOSCatalina) { // Unknown name } else if (current >= QOperatingSystemVersion::MacOSCatalina) { diff --git a/src/systeminfo.h b/src/systeminfo.h index 93ec12023..0ff2377b3 100644 --- a/src/systeminfo.h +++ b/src/systeminfo.h @@ -13,9 +13,9 @@ class SystemInfo : public QObject { public: static SystemInfo *instance(); - const QString & os() const { return os_str_; } - const QString & osName() const { return os_name_str_; } - const QString & osVersion() const { return os_version_str_; } + const QString &os() const { return os_str_; } + const QString &osName() const { return os_name_str_; } + const QString &osVersion() const { return os_version_str_; } private: SystemInfo(); diff --git a/src/tabs/tabbablewidget.cpp b/src/tabs/tabbablewidget.cpp index 5a1e20740..f67afbee7 100644 --- a/src/tabs/tabbablewidget.cpp +++ b/src/tabs/tabbablewidget.cpp @@ -130,7 +130,7 @@ TabbableWidget::~TabbableWidget() } int TabbableWidget::chatsCount = 0; -SendButtonTemplatesMenu * TabbableWidget::templateMenu = nullptr; +SendButtonTemplatesMenu *TabbableWidget::templateMenu = nullptr; QPointer TabbableWidget::templateEditDlg = nullptr; SendButtonTemplatesMenu *TabbableWidget::getTemplateMenu() { return TabbableWidget::templateMenu; } diff --git a/src/tabs/tabbablewidget.h b/src/tabs/tabbablewidget.h index 955285f60..1565e9be4 100644 --- a/src/tabs/tabbablewidget.h +++ b/src/tabs/tabbablewidget.h @@ -43,7 +43,7 @@ class TabbableWidget : public AdvancedWidget { TabbableWidget(const Jid &, PsiAccount *, TabManager *tabManager); ~TabbableWidget(); - PsiAccount * account() const; + PsiAccount *account() const; void setTabIcon(const QIcon &); const QIcon &icon() const; @@ -51,7 +51,7 @@ class TabbableWidget : public AdvancedWidget { virtual const QString &getDisplayName() const; virtual bool readyToHide(); - TabDlg * getManagingTabDlg(); + TabDlg *getManagingTabDlg(); bool isTabbed(); bool isActiveTab(); @@ -104,7 +104,7 @@ public slots: QIcon icon_; // Templates static int chatsCount; - static SendButtonTemplatesMenu * templateMenu; + static SendButtonTemplatesMenu *templateMenu; static QPointer templateEditDlg; // --- }; diff --git a/src/tabs/tabdlg.cpp b/src/tabs/tabdlg.cpp index ff6f7d588..3439879e5 100644 --- a/src/tabs/tabdlg.cpp +++ b/src/tabs/tabdlg.cpp @@ -624,9 +624,9 @@ void TabDlg::dropEvent(QDropEvent *event) PsiTabWidget *barParent = source->psiTabWidget(); if (remoteTab >= barParent->count()) return; - QWidget * widget = barParent->widget(remoteTab); + QWidget *widget = barParent->widget(remoteTab); TabbableWidget *chat = dynamic_cast(widget); - TabDlg * dlg = tabManager_->getManagingTabs(chat); + TabDlg *dlg = tabManager_->getManagingTabs(chat); if (!chat || !dlg) return; dlg->queuedSendTabTo(chat, this); diff --git a/src/tabs/tabdlg.h b/src/tabs/tabdlg.h index 8d6cf64f5..090a4fac6 100644 --- a/src/tabs/tabdlg.h +++ b/src/tabs/tabdlg.h @@ -144,17 +144,17 @@ private slots: void updateVSplitters(int log, int chat); private: - TabDlgDelegate * delegate_; + TabDlgDelegate *delegate_; QList tabs_; - PsiTabWidget * tabWidget_; - QPushButton * detachButton_; - QPushButton * closeButton_; - QPushButton * closeCross_; - QMenu * tabMenu_; - QAction * act_close_; - QAction * act_next_; - QAction * act_prev_; - TabManager * tabManager_; + PsiTabWidget *tabWidget_; + QPushButton *detachButton_; + QPushButton *closeButton_; + QPushButton *closeCross_; + QMenu *tabMenu_; + QAction *act_close_; + QAction *act_next_; + QAction *act_prev_; + TabManager *tabManager_; QPointer selectedTab_; bool userManagement_; bool tabBarSingles_; diff --git a/src/tabs/tabmanager.h b/src/tabs/tabmanager.h index 415855541..bea1e73eb 100644 --- a/src/tabs/tabmanager.h +++ b/src/tabs/tabmanager.h @@ -121,8 +121,8 @@ public slots: QMap tabsetToKinds_; QList tabs_; QList tabControlledChats_; - PsiCon * psiCon_; - TabDlgDelegate * tabDlgDelegate_; + PsiCon *psiCon_; + TabDlgDelegate *tabDlgDelegate_; bool userManagement_; bool tabSingles_; bool simplifiedCaption_; diff --git a/src/textutil.cpp b/src/textutil.cpp index 251ec18e8..9e7555542 100644 --- a/src/textutil.cpp +++ b/src/textutil.cpp @@ -26,8 +26,8 @@ QString TextUtil::quote(const QString &toquote, int width, bool quoteEmpty) { int ql = 0, col = 0, atstart = 1, ls = 0; - QString quoted = "> " + toquote; // quote first line - QString rxs = quoteEmpty ? "\n" : "\n(?!\\s*\n)"; + QString quoted = "> " + toquote; // quote first line + QString rxs = quoteEmpty ? "\n" : "\n(?!\\s*\n)"; QRegularExpression rx(rxs); // quote following lines quoted.replace(rx, "\n> "); rx.setPattern("> +>"); // compress > > > > quotes to >>>> @@ -207,17 +207,17 @@ QString TextUtil::resolveEntities(const QStringView &in) i = n; // should be n+1, but we'll let the loop increment do it - if (type == QLatin1String{"amp"}) + if (type == QLatin1String { "amp" }) out += '&'; - else if (type == QLatin1String{"lt"}) + else if (type == QLatin1String { "lt" }) out += '<'; - else if (type == QLatin1String{"gt"}) + else if (type == QLatin1String { "gt" }) out += '>'; - else if (type == QLatin1String{"quot"}) + else if (type == QLatin1String { "quot" }) out += '\"'; - else if (type == QLatin1String{"apos"}) + else if (type == QLatin1String { "apos" }) out += '\''; - else if (type == QLatin1String{"nbsp"}) + else if (type == QLatin1String { "nbsp" }) out += char(0xa0); } else { out += in[i]; @@ -301,7 +301,7 @@ static void emojiconifyPlainText(RTParse &p, const QString &in) QLatin1String( R"html()html") #endif - + QStringView{in}.mid(emojisStartIdx, idx - emojisStartIdx).toString() + QLatin1String("")); + + QStringView { in }.mid(emojisStartIdx, idx - emojisStartIdx).toString() + QLatin1String("
")); }; int position; while (std::tie(ref, position) = reg.findEmoji(in, idx), !ref.isEmpty()) { @@ -531,13 +531,13 @@ QString TextUtil::emoticonify(const QString &in) searchAgain = false; // find the closest match - const QRegularExpression &rx = icon->regExp(); - auto match = rx.match(str, iii); + const QRegularExpression &rx = icon->regExp(); + auto match = rx.match(str, iii); if (!match.hasMatch()) continue; - int n = match.capturedStart(); + int n = match.capturedStart(); if (ePos == -1 || n < ePos || (match.capturedLength() > foundLen && n < ePos + foundLen)) { bool leftSpace = n == 0 || (n > 0 && str[n - 1].isSpace()); bool rightSpace = (n + match.capturedLength() == int(str.length())) @@ -585,7 +585,7 @@ QString TextUtil::emoticonify(const QString &in) QString TextUtil::img2title(const QString &in) { - QString ret = in; + QString ret = in; QRegularExpression rxq("]+title\\s*=\\s*'([^']+)'[^>]*>"), rxdq("]+title\\s*=\\s*\"([^\"]+)\"[^>]*>"); ret.replace(rxq, "\\1"); ret.replace(rxdq, "\\1"); @@ -602,9 +602,9 @@ QString TextUtil::legacyFormat(const QString &in) // out=out.replace(QRegularExpression("(^[^<>\\s]*|\\s[^<>\\s]*)_(\\S+)_([^<>\\s]*\\s|[^<>\\s]*$)"),"\\1_\\2_\\3"); QString out = in; - out = out.replace(QRegularExpression("(^|\\s|>)_(\\S+)_(?=<|\\s|$)"), "\\1_\\2_"); // underline inside _text_ - out = out.replace(QRegularExpression("(^|\\s|>)\\*(\\S+)\\*(?=<|\\s|$)"), "\\1*\\2*"); // bold *text* - out = out.replace(QRegularExpression("(^|\\s|>)\\/(\\S+)\\/(?=<|\\s|$)"), "\\1/\\2/"); // italic /text/ + out = out.replace(QRegularExpression("(^|\\s|>)_(\\S+)_(?=<|\\s|$)"), "\\1_\\2_"); // underline inside _text_ + out = out.replace(QRegularExpression("(^|\\s|>)\\*(\\S+)\\*(?=<|\\s|$)"), "\\1*\\2*"); // bold *text* + out = out.replace(QRegularExpression("(^|\\s|>)\\/(\\S+)\\/(?=<|\\s|$)"), "\\1/\\2/"); // italic /text/ return out; } diff --git a/src/theme.h b/src/theme.h index a949056ae..3fe78a2c8 100644 --- a/src/theme.h +++ b/src/theme.h @@ -80,20 +80,20 @@ class Theme { static QByteArray loadData(const QString &fileName, const QString &themePath, bool caseInsensetive = false, bool *loaded = nullptr); QByteArray loadData(const QString &fileName, bool *loaded = nullptr) const; - ResourceLoader * resourceLoader() const; + ResourceLoader *resourceLoader() const; const QString id() const; void setId(const QString &id); - const QString & name() const; + const QString &name() const; void setName(const QString &name); - const QString & version() const; - const QString & description() const; + const QString &version() const; + const QString &description() const; const QStringList &authors() const; - const QString & creation() const; - const QString & homeUrl() const; + const QString &creation() const; + const QString &homeUrl() const; - PsiThemeProvider * themeProvider() const; - const QString & filePath() const; + PsiThemeProvider *themeProvider() const; + const QString &filePath() const; void setFilePath(const QString &f); const QHash info() const; void setInfo(const QHash &i); diff --git a/src/tools/advwidget/advwidget.cpp b/src/tools/advwidget/advwidget.cpp index 46bda3ee1..ee17cb494 100644 --- a/src/tools/advwidget/advwidget.cpp +++ b/src/tools/advwidget/advwidget.cpp @@ -121,8 +121,8 @@ void GAdvancedWidget::Private::posChanging(int *x, int *y, int *width, int *heig bool resizing = p->frameSize() != QSize(*width, *height); - auto parentScreen = p->screen(); - QWidgetList list; + auto parentScreen = p->screen(); + QWidgetList list; if (stickToWindows) list = QApplication::topLevelWidgets(); @@ -273,7 +273,7 @@ void GAdvancedWidget::Private::restoreGeometry() PsiOptions *o = PsiOptions::instance(); QVariant v(o->getOption(geometryOptionPath_)); -#if QT_VERSION < QT_VERSION_CHECK(6,0,0) +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) if (v.type() == QVariant::ByteArray) { #else if (v.typeId() == QVariant::ByteArray) { diff --git a/src/tools/crash/crash_sigsegv.cpp b/src/tools/crash/crash_sigsegv.cpp index 9bc61500a..1306da0f9 100644 --- a/src/tools/crash/crash_sigsegv.cpp +++ b/src/tools/crash/crash_sigsegv.cpp @@ -176,10 +176,10 @@ static char *get_path_from_pid(char *buff, size_t nbuff, pid_t pid) static void sigsegv_libc_dump(int (*myprint)(const char *format, ...)) { - void * array[48] = { 0 }; + void *array[48] = { 0 }; unsigned short i; int n; - char ** res; + char **res; #ifdef HAVE_BACKTRACE (*myprint)("Backtrace:%c", needs_cr ? "\n" : ""); diff --git a/src/tools/iconset/anim.cpp b/src/tools/iconset/anim.cpp index e676cc3ef..d9cea79df 100644 --- a/src/tools/iconset/anim.cpp +++ b/src/tools/iconset/anim.cpp @@ -21,7 +21,7 @@ #include "iconset.h" -//#include +// #include #include #include #include diff --git a/src/tools/iconset/anim.h b/src/tools/iconset/anim.h index 7758fa1f1..faaedce49 100644 --- a/src/tools/iconset/anim.h +++ b/src/tools/iconset/anim.h @@ -37,8 +37,8 @@ class Anim { ~Anim(); const QPixmap &framePixmap() const; - const QImage & frameImage() const; - const Impix & frameImpix() const; + const QImage &frameImage() const; + const Impix &frameImpix() const; bool isNull() const; int frameNumber() const; diff --git a/src/tools/iconset/iconset.cpp b/src/tools/iconset/iconset.cpp index 121458a76..bd6bc5121 100644 --- a/src/tools/iconset/iconset.cpp +++ b/src/tools/iconset/iconset.cpp @@ -203,8 +203,7 @@ class IconSharedObject : public QObject { public: IconSharedObject() #ifdef ICONSET_SOUND - : - QObject(qApp) + : QObject(qApp) #endif { setObjectName("IconSharedObject"); @@ -316,16 +315,16 @@ public slots: void animUpdate() { emit pixmapChanged(); } public: - QString name; + QString name; QRegularExpression regExp; - QList text; - QString sound; - QString mime; + QList text; + QString sound; + QString mime; Impix impix; std::unique_ptr anim; std::shared_ptr svgRenderer; - QIcon * icon = nullptr; + QIcon *icon = nullptr; mutable QByteArray rawData; bool scalable = false; @@ -844,8 +843,8 @@ class IconsetFactoryPrivate : public QObject { } static IconsetFactoryPrivate *instance_; - QList * iconsets_; - mutable QPixmap * emptyPixmap_; + QList *iconsets_; + mutable QPixmap *emptyPixmap_; public: const QPixmap &emptyPixmap() const @@ -1349,53 +1348,59 @@ class Iconset::Private : public QSharedData { }); #ifdef ICONSET_SOUND - loadSuccess = loadSuccess && (sound.isEmpty() || std::any_of(preferredSound.begin(), preferredSound.end(), [&, this](const auto &mime) { - QFileInfo fi(dir); - QString fileName = sound[mime]; - if (!fi.isDir()) { // it is a .zip file then - if (!iconSharedObject) { - iconSharedObject = new IconSharedObject(); - } - - QString path = iconSharedObject->unpackPath; - if (path.isEmpty()) { - qDebug("Iconset::load(): Couldn't load %s (%s) audio for the %s icon for the %s iconset. " - "unpack path is empty", - qPrintable(mime), qPrintable(fileName), qPrintable(name), qPrintable(this->name)); - return false; - } - - QFileInfo ext(fileName); - path += "/" + QCA::Hash("sha1").hashToString(QString(fi.absoluteFilePath() + '/' + fileName).toUtf8()) - + '.' + ext.suffix(); - - QFile file(path); - file.open(QIODevice::WriteOnly); - QDataStream out(&file); - - QByteArray data = this->loadData(fileName, dir); // "this" for compatibility with old gcc - if (data.isEmpty()) { - qDebug("Iconset::load(): Couldn't load %s (%s) audio for the %s icon for the %s iconset. " - "file is empty", - qPrintable(mime), qPrintable(fileName), qPrintable(name), qPrintable(this->name)); - return false; - } - - out.writeRawData(data, data.size()); - icon.setSound(path); - return true; - } else { - QString absFN = fi.absoluteFilePath() + '/' + fileName; - if (QFileInfo(absFN).isReadable()) { - icon.setSound(absFN); - return true; - } - qDebug("Iconset::load(): Couldn't load %s (%s) audio for the %s icon for the %s iconset. " - "not readable", - qPrintable(mime), qPrintable(fileName), qPrintable(name), qPrintable(this->name)); - return false; - } - })); + loadSuccess = loadSuccess + && (sound.isEmpty() + || std::any_of(preferredSound.begin(), preferredSound.end(), [&, this](const auto &mime) { + QFileInfo fi(dir); + QString fileName = sound[mime]; + if (!fi.isDir()) { // it is a .zip file then + if (!iconSharedObject) { + iconSharedObject = new IconSharedObject(); + } + + QString path = iconSharedObject->unpackPath; + if (path.isEmpty()) { + qDebug( + "Iconset::load(): Couldn't load %s (%s) audio for the %s icon for the %s iconset. " + "unpack path is empty", + qPrintable(mime), qPrintable(fileName), qPrintable(name), qPrintable(this->name)); + return false; + } + + QFileInfo ext(fileName); + path += "/" + + QCA::Hash("sha1").hashToString( + QString(fi.absoluteFilePath() + '/' + fileName).toUtf8()) + + '.' + ext.suffix(); + + QFile file(path); + file.open(QIODevice::WriteOnly); + QDataStream out(&file); + + QByteArray data = this->loadData(fileName, dir); // "this" for compatibility with old gcc + if (data.isEmpty()) { + qDebug( + "Iconset::load(): Couldn't load %s (%s) audio for the %s icon for the %s iconset. " + "file is empty", + qPrintable(mime), qPrintable(fileName), qPrintable(name), qPrintable(this->name)); + return false; + } + + out.writeRawData(data, data.size()); + icon.setSound(path); + return true; + } else { + QString absFN = fi.absoluteFilePath() + '/' + fileName; + if (QFileInfo(absFN).isReadable()) { + icon.setSound(absFN); + return true; + } + qDebug("Iconset::load(): Couldn't load %s (%s) audio for the %s icon for the %s iconset. " + "not readable", + qPrintable(mime), qPrintable(fileName), qPrintable(name), qPrintable(this->name)); + return false; + } + })); #endif // construct RegExp diff --git a/src/tools/iconset/iconset.h b/src/tools/iconset/iconset.h index 08265fc0a..18a075502 100644 --- a/src/tools/iconset/iconset.h +++ b/src/tools/iconset/iconset.h @@ -44,12 +44,12 @@ class Impix { bool isNull() const; const QPixmap &pixmap() const; - const QImage & image() const; + const QImage &image() const; void setPixmap(const QPixmap &); void setImage(const QImage &); - operator const QPixmap &() const { return pixmap(); } - operator const QImage &() const { return image(); } + operator const QPixmap &() const { return pixmap(); } + operator const QImage &() const { return image(); } Impix &operator=(const QPixmap &from) { setPixmap(from); @@ -121,7 +121,7 @@ class PsiIcon : public QObject { const QByteArray &raw() const; QSize size(const QSize &desiredSize = QSize()) const; bool isScalable() const; - const QString & mimeType() const; + const QString &mimeType() const; virtual const Impix &impix() const; virtual const Impix &frameImpix() const; @@ -137,7 +137,7 @@ class PsiIcon : public QObject { void setName(const QString &); const QRegularExpression ®Exp() const; - void setRegExp(const QRegularExpression &); + void setRegExp(const QRegularExpression &); struct IconText { IconText(QString _lang, QString _text) : lang(_lang), text(_text) { } @@ -199,14 +199,14 @@ class Iconset { void setIcon(const QString &, const PsiIcon &); void removeIcon(const QString &); - const QString & id() const; - const QString & name() const; - const QString & version() const; - const QString & description() const; + const QString &id() const; + const QString &name() const; + const QString &version() const; + const QString &description() const; const QStringList &authors() const; - const QString & creation() const; - const QString & homeUrl() const; - const int & iconSize() const; + const QString &creation() const; + const QString &homeUrl() const; + const int &iconSize() const; const QString &fileName() const; void setFileName(const QString &); @@ -246,7 +246,7 @@ class IconsetFactory { return iconPixmap(name, QSize(desiredSize, desiredSize)); } - static const PsiIcon * iconPtr(const QString &name); + static const PsiIcon *iconPtr(const QString &name); static const QStringList icons(); static const QByteArray raw(const QString &name); diff --git a/src/tools/iconset/unittest/testiconset.cpp b/src/tools/iconset/unittest/testiconset.cpp index 67595fd36..b49c87b23 100644 --- a/src/tools/iconset/unittest/testiconset.cpp +++ b/src/tools/iconset/unittest/testiconset.cpp @@ -80,9 +80,9 @@ private slots: QVERIFY(chat->anim() != 0); const Anim *anim = chat->anim(); - Anim * copy1 = new Anim(*anim); - Anim * copy2 = new Anim(*copy1); - Anim * copy3 = new Anim(*copy2); + Anim *copy1 = new Anim(*anim); + Anim *copy2 = new Anim(*copy1); + Anim *copy3 = new Anim(*copy2); // at first, all animations should contain 15 frames QCOMPARE(copy3->numFrames(), 15); diff --git a/src/tools/optionstree/optionstest/optionstest.cpp b/src/tools/optionstree/optionstest/optionstest.cpp index 04eb8c6af..f630e2905 100644 --- a/src/tools/optionstree/optionstest/optionstest.cpp +++ b/src/tools/optionstree/optionstest/optionstest.cpp @@ -28,8 +28,7 @@ int main(int argc, char const *argv[]) QVariantList l; l << QVariant(QString("item1")) << qVariantFromValue(QKeySequence("CTRL+L")); QStringList sl; - sl << "String 1" - << "String 2"; + sl << "String 1" << "String 2"; tree.setOption("paris", QVariant(QString("sirap"))); tree.setOption("Benvolio", QVariant(QString("Benvolio"))); diff --git a/src/tools/optionstree/optionstree.cpp b/src/tools/optionstree/optionstree.cpp index acc758216..35764021c 100644 --- a/src/tools/optionstree/optionstree.cpp +++ b/src/tools/optionstree/optionstree.cpp @@ -190,11 +190,11 @@ void OptionsTree::mapPut(const QString &basename, const QVariant &key, const QSt bool mapKeyListLessThanByNumber(const QString &s1, const QString &s2) { int dotpos = s1.lastIndexOf('.'); - if (QStringView{s1}.left(dotpos + 1).compare(QStringView{s2}.left(dotpos + 1)) == 0) { + if (QStringView { s1 }.left(dotpos + 1).compare(QStringView { s2 }.left(dotpos + 1)) == 0) { QString name1 = s1.mid(dotpos + 1), name2 = s2.mid(dotpos + 1); if (name1[0] == 'm' && name2[0] == 'm') { bool ok1 = false, ok2 = false; - unsigned int n1 = QStringView{name1}.mid(1).toUInt(&ok1), n2 = QStringView{name2}.mid(1).toUInt(&ok2); + unsigned int n1 = QStringView { name1 }.mid(1).toUInt(&ok1), n2 = QStringView { name2 }.mid(1).toUInt(&ok2); if (ok1 && ok2) { return n1 < n2; } diff --git a/src/tools/optionstree/optionstreemodel.cpp b/src/tools/optionstree/optionstreemodel.cpp index 3766361b3..fd4bf15cf 100644 --- a/src/tools/optionstree/optionstreemodel.cpp +++ b/src/tools/optionstree/optionstreemodel.cpp @@ -26,7 +26,7 @@ // Enable this if you have Trolltech Labs' ModelTest and are not going // to distribute the source or binary. You need to include modeltest.pri // somewhere too. -//#define HAVE_MODELTEST +// #define HAVE_MODELTEST #ifdef HAVE_MODELTEST #include #endif diff --git a/src/tools/optionstree/optionstreemodel.h b/src/tools/optionstree/optionstreemodel.h index 865dada22..cb60dc49d 100644 --- a/src/tools/optionstree/optionstreemodel.h +++ b/src/tools/optionstree/optionstreemodel.h @@ -65,7 +65,7 @@ protected slots: void optionRemoved(const QString &option); private: - OptionsTree * tree_; + OptionsTree *tree_; bool flat_; mutable QHash indexMap; // option index (seq number) to option.name mapping mutable QHash nameMap; // option.name to option index mapping diff --git a/src/tools/optionstree/optionstreereader.cpp b/src/tools/optionstree/optionstreereader.cpp index 61dfb7e97..7d5571568 100644 --- a/src/tools/optionstree/optionstreereader.cpp +++ b/src/tools/optionstree/optionstreereader.cpp @@ -121,7 +121,7 @@ QStringList OptionsTreeReader::readStringList() break; if (isStartElement()) { - if (name() == QLatin1String{"item"}) { + if (name() == QLatin1String { "item" }) { list << readElementText(); } } @@ -139,7 +139,7 @@ QVariantList OptionsTreeReader::readVariantList() break; if (isStartElement()) { - if (name() == QLatin1String{"item"}) { + if (name() == QLatin1String { "item" }) { list << readVariant(attributes().value("type").toString()); } } @@ -157,9 +157,9 @@ QSize OptionsTreeReader::readSize() break; if (isStartElement()) { - if (name() == QLatin1String{"width"}) { + if (name() == QLatin1String { "width" }) { width = readElementText().toInt(); - } else if (name() == QLatin1String{"height"}) { + } else if (name() == QLatin1String { "height" }) { height = readElementText().toInt(); } } @@ -177,13 +177,13 @@ QRect OptionsTreeReader::readRect() break; if (isStartElement()) { - if (name() == QLatin1String{"width"}) { + if (name() == QLatin1String { "width" }) { width = readElementText().toInt(); - } else if (name() == QLatin1String{"height"}) { + } else if (name() == QLatin1String { "height" }) { height = readElementText().toInt(); - } else if (name() == QLatin1String{"x"}) { + } else if (name() == QLatin1String { "x" }) { x = readElementText().toInt(); - } else if (name() == QLatin1String{"y"}) { + } else if (name() == QLatin1String { "y" }) { y = readElementText().toInt(); } } diff --git a/src/tools/optionstree/optionstreeviewtest/optionstreeviewtest.cpp b/src/tools/optionstree/optionstreeviewtest/optionstreeviewtest.cpp index cf4e5726b..bf9c93a80 100644 --- a/src/tools/optionstree/optionstreeviewtest/optionstreeviewtest.cpp +++ b/src/tools/optionstree/optionstreeviewtest/optionstreeviewtest.cpp @@ -32,9 +32,9 @@ class MyHeaderViewWidget : public QWidget { private: OptionsTree o_; - QTreeView * tv_; + QTreeView *tv_; OptionsTreeModel *tm_; - QCheckBox * cb_; + QCheckBox *cb_; }; int main(int argc, char *argv[]) diff --git a/src/tools/optionstree/unittest/OptionsTreeMainTest.cpp b/src/tools/optionstree/unittest/OptionsTreeMainTest.cpp index f3d9a098e..3492d3a7f 100644 --- a/src/tools/optionstree/unittest/OptionsTreeMainTest.cpp +++ b/src/tools/optionstree/unittest/OptionsTreeMainTest.cpp @@ -40,8 +40,7 @@ private slots: QVariantList l; l << QVariant(QString("item1")) << qVariantFromValue(QKeySequence("CTRL+L")); QStringList sl; - sl << "String 1" - << "String 2"; + sl << "String 1" << "String 2"; l << sl; l << QRect(10, 20, 30, -666); l << l; diff --git a/src/tools/tunecontroller/filetunecontroller.cpp b/src/tools/tunecontroller/filetunecontroller.cpp index 30ee0feaa..a20dfd53b 100644 --- a/src/tools/tunecontroller/filetunecontroller.cpp +++ b/src/tools/tunecontroller/filetunecontroller.cpp @@ -77,7 +77,7 @@ void FileTuneController::check() QFile file(_songFile); if (file.open(QIODevice::ReadOnly)) { QTextStream stream(&file); -#if QT_VERSION < QT_VERSION_CHECK(6,0,0) +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) stream.setCodec("UTF-8"); #else stream.setEncoding(QStringConverter::Utf8); diff --git a/src/tools/tunecontroller/itunestunecontroller.cpp b/src/tools/tunecontroller/itunestunecontroller.cpp index 2b221058a..95f959da2 100644 --- a/src/tools/tunecontroller/itunestunecontroller.cpp +++ b/src/tools/tunecontroller/itunestunecontroller.cpp @@ -36,7 +36,7 @@ static QString CFStringToQString(CFStringRef s) if (s != NULL) { CFIndex length = CFStringGetMaximumSizeForEncoding(CFStringGetLength(s), kCFStringEncodingUTF8) + 1; - char * buffer = new char[length]; + char *buffer = new char[length]; if (CFStringGetCString(s, buffer, length, kCFStringEncodingUTF8)) { result = QString::fromUtf8(buffer); } else { diff --git a/src/tools/tunecontroller/mpristunecontroller.cpp b/src/tools/tunecontroller/mpristunecontroller.cpp index f7419cd56..75115cc25 100644 --- a/src/tools/tunecontroller/mpristunecontroller.cpp +++ b/src/tools/tunecontroller/mpristunecontroller.cpp @@ -28,7 +28,7 @@ * \brief A common controller class for MPRIS compilant players. */ -const char * MPRISTuneController::MPRIS_PREFIX = "org.mpris"; +const char *MPRISTuneController::MPRIS_PREFIX = "org.mpris"; static const QString busName = "SessionBus"; QDBusArgument &operator<<(QDBusArgument &arg, const PlayerStatus &ps) diff --git a/src/tools/tunecontroller/plugins/winamp/third-party/wa_ipc.h b/src/tools/tunecontroller/plugins/winamp/third-party/wa_ipc.h index 248805800..724f081e6 100644 --- a/src/tools/tunecontroller/plugins/winamp/third-party/wa_ipc.h +++ b/src/tools/tunecontroller/plugins/winamp/third-party/wa_ipc.h @@ -503,7 +503,7 @@ typedef struct { typedef struct _prefsDlgRec { HINSTANCE hInst; int dlgID; - void * proc; + void *proc; char *name; int where; // 0 for options, 1 for plugins, 2 for skins, 3 for bookmarks, 4 for prefs @@ -664,7 +664,7 @@ typedef struct { #define IPC_SETPLEDITCOLORS 920 typedef struct { int numElems; - int * elems; + int *elems; HBITMAP bm; // set if you want to override } waSetPlColorsStruct; diff --git a/src/tools/tunecontroller/tunecontrollermanager.cpp b/src/tools/tunecontroller/tunecontrollermanager.cpp index e3f83a7bc..4f0791e87 100644 --- a/src/tools/tunecontroller/tunecontrollermanager.cpp +++ b/src/tools/tunecontroller/tunecontrollermanager.cpp @@ -26,9 +26,9 @@ #include "tunecontroller.h" #include "tunecontrollerplugin.h" +#include #include #include -#include /** * \class TuneControllerManager @@ -128,7 +128,8 @@ bool TuneControllerManager::checkTune(const Tune &tune) const { if (!tuneTitleFilterPattern_.isEmpty() && !tune.name().isEmpty()) { QRegularExpression tuneTitleFilter(tuneTitleFilterPattern_); - if (tuneTitleFilter.isValid() && tuneTitleFilter.match(QLatin1Char('^') + tune.name() + QLatin1Char('^')).hasMatch()) { + if (tuneTitleFilter.isValid() + && tuneTitleFilter.match(QLatin1Char('^') + tune.name() + QLatin1Char('^')).hasMatch()) { return false; } } diff --git a/src/unittest/psipopup/testpsipopup.cpp b/src/unittest/psipopup/testpsipopup.cpp index 4d24d0434..c9dfd0635 100644 --- a/src/unittest/psipopup/testpsipopup.cpp +++ b/src/unittest/psipopup/testpsipopup.cpp @@ -15,8 +15,8 @@ class TestPsiPopup : public QObject { Q_OBJECT private: - PsiCon * psi; - PsiAccount * account; + PsiCon *psi; + PsiAccount *account; bool timeout; QCA::Initializer *qca_init; @@ -66,7 +66,7 @@ private slots: option.ppBorderColor = Qt::blue; option.ppIsOn = true; - PsiPopup * popup = new PsiPopup(PsiPopup::AlertChat, account); + PsiPopup *popup = new PsiPopup(PsiPopup::AlertChat, account); Jid jid("mblsha@jabber.ru"); Resource resource("PowerBook"); UserListItem userListItem; diff --git a/src/userlist.h b/src/userlist.h index 51f69a4b1..c66fdd2cb 100644 --- a/src/userlist.h +++ b/src/userlist.h @@ -22,10 +22,10 @@ #include "activity.h" #include "geolocation.h" -#include "maybe.h" -#include "mood.h" #include "iris/xmpp_liverosteritem.h" #include "iris/xmpp_resource.h" +#include "maybe.h" +#include "mood.h" #include #include @@ -64,7 +64,7 @@ class UserResource : public XMPP::Resource { void setSigTimestamp(const QDateTime &); void setTune(const QString &); - const QString & tune() const; + const QString &tune() const; void setGeoLocation(const GeoLocation &); const GeoLocation &geoLocation() const; // void setPhysicalLocation(const PhysicalLocation&); @@ -115,13 +115,13 @@ class UserListItem : public XMPP::LiveRosterItem { QDateTime lastAvailable() const; int lastMessageType() const; void setLastMessageType(const int mtype); - const QString & presenceError() const; + const QString &presenceError() const; bool isSelf() const; QString makeTip(bool trim = true, bool doLinkify = true) const; QString makeBareTip(bool trim, bool doLinkify) const; QString makeDesc() const; bool isPrivate() const; - const Mood & mood() const; + const Mood &mood() const; QStringList clients() const; QString findClient(const UserResource &ur) const; const Activity &activity() const; @@ -138,16 +138,16 @@ class UserListItem : public XMPP::LiveRosterItem { void setTune(const QString &); void setConference(bool); void setPending(int p, int h); - const QString & tune() const; + const QString &tune() const; void setGeoLocation(const GeoLocation &); const GeoLocation &geoLocation() const; // void setPhysicalLocation(const PhysicalLocation&); // const PhysicalLocation& physicalLocation() const; void setAvatarFactory(AvatarFactory *); - UserResourceList & userResourceList(); + UserResourceList &userResourceList(); UserResourceList::Iterator priority(); - const UserResourceList & userResourceList() const; + const UserResourceList &userResourceList() const; UserResourceList::ConstIterator priority() const; void removeAllResources(); void removeResource(const QString &resource); diff --git a/src/vcardfactory.cpp b/src/vcardfactory.cpp index e21aefb27..60e78712a 100644 --- a/src/vcardfactory.cpp +++ b/src/vcardfactory.cpp @@ -20,12 +20,12 @@ #include "vcardfactory.h" #include "applicationinfo.h" -#include "jidutil.h" -#include "profiles.h" -#include "psiaccount.h" #include "iris/xmpp_client.h" #include "iris/xmpp_tasks.h" #include "iris/xmpp_vcard.h" +#include "jidutil.h" +#include "profiles.h" +#include "psiaccount.h" #include #include diff --git a/src/vcardfactory.h b/src/vcardfactory.h index bf3aab0c8..a77374ad8 100644 --- a/src/vcardfactory.h +++ b/src/vcardfactory.h @@ -67,7 +67,7 @@ private slots: VCardFactory(); ~VCardFactory(); - static VCardFactory * instance_; + static VCardFactory *instance_; const int dictSize_; QStringList vcardList_; QMap vcardDict_; diff --git a/src/vcardphotodlg.h b/src/vcardphotodlg.h index 3aa3d3a16..3285e7675 100644 --- a/src/vcardphotodlg.h +++ b/src/vcardphotodlg.h @@ -11,12 +11,12 @@ class ShowPhotoDlg : public QDialog { ShowPhotoDlg(QWidget *parent, QPixmap &pixmap); private: - QDialog * showPhotoDlg; - QLabel * label; + QDialog *showPhotoDlg; + QLabel *label; QPixmap photoPixmap; QToolBar *toolbar; - QAction * saveAct; - QAction * restoreAct; + QAction *saveAct; + QAction *restoreAct; bool initSize; void createActions(); void updatePhoto(const QSize size); diff --git a/src/voicecalldlg.h b/src/voicecalldlg.h index 8c2d51528..ec76443b5 100644 --- a/src/voicecalldlg.h +++ b/src/voicecalldlg.h @@ -20,8 +20,8 @@ #ifndef VOICECALLDLG_H #define VOICECALLDLG_H -#include "ui_voicecall.h" #include "iris/xmpp_jid.h" +#include "ui_voicecall.h" #include @@ -71,7 +71,7 @@ protected slots: private: Jid jid_; CallStatus status_; - VoiceCaller * voiceCaller_; + VoiceCaller *voiceCaller_; Ui::VoiceCall ui_; }; diff --git a/src/webview.cpp b/src/webview.cpp index d49d1cabd..ddc843b97 100644 --- a/src/webview.cpp +++ b/src/webview.cpp @@ -206,7 +206,7 @@ void WebView::mouseMoveEvent(QMouseEvent *event) if ((event->pos() - dragStartPosition).manhattanLength() < QApplication::startDragDistance()) return; - QDrag * drag = new QDrag(this); + QDrag *drag = new QDrag(this); QMimeData *mimeData = new QMimeData; QString html = TextUtil::img2title(selectedHtml()); @@ -221,7 +221,7 @@ void WebView::convertClipboardHtmlImages(QClipboard::Mode mode) { QClipboard *cb = QApplication::clipboard(); QString html = TextUtil::img2title(selectedHtml()); - QMimeData * data = new QMimeData; + QMimeData *data = new QMimeData; data->setHtml(html); data->setText(TextUtil::rich2plain(html, false)); cb->setMimeData(data, mode); diff --git a/src/whiteboarding/wbdlg.h b/src/whiteboarding/wbdlg.h index e04da46db..0c7d10605 100644 --- a/src/whiteboarding/wbdlg.h +++ b/src/whiteboarding/wbdlg.h @@ -151,8 +151,8 @@ private slots: /*! \brief The menu for widths.*/ QMenu *menu_widths_; /*! \brief The menu for modes.*/ - QMenu * menu_modes_; - QAction * act_color_, *act_fill_; + QMenu *menu_modes_; + QAction *act_color_, *act_fill_; IconAction *act_end_, *act_clear_, *act_save_, *act_geometry_, *act_widths_, *act_modes_; /*! \brief True if the target is a groupchat.*/ bool groupChat_; diff --git a/src/whiteboarding/wbitem.cpp b/src/whiteboarding/wbitem.cpp index ab888d9ed..0b768afd1 100644 --- a/src/whiteboarding/wbitem.cpp +++ b/src/whiteboarding/wbitem.cpp @@ -23,10 +23,10 @@ #include "wbwidget.h" #include +#include #include #include #include -#include #include @@ -142,7 +142,7 @@ void WbItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event) QPointF difference = event->scenePos() - event->lastScenePos(); // qDebug() << QString("d: %1 %2 = %3 %4 + %5 // %6").arg(difference.x()).arg(difference.y()).arg(event->scenePos().x()).arg(event->scenePos().y()).arg(event->lastScenePos().x()).arg(event->lastScenePos().y()); - QPointF p = event->scenePos(); + QPointF p = event->scenePos(); QTransform delta; if (p.x() >= scenePivot.x() && p.y() >= scenePivot.y()) { delta.rotate((-difference.x() + difference.y()) / 2); @@ -180,7 +180,7 @@ void WbItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event) if (!graphicsitem->parentItem() || !graphicsitem->parentItem()->isSelected()) { // get center coordinates in item coordinates - QPointF c = center(); + QPointF c = center(); QTransform translation, delta; // translates the the item's center to the origin of the item coordinates translation.translate(-c.x(), -c.y()); @@ -239,7 +239,7 @@ void WbItem::regenerateTransform() return; // get the existing SVG transformation - QString oldValue = node_.attribute("transform"); + QString oldValue = node_.attribute("transform"); QTransform oldTransform = parseSvgTransform(oldValue); // construct a translation that translates the item to (0,0) in scene coordinates @@ -538,7 +538,7 @@ static QVector parseNumbersList(const QChar *&str) static QTransform parseTransformationMatrix(const QString &value) { - QTransform matrix; + QTransform matrix; const QChar *str = value.constData(); while (*str != QLatin1Char(0)) { diff --git a/src/whiteboarding/wbnewpath.cpp b/src/whiteboarding/wbnewpath.cpp index cbb4fbf41..d2a494bdf 100644 --- a/src/whiteboarding/wbnewpath.cpp +++ b/src/whiteboarding/wbnewpath.cpp @@ -26,8 +26,7 @@ #include WbNewPath::WbNewPath(QGraphicsScene *s, QPointF startPos, int strokeWidth, const QColor &strokeColor, - const QColor &fillColor) : - WbNewItem(s) + const QColor &fillColor) : WbNewItem(s) { controlPoint_ = nullptr; diff --git a/src/whiteboarding/wbnewpath.h b/src/whiteboarding/wbnewpath.h index 1100f8c65..a9323aa6f 100644 --- a/src/whiteboarding/wbnewpath.h +++ b/src/whiteboarding/wbnewpath.h @@ -35,7 +35,7 @@ class WbNewPath : public WbNewItem { private: QGraphicsPathItem graphicsitem_; - QPointF * controlPoint_; + QPointF *controlPoint_; }; #endif // WBNEWPATH_H diff --git a/src/whiteboarding/wbscene.h b/src/whiteboarding/wbscene.h index aa7128214..d10a9a736 100644 --- a/src/whiteboarding/wbscene.h +++ b/src/whiteboarding/wbscene.h @@ -72,7 +72,7 @@ public slots: */ void bring(int n, bool toExtremum); - SxeSession * session_; + SxeSession *session_; QList> pendingTranformations_; QPointF selectionCenter_; diff --git a/src/widgets/actionlineedit.cpp b/src/widgets/actionlineedit.cpp index b957222b2..889f313b7 100644 --- a/src/widgets/actionlineedit.cpp +++ b/src/widgets/actionlineedit.cpp @@ -92,7 +92,7 @@ void ActionLineEditButton::paintEvent(QPaintEvent *event) Q_UNUSED(event) QPainter painter(this); - ActionLineEdit * p = static_cast(parent()); + ActionLineEdit *p = static_cast(parent()); Qt::ToolButtonStyle tbs = p->toolButtonStyle(); int lpos = 0; // int h = height(); @@ -113,7 +113,7 @@ void ActionLineEditButton::paintEvent(QPaintEvent *event) QSize ActionLineEditButton::sizeHint() const { - ActionLineEdit * p = static_cast(parent()); + ActionLineEdit *p = static_cast(parent()); Qt::ToolButtonStyle tbs = p->toolButtonStyle(); int w = 0, h = p->height(); int ih = static_cast(parent())->minimumSizeHint().height() * IconScaleFactor; @@ -142,7 +142,7 @@ ActionLineEdit::ActionLineEdit(QWidget *parent) : QLineEdit(parent), toolButtonS ActionLineEditButton *ActionLineEdit::widgetForAction(QAction *action) { - QHBoxLayout * lo = static_cast(layout()); + QHBoxLayout *lo = static_cast(layout()); ActionLineEditButton *btn; for (int i = 1, count = lo->count(); i < count; i++) { btn = static_cast(lo->itemAt(i)->widget()); @@ -155,8 +155,8 @@ ActionLineEditButton *ActionLineEdit::widgetForAction(QAction *action) void ActionLineEdit::actionEvent(QActionEvent *event) { - QHBoxLayout * lo = static_cast(layout()); - QAction * act = event->action(); + QHBoxLayout *lo = static_cast(layout()); + QAction *act = event->action(); ActionLineEditButton *btn; if (event->type() == QEvent::ActionAdded) { btn = new ActionLineEditButton(this); diff --git a/src/widgets/emojidb.cpp b/src/widgets/emojidb.cpp index cc26cdf23..9bbbd5c5d 100644 --- a/src/widgets/emojidb.cpp +++ b/src/widgets/emojidb.cpp @@ -8175,4 +8175,3 @@ static std::map ranges = { }; // clang-format on - diff --git a/src/widgets/emojiregistry.cpp b/src/widgets/emojiregistry.cpp index e9ef001b6..e21629b3e 100644 --- a/src/widgets/emojiregistry.cpp +++ b/src/widgets/emojiregistry.cpp @@ -19,8 +19,8 @@ #include -#include "emojiregistry.h" #include "emojidb.cpp" +#include "emojiregistry.h" const EmojiRegistry &EmojiRegistry::instance() { @@ -85,7 +85,7 @@ int EmojiRegistry::count() const return count; } -std::pair EmojiRegistry::findEmoji(const QString &in, int idx) const +std::pair EmojiRegistry::findEmoji(const QString &in, int idx) const { int emojiStart = -1; @@ -93,7 +93,7 @@ std::pair EmojiRegistry::findEmoji(const QString &in, int idx) bool gotSkin = false; bool gotFQ = false; for (; idx < in.size(); idx++) { - auto category = startCategory(QStringView{in}.mid(idx, in.size() - idx)); + auto category = startCategory(QStringView { in }.mid(idx, in.size() - idx)); if (gotEmoji && category != Category::None) { if (category == Category::ZWJ) { // zero-width joiner gotEmoji = false; @@ -130,7 +130,8 @@ std::pair EmojiRegistry::findEmoji(const QString &in, int idx) if (in[idx].isHighSurrogate()) idx++; } - return emojiStart == -1 ? std::make_pair(QStringView(),-1) : std::make_pair(QStringView{in}.mid(emojiStart, idx - emojiStart), emojiStart); + return emojiStart == -1 ? std::make_pair(QStringView(), -1) + : std::make_pair(QStringView { in }.mid(emojiStart, idx - emojiStart), emojiStart); } EmojiRegistry::EmojiRegistry() : groups(std::move(db)), ranges_(std::move(ranges)) { } diff --git a/src/widgets/emojiregistry.h b/src/widgets/emojiregistry.h index 8cb1a4f03..4ea6630b0 100644 --- a/src/widgets/emojiregistry.h +++ b/src/widgets/emojiregistry.h @@ -72,7 +72,7 @@ class EmojiRegistry { return other.group_idx != group_idx || other.subgroup_idx != subgroup_idx || other.emoji_idx != emoji_idx; } - iterator & operator++(); + iterator &operator++(); const EmojiRegistry::Emoji &operator*() const { return EmojiRegistry::instance().groups[group_idx].subGroups[subgroup_idx].emojis[emoji_idx]; @@ -84,7 +84,7 @@ class EmojiRegistry { private: EmojiRegistry(); - EmojiRegistry(const EmojiRegistry &) = delete; + EmojiRegistry(const EmojiRegistry &) = delete; EmojiRegistry &operator=(const EmojiRegistry &) = delete; const std::map ranges_; // start to end range mapping diff --git a/src/widgets/fancylabel.cpp b/src/widgets/fancylabel.cpp index ab174832b..8522d5306 100644 --- a/src/widgets/fancylabel.cpp +++ b/src/widgets/fancylabel.cpp @@ -45,7 +45,7 @@ class IconLabel::Private : public QObject { public: IconLabel *label; - PsiIcon * icon; + PsiIcon *icon; bool copyIcon; #ifdef WIDGET_PLUGIN QString iconName; @@ -240,7 +240,7 @@ class MyFancyFrame : public QFrame { class FancyLabel::Private : public QObject { public: MyFancyFrame *frame; - IconLabel * text, *help, *pix; + IconLabel *text, *help, *pix; QColor from, to, font; QString textStr, helpStr; static int smallFontSize; diff --git a/src/widgets/fancylabel.h b/src/widgets/fancylabel.h index faeb42371..2b7eedf39 100644 --- a/src/widgets/fancylabel.h +++ b/src/widgets/fancylabel.h @@ -50,9 +50,9 @@ class FancyLabel : public QWidget { const QString &text() const; const QString &help() const; QPixmap pixmap() const; - const QColor & colorFrom() const; - const QColor & colorTo() const; - const QColor & colorFont() const; + const QColor &colorFrom() const; + const QColor &colorTo() const; + const QColor &colorFont() const; const PsiIcon *psiIcon() const; QString psiIconName() const; void setText(const QString &); diff --git a/src/widgets/fancypopup.cpp b/src/widgets/fancypopup.cpp index e34b215b7..7ffe979a4 100644 --- a/src/widgets/fancypopup.cpp +++ b/src/widgets/fancypopup.cpp @@ -20,19 +20,19 @@ #include "fancypopup.h" #include "fancylabel.h" -//#include "iconlabel.h" +// #include "iconlabel.h" #include "iconset.h" #include "psioptions.h" #include "psitooltip.h" #include "ui_fancypopup.h" #include -//#include +// #include #include #include +#include #include #include -#include #define BUTTON_WIDTH 16 #define BUTTON_HEIGHT 14 @@ -110,7 +110,7 @@ public slots: QList prevPopups; // QBoxLayout *layout; FancyPopup *popup; - QTimer * hideTimer; + QTimer *hideTimer; Ui::Frame ui_; }; diff --git a/src/widgets/iconaction.cpp b/src/widgets/iconaction.cpp index 79838a16d..da295c9a6 100644 --- a/src/widgets/iconaction.cpp +++ b/src/widgets/iconaction.cpp @@ -42,7 +42,7 @@ class IconAction::Private : public QObject { Q_OBJECT public: QList buttons; - PsiIcon * icon; + PsiIcon *icon; #ifdef WIDGET_PLUGIN QString iconName; #endif @@ -88,8 +88,7 @@ IconAction::IconAction(QObject *parent, const QString &name) : QAction(parent) } IconAction::IconAction(const QString &statusTip, const QString &icon, const QString &text, QKeySequence accel, - QObject *parent, const QString &name, bool checkable) : - QAction(text, parent) + QObject *parent, const QString &name, bool checkable) : QAction(text, parent) { d = new Private(this, parent); d->init(name, statusTip, accel, checkable); @@ -98,8 +97,7 @@ IconAction::IconAction(const QString &statusTip, const QString &icon, const QStr } IconAction::IconAction(const QString &statusTip, const QString &icon, const QString &text, QList accel, - QObject *parent, const QString &name, bool checkable) : - QAction(text, parent) + QObject *parent, const QString &name, bool checkable) : QAction(text, parent) { d = new Private(this, parent); d->init(name, statusTip, QKeySequence(), checkable); @@ -109,16 +107,14 @@ IconAction::IconAction(const QString &statusTip, const QString &icon, const QStr } IconAction::IconAction(const QString &statusTip, const QString &text, QKeySequence accel, QObject *parent, - const QString &name, bool checkable) : - QAction(text, parent) + const QString &name, bool checkable) : QAction(text, parent) { d = new Private(this, parent); d->init(name, statusTip, accel, checkable); } IconAction::IconAction(const QString &statusTip, const QString &text, QList accel, QObject *parent, - const QString &name, bool checkable) : - QAction(text, parent) + const QString &name, bool checkable) : QAction(text, parent) { d = new Private(this, parent); d->init(name, statusTip, QKeySequence(), checkable); @@ -371,7 +367,7 @@ class IconActionGroup::Private : public QObject { explicit Private(IconActionGroup *_group) { group = _group; } IconActionGroup *group = nullptr; - QMenu * popup = nullptr; + QMenu *popup = nullptr; bool exclusive = false; bool usesDropDown = false; diff --git a/src/widgets/iconselect.cpp b/src/widgets/iconselect.cpp index 2b63fc1df..870025d1a 100644 --- a/src/widgets/iconselect.cpp +++ b/src/widgets/iconselect.cpp @@ -29,12 +29,12 @@ #include #include #include +#include #include #include #include #include #include -#include #include @@ -136,7 +136,7 @@ class IconSelectButton : public QAbstractButton { } } -#if QT_VERSION < QT_VERSION_CHECK(6,0,0) +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) void enterEvent(QEvent *) #else void enterEvent(QEnterEvent *) @@ -207,7 +207,7 @@ class IconSelect : public QWidget { private: IconSelectPopup *menu; Iconset is; - QGridLayout * grid; + QGridLayout *grid; bool shown; bool emojiSorting; @@ -269,7 +269,7 @@ void IconSelect::closeMenu() void IconSelect::createLayout() { Q_ASSERT(!grid); - grid = new QGridLayout(this); + grid = new QGridLayout(this); auto margin = style()->pixelMetric(QStyle::PM_MenuPanelWidth, nullptr, this); grid->setContentsMargins(margin, margin, margin, margin); grid->setSpacing(1); @@ -448,9 +448,9 @@ class IconSelectPopup::Private : public QObject { Private(IconSelectPopup *parent) : QObject(parent), parent_(parent), icsel_(nullptr), widgetAction_(nullptr) { } IconSelectPopup *parent_; - IconSelect * icsel_; - QWidgetAction * widgetAction_; - QScrollArea * scrollArea_; + IconSelect *icsel_; + QWidgetAction *widgetAction_; + QScrollArea *scrollArea_; public slots: void updatedGeometry() diff --git a/src/widgets/iconwidget.cpp b/src/widgets/iconwidget.cpp index 43d5f1f8b..be19fc7ba 100644 --- a/src/widgets/iconwidget.cpp +++ b/src/widgets/iconwidget.cpp @@ -207,9 +207,9 @@ class IconWidgetDelegate : public QAbstractItemDelegate { if (option.state & QStyle::State_HasFocus) { QStyleOptionFocusRect o; - o.QStyleOption:: operator=(option); - QRect r = option.rect; - QPoint margin(1, 1); + o.QStyleOption::operator=(option); + QRect r = option.rect; + QPoint margin(1, 1); o.rect = QRect(r.topLeft() + margin, r.bottomRight() - margin); o.state |= QStyle::State_KeyboardFocusChange; o.backgroundColor = option.palette.color( @@ -520,7 +520,7 @@ void IconsetDisplay::setIconset(const Iconset &iconset) class IconButton::Private : public QObject { Q_OBJECT public: - PsiIcon * icon; + PsiIcon *icon; IconButton *button; bool textVisible; bool activate, forced; @@ -673,7 +673,7 @@ void IconButton::setTextVisible(bool v) class IconToolButton::Private : public QObject { Q_OBJECT public: - PsiIcon * icon; + PsiIcon *icon; IconToolButton *button; bool activate; #ifdef WIDGET_PLUGIN diff --git a/src/widgets/psirichtext.cpp b/src/widgets/psirichtext.cpp index 1ecb43e5b..226c0039f 100644 --- a/src/widgets/psirichtext.cpp +++ b/src/widgets/psirichtext.cpp @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include @@ -283,7 +282,7 @@ static QStringView preserveOriginalObjectReplacementCharacters(const QStringView static QString convertIconsToObjectReplacementCharacters(const QStringView &text, TextCharFormatQueue *queue, int insertedAfter, const PsiRichText::ParsersMap &parsers) { - QString result; + QString result; QStringView work(text); int start = -1; @@ -292,7 +291,7 @@ static QString convertIconsToObjectReplacementCharacters(const QStringView &text start = work.indexOf(QLatin1Char('<'), start + 1); if (start == -1) break; - if (work.mid(start + 1, 4) == QLatin1String{"icon"}) { + if (work.mid(start + 1, 4) == QLatin1String { "icon" }) { // Format: static QRegularExpression rxName("name=\"([^\"]+)\""); static QRegularExpression rxText("text=\"([^\"]+)\""); @@ -300,11 +299,11 @@ static QString convertIconsToObjectReplacementCharacters(const QStringView &text result += preserveOriginalObjectReplacementCharacters(work.left(start), queue); - int end = work.indexOf(QLatin1Char{'>'}, start); + int end = work.indexOf(QLatin1Char { '>' }, start); Q_ASSERT(end != -1); QStringView fragment = work.mid(start, end - start); - auto matchName = rxName.match(fragment); + auto matchName = rxName.match(fragment); if (matchName.hasMatch()) { #ifndef WIDGET_PLUGIN QString iconName = TextUtil::unescape(matchName.capturedTexts().at(1)); @@ -341,18 +340,17 @@ static QString convertIconsToObjectReplacementCharacters(const QStringView &text // if parsers key matches with html element name result += preserveOriginalObjectReplacementCharacters(work.left(start), queue); - int end = work.indexOf(QLatin1Char{'>'}, start); + int end = work.indexOf(QLatin1Char { '>' }, start); Q_ASSERT(end != -1); // take attributes part of the tag - auto fragment = work.mid(start + it.key().length() + 1, end - start - it.key().length() - 1); - QString replaceHtml; + auto fragment = work.mid(start + it.key().length() + 1, end - start - it.key().length() - 1); + QString replaceHtml; QTextCharFormat charFormat; std::tie(charFormat, replaceHtml) = it.value()(fragment, insertedAfter); if (replaceHtml.size()) { - result += convertIconsToObjectReplacementCharacters(replaceHtml, queue, - insertedAfter, parsers); + result += convertIconsToObjectReplacementCharacters(replaceHtml, queue, insertedAfter, parsers); } if (charFormat.isValid()) { queue->enqueue(new QTextCharFormat(charFormat)); @@ -413,8 +411,8 @@ static void appendTextHelper(QTextDocument *doc, QString text, QTextCursor &curs // prepare images and remove insecure images static QRegularExpression imgRe("]+src\\s*=\\s*(\"[^\"]*\"|'[^']*')[^>]*>"); - QString replace; - QRegularExpressionMatch match; + QString replace; + QRegularExpressionMatch match; for (int pos = 0; (match = imgRe.match(text, pos)).hasMatch();) { replace.clear(); QString imgSrc = match.captured(1).mid(1, match.captured(1).size() - 2); @@ -422,7 +420,7 @@ static void appendTextHelper(QTextDocument *doc, QString text, QTextCursor &curs if (imgSrcUrl.isValid()) { if (imgSrcUrl.scheme() == "data") { static QRegularExpression dataRe("^[a-zA-Z]+/[a-zA-Z]+;base64,([a-zA-Z0-9/=+%]+)$"); - auto dataMatch = dataRe.match(imgSrcUrl.path()); + auto dataMatch = dataRe.match(imgSrcUrl.path()); if (dataMatch.hasMatch()) { const QByteArray ba = QByteArray::fromBase64(dataMatch.captured(1).toLatin1()); if (!ba.isNull()) { diff --git a/src/widgets/psirichtext.h b/src/widgets/psirichtext.h index 1f9583395..bcec5cac0 100644 --- a/src/widgets/psirichtext.h +++ b/src/widgets/psirichtext.h @@ -46,7 +46,7 @@ class PsiRichText { static QTextCharFormat markerFormat(const QString &uniqueId); static void insertMarker(QTextCursor &cursor, const QString &uniqueId); static QTextCursor findMarker(const QTextCursor &cursor, - const QString & uniqueId); // will modify cursor to stay right after marker. + const QString &uniqueId); // will modify cursor to stay right after marker. struct Selection { int start, end; diff --git a/src/widgets/psitabwidget.cpp b/src/widgets/psitabwidget.cpp index a7e71f3a1..d4a0d98a0 100644 --- a/src/widgets/psitabwidget.cpp +++ b/src/widgets/psitabwidget.cpp @@ -46,17 +46,16 @@ PsiTabWidget::PsiTabWidget(QWidget *parent) : QWidget(parent) tabBar_->setUsesScrollButtons(!multiRow); tabBar_->setCurrentIndexAlwaysAtBottom(currentIndexAlwaysAtBottom); layout_ = new QVBoxLayout(this); - layout_->setContentsMargins(0,0,0,0); + layout_->setContentsMargins(0, 0, 0, 0); layout_->setSpacing(0); barLayout_ = new QHBoxLayout; layout_->addLayout(barLayout_); - barLayout_->setContentsMargins(0,0,0,0); + barLayout_->setContentsMargins(0, 0, 0, 0); barLayout_->setSpacing(0); barLayout_->addWidget(tabBar_, 2); barLayout_->setAlignment(Qt::AlignLeft); - int buttonwidth = qMax(tabBar_->style()->pixelMetric(QStyle::PM_TabBarScrollButtonWidth, nullptr, tabBar_), - 16); + int buttonwidth = qMax(tabBar_->style()->pixelMetric(QStyle::PM_TabBarScrollButtonWidth, nullptr, tabBar_), 16); downButton_ = new QToolButton(this); downButton_->setMinimumSize(3, 3); diff --git a/src/widgets/psitabwidget.h b/src/widgets/psitabwidget.h index 235bad422..fa3f95b58 100644 --- a/src/widgets/psitabwidget.h +++ b/src/widgets/psitabwidget.h @@ -99,14 +99,14 @@ private slots: private: QVector widgets_; - PsiTabBar * tabBar_; - QVBoxLayout * layout_; - QHBoxLayout * barLayout_; - QStackedLayout * stacked_; - QToolButton * closeButton_; - QToolButton * downButton_; + PsiTabBar *tabBar_; + QVBoxLayout *layout_; + QHBoxLayout *barLayout_; + QStackedLayout *stacked_; + QToolButton *closeButton_; + QToolButton *downButton_; QTabWidget::TabPosition tabsPosition_; - QMenu * menu_; + QMenu *menu_; }; #endif // PSITABWIDGET_H diff --git a/src/widgets/psitextview.cpp b/src/widgets/psitextview.cpp index b7ce13eaa..9ebc70269 100644 --- a/src/widgets/psitextview.cpp +++ b/src/widgets/psitextview.cpp @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -50,7 +49,7 @@ class PsiTextView::Private : public QObject { QString anchorOnMousePress; bool hadSelectionOnMousePress = false; FileSharingDeviceOpener *mediaOpener = nullptr; - ITEAudioController * voiceMsgCtrl = nullptr; + ITEAudioController *voiceMsgCtrl = nullptr; // handler function accepts everything after tag name upto but exluding final ">" PsiRichText::ParsersMap objectParsers; @@ -220,15 +219,15 @@ PsiTextView::~PsiTextView() QMenu *PsiTextView::createStandardContextMenu(const QPoint &position) { QTextCursor textcursor = cursorForPosition(position); - QMenu * menu; + QMenu *menu; QString anc = anchorAt(position); if (!anc.isEmpty()) { menu = URLObject::getInstance()->createPopupMenu(anc); int posInBlock = textcursor.position() - textcursor.block().position(); QString textblock = textcursor.block().text(); - int begin = textcursor.block().position() + textblock.lastIndexOf(QRegularExpression("\\s|^"), posInBlock) + 1; - int end = textcursor.block().position() + textblock.indexOf(QRegularExpression("\\s|$"), posInBlock); + int begin = textcursor.block().position() + textblock.lastIndexOf(QRegularExpression("\\s|^"), posInBlock) + 1; + int end = textcursor.block().position() + textblock.indexOf(QRegularExpression("\\s|$"), posInBlock); textcursor.setPosition(begin); textcursor.setPosition(end, QTextCursor::KeepAnchor); setTextCursor(textcursor); @@ -251,7 +250,7 @@ bool PsiTextView::isSelectedBlock() { if (textCursor().hasSelection()) { const QTextCursor &cursor = textCursor(); - const QTextBlock & block = cursor.block(); + const QTextBlock &block = cursor.block(); int start = cursor.selectionStart(); if (block.position() == start && block.length() == cursor.selectionEnd() - start + 1) return true; @@ -376,7 +375,7 @@ void PsiTextView::mousePressEvent(QMouseEvent *e) if (!textCursor().hasSelection() && !d->anchorOnMousePress.isEmpty()) { QTextCursor cursor = textCursor(); QPoint mapped = QPoint(e->pos().x() + horizontalScrollBar()->value(), - e->pos().y() + verticalScrollBar()->value()); // from QTextEditPrivate::mapToContents + e->pos().y() + verticalScrollBar()->value()); // from QTextEditPrivate::mapToContents const int cursorPos = document()->documentLayout()->hitTest(mapped, Qt::FuzzyHit); if (cursorPos != -1) cursor.setPosition(cursorPos); diff --git a/src/widgets/psitiplabel.cpp b/src/widgets/psitiplabel.cpp index 533d72ba1..23bbb5a23 100644 --- a/src/widgets/psitiplabel.cpp +++ b/src/widgets/psitiplabel.cpp @@ -206,7 +206,7 @@ void PsiTipLabel::hideTip() deleteTimer.start(250, this); } -#if QT_VERSION < QT_VERSION_CHECK(6,0,0) +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) void PsiTipLabel::enterEvent(QEvent *e) #else void PsiTipLabel::enterEvent(QEnterEvent *e) diff --git a/src/widgets/psitiplabel.h b/src/widgets/psitiplabel.h index 4b17b66a7..2609d090d 100644 --- a/src/widgets/psitiplabel.h +++ b/src/widgets/psitiplabel.h @@ -29,7 +29,7 @@ class PsiTipLabel : public QFrame { void hideTip(); protected: -#if QT_VERSION < QT_VERSION_CHECK(6,0,0) +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) void enterEvent(QEvent *e); #else void enterEvent(QEnterEvent *e); diff --git a/src/widgets/psitooltip.cpp b/src/widgets/psitooltip.cpp index 492715a1e..7293846c5 100644 --- a/src/widgets/psitooltip.cpp +++ b/src/widgets/psitooltip.cpp @@ -23,7 +23,7 @@ #include "psitiplabel.h" #include -//#include +// #include #include #include #include diff --git a/src/widgets/psitooltip.h b/src/widgets/psitooltip.h index ab8ea73d3..0fee0f591 100644 --- a/src/widgets/psitooltip.h +++ b/src/widgets/psitooltip.h @@ -51,7 +51,7 @@ class PsiToolTip : public QObject { void doShowText(const QPoint &pos, const QString &text, const QWidget *w = nullptr); void doInstall(QWidget *w); virtual ToolTipPosition *createTipPosition(const QPoint &cursorPos, const QWidget *parentWidget); - virtual PsiTipLabel * createTipLabel(const QString &text, QWidget *parent); + virtual PsiTipLabel *createTipLabel(const QString &text, QWidget *parent); virtual bool moveAndUpdateTipLabel(PsiTipLabel *label, const QString &text); virtual void updateTipLabel(PsiTipLabel *label, const QString &text); diff --git a/src/widgets/tabbar.cpp b/src/widgets/tabbar.cpp index c72d9e6ea..ec2da70ae 100644 --- a/src/widgets/tabbar.cpp +++ b/src/widgets/tabbar.cpp @@ -24,7 +24,7 @@ #include #include -//#include +// #include #include #include #include @@ -44,13 +44,13 @@ class CloseButton : public QAbstractButton { QSize sizeHint() const; inline QSize minimumSizeHint() const { return sizeHint(); } -#if QT_VERSION < QT_VERSION_CHECK(6,0,0) +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) void enterEvent(QEvent *e); #else void enterEvent(QEnterEvent *e); #endif - void leaveEvent(QEvent *event); - void paintEvent(QPaintEvent *event); + void leaveEvent(QEvent *event); + void paintEvent(QPaintEvent *event); }; struct RowSf { @@ -72,7 +72,7 @@ class TabBar::Private { void balanseCloseButtons(); bool indexAtBottom(int index) const; - TabBar * q; + TabBar *q; QVector hackedTabs; QVector closeButtons; bool tabsClosable; @@ -142,7 +142,7 @@ LayoutSf possibleLayouts2(const QList &tabs, int barWidth, int rows, double pLayout += rows; } - int * pGoodLayout = nullptr; + int *pGoodLayout = nullptr; double minDSf = 10000.; // Just huge number for (pPrevLayout = &layouts[0]; pPrevLayout < pLayout; pPrevLayout += rows) { @@ -283,7 +283,9 @@ void TabBar::Private::layoutTabs() tab.rect.setSize(tabSizeHint(tab)); // Make pinned tab if need if (i < pinnedTabs) { - tab.text = tab.text.left(QStringView{tab.text}.left(PINNED_CHARS).contains(QLatin1Char{'&'}) ? (PINNED_CHARS + 1) : PINNED_CHARS); + tab.text = tab.text.left(QStringView { tab.text }.left(PINNED_CHARS).contains(QLatin1Char { '&' }) + ? (PINNED_CHARS + 1) + : PINNED_CHARS); tab.rect.setWidth(pinnedTabWidth); } hackedTabs << tab; @@ -1226,7 +1228,7 @@ QSize CloseButton::sizeHint() const return { width, height }; } -#if QT_VERSION < QT_VERSION_CHECK(6,0,0) +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) void CloseButton::enterEvent(QEvent *event) #else void CloseButton::enterEvent(QEnterEvent *event) diff --git a/src/widgets/thumbnailtoolbar.h b/src/widgets/thumbnailtoolbar.h index a8624e22f..d3ae87f87 100644 --- a/src/widgets/thumbnailtoolbar.h +++ b/src/widgets/thumbnailtoolbar.h @@ -42,6 +42,6 @@ class PsiThumbnailToolBar : public QWinThumbnailToolBar { QWinThumbnailToolButton *onlineStatusBtn_; QWinThumbnailToolButton *offlineStatusBtn_; QWinThumbnailToolButton *eventsBtn_; - QWinTaskbarButton * taskbarBtn_; + QWinTaskbarButton *taskbarBtn_; }; #endif // THUMBNAIL_TOOLBAR_H diff --git a/src/widgets/typeaheadfind.cpp b/src/widgets/typeaheadfind.cpp index 4be645bc9..cfe6b6266 100644 --- a/src/widgets/typeaheadfind.cpp +++ b/src/widgets/typeaheadfind.cpp @@ -125,8 +125,8 @@ class TypeAheadFindBar::Private { WebView *wv; #endif QLineEdit *le_find; - QAction * act_prev; - QAction * act_next; + QAction *act_prev; + QAction *act_next; QCheckBox *cb_case; }; diff --git a/src/widgets/urlobject.h b/src/widgets/urlobject.h index 1d83c465a..3cba80c70 100644 --- a/src/widgets/urlobject.h +++ b/src/widgets/urlobject.h @@ -39,7 +39,7 @@ class URLObject : public QObject { public: static URLObject *getInstance(); - QMenu * createPopupMenu(const QString &lnk); + QMenu *createPopupMenu(const QString &lnk); void popupAction(QString lnk); diff --git a/src/x11windowsystem.cpp b/src/x11windowsystem.cpp index 79da3910d..8d18e75b3 100644 --- a/src/x11windowsystem.cpp +++ b/src/x11windowsystem.cpp @@ -1,6 +1,6 @@ #include "x11windowsystem.h" -#if QT_VERSION < QT_VERSION_CHECK(6,0,0) +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) #include #else #include @@ -11,11 +11,11 @@ const long MAX_PROP_SIZE = 100000; X11WindowSystem *X11WindowSystem::_instance = nullptr; - namespace { -bool isPlatformX11() { -#if QT_VERSION < QT_VERSION_CHECK(6,0,0) +bool isPlatformX11() +{ +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) return QX11Info::isPlatformX11()); #else auto x11app = qApp->nativeInterface(); @@ -40,7 +40,7 @@ static bool getCardinal32Prop(Display *display, Window win, char *propName, long Atom nameAtom, typeAtom, actual_type_return; int actual_format_return, result; unsigned long nitems_return, bytes_after_return; - long * result_array = nullptr; + long *result_array = nullptr; nameAtom = XInternAtom(display, propName, False); typeAtom = XInternAtom(display, "CARDINAL", False); @@ -49,7 +49,7 @@ static bool getCardinal32Prop(Display *display, Window win, char *propName, long return false; } - // Try to get the property + // Try to get the property result = XGetWindowProperty(display, win, nameAtom, 0, 1, False, typeAtom, &actual_type_return, &actual_format_return, &nitems_return, &bytes_after_return, reinterpret_cast(&result_array)); @@ -70,8 +70,9 @@ static bool getCardinal32Prop(Display *display, Window win, char *propName, long return true; } -auto getDisplay() { -#if QT_VERSION < QT_VERSION_CHECK(6,0,0) +auto getDisplay() +{ +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) return QX11Info::display()); #else auto x11app = qApp->nativeInterface(); @@ -79,8 +80,9 @@ auto getDisplay() { #endif } -auto getRootWindow() { -#if QT_VERSION < QT_VERSION_CHECK(6,0,0) +auto getRootWindow() +{ +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) return QX11Info::appRootWindow(); #else auto x11app = qApp->nativeInterface(); @@ -90,9 +92,7 @@ auto getRootWindow() { } -bool X11WindowSystem::isValid() const { - return ::isPlatformX11(); -} +bool X11WindowSystem::isValid() const { return ::isPlatformX11(); } void X11WindowSystem::x11wmClass(WId wid, QString resName) { @@ -103,7 +103,7 @@ void X11WindowSystem::x11wmClass(WId wid, QString resName) if (!isValid()) // Avoid crashes if launched in Wayland return; - Display *dsp = getDisplay(); // get the display + Display *dsp = getDisplay(); // get the display // WId win = winId(); // get the window XClassHint classhint; // class hints // Get old class hint. It is important to save old class name @@ -112,7 +112,7 @@ void X11WindowSystem::x11wmClass(WId wid, QString resName) const QByteArray latinResName = resName.toLatin1(); classhint.res_name = const_cast(latinResName.data()); // res_name - XSetClassHint(dsp, wid, &classhint); // set the class hints + XSetClassHint(dsp, wid, &classhint); // set the class hints XFree(classhint.res_class); } @@ -227,7 +227,7 @@ QRect X11WindowSystem::windowRect(Window win) Window w_unused; int x, y; unsigned int w, h, junk; - Display *display = getDisplay(); + Display *display = getDisplay(); XGetGeometry(display, win, &w_unused, &x, &y, &w, &h, &junk, &junk); XTranslateCoordinates(display, win, getRootWindow(), 0, 0, &x, &y, &w_unused); @@ -237,8 +237,8 @@ QRect X11WindowSystem::windowRect(Window win) unsigned long nitems_ret, unused; const Atom XA_CARDINAL = Atom(6); if (net_frame_extents != None - && XGetWindowProperty(display, win, net_frame_extents, 0l, 4l, False, XA_CARDINAL, &type_ret, - &format_ret, &nitems_ret, &unused, &data_ret) + && XGetWindowProperty(display, win, net_frame_extents, 0l, 4l, False, XA_CARDINAL, &type_ret, &format_ret, + &nitems_ret, &unused, &data_ret) == Success) { if (type_ret == XA_CARDINAL && format_ret == 32 && nitems_ret == 4) { // Struts array: 0 - left, 1 - right, 2 - top, 3 - bottom @@ -281,8 +281,8 @@ bool X11WindowSystem::isWindowObscured(QWidget *widget, bool alwaysOnTop) if (net_client_list_stacking != None) { QRect winRect = windowRect(win); - if (XGetWindowProperty(display, getRootWindow(), net_client_list_stacking, 0, - MAX_PROP_SIZE, False, XA_WINDOW, &type_ret, &format_ret, &nitems_ret, &unused, &data_ret) + if (XGetWindowProperty(display, getRootWindow(), net_client_list_stacking, 0, MAX_PROP_SIZE, False, XA_WINDOW, + &type_ret, &format_ret, &nitems_ret, &unused, &data_ret) == Success) { if (type_ret == XA_WINDOW && format_ret == 32) { Window *wins = reinterpret_cast(data_ret); @@ -329,11 +329,11 @@ bool X11WindowSystem::windowHasOnlyTypes(Window win, const QSet &allowedTy int format_ret; unsigned char *data_ret; unsigned long nitems_ret, unused; - Display *display = getDisplay(); + Display *display = getDisplay(); if (net_wm_window_type != None - && XGetWindowProperty(display, win, net_wm_window_type, 0l, 2048l, False, XA_ATOM, &type_ret, - &format_ret, &nitems_ret, &unused, &data_ret) + && XGetWindowProperty(display, win, net_wm_window_type, 0l, 2048l, False, XA_ATOM, &type_ret, &format_ret, + &nitems_ret, &unused, &data_ret) == Success) { if (type_ret == XA_ATOM && format_ret == 32 && nitems_ret > 0) { Atom *types = reinterpret_cast(data_ret); @@ -358,7 +358,7 @@ bool X11WindowSystem::windowHasAnyOfStates(Window win, const QSet &filtere int format_ret; unsigned char *data_ret; unsigned long nitems_ret, unused; - Display *display = getDisplay(); + Display *display = getDisplay(); if (net_wm_state != None && XGetWindowProperty(display, win, net_wm_state, 0l, 2048l, False, XA_ATOM, &type_ret, &format_ret, diff --git a/src/x11windowsystem.h b/src/x11windowsystem.h index 3431753cc..db335e806 100644 --- a/src/x11windowsystem.h +++ b/src/x11windowsystem.h @@ -31,7 +31,7 @@ class X11WindowSystem { X11WindowSystem(); ~X11WindowSystem() { } X11WindowSystem(const X11WindowSystem &) = default; - X11WindowSystem &operator =(const X11WindowSystem &); + X11WindowSystem &operator=(const X11WindowSystem &); public: static X11WindowSystem *instance(); diff --git a/src/xdata_widget.cpp b/src/xdata_widget.cpp index a8d5e2063..99d0de39c 100644 --- a/src/xdata_widget.cpp +++ b/src/xdata_widget.cpp @@ -20,11 +20,11 @@ #include "xdata_widget.h" #include "desktoputil.h" -#include "networkaccessmanager.h" -#include "psicon.h" #include "iris/xmpp_client.h" #include "iris/xmpp_tasks.h" #include "iris/xmpp_xdata.h" +#include "networkaccessmanager.h" +#include "psicon.h" #include #include @@ -571,14 +571,8 @@ void XDataWidget::setForm(const XMPP::XData &d, bool withInstructions) if (registrarType_ == "urn:xmpp:captcha") { QStringList supportedMedia = XDataMediaWidget::supportedMedia(); QStringList mediaVars; - mediaVars << "audio_recog" - << "ocr" - << "picture_q" - << "picture_recog" - << "speech_q" - << "speech_recog" - << "video_q" - << "video_recog"; + mediaVars << "audio_recog" << "ocr" << "picture_q" << "picture_recog" << "speech_q" << "speech_recog" + << "video_q" << "video_recog"; short maxAnswers = 0; short requestedAnswers = 0; Jid from; diff --git a/src/xdata_widget.h b/src/xdata_widget.h index 1a5be340f..05ea72b8f 100644 --- a/src/xdata_widget.h +++ b/src/xdata_widget.h @@ -43,8 +43,8 @@ class XDataWidget : public QWidget { XDataWidget(PsiCon *psi, QWidget *parent, XMPP::Client *client, XMPP::Jid owner); ~XDataWidget(); - PsiCon * psi() const; - XMPP::Client * client() const; + PsiCon *psi() const; + XMPP::Client *client() const; QString registrarType() const; XMPP::Jid owner() const; XMPP::Stanza::Error consistencyError() const; @@ -52,7 +52,7 @@ class XDataWidget : public QWidget { void setForm(const XMPP::XData &, bool withInstructions = true); XMPP::XData::FieldList fields() const; - XDataField * fieldByVar(const QString &) const; + XDataField *fieldByVar(const QString &) const; protected slots: void linkActivated(const QString &); @@ -65,9 +65,9 @@ protected slots: typedef QList XDataFieldList; XDataFieldList fields_; QString registrarType_; - QVBoxLayout * layout_; - PsiCon * psi_; - XMPP::Client * client_; + QVBoxLayout *layout_; + PsiCon *psi_; + XMPP::Client *client_; XMPP::Jid owner_; bool consistent_; XMPP::Stanza::Error consistencyError_; diff --git a/src/xmlconsole.cpp b/src/xmlconsole.cpp index 7d21b66d3..d5ea01286 100644 --- a/src/xmlconsole.cpp +++ b/src/xmlconsole.cpp @@ -20,11 +20,11 @@ #include "xmlconsole.h" #include "iconset.h" +#include "iris/xmpp_client.h" #include "psiaccount.h" #include "psicon.h" #include "psicontactlist.h" #include "textutil.h" -#include "iris/xmpp_client.h" #include #include diff --git a/src/xmlconsole.h b/src/xmlconsole.h index 2a816572b..2d0babf98 100644 --- a/src/xmlconsole.h +++ b/src/xmlconsole.h @@ -53,7 +53,7 @@ private slots: private: Ui::XMLConsole ui_; - PsiAccount * pa; + PsiAccount *pa; QPointer prompt; }; diff --git a/tests/travis-ci/build-and-test.sh b/tests/travis-ci/build-and-test.sh index cac69286c..757058432 100755 --- a/tests/travis-ci/build-and-test.sh +++ b/tests/travis-ci/build-and-test.sh @@ -40,4 +40,3 @@ else echo "Unknown target!" exit 1 fi - diff --git a/tests/travis-ci/install-build-depends.sh b/tests/travis-ci/install-build-depends.sh index 88b39aeab..3bb4da47b 100755 --- a/tests/travis-ci/install-build-depends.sh +++ b/tests/travis-ci/install-build-depends.sh @@ -81,4 +81,3 @@ else echo "Unknown target!" exit 1 fi -