Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 267514ee authored by Laurent Montel's avatar Laurent Montel 😁 Committed by Pali Rohár

Coding style

parent c46d82a4
......@@ -15,7 +15,6 @@
* *
***************************************************************************/
#include "autoreplacepreferences.h"
#include <qlayout.h>
......
......@@ -726,8 +726,9 @@ unsigned int HistoryLogger::getFirstMonth(const Kopete::Contact *c)
// BEGIN check if there are Kopete 0.7.x
QDir d1(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1Char('/') + QString("kopete/logs/"
+c->protocol()->pluginId().replace(QRegExp(QString::fromLatin1("[./~?*]")), QString::fromLatin1("-"))
));
+c->protocol()->pluginId().replace(QRegExp(QString::fromLatin1(
"[./~?*]")), QString::fromLatin1("-"))
));
d1.setFilter(QDir::Files | QDir::NoSymLinks);
d1.setSorting(QDir::Name);
......@@ -748,10 +749,12 @@ unsigned int HistoryLogger::getFirstMonth(const Kopete::Contact *c)
// END of kopete 0.7.x check
QDir d(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1Char('/') + QString("kopete/logs/"
+c->protocol()->pluginId().replace(QRegExp(QString::fromLatin1("[./~?*]")), QString::fromLatin1("-"))
+QString::fromLatin1("/")
+c->account()->accountId().replace(QRegExp(QString::fromLatin1("[./~?*]")), QString::fromLatin1("-"))
));
+c->protocol()->pluginId().replace(QRegExp(QString::fromLatin1(
"[./~?*]")), QString::fromLatin1("-"))
+QString::fromLatin1("/")
+c->account()->accountId().replace(QRegExp(QString::fromLatin1(
"[./~?*]")), QString::fromLatin1("-"))
));
d.setFilter(QDir::Files | QDir::NoSymLinks);
d.setSorting(QDir::Name);
......
......@@ -33,7 +33,6 @@
#include "ui_nowlisteningprefs.h"
#include "nowlisteningconfig.h"
K_PLUGIN_FACTORY(NowListeningPreferencesFactory, registerPlugin<NowListeningPreferences>();
)
......
......@@ -26,7 +26,6 @@
#include <kglobal.h>
#include <kopetemessage.h>
#include <kopeteplugin.h>
......
......@@ -27,7 +27,6 @@
#include <kdebug.h>
#include <kmessagebox.h>
#include <time.h>
#include <QStandardPaths>
......
......@@ -35,7 +35,6 @@
#include <klocalizedstring.h>
#include <khtml_part.h>
#include "kopetemetacontact.h"
#include "kopeteonlinestatus.h"
......
......@@ -31,7 +31,6 @@
#include <KDebug>
#include <KLocalizedString>
#include <kapplication.h>
#include "kopetechatsessionmanager.h"
......
......@@ -208,7 +208,7 @@ void TextEffectPreferences::slotDownPressed()
void TextEffectPreferences::slotSettingChanged()
{
qCDebug(KOPETE_PLUGIN_TEXTEFFECT_LOG) << "Called"
<< endl;
<< endl;
// Indicate that our settings have changed
emit changed(true);
}
......
......@@ -34,7 +34,6 @@
#include <kmessagebox.h>
#include <ktemporaryfile.h>
#include <libxml/parser.h>
#include <libxml/tree.h>
......
......@@ -103,9 +103,7 @@ void BonjourAccount::setAway(bool away, const QString & /* reason */)
}
}
void BonjourAccount::setOnlineStatus(const Kopete::OnlineStatus &status,
const Kopete::StatusMessage &reason,
const OnlineStatusOptions & /*options*/)
void BonjourAccount::setOnlineStatus(const Kopete::OnlineStatus &status, const Kopete::StatusMessage &reason, const OnlineStatusOptions & /*options*/)
{
if (status.status() == Kopete::OnlineStatus::Online
&& myself()->onlineStatus().status() == Kopete::OnlineStatus::Offline) {
......@@ -453,10 +451,10 @@ void BonjourAccount::newIncomingConnection()
QTcpSocket *sock = localServer->nextPendingConnection();
BonjourContactConnection *bcc = new BonjourContactConnection(sock);
QObject::connect(bcc, SIGNAL(discoveredUserName(BonjourContactConnection*,QString)),
this, SLOT(discoveredUserName(BonjourContactConnection*,QString)));
QObject::connect(bcc, SIGNAL(usernameNotInStream(BonjourContactConnection*)),
this, SLOT(usernameNotInStream(BonjourContactConnection*)));
QObject::connect(bcc, SIGNAL(discoveredUserName(BonjourContactConnection *,QString)),
this, SLOT(discoveredUserName(BonjourContactConnection *,QString)));
QObject::connect(bcc, SIGNAL(usernameNotInStream(BonjourContactConnection *)),
this, SLOT(usernameNotInStream(BonjourContactConnection *)));
unknownConnections << bcc;
}
......
......@@ -107,8 +107,7 @@ public:
*
* @return @c true if the contact is created, @c false otherwise
*/
bool createContact(const QString &contactId,
Kopete::MetaContact *parentContact) Q_DECL_OVERRIDE;
bool createContact(const QString &contactId, Kopete::MetaContact *parentContact) Q_DECL_OVERRIDE;
/**
* @brief Called when Kopete is set globally away
......@@ -122,9 +121,7 @@ public:
*
* @todo FIXME: This Only Makes us go online or offline, we cannot go away
*/
void setOnlineStatus(const Kopete::OnlineStatus &status,
const Kopete::StatusMessage &reason = Kopete::StatusMessage(),
const OnlineStatusOptions &options = None) Q_DECL_OVERRIDE;
void setOnlineStatus(const Kopete::OnlineStatus &status, const Kopete::StatusMessage &reason = Kopete::StatusMessage(), const OnlineStatusOptions &options = None) Q_DECL_OVERRIDE;
void setStatusMessage(const Kopete::StatusMessage &statusMessage) Q_DECL_OVERRIDE;
/**
......
......@@ -33,8 +33,7 @@
// FIXME: Here, we hardcode the icon (bonjour_protocol) into the constructor.
// This shouldn't be necessary
BonjourContact::BonjourContact(Kopete::Account *_account, const QString &uniqueName,
Kopete::MetaContact *parent)
BonjourContact::BonjourContact(Kopete::Account *_account, const QString &uniqueName, Kopete::MetaContact *parent)
: Kopete::Contact(_account, uniqueName, parent, QStringLiteral("bonjour_protocol"))
, connection(NULL)
, remoteHostName()
......@@ -76,7 +75,7 @@ Kopete::ChatSession *BonjourContact::manager(CanCreateFlags canCreateFlags)
Kopete::ChatSession::Form form = (Kopete::ChatSession::Small);
m_msgManager = Kopete::ChatSessionManager::self()->create(
account()->myself(), contacts, protocol(), form);
connect(m_msgManager, SIGNAL(messageSent(Kopete::Message&,Kopete::ChatSession*)),
connect(m_msgManager, SIGNAL(messageSent(Kopete::Message&,Kopete::ChatSession *)),
this, SLOT(sendMessage(Kopete::Message&)));
connect(m_msgManager, SIGNAL(destroyed()), this, SLOT(slotChatSessionDestroyed()));
return m_msgManager;
......@@ -198,8 +197,8 @@ void BonjourContact::setConnection(BonjourContactConnection *c)
// can delete the connection (and the socket hence)
connection->setParent(this);
connect(connection, SIGNAL(disconnected(BonjourContactConnection*)),
this, SLOT(connectionDisconnected(BonjourContactConnection*)));
connect(connection, SIGNAL(disconnected(BonjourContactConnection *)),
this, SLOT(connectionDisconnected(BonjourContactConnection *)));
connect(connection, SIGNAL(messageReceived(Kopete::Message)),
this, SLOT(receivedMessage(Kopete::Message)));
......@@ -212,4 +211,3 @@ void BonjourContact::connectionDisconnected(BonjourContactConnection *c)
connection = NULL;
}
}
......@@ -64,8 +64,7 @@ class BonjourContact : public Kopete::Contact
QMap <QString, QByteArray> textdata;
public:
BonjourContact(Kopete::Account *_account, const QString &uniqueName,
Kopete::MetaContact *parent);
BonjourContact(Kopete::Account *_account, const QString &uniqueName, Kopete::MetaContact *parent);
~BonjourContact();
......
......@@ -65,9 +65,7 @@ BonjourContactConnection::BonjourContactConnection(QTcpSocket *aSocket, QObject
setSocket(aSocket);
}
BonjourContactConnection::BonjourContactConnection(const QHostAddress &address, short int port,
const QString &alocal, const QString &aremote,
QObject *parent) : QObject(parent)
BonjourContactConnection::BonjourContactConnection(const QHostAddress &address, short int port, const QString &alocal, const QString &aremote, QObject *parent) : QObject(parent)
{
QTcpSocket *aSocket = new QTcpSocket;
aSocket->connectToHost(address, port);
......
......@@ -187,8 +187,7 @@ public:
* @param remote The remoteuser@hostname
* @param local myself@hostname
*/
BonjourContactConnection(const QHostAddress &address, short int port, const QString &alocal,
const QString &aremote, QObject *parent = NULL);
BonjourContactConnection(const QHostAddress &address, short int port, const QString &alocal, const QString &aremote, QObject *parent = NULL);
// Destructor
~BonjourContactConnection();
......
......@@ -26,9 +26,9 @@
#include "bonjouraddcontactpage.h"
#include "bonjoureditaccountwidget.h"
K_PLUGIN_FACTORY( BonjourProtocolFactory, registerPlugin<BonjourProtocol>(); )
K_EXPORT_PLUGIN( BonjourProtocolFactory( "kopete_bonjour" ) )
K_PLUGIN_FACTORY(BonjourProtocolFactory, registerPlugin<BonjourProtocol>();
)
K_EXPORT_PLUGIN(BonjourProtocolFactory("kopete_bonjour"))
BonjourProtocol *BonjourProtocol::s_protocol = nullptr;
......@@ -53,8 +53,7 @@ BonjourProtocol::~BonjourProtocol()
}
Kopete::Contact *BonjourProtocol::deserializeContact(
Kopete::MetaContact *metaContact, const QMap<QString, QString> &serializedData,
const QMap<QString, QString> & /* addressBookData */)
Kopete::MetaContact *metaContact, const QMap<QString, QString> &serializedData, const QMap<QString, QString> & /* addressBookData */)
{
QString contactId = serializedData[ QStringLiteral("contactId") ];
QString accountId = serializedData[ QStringLiteral("accountId") ];
......@@ -79,15 +78,13 @@ Kopete::Contact *BonjourProtocol::deserializeContact(
return contact;
}
AddContactPage *BonjourProtocol::createAddContactWidget(QWidget *parent,
Kopete::Account * /* account */)
AddContactPage *BonjourProtocol::createAddContactWidget(QWidget *parent, Kopete::Account * /* account */)
{
qDebug()<< "Creating Add Contact Page";
return new BonjourAddContactPage(parent);
}
KopeteEditAccountWidget *BonjourProtocol::createEditAccountWidget(Kopete::Account *account,
QWidget *parent)
KopeteEditAccountWidget *BonjourProtocol::createEditAccountWidget(Kopete::Account *account, QWidget *parent)
{
qDebug() << "Creating Edit Account Page";
return new BonjourEditAccountWidget(parent, account);
......@@ -102,4 +99,5 @@ BonjourProtocol *BonjourProtocol::protocol()
{
return s_protocol;
}
#include "bonjourprotocol.moc"
......@@ -39,8 +39,7 @@ public:
* to its Kopete::MetaContact
*/
Kopete::Contact *deserializeContact(
Kopete::MetaContact *metaContact, const QMap< QString, QString > &serializedData,
const QMap< QString, QString > &addressBookData) Q_DECL_OVERRIDE;
Kopete::MetaContact *metaContact, const QMap< QString, QString > &serializedData, const QMap< QString, QString > &addressBookData) Q_DECL_OVERRIDE;
/**
* @brief Generate an Add Contact Page (not actually useful)
......@@ -52,8 +51,7 @@ public:
*
* @return The Add Contact Page Widget
*/
AddContactPage *createAddContactWidget(QWidget *parent,
Kopete::Account *account) Q_DECL_OVERRIDE;
AddContactPage *createAddContactWidget(QWidget *parent, Kopete::Account *account) Q_DECL_OVERRIDE;
/**
* @brief Generate an Edit Account Page
......@@ -65,8 +63,7 @@ public:
*
* @return The Edit Account Page Widget
*/
KopeteEditAccountWidget *createEditAccountWidget(Kopete::Account *account,
QWidget *parent) Q_DECL_OVERRIDE;
KopeteEditAccountWidget *createEditAccountWidget(Kopete::Account *account, QWidget *parent) Q_DECL_OVERRIDE;
/**
* @brief Create a New Account
......
......@@ -233,10 +233,10 @@ GaduAccount::initConnections()
{
QObject::connect(p->session_, SIGNAL(error(QString,QString)),
SLOT(error(QString,QString)));
QObject::connect(p->session_, SIGNAL(messageReceived(KGaduMessage*)),
SLOT(messageReceived(KGaduMessage*)));
QObject::connect(p->session_, SIGNAL(contactStatusChanged(KGaduNotify*)),
SLOT(contactStatusChanged(KGaduNotify*)));
QObject::connect(p->session_, SIGNAL(messageReceived(KGaduMessage *)),
SLOT(messageReceived(KGaduMessage *)));
QObject::connect(p->session_, SIGNAL(contactStatusChanged(KGaduNotify *)),
SLOT(contactStatusChanged(KGaduNotify *)));
QObject::connect(p->session_, SIGNAL(connectionFailed(gg_failure_t)),
SLOT(connectionFailed(gg_failure_t)));
QObject::connect(p->session_, SIGNAL(connectionSucceed()),
......@@ -426,9 +426,7 @@ GaduAccount::disconnect(DisconnectReason reason)
}
void
GaduAccount::setOnlineStatus(const Kopete::OnlineStatus &status,
const Kopete::StatusMessage &reason,
const OnlineStatusOptions & /*options*/)
GaduAccount::setOnlineStatus(const Kopete::OnlineStatus &status, const Kopete::StatusMessage &reason, const OnlineStatusOptions & /*options*/)
{
kDebug(14100) << "Called";
changeStatus(status, reason.message());
......
......@@ -77,9 +77,7 @@ public slots:
void connectWithPassword(const QString &password);
void disconnect(DisconnectReason);
void disconnect();
void setOnlineStatus(const Kopete::OnlineStatus &status,
const Kopete::StatusMessage &reason = Kopete::StatusMessage(),
const OnlineStatusOptions &options = None);
void setOnlineStatus(const Kopete::OnlineStatus &status, const Kopete::StatusMessage &reason = Kopete::StatusMessage(), const OnlineStatusOptions &options = None);
void setStatusMessage(const Kopete::StatusMessage &statusMessage);
//}
......
......@@ -380,8 +380,7 @@ ChangePasswordCommand::~ChangePasswordCommand()
}
void
ChangePasswordCommand::setInfo(uin_t uin, const QString &passwd, const QString &newpasswd,
const QString &newemail)
ChangePasswordCommand::setInfo(uin_t uin, const QString &passwd, const QString &newpasswd, const QString &newemail)
{
uin_ = uin;
passwd_ = passwd;
......
......@@ -132,8 +132,7 @@ public:
ChangePasswordCommand(QObject *parent = 0);
~ChangePasswordCommand();
void setInfo(uin_t uin, const QString &passwd, const QString &newpasswd,
const QString &newemail);
void setInfo(uin_t uin, const QString &passwd, const QString &newpasswd, const QString &newemail);
void execute();
protected slots:
......
......@@ -143,8 +143,8 @@ GaduContact::manager(Kopete::Contact::CanCreateFlags canCreate)
if (!msgManager_ && canCreate) {
msgManager_ = Kopete::ChatSessionManager::self()->create(account_->myself(), thisContact_,
GaduProtocol::protocol());
connect(msgManager_, SIGNAL(messageSent(Kopete::Message&,Kopete::ChatSession*)),
this, SLOT(messageSend(Kopete::Message&,Kopete::ChatSession*)));
connect(msgManager_, SIGNAL(messageSent(Kopete::Message&,Kopete::ChatSession *)),
this, SLOT(messageSend(Kopete::Message&,Kopete::ChatSession *)));
connect(msgManager_, SIGNAL(destroyed()), this, SLOT(slotChatSessionDestroyed()));
}
kDebug(14100) << "GaduContact::manager returning: " << msgManager_;
......
......@@ -85,8 +85,7 @@ public slots:
void messageAck();
void slotShowPublicProfile();
void slotEditContact();
virtual void sendFile(const KUrl &sourceURL = KUrl(),
const QString &fileName = QString(), uint fileSize = 0L);
virtual void sendFile(const KUrl &sourceURL = KUrl(), const QString &fileName = QString(), uint fileSize = 0L);
protected:
virtual Kopete::ChatSession *manager(
......
......@@ -138,9 +138,7 @@ GaduContactsList::addContact(ContactLine &cl)
void
GaduContactsList::addContact(
QString &displayname, QString &group, QString &uin, QString &firstname, QString &surname,
QString &nickname, QString &phonenr, QString &email, bool ignored, bool offlineTo,
QString &landline)
QString &displayname, QString &group, QString &uin, QString &firstname, QString &surname, QString &nickname, QString &phonenr, QString &email, bool ignored, bool offlineTo, QString &landline)
{
ContactLine cl;
......
......@@ -47,9 +47,8 @@ public:
~GaduContactsList();
QString asString();
void addContact(ContactLine &cl);
void addContact(QString &displayname, QString &group, QString &uin, QString &firstname,
QString &surname, QString &nickname, QString &phonenr, QString &email,
bool ignored, bool offlineTo, QString &landline);
void addContact(QString &displayname, QString &group, QString &uin, QString &firstname, QString &surname, QString &nickname, QString &phonenr, QString &email, bool ignored, bool offlineTo,
QString &landline);
unsigned int size();
const GaduContactsList::ContactLine &operator[](unsigned int i);
private:
......
......@@ -133,7 +133,7 @@ GaduDCC::registerAccount(GaduAccount *account)
dccServer = new GaduDCCServer();
}
connect(dccServer, SIGNAL(incoming(gg_dcc*,bool&)), SLOT(slotIncoming(gg_dcc*,bool&)));
connect(dccServer, SIGNAL(incoming(gg_dcc *,bool&)), SLOT(slotIncoming(gg_dcc *,bool&)));
initmutex.unlock();
......
......@@ -156,7 +156,7 @@ GaduDCCTransaction::setupIncoming(gg_dcc *dccS)
connect(Kopete::TransferManager::transferManager(), SIGNAL(accepted(Kopete::Transfer *,
QString)),
this, SLOT(slotIncomingTransferAccepted(Kopete::Transfer*,QString)));
this, SLOT(slotIncomingTransferAccepted(Kopete::Transfer *,QString)));
connect(Kopete::TransferManager::transferManager(), SIGNAL(refused(Kopete::FileTransferInfo)),
this, SLOT(slotTransferRefused(Kopete::FileTransferInfo)));
......@@ -230,8 +230,7 @@ GaduDCCTransaction::disableNotifiers()
}
void
GaduDCCTransaction::slotIncomingTransferAccepted(Kopete::Transfer *transfer,
const QString &fileName)
GaduDCCTransaction::slotIncomingTransferAccepted(Kopete::Transfer *transfer, const QString &fileName)
{
if ((long)transfer->info().transferId() != transferId_) {
return;
......@@ -288,7 +287,7 @@ GaduDCCTransaction::slotIncomingTransferAccepted(Kopete::Transfer *transfer,
dccSock_->file_fd = localFile_.handle();
}
connect(transfer, SIGNAL(result(KJob*)), this, SLOT(slotTransferResult()));
connect(transfer, SIGNAL(result(KJob *)), this, SLOT(slotTransferResult()));
// reenable notifiers
enableNotifiers(dccSock_->check);
......@@ -321,7 +320,7 @@ GaduDCCTransaction::askIncommingTransfer()
char *)
dccSock_->
file_info.
filename), dccSock_->file_info.size);
filename), dccSock_->file_info.size);
}
void
......
......@@ -33,8 +33,7 @@ namespace Kopete {
class Account;
}
class GaduEditAccount : public QWidget, private Ui::GaduAccountEditUI,
public KopeteEditAccountWidget
class GaduEditAccount : public QWidget, private Ui::GaduAccountEditUI, public KopeteEditAccountWidget
{
Q_OBJECT
......
......@@ -63,8 +63,7 @@ GaduEditContact::GaduEditContact(GaduAccount *account, GaduContact *contact, QWi
fillIn();
}
GaduEditContact::GaduEditContact(GaduAccount *account, GaduContactsList::ContactLine *clin,
QWidget *parent)
GaduEditContact::GaduEditContact(GaduAccount *account, GaduContactsList::ContactLine *clin, QWidget *parent)
: KDialog(parent)
, account_(account)
, contact_(NULL)
......@@ -131,8 +130,8 @@ GaduEditContact::init()
show();
connect(this, SIGNAL(okClicked()), SLOT(slotApply()));
connect(ui_->groups, SIGNAL(itemClicked(QTreeWidgetItem*,0)),
SLOT(listClicked(QTreeWidgetItem*)));
connect(ui_->groups, SIGNAL(itemClicked(QTreeWidgetItem *,0)),
SLOT(listClicked(QTreeWidgetItem *)));
}
void
......
......@@ -130,8 +130,7 @@ GaduProtocol::settingsChanged()
Kopete::Contact *
GaduProtocol::deserializeContact(Kopete::MetaContact *metaContact, const QMap<QString,
QString> &serializedData,
const QMap<QString, QString> & /* addressBookData */)
QString> &serializedData, const QMap<QString, QString> & /* addressBookData */)
{
const QString aid = serializedData[ "accountId" ];
const QString cid = serializedData[ "contactId" ];
......
......@@ -68,9 +68,7 @@ public:
return true;
}
virtual Kopete::Contact *deserializeContact(Kopete::MetaContact *metaContact,
const QMap<QString, QString> &serializedData,
const QMap<QString, QString> &addressBookData);
virtual Kopete::Contact *deserializeContact(Kopete::MetaContact *metaContact, const QMap<QString, QString> &serializedData, const QMap<QString, QString> &addressBookData);
// }
//!Plugin reimplementation
......
......@@ -2,7 +2,7 @@
Kopete Groupwise Protocol
chatroommanager.cpp - tracks our knowledge of server side chatrooms
Copyright (c) 2005 SUSE Linux Products GmbH http://www.suse.com
Copyright (c) 2005 SUSE Linux Products GmbH http://www.suse.com
Kopete (c) 2002-2005 by the Kopete developers <kopete-devel@kde.org>
......@@ -27,8 +27,10 @@
#include "tasks/chatpropertiestask.h"
#include "tasks/searchchattask.h"
ChatroomManager::ChatroomManager( Client * parent)
: QObject(parent), m_client( parent ), m_replace( false )
ChatroomManager::ChatroomManager(Client *parent)
: QObject(parent)
, m_client(parent)
, m_replace(false)
{
}
......@@ -38,101 +40,98 @@ ChatroomManager::~ChatroomManager()
void ChatroomManager::updateRooms()
{
getChatrooms( !m_rooms.isEmpty() );
getChatrooms(!m_rooms.isEmpty());
}
GroupWise::ChatroomMap ChatroomManager::rooms()
{
return m_rooms;
return m_rooms;
}
void ChatroomManager::getChatrooms( bool refresh )
void ChatroomManager::getChatrooms(bool refresh)
{
m_replace = !refresh;
SearchChatTask * sct = new SearchChatTask( m_client->rootTask() );
sct->search( ( refresh ? SearchChatTask::SinceLastSearch : SearchChatTask::FetchAll ) );
connect( sct, SIGNAL(finished()), SLOT(slotGotChatroomList()) );
sct->go( true );
m_replace = !refresh;
SearchChatTask *sct = new SearchChatTask(m_client->rootTask());
sct->search((refresh ? SearchChatTask::SinceLastSearch : SearchChatTask::FetchAll));
connect(sct, SIGNAL(finished()), SLOT(slotGotChatroomList()));
sct->go(true);
}
void ChatroomManager::slotGotChatroomList()
{
// kDebug () ;
SearchChatTask * sct = (SearchChatTask *)sender();
if ( sct )
{
if ( m_replace )
m_rooms.clear();
const QList<ChatroomSearchResult> roomsFound = sct->results();
QList<ChatroomSearchResult>::ConstIterator it = roomsFound.begin();