[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:30 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-contact-list.git;a=commitdiff;h=5f06e85
The following commit has been merged in the master branch:
commit 5f06e855154fc0d3098e91041f1ba7040a55cc63
Author: Martin Klapetek <martin.klapetek at gmail.com>
Date: Fri Mar 11 01:17:47 2011 +0100
Fix trailing whitespaces
---
accountbutton.cpp | 58 +++++++++++++++++-----------------
accountbutton.h | 10 +++---
accountfiltermodel.cpp | 7 ++---
accountfiltermodel.h | 11 +++----
accounts-model-item.h | 2 +-
accounts-model.cpp | 6 ++--
accounts-model.h | 1 -
config.h.cmake | 4 +--
contact-model-item.cpp | 2 +-
contactdelegate.cpp | 11 +++----
contactdelegateoverlay.cpp | 10 +++---
contactdelegateoverlay.h | 12 ++++----
contactoverlays.cpp | 77 +++++++++++++++++++++++-----------------------
contactoverlays.h | 72 +++++++++++++++++++++----------------------
contactviewhoverbutton.cpp | 8 ++---
contactviewhoverbutton.h | 8 ++---
16 files changed, 147 insertions(+), 152 deletions(-)
diff --git a/accountbutton.cpp b/accountbutton.cpp
index dbd5d18..1938f39 100644
--- a/accountbutton.cpp
+++ b/accountbutton.cpp
@@ -1,6 +1,6 @@
/*
* Tool button which controls account's presence
- *
+ *
* Copyright (C) 2011 Martin Klapetek <martin dot klapetek at gmail dot com>
*
* This library is free software; you can redistribute it and/or
@@ -47,38 +47,38 @@ AccountButton::AccountButton(const Tp::AccountPtr &account, QWidget* parent): QT
{
m_account = account;
m_statusIndex = -1;
-
+
m_busyOverlay = new KPixmapSequenceOverlayPainter(this);
m_busyOverlay->setWidget(this);
m_busyOverlay->setSequence(KPixmapSequence(QString("process-working")));
-
+
QString iconPath = account->iconName();
-
- //if the icon has not been set, we use the protocol icon
+
+ //if the icon has not been set, we use the protocol icon
if(iconPath.isEmpty()) {
iconPath = QString("im-%1").arg(account->protocolName());
}
-
+
setIcon(KIcon(iconPath));
-
+
if(!account->isValid()) {
//we paint a warning symbol in the right-bottom corner
QPixmap pixmap = icon().pixmap(32, 32);
QPainter painter(&pixmap);
KIcon("dialog-error").paint(&painter, 15, 15, 16, 16);
-
+
setIcon(KIcon(pixmap));
}
-
+
setMaximumWidth(24);
-
+
setAutoRaise(true);
setPopupMode(QToolButton::InstantPopup);
setArrowType(Qt::NoArrow);
-
+
QActionGroup *presenceActions = new QActionGroup(this);
presenceActions->setExclusive(true);
-
+
QAction *onlineAction = new QAction(KIcon("user-online"), i18nc("@action:inmenu", "Available"), this);
QAction *awayAction = new QAction(KIcon("user-away"), i18nc("@action:inmenu", "Away"), this);
QAction *brbAction = new QAction(KIcon("user-busy"), i18nc("@action:inmenu", "Be right back"), this);
@@ -87,7 +87,7 @@ AccountButton::AccountButton(const Tp::AccountPtr &account, QWidget* parent): QT
QAction *xaAction = new QAction(KIcon("user-away-extended"), i18nc("@action:inmenu", "Extended Away"), this);
QAction *invisibleAction = new QAction(KIcon("user-invisible"), i18nc("@action:inmenu", "Invisible"), this);
QAction *offlineAction = new QAction(KIcon("user-offline"), i18nc("@action:inmenu", "Offline"), this);
-
+
//let's set the indexes as data(), so we don't have to rely on putting the actions into indexed list/menu/etc
onlineAction->setData(0);
awayAction->setData(1);
@@ -97,7 +97,7 @@ AccountButton::AccountButton(const Tp::AccountPtr &account, QWidget* parent): QT
xaAction->setData(5);
invisibleAction->setData(6);
offlineAction->setData(7);
-
+
presenceActions->addAction(onlineAction);
presenceActions->addAction(awayAction);
presenceActions->addAction(brbAction);
@@ -106,32 +106,32 @@ AccountButton::AccountButton(const Tp::AccountPtr &account, QWidget* parent): QT
presenceActions->addAction(xaAction);
presenceActions->addAction(invisibleAction);
presenceActions->addAction(offlineAction);
-
+
addActions(presenceActions->actions());
-
+
//make all the actions checkable
foreach(QAction *a, actions()) {
a->setCheckable(true);
-
+
if(m_account->currentPresence().status() == QLatin1String(accountPresenceStatuses[a->data().toInt()])) {
a->setChecked(true);
m_statusIndex = a->data().toInt();
}
}
-
+
connect(this, SIGNAL(triggered(QAction*)),
this, SLOT(setAccountStatus(QAction*)));
-
- connect(m_account.data(),SIGNAL(connectionStatusChanged(Tp::ConnectionStatus)),
+
+ connect(m_account.data(),SIGNAL(connectionStatusChanged(Tp::ConnectionStatus)),
this, SLOT(connectionChanged(Tp::ConnectionStatus)));
-
+
connect(m_account.data(), SIGNAL(currentPresenceChanged(Tp::Presence)),
this, SLOT(preseneceChanged(Tp::Presence)));
-
+
if(m_statusIndex == -1) {
m_statusIndex = 7;
}
-
+
updateToolTip();
}
@@ -144,17 +144,17 @@ void AccountButton::setAccountStatus(QAction *action)
{
int statusIndex = action->data().toInt();
Q_ASSERT(statusIndex >= 0 && statusIndex <= 7);
-
+
m_statusIndex = statusIndex;
-
+
Tp::SimplePresence presence;
presence.type = accountPresenceTypes[statusIndex];
presence.status = QLatin1String(accountPresenceStatuses[statusIndex]);
-
+
Q_ASSERT(!m_account.isNull());
-
+
Tp::PendingOperation* presenceRequest = m_account->setRequestedPresence(presence);
-
+
connect(presenceRequest, SIGNAL(finished(Tp::PendingOperation*)),
this, SLOT(updateToolTip()));
}
@@ -205,5 +205,5 @@ void AccountButton::preseneceChanged(Tp::Presence presence)
m_statusIndex = a->data().toInt();
break;
}
- }
+ }
}
\ No newline at end of file
diff --git a/accountbutton.h b/accountbutton.h
index 497929e..8aa2e4c 100644
--- a/accountbutton.h
+++ b/accountbutton.h
@@ -1,6 +1,6 @@
/*
* Tool button which controls account's presence
- *
+ *
* Copyright (C) 2011 Martin Klapetek <martin dot klapetek at gmail dot com>
*
* This library is free software; you can redistribute it and/or
@@ -32,12 +32,12 @@ class KPixmapSequenceOverlayPainter;
class AccountButton : public QToolButton
{
Q_OBJECT
-
+
public:
AccountButton(const Tp::AccountPtr &account, QWidget *parent = 0);
-
+
QString accountId();
-
+
public Q_SLOTS:
void setAccountStatus(QAction *action);
void updateToolTip();
@@ -45,7 +45,7 @@ public Q_SLOTS:
void showBusyIndicator();
void hideBusyIndicator();
void preseneceChanged(Tp::Presence presence);
-
+
private:
Tp::AccountPtr m_account;
int m_statusIndex;
diff --git a/accountfiltermodel.cpp b/accountfiltermodel.cpp
index 9429c0e..71e8433 100644
--- a/accountfiltermodel.cpp
+++ b/accountfiltermodel.cpp
@@ -46,22 +46,21 @@ 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()) {
-
//filter by name in the contact list
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)) {
-
+
rowAccepted = false;
}
}
diff --git a/accountfiltermodel.h b/accountfiltermodel.h
index a360710..0c0fbc2 100644
--- a/accountfiltermodel.h
+++ b/accountfiltermodel.h
@@ -26,27 +26,26 @@
class AccountFilterModel : public QSortFilterProxyModel
{
Q_OBJECT
-
+
public:
AccountFilterModel(QObject *parent=0);
-
bool filterOfflineUsers() const;
-
+
public slots:
void filterOfflineUsers(bool filterOfflineUsers);
void setFilterString(const QString &str);
void clearFilterString();
-
+
protected:
bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const;
private:
/// Filters out offline users
bool m_filterOfflineUsers;
-
+
/// Used when searching for contact
bool m_filterByName;
-
+
/// Holds the string which is searched in the model
QString m_filterString;
};
diff --git a/accounts-model-item.h b/accounts-model-item.h
index 451e72a..2168775 100644
--- a/accounts-model-item.h
+++ b/accounts-model-item.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
diff --git a/accounts-model.cpp b/accounts-model.cpp
index c2720b1..e41bd79 100644
--- a/accounts-model.cpp
+++ b/accounts-model.cpp
@@ -54,11 +54,11 @@ AccountsModel::AccountsModel(const Tp::AccountManagerPtr &am, QObject *parent)
connect(mPriv->mTree,
SIGNAL(changed(TreeNode*)),
SLOT(onItemChanged(TreeNode*)));
-
+
connect(mPriv->mTree,
SIGNAL(childrenAdded(TreeNode*,QList<TreeNode*>)),
SLOT(onItemsAdded(TreeNode*,QList<TreeNode*>)));
-
+
connect(mPriv->mTree,
SIGNAL(childrenRemoved(TreeNode*,int,int)),
SLOT(onItemsRemoved(TreeNode*,int,int)));
@@ -157,7 +157,7 @@ void AccountsModel::onItemsRemoved(TreeNode *parent, int first, int last)
beginRemoveRows(index(parent->parent()), parentIndex.row(), parentIndex.row());
parent->remove();
endRemoveRows();
-
+
emit accountCountChanged();
}
diff --git a/accounts-model.h b/accounts-model.h
index 8c82212..c503c60 100644
--- a/accounts-model.h
+++ b/accounts-model.h
@@ -95,7 +95,6 @@ public:
virtual QVariant data(const QModelIndex &index, int role) const;
Tp::AccountPtr accountForIndex(const QModelIndex &index) const;
Tp::ContactPtr contactForIndex(const QModelIndex &index) const;
-
Tp::AccountPtr accountForContactIndex(const QModelIndex &index) const;
virtual Qt::ItemFlags flags(const QModelIndex &index) const;
diff --git a/config.h.cmake b/config.h.cmake
index 5f53471..d5ced96 100644
--- a/config.h.cmake
+++ b/config.h.cmake
@@ -1,6 +1,6 @@
#ifndef CONFIG_H
#define CONFIG_H
-
+
#cmakedefine TP_DEBUG
-
+
#endif // CONFIG_H
diff --git a/contact-model-item.cpp b/contact-model-item.cpp
index 8136f3f..39bc14f 100644
--- a/contact-model-item.cpp
+++ b/contact-model-item.cpp
@@ -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
diff --git a/contactdelegate.cpp b/contactdelegate.cpp
index 8912d43..6c470ac 100644
--- a/contactdelegate.cpp
+++ b/contactdelegate.cpp
@@ -92,9 +92,9 @@ void ContactDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opt
const QFontMetrics nameFontMetrics(nameFont);
painter->setFont(nameFont);
- painter->drawText(userNameRect,
+ painter->drawText(userNameRect
nameFontMetrics.elidedText(optV4.text, Qt::ElideRight, userNameRect.width()));
-
+
QRect statusMsgRect = optV4.rect;
statusMsgRect.setX(iconRect.x() + iconRect.width() + SPACING);
statusMsgRect.setY(userNameRect.top() + 16);
@@ -107,7 +107,7 @@ void ContactDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opt
const QFontMetrics statusFontMetrics(statusFont);
QColor fadingColor(m_palette->color(QPalette::WindowText));
-
+
if (index == m_indexForHiding) {
fadingColor.setAlpha(m_fadingValue);
painter->setPen(fadingColor);
@@ -128,14 +128,13 @@ void ContactDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opt
QRect groupLabelRect = groupRect;
groupLabelRect.setLeft(20);
-
+
QRect expandSignRect = groupLabelRect;
expandSignRect.setLeft(groupLabelRect.right()-20);
QFont groupFont = painter->font();
groupFont.setWeight(QFont::Normal);
groupFont.setPixelSize(10);
-
QString counts;// = QString(" (%1/%2)").arg(index.data(AccountsModel::).toString(),
// index.data(ModelRoles::AccountAllContactsCountRole).toString());
@@ -143,7 +142,7 @@ void ContactDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opt
painter->fillRect(groupRect, m_palette->color(QPalette::AlternateBase));
painter->drawPixmap(accountGroupRect, KIcon(index.data(AccountsModel::IconRole).toString()).pixmap(16,16));
-
+
painter->setPen(m_palette->color(QPalette::WindowText));
painter->setFont(groupFont);
painter->drawText(groupLabelRect, Qt::AlignVCenter,
diff --git a/contactdelegateoverlay.cpp b/contactdelegateoverlay.cpp
index a531b9c..bf1fd56 100644
--- a/contactdelegateoverlay.cpp
+++ b/contactdelegateoverlay.cpp
@@ -1,19 +1,19 @@
/*
* Qt item view for images - delegate additions
-*
+*
* Copyright (C) 2009 Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
* Copyright (C) 2011 Martin Klapetek <martin dot klapetek at gmail dot com>
-*
+*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
-*
+*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-*
+*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
@@ -187,7 +187,7 @@ void AbstractWidgetDelegateOverlay::slotEntered(const QModelIndex& index)
void AbstractWidgetDelegateOverlay::slotWidgetAboutToShow(const QModelIndex& index)
{
Q_UNUSED(index);
- m_widget->show();
+ m_widget->show();
}
bool AbstractWidgetDelegateOverlay::checkIndex(const QModelIndex& index) const
diff --git a/contactdelegateoverlay.h b/contactdelegateoverlay.h
index 1b5fb03..3be2bbc 100644
--- a/contactdelegateoverlay.h
+++ b/contactdelegateoverlay.h
@@ -1,19 +1,19 @@
/*
* Qt item view for images - delegate additions
- *
+ *
* Copyright (C) 2009 Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
* Copyright (C) 2011 Martin Klapetek <martin dot klapetek at gmail dot com>
- *
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
@@ -119,11 +119,11 @@ protected:
/** Called when a QEvent::Leave of the viewport is received.
* The default implementation hide()s. */
virtual void viewportLeaveEvent(QObject* obj, QEvent* event);
-
+
Q_SIGNALS:
/// Emitted when the overlay is shown
void overlayActivated(QModelIndex);
-
+
/// Emitted when the overlay is hidden
void overlayHidden();
diff --git a/contactoverlays.cpp b/contactoverlays.cpp
index af953fe..9c106db 100644
--- a/contactoverlays.cpp
+++ b/contactoverlays.cpp
@@ -1,19 +1,19 @@
/*
* Contact overlay buttons
- *
+ *
* Copyright (C) 2009 Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
* Copyright (C) 2011 Martin Klapetek <martin dot klapetek at gmail dot com>
- *
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
@@ -70,7 +70,7 @@ void TextChannelContactOverlay::Button::updateToolTip()
TextChannelContactOverlay::TextChannelContactOverlay(QObject* parent)
: HoverButtonDelegateOverlay(parent)
{
- m_gui = KGuiItem(i18n("Start text channel"), "text-x-generic",
+ m_gui = KGuiItem(i18n("Start text channel"), "text-x-generic",
i18n("Start text channel"), i18n("Whats this"));
}
@@ -123,7 +123,7 @@ bool TextChannelContactOverlay::checkIndex(const QModelIndex& index) const
if(index.data(AccountsModel::TextChatCapabilityRole).toBool()) {
return true;
}
-
+
return false;
}
@@ -132,17 +132,17 @@ bool TextChannelContactOverlay::checkIndex(const QModelIndex& index) const
class AudioChannelContactOverlay::Button : public ContactViewHoverButton
{
public:
-
+
Button(QAbstractItemView* parentView, const KGuiItem& gui);
virtual QSize sizeHint() const;
-
+
protected:
-
+
KGuiItem gui;
-
+
virtual QPixmap icon();
virtual void updateToolTip();
-
+
};
AudioChannelContactOverlay::Button::Button(QAbstractItemView* parentView, const KGuiItem& gui)
@@ -172,9 +172,8 @@ void AudioChannelContactOverlay::Button::updateToolTip()
AudioChannelContactOverlay::AudioChannelContactOverlay(QObject* parent)
: HoverButtonDelegateOverlay(parent)
{
- m_gui = KGuiItem(i18n("Start audio channel"), "voicecall",
+ m_gui = KGuiItem(i18n("Start audio channel"), "voicecall",
i18n("Start audio channel"), i18n("Whats this"));
-
}
AudioChannelContactOverlay::Button *AudioChannelContactOverlay::button() const
@@ -185,7 +184,7 @@ AudioChannelContactOverlay::Button *AudioChannelContactOverlay::button() const
void AudioChannelContactOverlay::setActive(bool active)
{
HoverButtonDelegateOverlay::setActive(active);
-
+
if (active) {
connect(button(), SIGNAL(clicked(bool)),
this, SLOT(slotClicked(bool)));
@@ -204,7 +203,7 @@ void AudioChannelContactOverlay::updateButton(const QModelIndex& index)
{
const QRect rect = m_view->visualRect(index);
const QSize size = button()->size();
-
+
const int gap = 5;
const int x = rect.right() - gap - 72 - size.width();
const int y = rect.bottom() - gap - size.height();
@@ -215,7 +214,7 @@ void AudioChannelContactOverlay::slotClicked(bool checked)
{
Q_UNUSED(checked);
QModelIndex index = button()->index();
-
+
if (index.isValid()) {
emit activated(index);
}
@@ -226,7 +225,7 @@ bool AudioChannelContactOverlay::checkIndex(const QModelIndex& index) const
if(index.data(AccountsModel::AudioCallCapabilityRole).toBool()) {
return true;
}
-
+
return false;
}
@@ -235,17 +234,17 @@ bool AudioChannelContactOverlay::checkIndex(const QModelIndex& index) const
class VideoChannelContactOverlay::Button : public ContactViewHoverButton
{
public:
-
+
Button(QAbstractItemView* parentView, const KGuiItem& gui);
virtual QSize sizeHint() const;
-
+
protected:
-
+
KGuiItem gui;
-
+
virtual QPixmap icon();
virtual void updateToolTip();
-
+
};
VideoChannelContactOverlay::Button::Button(QAbstractItemView* parentView, const KGuiItem& gui)
@@ -275,8 +274,8 @@ void VideoChannelContactOverlay::Button::updateToolTip()
VideoChannelContactOverlay::VideoChannelContactOverlay(QObject* parent)
: HoverButtonDelegateOverlay(parent)
{
- m_gui = KGuiItem(i18n("Start video channel"), "camera-web",
- i18n("Start video channel"), i18n("Whats this"));
+ m_gui = KGuiItem(i18n("Start video channel"), "camera-web",
+ i18n("Start video channel"), i18n("Whats this"));
}
VideoChannelContactOverlay::Button *VideoChannelContactOverlay::button() const
@@ -287,7 +286,7 @@ VideoChannelContactOverlay::Button *VideoChannelContactOverlay::button() const
void VideoChannelContactOverlay::setActive(bool active)
{
HoverButtonDelegateOverlay::setActive(active);
-
+
if (active) {
connect(button(), SIGNAL(clicked(bool)),
this, SLOT(slotClicked(bool)));
@@ -306,7 +305,7 @@ void VideoChannelContactOverlay::updateButton(const QModelIndex& index)
{
const QRect rect = m_view->visualRect(index);
const QSize size = button()->size();
-
+
const int gap = 5;
const int x = rect.right() - gap - 50 - size.width();
const int y = rect.bottom() - gap - size.height();
@@ -317,7 +316,7 @@ void VideoChannelContactOverlay::slotClicked(bool checked)
{
Q_UNUSED(checked);
QModelIndex index = button()->index();
-
+
if (index.isValid()) {
emit activated(index);
}
@@ -328,7 +327,7 @@ bool VideoChannelContactOverlay::checkIndex(const QModelIndex& index) const
if(index.data(AccountsModel::VideoCallCapabilityRole).toBool()) {
return true;
}
-
+
return false;
}
@@ -337,17 +336,17 @@ bool VideoChannelContactOverlay::checkIndex(const QModelIndex& index) const
class FileTransferContactOverlay::Button : public ContactViewHoverButton
{
public:
-
+
Button(QAbstractItemView* parentView, const KGuiItem& gui);
virtual QSize sizeHint() const;
-
+
protected:
-
+
KGuiItem gui;
-
+
virtual QPixmap icon();
virtual void updateToolTip();
-
+
};
FileTransferContactOverlay::Button::Button(QAbstractItemView* parentView, const KGuiItem& gui)
@@ -377,8 +376,8 @@ void FileTransferContactOverlay::Button::updateToolTip()
FileTransferContactOverlay::FileTransferContactOverlay(QObject* parent)
: HoverButtonDelegateOverlay(parent)
{
- m_gui = KGuiItem(i18n("Send file"), "mail-attachment",
- i18n("Send file"), i18n("Whats this"));
+ m_gui = KGuiItem(i18n("Send file"), "mail-attachment",
+ i18n("Send file"), i18n("Whats this"));
}
FileTransferContactOverlay::Button *FileTransferContactOverlay::button() const
@@ -389,7 +388,7 @@ FileTransferContactOverlay::Button *FileTransferContactOverlay::button() const
void FileTransferContactOverlay::setActive(bool active)
{
HoverButtonDelegateOverlay::setActive(active);
-
+
if (active) {
connect(button(), SIGNAL(clicked(bool)),
this, SLOT(slotClicked(bool)));
@@ -408,7 +407,7 @@ void FileTransferContactOverlay::updateButton(const QModelIndex& index)
{
const QRect rect = m_view->visualRect(index);
const QSize size = button()->size();
-
+
const int gap = 5;
const int x = rect.right() - gap - 132 - size.width();
const int y = rect.bottom() - gap - size.height();
@@ -419,7 +418,7 @@ void FileTransferContactOverlay::slotClicked(bool checked)
{
Q_UNUSED(checked);
QModelIndex index = button()->index();
-
+
if (index.isValid()) {
emit activated(index);
}
@@ -430,6 +429,6 @@ bool FileTransferContactOverlay::checkIndex(const QModelIndex& index) const
if(index.data(AccountsModel::FileTransferCapabilityRole).toBool()) {
return true;
}
-
+
return false;
}
\ No newline at end of file
diff --git a/contactoverlays.h b/contactoverlays.h
index 67a2d78..51d12a9 100644
--- a/contactoverlays.h
+++ b/contactoverlays.h
@@ -1,19 +1,19 @@
/*
* Contact overlay buttons
- *
+ *
* Copyright (C) 2009 Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
* Copyright (C) 2011 Martin Klapetek <martin dot klapetek at gmail dot com>
- *
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
@@ -63,30 +63,30 @@ protected:
class AudioChannelContactOverlay : public HoverButtonDelegateOverlay
{
Q_OBJECT
-
+
public:
-
+
AudioChannelContactOverlay(QObject* parent);
virtual void setActive(bool active);
-
+
Q_SIGNALS:
-
+
void activated(const QModelIndex& index);
-
+
protected:
-
+
virtual ContactViewHoverButton* createButton();
virtual void updateButton(const QModelIndex& index);
virtual bool checkIndex(const QModelIndex& index) const;
-
+
protected Q_SLOTS:
-
+
void slotClicked(bool checked);
-
+
protected:
-
+
KGuiItem m_gui;
-
+
class Button;
Button *button() const;
};
@@ -96,30 +96,30 @@ protected:
class VideoChannelContactOverlay : public HoverButtonDelegateOverlay
{
Q_OBJECT
-
+
public:
-
+
VideoChannelContactOverlay(QObject* parent);
virtual void setActive(bool active);
-
+
Q_SIGNALS:
-
+
void activated(const QModelIndex& index);
-
+
protected:
-
+
virtual ContactViewHoverButton* createButton();
virtual void updateButton(const QModelIndex& index);
virtual bool checkIndex(const QModelIndex& index) const;
-
+
protected Q_SLOTS:
-
+
void slotClicked(bool checked);
-
+
protected:
-
+
KGuiItem m_gui;
-
+
class Button;
Button *button() const;
};
@@ -129,30 +129,30 @@ protected:
class FileTransferContactOverlay : public HoverButtonDelegateOverlay
{
Q_OBJECT
-
+
public:
-
+
FileTransferContactOverlay(QObject* parent);
virtual void setActive(bool active);
Q_SIGNALS:
-
+
void activated(const QModelIndex& index);
-
+
protected:
-
+
virtual ContactViewHoverButton* createButton();
virtual void updateButton(const QModelIndex& index);
virtual bool checkIndex(const QModelIndex& index) const;
-
+
protected Q_SLOTS:
-
+
void slotClicked(bool checked);
-
+
protected:
-
+
KGuiItem m_gui;
-
+
class Button;
Button *button() const;
};
diff --git a/contactviewhoverbutton.cpp b/contactviewhoverbutton.cpp
index 0a2fc30..f06626b 100644
--- a/contactviewhoverbutton.cpp
+++ b/contactviewhoverbutton.cpp
@@ -1,20 +1,20 @@
/*
* Qt item view mouse hover button
- *
+ *
* Copyright (C) 2008 Peter Penz <peter dot penz at gmx dot at>
* Copyright (C) 2009 Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
* Copyright (C) 2011 Martin Klapetek <martin dot klapetek at gmail dot com>
- *
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
diff --git a/contactviewhoverbutton.h b/contactviewhoverbutton.h
index ac91a3b..a3e8a9d 100644
--- a/contactviewhoverbutton.h
+++ b/contactviewhoverbutton.h
@@ -1,19 +1,19 @@
/*
* Qt item view mouse hover button
- *
+ *
* Copyright (C) 2009 Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
* Copyright (C) 2011 Martin Klapetek <martin dot klapetek at gmail dot com>
- *
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
--
ktp-contact-list packaging
More information about the pkg-kde-commits
mailing list