gnome: adapt to new LRC interfaces API

Issue: #79656
Change-Id: Id83710705709656689a680a21eb5de1b7a05b667
diff --git a/src/callsview.cpp b/src/callsview.cpp
index 581a6f3..5271438 100644
--- a/src/callsview.cpp
+++ b/src/callsview.cpp
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2015 Savoir-Faire Linux Inc.
+ *  Copyright (C) 2015 Savoir-faire Linux Inc.
  *  Author: Stepan Salenikovich <stepan.salenikovich@savoirfairelinux.com>
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -21,7 +21,7 @@
  *  If you modify this program, or any covered work, by linking or
  *  combining it with the OpenSSL project's OpenSSL library (or a
  *  modified version of that library), containing parts covered by the
- *  terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
+ *  terms of the OpenSSL or SSLeay licenses, Savoir-faire Linux Inc.
  *  grants you additional permission to convey the resulting work.
  *  Corresponding Source for a non-source form of such a combination
  *  shall include the source code for the parts of OpenSSL used as well
@@ -35,7 +35,8 @@
 #include <callmodel.h>
 #include <QtCore/QItemSelectionModel>
 #include "utils/models.h"
-#include "delegates/pixbufdelegate.h"
+#include <globalinstances.h>
+#include "native/pixbufmanipulator.h"
 #include <QtCore/QSize>
 #include "defines.h"
 #include "utils/menus.h"
@@ -105,7 +106,7 @@
          * since before then we likely don't know the contact yet anyways */
         if (c->lifeCycleState() != Call::LifeCycleState::CREATION) {
             /* get photo */
-            QVariant var_p = PixbufDelegate::instance()->callPhoto(c, QSize(50, 50), false);
+            QVariant var_p = GlobalInstances::pixmapManipulator().callPhoto(c, QSize(50, 50), false);
             std::shared_ptr<GdkPixbuf> photo = var_p.value<std::shared_ptr<GdkPixbuf>>();
             g_object_set(G_OBJECT(cell), "pixbuf", photo.get(), NULL);
             return;
diff --git a/src/choosecontactview.cpp b/src/choosecontactview.cpp
index 1f8f6c9..ecbe4bf 100644
--- a/src/choosecontactview.cpp
+++ b/src/choosecontactview.cpp
@@ -35,7 +35,8 @@
 #include <QtCore/QSortFilterProxyModel>
 #include <memory>
 #include "models/gtkqsortfiltertreemodel.h"
-#include "delegates/pixbufdelegate.h"
+#include <globalinstances.h>
+#include "native/pixbufmanipulator.h"
 #include "utils/models.h"
 
 enum
@@ -92,7 +93,7 @@
             QVariant var_c = idx.data(static_cast<int>(Person::Role::Object));
             Person *c = var_c.value<Person *>();
             /* get photo */
-            QVariant var_p = PixbufDelegate::instance()->contactPhoto(c, QSize(50, 50), false);
+            QVariant var_p = GlobalInstances::pixmapManipulator().contactPhoto(c, QSize(50, 50), false);
             std::shared_ptr<GdkPixbuf> photo = var_p.value<std::shared_ptr<GdkPixbuf>>();
             g_object_set(G_OBJECT(cell), "pixbuf", photo.get(), NULL);
             return;
diff --git a/src/contactsview.cpp b/src/contactsview.cpp
index 8b0f93e..4058d14 100644
--- a/src/contactsview.cpp
+++ b/src/contactsview.cpp
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2015 Savoir-Faire Linux Inc.
+ *  Copyright (C) 2015 Savoir-faire Linux Inc.
  *  Author: Stepan Salenikovich <stepan.salenikovich@savoirfairelinux.com>
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -21,7 +21,7 @@
  *  If you modify this program, or any covered work, by linking or
  *  combining it with the OpenSSL project's OpenSSL library (or a
  *  modified version of that library), containing parts covered by the
