[SCM] ktp-common-internals packaging branch, master, updated. debian/15.12.1-2-1839-gf0635e9
Maximiliano Curia
maxy at moszumanska.debian.org
Mon May 9 09:08:29 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-common-internals.git;a=commitdiff;h=6f1b9b2
The following commit has been merged in the master branch:
commit 6f1b9b27091967214f8a07acda2e79668763b189
Author: Aleix Pol <aleixpol at kde.org>
Date: Tue Oct 28 17:08:33 2014 +0100
KIcon -> QIcon
REVIEW: 120851
---
KTp/Declarative/conversation.cpp | 10 ++++++----
KTp/Declarative/conversation.h | 3 +--
KTp/Declarative/pinned-contacts-model.cpp | 5 ++---
KTp/Models/accounts-list-model.cpp | 14 +++++++-------
KTp/Models/accounts-list-model.h | 4 +---
KTp/Models/accounts-tree-proxy-model.cpp | 5 +----
KTp/Models/rooms-model.cpp | 12 ++++++------
KTp/Widgets/contact-view-widget.cpp | 2 +-
KTp/Widgets/settings-kcm-dialog.cpp | 3 +--
KTp/contact-info-dialog.cpp | 7 +++----
KTp/global-presence.cpp | 1 -
KTp/presence.cpp | 16 +++++++---------
KTp/presence.h | 6 ++----
kpeople/actionsplugin/kpeople-actions-plugin.cpp | 22 +++++++++++-----------
tools/debugger/debug-message-view.cpp | 1 -
tools/debugger/main-window.cpp | 1 -
16 files changed, 49 insertions(+), 63 deletions(-)
diff --git a/KTp/Declarative/conversation.cpp b/KTp/Declarative/conversation.cpp
index 59329e9..e575dcb 100644
--- a/KTp/Declarative/conversation.cpp
+++ b/KTp/Declarative/conversation.cpp
@@ -127,11 +127,13 @@ QIcon Conversation::avatar() const
if (d->isGroupChat) {
return QIcon();
} else {
- QString path = d->targetContact->avatarData().fileName;
+ const QString path = d->targetContact->avatarData().fileName;
+ QIcon icon;
if (path.isEmpty()) {
- path = QLatin1String("im-user");
- }
- return KIcon(path);
+ icon = QIcon::fromTheme(QStringLiteral("im-user"));
+ } else
+ icon = QIcon(path);
+ return icon;
}
}
diff --git a/KTp/Declarative/conversation.h b/KTp/Declarative/conversation.h
index 9d72d5d..6f07d66 100644
--- a/KTp/Declarative/conversation.h
+++ b/KTp/Declarative/conversation.h
@@ -21,11 +21,10 @@
#define CONVERSATION_H
#include <QObject>
+#include <QIcon>
#include <TelepathyQt/Account>
#include <TelepathyQt/TextChannel>
-#include <KIcon>
-
#include "messages-model.h"
class MessagesModel;
diff --git a/KTp/Declarative/pinned-contacts-model.cpp b/KTp/Declarative/pinned-contacts-model.cpp
index 88affc4..e972bee 100644
--- a/KTp/Declarative/pinned-contacts-model.cpp
+++ b/KTp/Declarative/pinned-contacts-model.cpp
@@ -29,7 +29,6 @@
#include <TelepathyQt/ContactManager>
#include <TelepathyQt/PendingContacts>
-#include <KIcon>
#include <KGlobal>
#include <KComponentData>
#include <KConfigGroup>
@@ -163,11 +162,11 @@ QVariant PinnedContactsModel::data(const QModelIndex &index, int role) const
if (p->contact()) {
QString file = p->contact()->avatarData().fileName;
if (!file.isEmpty()) {
- icon = KIcon(file);
+ icon = QIcon::fromTheme(file);
}
}
if (icon.isNull()) {
- icon = KIcon(QLatin1String("im-user"));
+ icon = QIcon::fromTheme(QStringLiteral("im-user"));
}
return icon;
}
diff --git a/KTp/Models/accounts-list-model.cpp b/KTp/Models/accounts-list-model.cpp
index 342f935..eff1da8 100644
--- a/KTp/Models/accounts-list-model.cpp
+++ b/KTp/Models/accounts-list-model.cpp
@@ -21,8 +21,8 @@
#include "accounts-list-model.h"
+#include <QIcon>
#include <KDebug>
-#include <KIcon>
#include <KLocalizedString>
#include <KPixmapSequence>
@@ -112,7 +112,7 @@ QVariant KTp::AccountsListModel::data(const QModelIndex &index, int role) const
break;
case Qt::DecorationRole:
- data = QVariant(KIcon(account->iconName()));
+ data = QVariant(QIcon::fromTheme(account->iconName()));
break;
case AccountsListModel::ConnectionStateRole:
@@ -269,7 +269,7 @@ const QString KTp::AccountsListModel::connectionStateString(const Tp::AccountPtr
}
}
-const KIcon KTp::AccountsListModel::connectionStateIcon(const Tp::AccountPtr &account) const
+const QIcon KTp::AccountsListModel::connectionStateIcon(const Tp::AccountPtr &account) const
{
if (account->isEnabled()) {
switch (account->connectionStatus()) {
@@ -277,14 +277,14 @@ const KIcon KTp::AccountsListModel::connectionStateIcon(const Tp::AccountPtr &ac
return KTp::Presence(account->currentPresence()).icon();
case Tp::ConnectionStatusConnecting:
//imho this is not really worth animating, but feel free to play around..
- return KIcon(KPixmapSequence(QLatin1String("process-working"), 22).frameAt(0));
+ return QIcon(KPixmapSequence(QLatin1String("process-working"), 22).frameAt(0));
case Tp::ConnectionStatusDisconnected:
- return KIcon(QLatin1String("user-offline"));
+ return QIcon::fromTheme(QStringLiteral("user-offline"));
default:
- return KIcon(QLatin1String("user-offline"));
+ return QIcon::fromTheme(QStringLiteral("user-offline"));
}
} else {
- return KIcon();
+ return QIcon();
}
}
diff --git a/KTp/Models/accounts-list-model.h b/KTp/Models/accounts-list-model.h
index 9c33955..a624b19 100644
--- a/KTp/Models/accounts-list-model.h
+++ b/KTp/Models/accounts-list-model.h
@@ -29,8 +29,6 @@
#include <KTp/Models/ktpmodels_export.h>
#include <KTp/types.h>
-class KIcon;
-
namespace KTp
{
@@ -71,7 +69,7 @@ private:
Private * const d;
const QString connectionStateString(const Tp::AccountPtr &account) const;
- const KIcon connectionStateIcon(const Tp::AccountPtr &account) const;
+ const QIcon connectionStateIcon(const Tp::AccountPtr &account) const;
const QString connectionStatusReason(const Tp::AccountPtr &account) const;
};
diff --git a/KTp/Models/accounts-tree-proxy-model.cpp b/KTp/Models/accounts-tree-proxy-model.cpp
index eae3eac..4b25d45 100644
--- a/KTp/Models/accounts-tree-proxy-model.cpp
+++ b/KTp/Models/accounts-tree-proxy-model.cpp
@@ -24,9 +24,6 @@
#include <TelepathyQt/AccountManager>
#include <TelepathyQt/AccountSet>
-#include <KIcon>
-
-
class KTp::AccountsTreeProxyModel::Private
{
public:
@@ -77,7 +74,7 @@ QVariant KTp::AccountsTreeProxyModel::dataForGroup(const QString &group, int rol
case Qt::DecorationRole:
account = d->accountManager->accountForObjectPath(group);
if (account) {
- return KIcon(account->iconName());
+ return QIcon::fromTheme(account->iconName());
}
break;
case KTp::AccountRole:
diff --git a/KTp/Models/rooms-model.cpp b/KTp/Models/rooms-model.cpp
index f16fd57..cef2797 100644
--- a/KTp/Models/rooms-model.cpp
+++ b/KTp/Models/rooms-model.cpp
@@ -18,8 +18,8 @@
*/
#include "rooms-model.h"
-#include <KIcon>
#include <KLocale>
+#include <QIcon>
// RoomsModel
KTp::RoomsModel::RoomsModel(QObject *parent): QAbstractListModel(parent)
@@ -64,7 +64,7 @@ QVariant KTp::RoomsModel::data(const QModelIndex &index, int role) const
case Qt::DisplayRole:
case Qt::DecorationRole:
if (roomInfo.info.value(QLatin1String("password")).toBool()) {
- return KIcon(QLatin1String("object-locked"));
+ return QIcon::fromTheme(QStringLiteral("object-locked"));
} else {
return QVariant();
}
@@ -117,9 +117,9 @@ QVariant KTp::RoomsModel::headerData(int section, Qt::Orientation orientation, i
case Qt::DecorationRole:
switch (section) {
case PasswordColumn:
- return KIcon(QLatin1String("object-locked"));
+ return QIcon::fromTheme(QStringLiteral("object-locked"));
case MembersColumn:
- return KIcon(QLatin1String("meeting-participant"));
+ return QIcon::fromTheme(QStringLiteral("meeting-participant"));
}
}
}
@@ -208,9 +208,9 @@ QVariant KTp::FavoriteRoomsModel::data(const QModelIndex &index, int role) const
switch (index.column()) {
case BookmarkColumn:
if (room.value(QLatin1String("is-bookmarked")).toBool()) {
- return KIcon(QLatin1String("bookmarks"));
+ return QIcon::fromTheme(QStringLiteral("bookmarks"));
} else {
- return KIcon(KIcon(QLatin1String("bookmarks")).pixmap(32, 32, QIcon::Disabled));
+ return QIcon(QIcon::fromTheme(QStringLiteral("bookmarks")).pixmap(32, 32, QIcon::Disabled));
}
case HandleNameColumn:
case AccountIdentifierColumn:
diff --git a/KTp/Widgets/contact-view-widget.cpp b/KTp/Widgets/contact-view-widget.cpp
index df2d014..cfb4dc0 100644
--- a/KTp/Widgets/contact-view-widget.cpp
+++ b/KTp/Widgets/contact-view-widget.cpp
@@ -74,7 +74,7 @@ void KTp::ContactViewDelegate::paint(QPainter *painter, const QStyleOptionViewIt
QPixmap avatar;
avatar.load(index.data(KTp::ContactAvatarPathRole).toString());
if (avatar.isNull()) {
- avatar = KIcon(QLatin1String("im-user-online")).pixmap(option.decorationSize);
+ avatar = QIcon::fromTheme(QStringLiteral("im-user-online")).pixmap(option.decorationSize);
} else if (avatar.width() > option.decorationSize.width() || avatar.height() > option.decorationSize.height()) {
//resize larger avatars if required
avatar = avatar.scaled(option.decorationSize, Qt::KeepAspectRatio, Qt::SmoothTransformation);
diff --git a/KTp/Widgets/settings-kcm-dialog.cpp b/KTp/Widgets/settings-kcm-dialog.cpp
index 1ff8b1a..c24980d 100644
--- a/KTp/Widgets/settings-kcm-dialog.cpp
+++ b/KTp/Widgets/settings-kcm-dialog.cpp
@@ -24,7 +24,6 @@
#include <KNotifyConfigWidget>
#include <KMessageBox>
#include <KLocalizedString>
-#include <KIcon>
namespace KTp
{
@@ -64,7 +63,7 @@ void SettingsKcmDialog::addNotificationsModule()
notificationWidget, SLOT(save()));
KPageWidgetItem *notificationPage = new KPageWidgetItem(notificationWidget, i18n("Notifications"));
- notificationPage->setIcon(KIcon(QLatin1String("preferences-desktop-notification")));
+ notificationPage->setIcon(QIcon::fromTheme(QStringLiteral("preferences-desktop-notification")));
addPage(notificationPage);
}
diff --git a/KTp/contact-info-dialog.cpp b/KTp/contact-info-dialog.cpp
index 18f462b..47206cd 100644
--- a/KTp/contact-info-dialog.cpp
+++ b/KTp/contact-info-dialog.cpp
@@ -47,7 +47,6 @@
#include <KMessageBox>
#include <KIconLoader>
#include <KMimeType>
-#include <KIcon>
namespace KTp {
@@ -308,14 +307,14 @@ void ContactInfoDialog::Private::addStateRow(const QString& description, Tp::Con
QIcon icon;
switch (state) {
case Tp::Contact::PresenceStateYes:
- icon = KIcon(QLatin1String("task-complete"));
+ icon = QIcon::fromTheme(QStringLiteral("task-complete"));
break;
case Tp::Contact::PresenceStateNo:
- icon = KIcon(QLatin1String("task-reject"));
+ icon = QIcon::fromTheme(QStringLiteral("task-reject"));
break;
case Tp::Contact::PresenceStateAsk:
default:
- icon = KIcon(QLatin1String("task-attempt"));
+ icon = QIcon::fromTheme(QStringLiteral("task-attempt"));
break;
}
diff --git a/KTp/global-presence.cpp b/KTp/global-presence.cpp
index fd6867f..08e268b 100644
--- a/KTp/global-presence.cpp
+++ b/KTp/global-presence.cpp
@@ -27,7 +27,6 @@
#include <TelepathyQt/PendingReady>
#include <KDebug>
-#include <KIcon>
namespace KTp
{
diff --git a/KTp/presence.cpp b/KTp/presence.cpp
index f061712..6030db0 100644
--- a/KTp/presence.cpp
+++ b/KTp/presence.cpp
@@ -23,7 +23,7 @@
#include <KLocalizedString>
#include <KIconLoader>
-#include <KIcon>
+#include <QIcon>
namespace KTp
{
@@ -38,23 +38,21 @@ Presence::Presence(const Tp::Presence &presence) :
{
}
-KIcon Presence::icon(bool useImIcons) const
+QIcon Presence::icon(bool useImIcons) const
{
const QString &name(iconName(useImIcons));
if (!name.isEmpty()) {
- return KIcon(name);
+ return QIcon::fromTheme(name);
}
- return KIcon();
+ return QIcon();
}
-KIcon Presence::icon(QStringList overlays, bool useImIcons) const
+QIcon Presence::icon(QStringList overlays, bool useImIcons) const
{
const QString &name(iconName(useImIcons));
if (!name.isEmpty()) {
- return KIcon(name,
- KIconLoader::global(),
- overlays);
+ return KIconLoader::global()->loadIcon(name, KIconLoader::NoGroup, 0, KIconLoader::DefaultState, overlays);
}
- return KIcon();
+ return QIcon();
}
QString Presence::iconName(bool useImIcons) const
diff --git a/KTp/presence.h b/KTp/presence.h
index cb7fbf6..7da07d0 100644
--- a/KTp/presence.h
+++ b/KTp/presence.h
@@ -26,8 +26,6 @@
#include <KTp/ktpcommoninternals_export.h>
-class KIcon;
-
namespace KTp
{
@@ -43,7 +41,7 @@ public:
* \param useImIcons Use im-user-* icons instead of the user-* (i.e. the "pawn" icons instead of the "circles").
*
eturn The icon for the current presence.
*/
- KIcon icon(bool useImIcons = false) const;
+ QIcon icon(bool useImIcons = false) const;
/**
* rief Get the icon for the presence with the specified overlays.
@@ -52,7 +50,7 @@ public:
* \param useImIcons Use im-user-* icons instead of the user-* (i.e. the "pawn" icons instead of the "circles").
*
eturn The icon for the current presence.
*/
- KIcon icon(QStringList overlays, bool useImIcons = false) const;
+ QIcon icon(QStringList overlays, bool useImIcons = false) const;
/**
* rief Get the name of the icon for the presence.
diff --git a/kpeople/actionsplugin/kpeople-actions-plugin.cpp b/kpeople/actionsplugin/kpeople-actions-plugin.cpp
index 9fec2d3..f7df625 100644
--- a/kpeople/actionsplugin/kpeople-actions-plugin.cpp
+++ b/kpeople/actionsplugin/kpeople-actions-plugin.cpp
@@ -20,7 +20,7 @@
#include <QAction>
-#include <KIcon>
+#include <QIcon>
#include <KLocalizedString>
#include <KPluginFactory>
#include <KFileDialog>
@@ -48,9 +48,9 @@ enum IMActionType {
class IMAction : public QAction {
Q_OBJECT
public:
- IMAction(const QString &text, const KIcon &icon, const KTp::ContactPtr &contact,
+ IMAction(const QString &text, const QIcon &icon, const KTp::ContactPtr &contact,
const Tp::AccountPtr &account, IMActionType type, QObject *parent);
- IMAction(const QString &text, const KIcon &icon, const QUrl &uri,
+ IMAction(const QString &text, const QIcon &icon, const QUrl &uri,
IMActionType type, QObject *parent);
KTp::ContactPtr contact() const;
Tp::AccountPtr account() const;
@@ -63,7 +63,7 @@ private:
IMActionType m_type;
};
-IMAction::IMAction(const QString &text, const KIcon &icon, const KTp::ContactPtr &contact,
+IMAction::IMAction(const QString &text, const QIcon &icon, const KTp::ContactPtr &contact,
const Tp::AccountPtr &account, IMActionType type, QObject *parent):
QAction(icon, text, parent),
m_contact(contact),
@@ -72,7 +72,7 @@ IMAction::IMAction(const QString &text, const KIcon &icon, const KTp::ContactPtr
{
}
-IMAction::IMAction(const QString &text, const KIcon &icon, const QUrl &uri,
+IMAction::IMAction(const QString &text, const QIcon &icon, const QUrl &uri,
IMActionType type, QObject *parent):
QAction(icon, text, parent),
m_uri(uri),
@@ -134,7 +134,7 @@ QList<QAction*> KPeopleActionsPlugin::actionsForPerson(const KABC::Addressee &pe
if (contact->textChatCapability()) {
QAction *action = new IMAction(i18n("Start Chat Using %1...", account->displayName()),
- KIcon(QLatin1String("text-x-generic")),
+ QIcon::fromTheme(QStringLiteral("text-x-generic")),
contact,
account,
TextChannel,
@@ -144,7 +144,7 @@ QList<QAction*> KPeopleActionsPlugin::actionsForPerson(const KABC::Addressee &pe
}
if (contact->audioCallCapability()) {
QAction *action = new IMAction(i18n("Start Audio Call Using %1...", account->displayName()),
- KIcon(QLatin1String("audio-headset")),
+ QIcon::fromTheme(QStringLiteral("audio-headset")),
contact,
account,
AudioChannel,
@@ -154,7 +154,7 @@ QList<QAction*> KPeopleActionsPlugin::actionsForPerson(const KABC::Addressee &pe
}
if (contact->videoCallCapability()) {
QAction *action = new IMAction(i18n("Start Video Call Using %1...", account->displayName()),
- KIcon(QLatin1String("camera-web")),
+ QIcon::fromTheme(QStringLiteral("camera-web")),
contact,
account,
VideoChannel,
@@ -165,7 +165,7 @@ QList<QAction*> KPeopleActionsPlugin::actionsForPerson(const KABC::Addressee &pe
if (contact->fileTransferCapability()) {
QAction *action = new IMAction(i18n("Send Files Using %1...", account->displayName()),
- KIcon(QLatin1String("mail-attachment")),
+ QIcon::fromTheme(QStringLiteral("mail-attachment")),
contact,
account,
FileTransfer,
@@ -175,7 +175,7 @@ QList<QAction*> KPeopleActionsPlugin::actionsForPerson(const KABC::Addressee &pe
}
if (contact->collaborativeEditingCapability()) {
QAction *action = new IMAction(i18n("Collaboratively edit a document Using %1...", account->displayName()),
- KIcon(QLatin1String("document-edit")),
+ QIcon::fromTheme(QStringLiteral("document-edit")),
contact,
account,
CollabEditing,
@@ -186,7 +186,7 @@ QList<QAction*> KPeopleActionsPlugin::actionsForPerson(const KABC::Addressee &pe
//FIXME-KPEOPLE
// QAction *action = new IMAction(i18n("Open Log Viewer..."),
-// KIcon(QLatin1String("documentation")),
+// QIcon::fromTheme(QStringLiteral("documentation")),
// personData->uri(),
// LogViewer,
// parent);
diff --git a/tools/debugger/debug-message-view.cpp b/tools/debugger/debug-message-view.cpp
index 3eb3214..a93f9b9 100644
--- a/tools/debugger/debug-message-view.cpp
+++ b/tools/debugger/debug-message-view.cpp
@@ -23,7 +23,6 @@
#include <TelepathyQt/PendingDebugMessageList>
#include <KDebug>
-#include <KIcon>
#include <KColorScheme>
#include <KStandardAction>
#include <KAction>
diff --git a/tools/debugger/main-window.cpp b/tools/debugger/main-window.cpp
index ad9ba56..a7b34a8 100644
--- a/tools/debugger/main-window.cpp
+++ b/tools/debugger/main-window.cpp
@@ -25,7 +25,6 @@
#include <QtAlgorithms>
#include <KAction>
-#include <KIcon>
#include <KStatusBar>
#include <KToolBar>
#include <KLocalizedString>
--
ktp-common-internals packaging
More information about the pkg-kde-commits
mailing list