Skip to content

Commit

Permalink
clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
Ri0n committed Mar 15, 2024
1 parent 8b66dd4 commit bc0af92
Show file tree
Hide file tree
Showing 346 changed files with 1,367 additions and 1,498 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion admin/psi-plus-nightly-version
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,3 @@ FEATURES=""
[ "${1}" = "--webengine" ] && FEATURES=", webengine"

echo "${PSI_TAG}.${PATCHES_NUM} (${DATE_STR}, ${PSI_HASH}${FEATURES})"

4 changes: 2 additions & 2 deletions plugins/include/accountinfoaccessinghost.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<QString, QString> getKnownPgpKeys(int account) = 0;
};
Expand Down
2 changes: 1 addition & 1 deletion plugins/include/gctoolbariconaccessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class GCToolbarIconAccessor {
virtual ~GCToolbarIconAccessor() { }

virtual QList<QVariantHash> 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");
Expand Down
4 changes: 2 additions & 2 deletions plugins/include/iqfilteringhost.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand Down
4 changes: 2 additions & 2 deletions plugins/include/menuaccessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ class MenuAccessor {

virtual QList<QVariantHash> getAccountMenuParam() = 0;
virtual QList<QVariantHash> 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");
Expand Down
2 changes: 1 addition & 1 deletion plugins/include/pluginaccessinghost.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand Down
4 changes: 2 additions & 2 deletions plugins/include/psimediaprovider.h
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
2 changes: 1 addition & 1 deletion plugins/include/toolbariconaccessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class ToolbarIconAccessor {
virtual ~ToolbarIconAccessor() { }

virtual QList<QVariantHash> 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");
Expand Down
2 changes: 1 addition & 1 deletion plugins/include/webkitaccessinghost.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/AutoUpdater/guitest/testapp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public slots:
}

private:
QTcpServer * tcpServer_;
QTcpServer *tcpServer_;
QMap<QString, QByteArray> pages_;
};

Expand Down Expand Up @@ -168,7 +168,7 @@ public slots:
}

private:
AutoUpdater * updater_;
AutoUpdater *updater_;
SimpleHTTPServer *server_;
QString appCastURL_, releaseNotesURL_, releaseURL_;
};
Expand Down
3 changes: 1 addition & 2 deletions src/Certificates/CertificateDisplayDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
#include <QtCrypto>

CertificateDisplayDialog::CertificateDisplayDialog(const QCA::Certificate &cert, int result, QCA::Validity validity,
QWidget *parent) :
QDialog(parent)
QWidget *parent) : QDialog(parent)
{
ui_.setupUi(this);
setModal(true);
Expand Down
11 changes: 5 additions & 6 deletions src/Certificates/CertificateErrorDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/Certificates/CertificateErrorDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_;
};
Expand Down
4 changes: 2 additions & 2 deletions src/CocoaUtilities/CocoaTrayClick.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <objc/message.h>
#include <objc/runtime.h>

//#define DEBUG_OUTPUT
// #define DEBUG_OUTPUT

bool dockClickHandler(id /*self*/, SEL /*_cmd*/, ...)
{
Expand All @@ -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");
Expand Down
4 changes: 2 additions & 2 deletions src/abstracttreeitem.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -49,6 +49,6 @@ class AbstractTreeItem {
virtual QString toString() const { return QString(); /* no default implementation */ }

private:
AbstractTreeItem * _parent;
AbstractTreeItem *_parent;
AbstractTreeItemList _children;
};
12 changes: 6 additions & 6 deletions src/accountmanagedlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
#include "accountadddlg.h"
#include "common.h"
#include "iconaction.h"
#include "iris/xmpp_tasks.h"
#include "miniclient.h"
#include "psiaccount.h"
#include "psicon.h"
#include "psicontactlist.h"
#include "psiiconset.h"
#include "shortcutmanager.h"
#include "ui_accountremove.h"
#include "iris/xmpp_tasks.h"

#include <QButtonGroup>
#include <QDropEvent>
Expand Down Expand Up @@ -75,7 +75,7 @@ private slots:
class Private;
Private *d;

MiniClient * client;
MiniClient *client;
QPushButton *pb_close_;
QPushButton *pb_remove_;
};
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -171,7 +171,7 @@ void AccountRemoveDlg::remove()
}

QMessageBox messageBox(QMessageBox::Information, CAP(tr("Warning")),
tr("Are you sure you want to remove <b>%1</b> ?").arg(d->acc.name));
tr("Are you sure you want to remove <b>%1</b> ?").arg(d->acc.name));
QPushButton *cancel = messageBox.addButton(QMessageBox::Cancel);
QPushButton *remove = messageBox.addButton(tr("&Remove"), QMessageBox::AcceptRole);
messageBox.setDefaultButton(remove);
Expand Down Expand Up @@ -294,7 +294,7 @@ void AccountManageTree::dropEvent(QDropEvent *event)

if (tree) {
QList<PsiAccount *> accountsList;
const auto & items = tree->findItems("*", Qt::MatchWildcard);
const auto &items = tree->findItems("*", Qt::MatchWildcard);
for (QTreeWidgetItem *ami : items) {
accountsList.append(static_cast<AccountManageItem *>(ami)->pa.data());
}
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/accountmanagedlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ private slots:
void accountRemoved(PsiAccount *);

private:
PsiCon * psi;
PsiCon *psi;
QAction *removeAction_;
};

Expand Down
4 changes: 2 additions & 2 deletions src/accountmodifydlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ private slots:
bool checkSSL();

private:
PsiCon * psi;
PsiAccount * pa;
PsiCon *psi;
PsiAccount *pa;
ProxyChooser *pc;
UserAccount acc;

Expand Down
2 changes: 1 addition & 1 deletion src/accountregdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#include "accountregdlg.h"

#include "iris/xmpp_tasks.h"
#include "jidutil.h"
#include "miniclient.h"
#include "proxy.h"
Expand All @@ -27,7 +28,6 @@
#include "serverlistquerier.h"
#include "textutil.h"
#include "xdata_widget.h"
#include "iris/xmpp_tasks.h"

#include <QMessageBox>
#include <QScrollArea>
Expand Down
18 changes: 9 additions & 9 deletions src/accountregdlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <QDialog>
#include <QString>
Expand All @@ -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_; }
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/accountscombobox.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ private slots:
void updateAccounts();

private:
PsiCon * controller_;
PsiCon *controller_;
PsiAccount *account_;
bool onlineOnly_;

Expand Down
8 changes: 4 additions & 4 deletions src/actionlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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<ActionList *> actionLists(const unsigned int id) const;
QStringList actionLists() const;

Expand Down
5 changes: 2 additions & 3 deletions src/activeprofiles_dbus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
Expand Down Expand Up @@ -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...<br>please wait..."));
Expand Down
Loading

0 comments on commit bc0af92

Please sign in to comment.