- *  terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
+ *  terms of the OpenSSL or SSLeay licenses, Savoir-faire Linux Inc.
  *  grants you additional permission to convey the resulting work.
  *  Corresponding Source for a non-source form of such a combination
  *  shall include the source code for the parts of OpenSSL used as well
@@ -36,7 +36,8 @@
 #include <personmodel.h>
 #include "utils/calling.h"
 #include <memory>
-#include "delegates/pixbufdelegate.h"
+#include <globalinstances.h>
+#include "native/pixbufmanipulator.h"
 #include <contactmethod.h>
 #include "defines.h"
 #include "utils/models.h"
@@ -85,7 +86,7 @@
             QVariant var_c = idx.data(static_cast<int>(Person::Role::Object));
             Person *c = var_c.value<Person *>();
             /* get photo */
-            QVariant var_p = PixbufDelegate::instance()->contactPhoto(c, QSize(50, 50), false);
+            QVariant var_p = GlobalInstances::pixmapManipulator().contactPhoto(c, QSize(50, 50), false);
             std::shared_ptr<GdkPixbuf> photo = var_p.value<std::shared_ptr<GdkPixbuf>>();
             g_object_set(G_OBJECT(cell), "pixbuf", photo.get(), NULL);
             return;
diff --git a/src/currentcallview.cpp b/src/currentcallview.cpp
index 1a8b704..cd1785b 100644
--- a/src/currentcallview.cpp
+++ b/src/currentcallview.cpp
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2015 Savoir-Faire Linux Inc.
+ *  Copyright (C) 2015 Savoir-faire Linux Inc.
  *  Author: Stepan Salenikovich <stepan.salenikovich@savoirfairelinux.com>
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -21,7 +21,7 @@
  *  If you modify this program, or any covered work, by linking or
  *  combining it with the OpenSSL project's OpenSSL library (or a
  *  modified version of that library), containing parts covered by the
- *  terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
+ *  terms of the OpenSSL or SSLeay licenses, Savoir-faire Linux Inc.
  *  grants you additional permission to convey the resulting work.
  *  Corresponding Source for a non-source form of such a combination
  *  shall include the source code for the parts of OpenSSL used as well
@@ -38,7 +38,8 @@
 #include <video/previewmanager.h>
 #include <contactmethod.h>
 #include <person.h>
-#include "delegates/pixbufdelegate.h"
+#include <globalinstances.h>
+#include "native/pixbufmanipulator.h"
 #include <media/media.h>
 #include <media/text.h>
 #include <media/textrecording.h>
@@ -479,7 +480,7 @@
     priv->call = CallModel::instance()->getCall(idx);
 
     /* get call image */
-    QVariant var_i = PixbufDelegate::instance()->callPhoto(priv->call, QSize(60, 60), false);
+    QVariant var_i = GlobalInstances::pixmapManipulator().callPhoto(priv->call, QSize(60, 60), false);
     std::shared_ptr<GdkPixbuf> image = var_i.value<std::shared_ptr<GdkPixbuf>>();
     gtk_image_set_from_pixbuf(GTK_IMAGE(priv->image_peer), image.get());
 
diff --git a/src/frequentcontactsview.cpp b/src/frequentcontactsview.cpp
index eca6cfe..74be6ac 100644
--- a/src/frequentcontactsview.cpp
+++ b/src/frequentcontactsview.cpp
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2015 Savoir-Faire Linux Inc.
+ *  Copyright (C) 2015 Savoir-faire Linux Inc.
  *  Author: Stepan Salenikovich <stepan.salenikovich@savoirfairelinux.com>
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -21,7 +21,7 @@
  *  If you modify this program, or any covered work, by linking or
  *  combining it with the OpenSSL project's OpenSSL library (or a
  *  modified version of that library), containing parts covered by the
