[SCM] ktp-contact-list packaging branch, master, updated. debian/15.12.1-2-1070-g6c56f91
Maximiliano Curia
maxy at moszumanska.debian.org
Sat May 28 00:05:32 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-contact-list.git;a=commitdiff;h=ae6dbb9
The following commit has been merged in the master branch:
commit ae6dbb95d2db3ff61a12b67d175185152ba1f5f3
Author: Florian Reinhard <florian.reinhard at googlemail.com>
Date: Fri Mar 11 15:53:31 2011 +0100
Do some code clean-up based on astyle suggests.
---
account-button.cpp | 8 +--
account-filter-model.cpp | 20 +++----
account-filter-model.h | 2 +-
accounts-model-item.cpp | 104 ++++++++++++++++-----------------
accounts-model.cpp | 3 +-
contact-delegate-overlay.cpp | 11 ++--
contact-delegate.cpp | 27 ++++-----
contact-model-item.cpp | 133 +++++++++++++++++++++---------------------
contact-overlays.cpp | 32 +++++-----
contact-view-hover-button.cpp | 23 +++-----
main-widget.h | 4 +-
main.cpp | 8 +--
tree-node.cpp | 6 +-
tree-node.h | 2 +-
14 files changed, 182 insertions(+), 201 deletions(-)
diff --git a/account-button.cpp b/account-button.cpp
index eea2c4e..3c4133b 100644
--- a/account-button.cpp
+++ b/account-button.cpp
@@ -55,13 +55,13 @@ AccountButton::AccountButton(const Tp::AccountPtr &account, QWidget* parent): QT
QString iconPath = account->iconName();
//if the icon has not been set, we use the protocol icon
- if(iconPath.isEmpty()) {
+ if (iconPath.isEmpty()) {
iconPath = QString("im-%1").arg(account->protocolName());
}
setIcon(KIcon(iconPath));
- if(!account->isValid()) {
+ if (!account->isValid()) {
//we paint a warning symbol in the right-bottom corner
QPixmap pixmap = icon().pixmap(32, 32);
QPainter painter(&pixmap);
@@ -113,7 +113,7 @@ AccountButton::AccountButton(const Tp::AccountPtr &account, QWidget* parent): QT
foreach(QAction *a, actions()) {
a->setCheckable(true);
- if(m_account->currentPresence().status() == QLatin1String(accountPresenceStatuses[a->data().toInt()])) {
+ if (m_account->currentPresence().status() == QLatin1String(accountPresenceStatuses[a->data().toInt()])) {
a->setChecked(true);
m_statusIndex = a->data().toInt();
}
@@ -128,7 +128,7 @@ AccountButton::AccountButton(const Tp::AccountPtr &account, QWidget* parent): QT
connect(m_account.data(), SIGNAL(currentPresenceChanged(Tp::Presence)),
this, SLOT(preseneceChanged(Tp::Presence)));
- if(m_statusIndex == -1) {
+ if (m_statusIndex == -1) {
m_statusIndex = 7;
}
diff --git a/account-filter-model.cpp b/account-filter-model.cpp
index e716248..2816a7e 100644
--- a/account-filter-model.cpp
+++ b/account-filter-model.cpp
@@ -45,30 +45,30 @@ bool AccountFilterModel::filterAcceptsRow(int source_row, const QModelIndex &sou
{
bool rowAccepted = true;
//if we're looking at filtering an account or not
- if(source_parent != QModelIndex()) {
+ if (source_parent != QModelIndex()) {
//filter by name in the contact list
- if(m_filterByName &&
- !source_parent.child(source_row, 0).data(AccountsModel::AliasRole).toString()
+ if (m_filterByName &&
+ !source_parent.child(source_row, 0).data(AccountsModel::AliasRole).toString()
.contains(m_filterString, Qt::CaseInsensitive)) {
rowAccepted = false;
}
//filter offline users out
- if( m_filterOfflineUsers &&
- (source_parent.child(source_row, 0).data(AccountsModel::PresenceTypeRole).toUInt()
- == Tp::ConnectionPresenceTypeOffline) ||
- (source_parent.child(source_row, 0).data(AccountsModel::PresenceTypeRole).toUInt()
- == Tp::ConnectionPresenceTypeUnknown)) {
+ if (m_filterOfflineUsers &&
+ (source_parent.child(source_row, 0).data(AccountsModel::PresenceTypeRole).toUInt()
+ == Tp::ConnectionPresenceTypeOffline) ||
+ (source_parent.child(source_row, 0).data(AccountsModel::PresenceTypeRole).toUInt()
+ == Tp::ConnectionPresenceTypeUnknown)) {
- rowAccepted = false;
+ rowAccepted = false;
}
}
return rowAccepted;
}
-void AccountFilterModel::setFilterString (const QString& str)
+void AccountFilterModel::setFilterString(const QString& str)
{
m_filterString = str;
m_filterByName = true;
diff --git a/account-filter-model.h b/account-filter-model.h
index 0c0fbc2..d33231d 100644
--- a/account-filter-model.h
+++ b/account-filter-model.h
@@ -28,7 +28,7 @@ class AccountFilterModel : public QSortFilterProxyModel
Q_OBJECT
public:
- AccountFilterModel(QObject *parent=0);
+ AccountFilterModel(QObject *parent = 0);
bool filterOfflineUsers() const;
public slots:
diff --git a/accounts-model-item.cpp b/accounts-model-item.cpp
index c80d519..536e513 100644
--- a/accounts-model-item.cpp
+++ b/accounts-model-item.cpp
@@ -136,57 +136,57 @@ AccountsModelItem::~AccountsModelItem()
QVariant AccountsModelItem::data(int role) const
{
switch (role) {
- case AccountsModel::ItemRole:
- return QVariant::fromValue(
- const_cast<QObject *>(
- static_cast<const QObject *>(this)));
- case AccountsModel::IdRole:
- return mPriv->mAccount->uniqueIdentifier();
- case AccountsModel::AvatarRole:
- return QVariant(); //TODO: Return account icon
- case AccountsModel::ValidRole:
- return mPriv->mAccount->isValid();
- case AccountsModel::EnabledRole:
- return mPriv->mAccount->isEnabled();
- case AccountsModel::ConnectionManagerNameRole:
- return mPriv->mAccount->cmName();
- case AccountsModel::ProtocolNameRole:
- return mPriv->mAccount->protocolName();
- case AccountsModel::DisplayNameRole:
- case Qt::DisplayRole:
- return mPriv->mAccount->displayName();
- case AccountsModel::IconRole:
- return mPriv->mAccount->iconName();
- case AccountsModel::NicknameRole:
- return mPriv->mAccount->nickname();
- case AccountsModel::ConnectsAutomaticallyRole:
- return mPriv->mAccount->connectsAutomatically();
- case AccountsModel::ChangingPresenceRole:
- return mPriv->mAccount->isChangingPresence();
- case AccountsModel::AutomaticPresenceRole:
- return mPriv->mAccount->automaticPresence().status();
- case AccountsModel::AutomaticPresenceTypeRole:
- return mPriv->mAccount->automaticPresence().type();
- case AccountsModel::AutomaticPresenceStatusMessageRole:
- return mPriv->mAccount->automaticPresence().statusMessage();
- case AccountsModel::CurrentPresenceRole:
- return mPriv->mAccount->currentPresence().status();
- case AccountsModel::CurrentPresenceTypeRole:
- return mPriv->mAccount->currentPresence().type();
- case AccountsModel::CurrentPresenceStatusMessageRole:
- return mPriv->mAccount->currentPresence().statusMessage();
- case AccountsModel::RequestedPresenceRole:
- return mPriv->mAccount->requestedPresence().status();
- case AccountsModel::RequestedPresenceTypeRole:
- return mPriv->mAccount->requestedPresence().type();
- case AccountsModel::RequestedPresenceStatusMessageRole:
- return mPriv->mAccount->requestedPresence().statusMessage();
- case AccountsModel::ConnectionStatusRole:
- return mPriv->mAccount->connectionStatus();
- case AccountsModel::ConnectionStatusReasonRole:
- return mPriv->mAccount->connectionStatusReason();
- default:
- return QVariant();
+ case AccountsModel::ItemRole:
+ return QVariant::fromValue(
+ const_cast<QObject *>(
+ static_cast<const QObject *>(this)));
+ case AccountsModel::IdRole:
+ return mPriv->mAccount->uniqueIdentifier();
+ case AccountsModel::AvatarRole:
+ return QVariant(); //TODO: Return account icon
+ case AccountsModel::ValidRole:
+ return mPriv->mAccount->isValid();
+ case AccountsModel::EnabledRole:
+ return mPriv->mAccount->isEnabled();
+ case AccountsModel::ConnectionManagerNameRole:
+ return mPriv->mAccount->cmName();
+ case AccountsModel::ProtocolNameRole:
+ return mPriv->mAccount->protocolName();
+ case AccountsModel::DisplayNameRole:
+ case Qt::DisplayRole:
+ return mPriv->mAccount->displayName();
+ case AccountsModel::IconRole:
+ return mPriv->mAccount->iconName();
+ case AccountsModel::NicknameRole:
+ return mPriv->mAccount->nickname();
+ case AccountsModel::ConnectsAutomaticallyRole:
+ return mPriv->mAccount->connectsAutomatically();
+ case AccountsModel::ChangingPresenceRole:
+ return mPriv->mAccount->isChangingPresence();
+ case AccountsModel::AutomaticPresenceRole:
+ return mPriv->mAccount->automaticPresence().status();
+ case AccountsModel::AutomaticPresenceTypeRole:
+ return mPriv->mAccount->automaticPresence().type();
+ case AccountsModel::AutomaticPresenceStatusMessageRole:
+ return mPriv->mAccount->automaticPresence().statusMessage();
+ case AccountsModel::CurrentPresenceRole:
+ return mPriv->mAccount->currentPresence().status();
+ case AccountsModel::CurrentPresenceTypeRole:
+ return mPriv->mAccount->currentPresence().type();
+ case AccountsModel::CurrentPresenceStatusMessageRole:
+ return mPriv->mAccount->currentPresence().statusMessage();
+ case AccountsModel::RequestedPresenceRole:
+ return mPriv->mAccount->requestedPresence().status();
+ case AccountsModel::RequestedPresenceTypeRole:
+ return mPriv->mAccount->requestedPresence().type();
+ case AccountsModel::RequestedPresenceStatusMessageRole:
+ return mPriv->mAccount->requestedPresence().statusMessage();
+ case AccountsModel::ConnectionStatusRole:
+ return mPriv->mAccount->connectionStatus();
+ case AccountsModel::ConnectionStatusReasonRole:
+ return mPriv->mAccount->connectionStatusReason();
+ default:
+ return QVariant();
}
}
@@ -212,7 +212,7 @@ bool AccountsModelItem::setData(int role, const QVariant &value)
Tp::AccountPtr AccountsModelItem::account() const
{
- return mPriv->mAccount;
+ return mPriv->mAccount;
}
void AccountsModelItem::setEnabled(bool value)
diff --git a/accounts-model.cpp b/accounts-model.cpp
index e41bd79..b1f8e03 100644
--- a/accounts-model.cpp
+++ b/accounts-model.cpp
@@ -283,8 +283,7 @@ QModelIndex AccountsModel::index(TreeNode *node) const
{
if (node->parent()) {
return createIndex(node->parent()->indexOf(node), 0, node);
- }
- else {
+ } else {
return QModelIndex();
}
}
diff --git a/contact-delegate-overlay.cpp b/contact-delegate-overlay.cpp
index ef7ea08..138cc7c 100644
--- a/contact-delegate-overlay.cpp
+++ b/contact-delegate-overlay.cpp
@@ -135,8 +135,7 @@ void AbstractWidgetDelegateOverlay::setActive(bool active)
connect(m_view, SIGNAL(viewportEntered()),
this, SLOT(slotViewportEntered()));
- }
- else {
+ } else {
delete m_widget;
m_widget = 0;
@@ -239,12 +238,11 @@ bool AbstractWidgetDelegateOverlay::eventFilter(QObject* obj, QEvent* event)
default:
break;
}
- }
- else if (obj == m_widget) {
+ } else if (obj == m_widget) {
switch (event->type()) {
case QEvent::MouseButtonPress:
if (static_cast<QMouseEvent*>(event)->buttons() & Qt::LeftButton) {
- m_mouseButtonPressedOnWidget = true;
+ m_mouseButtonPressedOnWidget = true;
}
break;
case QEvent::MouseButtonRelease:
@@ -305,8 +303,7 @@ void HoverButtonDelegateOverlay::slotEntered(const QModelIndex& index)
if (index.isValid() && checkIndex(index)) {
button()->setIndex(index);
updateButton(index);
- }
- else {
+ } else {
button()->setIndex(index);
}
}
diff --git a/contact-delegate.cpp b/contact-delegate.cpp
index 60c6767..950ae63 100644
--- a/contact-delegate.cpp
+++ b/contact-delegate.cpp
@@ -14,7 +14,7 @@ const int SPACING = 4;
const int AVATAR_SIZE = 32;
ContactDelegate::ContactDelegate(QObject * parent)
- : QStyledItemDelegate(parent), ContactDelegateOverlayContainer(), m_palette(0)
+ : QStyledItemDelegate(parent), ContactDelegateOverlayContainer(), m_palette(0)
{
m_palette = new QPalette(QApplication::palette());
}
@@ -38,14 +38,14 @@ void ContactDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opt
bool isContact = !index.data(AccountsModel::AliasRole).toString().isEmpty();
- if(isContact) {
+ if (isContact) {
QRect iconRect = optV4.rect;
iconRect.setSize(QSize(AVATAR_SIZE, AVATAR_SIZE));
iconRect.moveTo(QPoint(iconRect.x() + SPACING, iconRect.y() + SPACING));
QPixmap avatar = QPixmap::fromImage(QImage(index.data(AccountsModel::AvatarRole).toString()));
- if(avatar.isNull()) {
+ if (avatar.isNull()) {
avatar = SmallIcon("im-user", KIconLoader::SizeMedium);
}
@@ -53,7 +53,7 @@ void ContactDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opt
QPixmap icon;
- switch(index.data(AccountsModel::PresenceTypeRole).toInt()) {
+ switch (index.data(AccountsModel::PresenceTypeRole).toInt()) {
case Tp::ConnectionPresenceTypeAvailable:
icon = SmallIcon("user-online", KIconLoader::SizeSmallMedium);
break;
@@ -118,19 +118,18 @@ void ContactDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opt
statusFontMetrics.elidedText(index.data(AccountsModel::PresenceMessageRole).toString(),
Qt::ElideRight, statusMsgRect.width()));
- }
- else {
+ } else {
QRect groupRect = optV4.rect;
QRect accountGroupRect = groupRect;
- accountGroupRect.setSize(QSize(16,16));
+ accountGroupRect.setSize(QSize(16, 16));
accountGroupRect.moveTo(QPoint(groupRect.left() + 2, groupRect.top() + 2));
QRect groupLabelRect = groupRect;
groupLabelRect.setLeft(20);
QRect expandSignRect = groupLabelRect;
- expandSignRect.setLeft(groupLabelRect.right()-20);
+ expandSignRect.setLeft(groupLabelRect.right() - 20);
QFont groupFont = painter->font();
groupFont.setWeight(QFont::Normal);
@@ -155,10 +154,9 @@ void ContactDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opt
QStyleOption expandSignOption = option;
expandSignOption.rect = expandSignRect;
- if(option.state & QStyle::State_Open) {
+ if (option.state & QStyle::State_Open) {
style->drawPrimitive(QStyle::PE_IndicatorArrowDown, &expandSignOption, painter);
- }
- else {
+ } else {
style->drawPrimitive(QStyle::PE_IndicatorArrowRight, &expandSignOption, painter);
}
}
@@ -172,10 +170,9 @@ QSize ContactDelegate::sizeHint(const QStyleOptionViewItem &option, const QModel
// if(option.state & QStyle::State_Selected)
// kDebug() << index.data(ModelRoles::UserNameRole).toString();
- if(!index.data(AccountsModel::AliasRole).toString().isEmpty()) {
+ if (!index.data(AccountsModel::AliasRole).toString().isEmpty()) {
return QSize(0, 32 + 4 * SPACING);
- }
- else return QSize(0,20);
+ } else return QSize(0, 20);
}
void ContactDelegate::hideStatusMessageSlot(const QModelIndex& index)
@@ -202,7 +199,7 @@ void ContactDelegate::fadeOutStatusMessageSlot()
a->start();
connect(a, SIGNAL(valueChanged(QVariant)),
- this, SLOT(triggerRepaint()));
+ this, SLOT(triggerRepaint()));
}
int ContactDelegate::fadingValue() const
diff --git a/contact-model-item.cpp b/contact-model-item.cpp
index 39bc14f..b24abe3 100644
--- a/contact-model-item.cpp
+++ b/contact-model-item.cpp
@@ -83,55 +83,54 @@ ContactModelItem::~ContactModelItem()
QVariant ContactModelItem::data(int role) const
{
- switch (role)
- {
- case AccountsModel::ItemRole:
- return QVariant::fromValue(
- const_cast<QObject *>(
- static_cast<const QObject *>(this)));
- case AccountsModel::IdRole:
- return mPriv->mContact->id();
- case Qt::DisplayRole:
- case AccountsModel::AliasRole:
- return mPriv->mContact->alias();
- case AccountsModel::PresenceStatusRole:
- return mPriv->mContact->presence().status();
- case AccountsModel::PresenceTypeRole:
- return mPriv->mContact->presence().type();
- case AccountsModel::PresenceMessageRole:
- return mPriv->mContact->presence().statusMessage();
- case AccountsModel::SubscriptionStateRole:
- return mPriv->mContact->subscriptionState();
- case AccountsModel::PublishStateRole:
- return mPriv->mContact->publishState();
- case AccountsModel::BlockedRole:
- return mPriv->mContact->isBlocked();
- case AccountsModel::GroupsRole:
- return mPriv->mContact->groups();
- case AccountsModel::AvatarRole:
- return mPriv->mContact->avatarData().fileName;
- case Qt::DecorationRole:
- return QImage(mPriv->mContact->avatarData().fileName);
- case AccountsModel::TextChatCapabilityRole:
- return mPriv->mContact->capabilities().textChats();
- case AccountsModel::MediaCallCapabilityRole:
- return mPriv->mContact->capabilities().streamedMediaCalls();
- case AccountsModel::AudioCallCapabilityRole:
- return mPriv->mContact->capabilities().streamedMediaAudioCalls();
- case AccountsModel::VideoCallCapabilityRole:
- return mPriv->mContact->capabilities().streamedMediaVideoCalls();
- case AccountsModel::UpgradeCallCapabilityRole:
- return mPriv->mContact->capabilities().upgradingStreamedMediaCalls();
- case AccountsModel::FileTransferCapabilityRole: {
- foreach (const Tp::RequestableChannelClassSpec &rccSpec, mPriv->mContact->capabilities().allClassSpecs()) {
- if (rccSpec.supports(Tp::RequestableChannelClassSpec::fileTransfer())) {
- return true;
- }
+ switch (role) {
+ case AccountsModel::ItemRole:
+ return QVariant::fromValue(
+ const_cast<QObject *>(
+ static_cast<const QObject *>(this)));
+ case AccountsModel::IdRole:
+ return mPriv->mContact->id();
+ case Qt::DisplayRole:
+ case AccountsModel::AliasRole:
+ return mPriv->mContact->alias();
+ case AccountsModel::PresenceStatusRole:
+ return mPriv->mContact->presence().status();
+ case AccountsModel::PresenceTypeRole:
+ return mPriv->mContact->presence().type();
+ case AccountsModel::PresenceMessageRole:
+ return mPriv->mContact->presence().statusMessage();
+ case AccountsModel::SubscriptionStateRole:
+ return mPriv->mContact->subscriptionState();
+ case AccountsModel::PublishStateRole:
+ return mPriv->mContact->publishState();
+ case AccountsModel::BlockedRole:
+ return mPriv->mContact->isBlocked();
+ case AccountsModel::GroupsRole:
+ return mPriv->mContact->groups();
+ case AccountsModel::AvatarRole:
+ return mPriv->mContact->avatarData().fileName;
+ case Qt::DecorationRole:
+ return QImage(mPriv->mContact->avatarData().fileName);
+ case AccountsModel::TextChatCapabilityRole:
+ return mPriv->mContact->capabilities().textChats();
+ case AccountsModel::MediaCallCapabilityRole:
+ return mPriv->mContact->capabilities().streamedMediaCalls();
+ case AccountsModel::AudioCallCapabilityRole:
+ return mPriv->mContact->capabilities().streamedMediaAudioCalls();
+ case AccountsModel::VideoCallCapabilityRole:
+ return mPriv->mContact->capabilities().streamedMediaVideoCalls();
+ case AccountsModel::UpgradeCallCapabilityRole:
+ return mPriv->mContact->capabilities().upgradingStreamedMediaCalls();
+ case AccountsModel::FileTransferCapabilityRole: {
+ foreach(const Tp::RequestableChannelClassSpec & rccSpec, mPriv->mContact->capabilities().allClassSpecs()) {
+ if (rccSpec.supports(Tp::RequestableChannelClassSpec::fileTransfer())) {
+ return true;
}
- return false;
}
- default:
- break;
+ return false;
+ }
+ default:
+ break;
}
return QVariant();
@@ -140,29 +139,29 @@ QVariant ContactModelItem::data(int role) const
bool ContactModelItem::setData(int role, const QVariant &value)
{
switch (role) {
- case AccountsModel::PublishStateRole: {
- Tp::Contact::PresenceState state;
- state = (Tp::Contact::PresenceState) value.toInt();
- switch (state) {
- case Tp::Contact::PresenceStateYes:
- // authorize the contact and request its presence publication
- mPriv->mContact->authorizePresencePublication();
- mPriv->mContact->requestPresenceSubscription();
- return true;
- case Tp::Contact::PresenceStateNo: {
- // reject the presence publication and remove the contact
- mPriv->mContact->removePresencePublication();
- QList<Tp::ContactPtr> contacts;
- contacts << mPriv->mContact;
- mPriv->mContact->manager()->removeContacts(contacts);
- return true;
- }
- default:
- return false;
- }
+ case AccountsModel::PublishStateRole: {
+ Tp::Contact::PresenceState state;
+ state = (Tp::Contact::PresenceState) value.toInt();
+ switch (state) {
+ case Tp::Contact::PresenceStateYes:
+ // authorize the contact and request its presence publication
+ mPriv->mContact->authorizePresencePublication();
+ mPriv->mContact->requestPresenceSubscription();
+ return true;
+ case Tp::Contact::PresenceStateNo: {
+ // reject the presence publication and remove the contact
+ mPriv->mContact->removePresencePublication();
+ QList<Tp::ContactPtr> contacts;
+ contacts << mPriv->mContact;
+ mPriv->mContact->manager()->removeContacts(contacts);
+ return true;
}
default:
return false;
+ }
+ }
+ default:
+ return false;
}
}
diff --git a/contact-overlays.cpp b/contact-overlays.cpp
index a826667..43e6cd1 100644
--- a/contact-overlays.cpp
+++ b/contact-overlays.cpp
@@ -86,8 +86,7 @@ void TextChannelContactOverlay::setActive(bool active)
if (active) {
connect(button(), SIGNAL(clicked(bool)),
this, SLOT(slotClicked(bool)));
- }
- else {
+ } else {
// button is deleted
}
}
@@ -120,7 +119,7 @@ void TextChannelContactOverlay::slotClicked(bool checked)
bool TextChannelContactOverlay::checkIndex(const QModelIndex& index) const
{
- if(index.data(AccountsModel::TextChatCapabilityRole).toBool()) {
+ if (index.data(AccountsModel::TextChatCapabilityRole).toBool()) {
return true;
}
@@ -146,7 +145,7 @@ protected:
};
AudioChannelContactOverlay::Button::Button(QAbstractItemView* parentView, const KGuiItem& gui)
-: ContactViewHoverButton(parentView), gui(gui)
+ : ContactViewHoverButton(parentView), gui(gui)
{
}
@@ -170,7 +169,7 @@ void AudioChannelContactOverlay::Button::updateToolTip()
// -------------------------------------------------------------------------
AudioChannelContactOverlay::AudioChannelContactOverlay(QObject* parent)
-: HoverButtonDelegateOverlay(parent)
+ : HoverButtonDelegateOverlay(parent)
{
m_gui = KGuiItem(i18n("Start audio channel"), "voicecall",
i18n("Start audio channel"), i18n("Whats this"));
@@ -188,8 +187,7 @@ void AudioChannelContactOverlay::setActive(bool active)
if (active) {
connect(button(), SIGNAL(clicked(bool)),
this, SLOT(slotClicked(bool)));
- }
- else {
+ } else {
// button is deleted
}
}
@@ -222,7 +220,7 @@ void AudioChannelContactOverlay::slotClicked(bool checked)
bool AudioChannelContactOverlay::checkIndex(const QModelIndex& index) const
{
- if(index.data(AccountsModel::AudioCallCapabilityRole).toBool()) {
+ if (index.data(AccountsModel::AudioCallCapabilityRole).toBool()) {
return true;
}
@@ -248,7 +246,7 @@ protected:
};
VideoChannelContactOverlay::Button::Button(QAbstractItemView* parentView, const KGuiItem& gui)
-: ContactViewHoverButton(parentView), gui(gui)
+ : ContactViewHoverButton(parentView), gui(gui)
{
}
@@ -272,7 +270,7 @@ void VideoChannelContactOverlay::Button::updateToolTip()
// -------------------------------------------------------------------------
VideoChannelContactOverlay::VideoChannelContactOverlay(QObject* parent)
-: HoverButtonDelegateOverlay(parent)
+ : HoverButtonDelegateOverlay(parent)
{
m_gui = KGuiItem(i18n("Start video channel"), "camera-web",
i18n("Start video channel"), i18n("Whats this"));
@@ -290,8 +288,7 @@ void VideoChannelContactOverlay::setActive(bool active)
if (active) {
connect(button(), SIGNAL(clicked(bool)),
this, SLOT(slotClicked(bool)));
- }
- else {
+ } else {
// button is deleted
}
}
@@ -324,7 +321,7 @@ void VideoChannelContactOverlay::slotClicked(bool checked)
bool VideoChannelContactOverlay::checkIndex(const QModelIndex& index) const
{
- if(index.data(AccountsModel::VideoCallCapabilityRole).toBool()) {
+ if (index.data(AccountsModel::VideoCallCapabilityRole).toBool()) {
return true;
}
@@ -350,7 +347,7 @@ protected:
};
FileTransferContactOverlay::Button::Button(QAbstractItemView* parentView, const KGuiItem& gui)
-: ContactViewHoverButton(parentView), gui(gui)
+ : ContactViewHoverButton(parentView), gui(gui)
{
}
@@ -374,7 +371,7 @@ void FileTransferContactOverlay::Button::updateToolTip()
// -------------------------------------------------------------------------
FileTransferContactOverlay::FileTransferContactOverlay(QObject* parent)
-: HoverButtonDelegateOverlay(parent)
+ : HoverButtonDelegateOverlay(parent)
{
m_gui = KGuiItem(i18n("Send file"), "mail-attachment",
i18n("Send file"), i18n("Whats this"));
@@ -392,8 +389,7 @@ void FileTransferContactOverlay::setActive(bool active)
if (active) {
connect(button(), SIGNAL(clicked(bool)),
this, SLOT(slotClicked(bool)));
- }
- else {
+ } else {
// button is deleted
}
}
@@ -426,7 +422,7 @@ void FileTransferContactOverlay::slotClicked(bool checked)
bool FileTransferContactOverlay::checkIndex(const QModelIndex& index) const
{
- if(index.data(AccountsModel::FileTransferCapabilityRole).toBool()) {
+ if (index.data(AccountsModel::FileTransferCapabilityRole).toBool()) {
return true;
}
diff --git a/contact-view-hover-button.cpp b/contact-view-hover-button.cpp
index a0857bd..d6bde9e 100644
--- a/contact-view-hover-button.cpp
+++ b/contact-view-hover-button.cpp
@@ -85,8 +85,7 @@ void ContactViewHoverButton::setIndex(const QModelIndex& index)
{
m_index = index;
- if (index.isValid())
- {
+ if (index.isValid()) {
startFading();
}
}
@@ -150,16 +149,12 @@ void ContactViewHoverButton::paintEvent(QPaintEvent* event)
painter.drawEllipse(0, 0, width(), height());
// draw the icon overlay
- if (m_isHovered)
- {
+ if (m_isHovered) {
KIconEffect iconEffect;
QPixmap activeIcon = iconEffect.apply(m_icon, KIconLoader::Desktop, KIconLoader::ActiveState);
painter.drawPixmap(0, 0, activeIcon);
- }
- else
- {
- if (m_fadingValue < 255)
- {
+ } else {
+ if (m_fadingValue < 255) {
// apply an alpha mask respecting the fading value to the icon
QPixmap icon = m_icon;
QPixmap alphaMask(icon.width(), icon.height());
@@ -167,9 +162,7 @@ void ContactViewHoverButton::paintEvent(QPaintEvent* event)
alphaMask.fill(color);
icon.setAlphaChannel(alphaMask);
painter.drawPixmap(0, 0, icon);
- }
- else
- {
+ } else {
// no fading is required
painter.drawPixmap(0, 0, m_icon);
}
@@ -180,8 +173,7 @@ void ContactViewHoverButton::setFadingValue(int value)
{
m_fadingValue = value;
- if (m_fadingValue >= 255)
- {
+ if (m_fadingValue >= 255) {
m_fadingTimeLine->stop();
}
@@ -206,8 +198,7 @@ void ContactViewHoverButton::refreshIcon()
void ContactViewHoverButton::startFading()
{
- if (m_fadingTimeLine->state() != QTimeLine::Running)
- {
+ if (m_fadingTimeLine->state() != QTimeLine::Running) {
m_fadingTimeLine->start();
}
diff --git a/main-widget.h b/main-widget.h
index 5c6ae90..48c4400 100644
--- a/main-widget.h
+++ b/main-widget.h
@@ -50,7 +50,7 @@ public:
* but it will fade after short timout,
* thus it should be used for non-important messages
* like "Connecting..." etc.
- */
+ */
SystemMessageInfo,
/*
@@ -71,7 +71,7 @@ public Q_SLOTS:
void showMessageToUser(const QString &text, const SystemMessageType type);
void addOverlayButtons();
void onNewAccountAdded(const Tp::AccountPtr &account);
- void onAccountStateChanged(bool enabled);
+ void onAccountStateChanged(bool enabled);
void onAccountRemoved();
void toggleSearchWidget(bool show);
// void startAudioChannel();
diff --git a/main.cpp b/main.cpp
index 9dd1d71..9a2445e 100644
--- a/main.cpp
+++ b/main.cpp
@@ -54,13 +54,13 @@ int main(int argc, char *argv[])
KAboutData aboutData("telepathy-kde-contactslist", 0, ki18n("Telepathy KDE Contact List"), "0.1",
ki18n("Telepathy KDE Contact List"), KAboutData::License_GPL,
ki18n("(C) 2011, Martin Klapetek"));
-
+
aboutData.addAuthor(ki18nc("@info:credit", "Martin Klapetek"), KLocalizedString(),
"martin.klapetek at gmail.com");
-
+
KCmdLineArgs::init(argc, argv, &aboutData);
KApplication app;
-
+
Tp::registerTypes();
#ifdef TP_DEBUG
Tp::enableDebug(true);
@@ -75,7 +75,7 @@ int main(int argc, char *argv[])
if (signal(SIGTERM, signal_handler) == SIG_ERR) {
kWarning() << "Setting up SIGTERM signal handler failed.";
}
-
+
// Create the main widget and show it.
MainWidget *mainWidget = new MainWidget(0);
mainWidget->show();
diff --git a/tree-node.cpp b/tree-node.cpp
index dc370fd..804f439 100644
--- a/tree-node.cpp
+++ b/tree-node.cpp
@@ -77,11 +77,13 @@ void TreeNode::addChild(TreeNode *node)
SIGNAL(childrenRemoved(TreeNode*,int,int)));
}
-int TreeNode::indexOf(TreeNode *node) const {
+int TreeNode::indexOf(TreeNode *node) const
+{
return mPriv->mChildren.indexOf(node);
}
-int TreeNode::size() const {
+int TreeNode::size() const
+{
return mPriv->mChildren.size();
}
diff --git a/tree-node.h b/tree-node.h
index 64bcc27..c800621 100644
--- a/tree-node.h
+++ b/tree-node.h
@@ -4,7 +4,7 @@
*
* Copyright (C) 2010 Collabora Ltd. <http://www.collabora.co.uk/>
* Copyright (C) 2011 Martin Klapetek <martin dot klapetek at gmail dot com>
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
--
ktp-contact-list packaging
More information about the pkg-kde-commits
mailing list