- *  terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
+ *  terms of the OpenSSL or SSLeay licenses, Savoir-faire Linux Inc.
  *  grants you additional permission to convey the resulting work.
  *  Corresponding Source for a non-source form of such a combination
  *  shall include the source code for the parts of OpenSSL used as well
@@ -34,7 +34,8 @@
 #include "models/gtkqtreemodel.h"
 #include "utils/calling.h"
 #include <memory>
-#include "delegates/pixbufdelegate.h"
+#include <globalinstances.h>
+#include "native/pixbufmanipulator.h"
 #include <contactmethod.h>
 #include "defines.h"
 #include "utils/models.h"
@@ -88,7 +89,7 @@
         auto n = idx.data(static_cast<int>(Call::Role::ContactMethod)).value<ContactMethod *>();
         if (n) {
             /* get photo */
-            QVariant var_p = PixbufDelegate::instance()->callPhoto(n, QSize(50, 50), false);
+            QVariant var_p = GlobalInstances::pixmapManipulator().callPhoto(n, QSize(50, 50), false);
             std::shared_ptr<GdkPixbuf> photo = var_p.value<std::shared_ptr<GdkPixbuf>>();
             g_object_set(G_OBJECT(cell), "pixbuf", photo.get(), NULL);
             return;
diff --git a/src/historyview.cpp b/src/historyview.cpp
index f53c603..bf52620 100644
--- a/src/historyview.cpp
+++ b/src/historyview.cpp
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2015 Savoir-Faire Linux Inc.
+ *  Copyright (C) 2015 Savoir-faire Linux Inc.
  *  Author: Stepan Salenikovich <stepan.salenikovich@savoirfairelinux.com>
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -21,7 +21,7 @@
  *  If you modify this program, or any covered work, by linking or
  *  combining it with the OpenSSL project's OpenSSL library (or a
  *  modified version of that library), containing parts covered by the
- *  terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
+ *  terms of the OpenSSL or SSLeay licenses, Savoir-faire Linux Inc.
  *  grants you additional permission to convey the resulting work.
  *  Corresponding Source for a non-source form of such a combination
  *  shall include the source code for the parts of OpenSSL used as well
@@ -37,7 +37,8 @@
 #include <personmodel.h>
 #include "utils/calling.h"
 #include <memory>
-#include "delegates/pixbufdelegate.h"
+#include <globalinstances.h>
+#include "native/pixbufmanipulator.h"
 #include "defines.h"
 #include "utils/models.h"
 #include <contactmethod.h>
@@ -241,7 +242,7 @@
             QVariant var_c = idx.data(static_cast<int>(Call::Role::Object));
             Call *c = var_c.value<Call *>();
             /* get photo */
-            QVariant var_p = PixbufDelegate::instance()->callPhoto(c, QSize(50, 50), false);
+            QVariant var_p = GlobalInstances::pixmapManipulator().callPhoto(c, QSize(50, 50), false);
             std::shared_ptr<GdkPixbuf> photo = var_p.value<std::shared_ptr<GdkPixbuf>>();
             g_object_set(G_OBJECT(cell), "pixbuf", photo.get(), NULL);
             return;
diff --git a/src/incomingcallview.cpp b/src/incomingcallview.cpp
index 18b8b3c..11a6e82 100644
--- a/src/incomingcallview.cpp
+++ b/src/incomingcallview.cpp
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2015 Savoir-Faire Linux Inc.
+ *  Copyright (C) 2015 Savoir-faire Linux Inc.
  *  Author: Stepan Salenikovich <stepan.salenikovich@savoirfairelinux.com>
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -21,7 +21,7 @@
  *  If you modify this program, or any covered work, by linking or
  *  combining it with the OpenSSL project's OpenSSL library (or a
  *  modified version of that library), containing parts covered by the
- *  terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
+ *  terms of the OpenSSL or SSLeay licenses, Savoir-faire Linux Inc.
  *  grants you additional permission to convey the resulting work.
  *  Corresponding Source for a non-source form of such a combination
  *  shall include the source code for the parts of OpenSSL used as well
@@ -36,7 +36,8 @@
 #include <callmodel.h>
 #include <contactmethod.h>
 #include <person.h>
-#include "delegates/pixbufdelegate.h"
+#include <globalinstances.h>
+#include "native/pixbufmanipulator.h"
 
 struct _IncomingCallView
 {
@@ -173,7 +174,7 @@
     Call *call = CallModel::instance()->getCall(idx);
 
     /* get call image */
-    QVariant var_i = PixbufDelegate::instance()->callPhoto(call, QSize(110, 110), false);
+    QVariant var_i = GlobalInstances::pixmapManipulator().callPhoto(call, QSize(110, 110), false);
     std::shared_ptr<GdkPixbuf> image = var_i.value<std::shared_ptr<GdkPixbuf>>();
     gtk_image_set_from_pixbuf(GTK_IMAGE(priv->image_incoming), image.get());
 
diff --git a/src/delegates/pixbufdelegate.cpp b/src/native/pixbufmanipulator.cpp
similarity index 70%
rename from src/delegates/pixbufdelegate.cpp
rename to src/native/pixbufmanipulator.cpp
index 0d0f07a..e1458ad 100644
--- a/src/delegates/pixbufdelegate.cpp
+++ b/src/native/pixbufmanipulator.cpp
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2015 Savoir-Faire Linux Inc.
+ *  Copyright (C) 2015 Savoir-faire Linux Inc.
  *  Author: Stepan Salenikovich <stepan.salenikovich@savoirfairelinux.com>
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -21,14 +21,14 @@
  *  If you modify this program, or any covered work, by linking or
  *  combining it with the OpenSSL project's OpenSSL library (or a
  *  modified version of that library), containing parts covered by the
- *  terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
+ *  terms of the OpenSSL or SSLeay licenses, Savoir-faire Linux Inc.
  *  grants you additional permission to convey the resulting work.
  *  Corresponding Source for a non-source form of such a combination
  *  shall include the source code for the parts of OpenSSL used as well
  *  as that of the covered work.
  */
 
-#include "pixbufdelegate.h"
+#include "pixbufmanipulator.h"
 
 #include "../utils/drawing.h"
 #include <QtCore/QSize>
@@ -38,14 +38,15 @@
 #include <call.h>
 #include <contactmethod.h>
 
-PixbufDelegate::PixbufDelegate()
-    : PixmapManipulationDelegate()
-    , fallbackAvatar_{ring_draw_fallback_avatar(FALLBACK_AVATAR_SIZE), g_object_unref}
+namespace Interfaces {
+
+PixbufManipulator::PixbufManipulator()
+    : fallbackAvatar_{ring_draw_fallback_avatar(FALLBACK_AVATAR_SIZE), g_object_unref}
 {
 }
 
 std::shared_ptr<GdkPixbuf>
-PixbufDelegate::scaleAndFrame(const GdkPixbuf *photo, const QSize& size)
+PixbufManipulator::scaleAndFrame(const GdkPixbuf *photo, const QSize& size)
 {
     /**
      * for now, respect the height requested
@@ -76,13 +77,13 @@
 }
 
 QVariant
-PixbufDelegate::callPhoto(Call* c, const QSize& size, bool displayPresence)
+PixbufManipulator::callPhoto(Call* c, const QSize& size, bool displayPresence)
 {
     return callPhoto(c->peerContactMethod(), size, displayPresence);
 }
 
 QVariant
-PixbufDelegate::callPhoto(const ContactMethod* n, const QSize& size, bool displayPresence)
+PixbufManipulator::callPhoto(const ContactMethod* n, const QSize& size, bool displayPresence)
 {
     if (n->contact()) {
         return contactPhoto(n->contact(), size, displayPresence);
@@ -92,7 +93,7 @@
 }
 
 QVariant
-PixbufDelegate::contactPhoto(Person* c, const QSize& size, bool displayPresence)
+PixbufManipulator::contactPhoto(Person* c, const QSize& size, bool displayPresence)
 {
     Q_UNUSED(displayPresence);
 
@@ -111,7 +112,7 @@
     return QVariant::fromValue(scaleAndFrame(photo.get(), size));
 }
 
-QVariant PixbufDelegate::personPhoto(const QByteArray& data, const QString& type)
+QVariant PixbufManipulator::personPhoto(const QByteArray& data, const QString& type)
 {
     Q_UNUSED(type);
     /* Try to load the image from the data provided by lrc vcard utils;
@@ -163,3 +164,61 @@
     /* could not load image, return emtpy QVariant */
     return QVariant();
 }
+
+QVariant
+PixbufManipulator::numberCategoryIcon(const QVariant& p, const QSize& size, bool displayPresence, bool isPresent)
+{
+    Q_UNUSED(p)
+    Q_UNUSED(size)
+    Q_UNUSED(displayPresence)
+    Q_UNUSED(isPresent)
+    return QVariant();
+}
+
+QVariant
+PixbufManipulator::securityIssueIcon(const QModelIndex& index)
+{
+    Q_UNUSED(index)
+    return QVariant();
+}
+
+QByteArray
+PixbufManipulator::toByteArray(const QVariant& pxm)
+{
+    Q_UNUSED(pxm);
+    return QByteArray();
+}
+
+QVariant
+PixbufManipulator::collectionIcon(const CollectionInterface* interface, PixmapManipulatorI::CollectionIconHint hint) const
+{
+    Q_UNUSED(interface)
+    Q_UNUSED(hint)
+    return QVariant();
+}
+QVariant
+PixbufManipulator::securityLevelIcon(const SecurityEvaluationModel::SecurityLevel level) const
+{
+    Q_UNUSED(level)
+    return QVariant();
+}
+QVariant
+PixbufManipulator::historySortingCategoryIcon(const CategorizedHistoryModel::SortedProxy::Categories cat) const
+{
+    Q_UNUSED(cat)
+    return QVariant();
+}
+QVariant
+PixbufManipulator::contactSortingCategoryIcon(const CategorizedContactModel::SortedProxy::Categories cat) const
+{
+    Q_UNUSED(cat)
+    return QVariant();
+}
+QVariant
+PixbufManipulator::userActionIcon(const UserActionElement& state) const
+{
+    Q_UNUSED(state)
+    return QVariant();
+}
+
+} // namespace Interfaces
diff --git a/src/delegates/pixbufdelegate.h b/src/native/pixbufmanipulator.h
similarity index 61%
rename from src/delegates/pixbufdelegate.h
rename to src/native/pixbufmanipulator.h
index 6fe3462..77ec780 100644
--- a/src/delegates/pixbufdelegate.h
+++ b/src/native/pixbufmanipulator.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2015 Savoir-Faire Linux Inc.
+ *  Copyright (C) 2015 Savoir-faire Linux Inc.
  *  Author: Stepan Salenikovich <stepan.salenikovich@savoirfairelinux.com>
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -21,37 +21,48 @@
  *  If you modify this program, or any covered work, by linking or
  *  combining it with the OpenSSL project's OpenSSL library (or a
  *  modified version of that library), containing parts covered by the
- *  terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
+ *  terms of the OpenSSL or SSLeay licenses, Savoir-faire Linux Inc.
  *  grants you additional permission to convey the resulting work.
  *  Corresponding Source for a non-source form of such a combination
  *  shall include the source code for the parts of OpenSSL used as well
  *  as that of the covered work.
  */
 
-#ifndef PIXBUFDELEGATE_H
-#define PIXBUFDELEGATE_H
+#pragma once
 
 #include <gtk/gtk.h>
 #include <memory>
-#include <delegates/pixmapmanipulationdelegate.h>
+#include <interfaces/pixmapmanipulatori.h>
 
 Q_DECLARE_METATYPE(std::shared_ptr<GdkPixbuf>);
 
 class Person;
 
-class PixbufDelegate : public PixmapManipulationDelegate {
+namespace Interfaces {
+
+class PixbufManipulator : public PixmapManipulatorI {
     constexpr static int FALLBACK_AVATAR_SIZE {100};
 public:
-    PixbufDelegate();
+    PixbufManipulator();
 
     QVariant callPhoto(Call* c, const QSize& size, bool displayPresence = true) override;
     QVariant callPhoto(const ContactMethod* n, const QSize& size, bool displayPresence = true) override;
     QVariant contactPhoto(Person* c, const QSize& size, bool displayPresence = true) override;
     QVariant personPhoto(const QByteArray& data, const QString& type = "PNG") override;
 
+    /* TODO: the following methods return an empty QVariant/QByteArray */
+    QVariant   numberCategoryIcon(const QVariant& p, const QSize& size, bool displayPresence = false, bool isPresent = false) override;
+    QVariant   securityIssueIcon(const QModelIndex& index) override;
+    QByteArray toByteArray(const QVariant& pxm) override;
+    QVariant   collectionIcon(const CollectionInterface* interface, PixmapManipulatorI::CollectionIconHint hint = PixmapManipulatorI::CollectionIconHint::NONE) const override;
+    QVariant   securityLevelIcon(const SecurityEvaluationModel::SecurityLevel level) const override;
+    QVariant   historySortingCategoryIcon(const CategorizedHistoryModel::SortedProxy::Categories cat) const override;
+    QVariant   contactSortingCategoryIcon(const CategorizedContactModel::SortedProxy::Categories cat) const override;
+    QVariant   userActionIcon(const UserActionElement& state) const override;
+
 private:
     std::shared_ptr<GdkPixbuf> scaleAndFrame(const GdkPixbuf *photo, const QSize& size);
     std::shared_ptr<GdkPixbuf> fallbackAvatar_;
 };
 
-#endif /* PIXBUFDELEGATE_H */
\ No newline at end of file
+} // namespace Interfaces
diff --git a/src/ring_client.cpp b/src/ring_client.cpp
index 31ea81d..49e8928 100644
--- a/src/ring_client.cpp
+++ b/src/ring_client.cpp
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2015 Savoir-Faire Linux Inc.
+ *  Copyright (C) 2015 Savoir-faire Linux Inc.
  *  Author: Stepan Salenikovich <stepan.salenikovich@savoirfairelinux.com>
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -21,7 +21,7 @@
  *  If you modify this program, or any covered work, by linking or
  *  combining it with the OpenSSL project's OpenSSL library (or a
  *  modified version of that library), containing parts covered by the
- *  terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
+ *  terms of the OpenSSL or SSLeay licenses, Savoir-faire Linux Inc.
  *  grants you additional permission to convey the resulting work.
  *  Corresponding Source for a non-source form of such a combination
  *  shall include the source code for the parts of OpenSSL used as well
@@ -46,12 +46,14 @@
 #include <localhistorycollection.h>
 #include <media/text.h>
 #include <numbercategorymodel.h>
+#include <globalinstances.h>
+#include <memory>
 
 #include "ring_client_options.h"
 #include "ringmainwindow.h"
 #include "dialogs.h"
 #include "backends/edscontactbackend.h"
-#include "delegates/pixbufdelegate.h"
+#include "native/pixbufmanipulator.h"
 #include "ringnotify.h"
 #include "config.h"
 #include "utils/files.h"
@@ -261,8 +263,7 @@
     }
 
     /* init delegates */
-    /* FIXME: put in smart pointer? */
-    new PixbufDelegate();
+    GlobalInstances::setPixmapManipulator(std::unique_ptr<Interfaces::PixbufManipulator>(new Interfaces::PixbufManipulator()));
 
     /* make sure all RING accounts have a display name... this basically makes sure
      * that all accounts created before the display name patch have a display name
diff --git a/src/ringmainwindow.cpp b/src/ringmainwindow.cpp
index cfed4ba..bb3271d 100644
--- a/src/ringmainwindow.cpp
+++ b/src/ringmainwindow.cpp
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2015 Savoir-Faire Linux Inc.
+ *  Copyright (C) 2015 Savoir-faire Linux Inc.
  *  Author: Stepan Salenikovich <stepan.salenikovich@savoirfairelinux.com>
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -21,7 +21,7 @@
  *  If you modify this program, or any covered work, by linking or
  *  combining it with the OpenSSL project's OpenSSL library (or a
  *  modified version of that library), containing parts covered by the
- *  terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
+ *  terms of the OpenSSL or SSLeay licenses, Savoir-faire Linux Inc.
  *  grants you additional permission to convey the resulting work.
  *  Corresponding Source for a non-source form of such a combination
  *  shall include the source code for the parts of OpenSSL used as well
@@ -50,7 +50,8 @@
 #include <personmodel.h>
 #include "utils/drawing.h"
 #include <memory>
-#include "delegates/pixbufdelegate.h"
+#include <globalinstances.h>
+#include "native/pixbufmanipulator.h"
 #include "models/activeitemproxymodel.h"
 #include <numbercompletionmodel.h>
 #include "utils/calling.h"
diff --git a/src/ringnotify.cpp b/src/ringnotify.cpp
index c55be73..fcfd59e 100644
--- a/src/ringnotify.cpp
+++ b/src/ringnotify.cpp
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2015 Savoir-Faire Linux Inc.
+ *  Copyright (C) 2015 Savoir-faire Linux Inc.
  *  Author: Stepan Salenikovich <stepan.salenikovich@savoirfairelinux.com>
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -21,7 +21,7 @@
  *  If you modify this program, or any covered work, by linking or
  *  combining it with the OpenSSL project's OpenSSL library (or a
  *  modified version of that library), containing parts covered by the
- *  terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
+ *  terms of the OpenSSL or SSLeay licenses, Savoir-faire Linux Inc.
  *  grants you additional permission to convey the resulting work.
  *  Corresponding Source for a non-source form of such a combination
  *  shall include the source code for the parts of OpenSSL used as well
@@ -34,7 +34,8 @@
 #if USE_LIBNOTIFY
 #include <libnotify/notify.h>
 #include <memory>
-#include "delegates/pixbufdelegate.h"
+#include <globalinstances.h>
+#include "native/pixbufmanipulator.h"
 #include <call.h>
 #include <QtCore/QSize>
 #include <media/text.h>
@@ -85,7 +86,7 @@
     g_free(body);
 
     /* get photo */
-    QVariant var_p = PixbufDelegate::instance()->callPhoto(
+    QVariant var_p = GlobalInstances::pixmapManipulator().callPhoto(
         call->peerContactMethod(), QSize(50, 50), false);
     std::shared_ptr<GdkPixbuf> photo = var_p.value<std::shared_ptr<GdkPixbuf>>();
     notify_notification_set_image_from_pixbuf(notification.get(), photo.get());
@@ -190,7 +191,7 @@
         g_object_set_data(G_OBJECT(notification), "call", call);
 
         /* get photo */
-        QVariant var_p = PixbufDelegate::instance()->callPhoto(
+        QVariant var_p = GlobalInstances::pixmapManipulator().callPhoto(
             call->peerContactMethod(), QSize(50, 50), false);
         std::shared_ptr<GdkPixbuf> photo = var_p.value<std::shared_ptr<GdkPixbuf>>();
         notify_notification_set_image_from_pixbuf(notification, photo.get());