Commit 271da4bd authored by David Edmundson's avatar David Edmundson

Drop effectively unused kemoticons support

Summary:
Konversation only supported emoticons if config value EnableEmotIcons
was true. This by default was false and there is no UI for configuring
this, making it effectively unused.

This appears to be deliberate from the code comments.

This helps clear up some KEmoticon library usage for future KF6
transitioning.

UTF-8 emoticons work correctly.

Test Plan: Compiles

Differential Revision: https://phabricator.kde.org/D24000
parent 4a49154b
......@@ -138,7 +138,6 @@ set(viewer_SRCS
viewer/topiclabel.cpp
viewer/awaylabel.cpp
viewer/editnotifydialog.cpp
viewer/emoticons.cpp
viewer/images.cpp
viewer/quickbutton.cpp
viewer/searchbar.cpp
......@@ -224,7 +223,6 @@ target_link_libraries(konversation
KF5::Bookmarks
KF5::ConfigWidgets
KF5::Crash
KF5::Emoticons
KF5::I18n
KF5::IdleTime
KF5::NotifyConfig
......
......@@ -844,14 +844,6 @@
<label></label>
<whatsthis></whatsthis>
</entry>
<entry key="EnableEmotIcons" type="Bool">
<default>false</default>
<label>Enable emoticons</label>
</entry>
<entry key="EmotIconTheme" type="String">
<default>Default</default>
<label>Emoticons theme</label>
</entry>
</group>
<group name="PreferencesDialog">
<entry name="PreferencesDialogSize" key="Size" type="Size">
......
/*
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.
*/
/*
Based on kopeteemoticons.cpp (as of KDE 4.2) - Kopete Preferences Container-Class
Copyright (C) 2002-2005 by the Kopete developers <kopete-devel@kde.org>
Copyright (C) 2002 Stefan Gehn <metz@gehn.net>
Copyright (C) 2002-2006 Olivier Goffart <ogoffart@kde.org>
Copyright (C) 2005 Engin Aydogan <engin@bzzzt.biz>
Copyright (C) 2005 Peter Simonsson <psn@linux.se>
Copyright (C) 2008 Modestas Vainius <modestas@vainius.eu>
*/
#include "emoticons.h"
#include "config/preferences.h"
namespace Konversation
{
Q_GLOBAL_STATIC(KEmoticons, s_self)
KEmoticons *Emoticons::self()
{
return s_self;
}
QString Emoticons::parseEmoticons(const QString &text, KEmoticonsTheme::ParseMode mode, const QStringList &exclude)
{
// Disable emoticons support until IRCView supports them
if (Preferences::self()->enableEmotIcons())
{
return Konversation::Emoticons::self()->theme().parseEmoticons(text, mode, exclude);
}
else
{
return text;
}
}
}
/*
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.
Copyright (C) 2005 Peter Simonsson <psn@linux.se>
Copyright (C) 2008 Modestas Vainius <modestas@vainius.eu>
*/
/*
Based on kopeteemoticons.cpp (as of KDE 4.2) - Kopete Preferences Container-Class
Copyright (C) 2002-2005 by the Kopete developers <kopete-devel@kde.org>
Copyright (C) 2002 Stefan Gehn <metz@gehn.net>
Copyright (C) 2002-2006 Olivier Goffart <ogoffart@kde.org>
Copyright (C) 2005 Engin Aydogan <engin@bzzzt.biz>
*/
#ifndef KONVERSATIONEMOTICONS_H
#define KONVERSATIONEMOTICONS_H
#include <kemoticons.h>
namespace Konversation {
class Emoticons
{
public:
/**
* The emoticons container-class by default is a singleton object.
* Use this method to retrieve the instance.
*/
static KEmoticons *self();
static QString parseEmoticons(const QString &text, KEmoticonsTheme::ParseMode mode = KEmoticonsTheme::DefaultParse, const QStringList &exclude = QStringList());
};
} //END namespace Konversation
#endif
......@@ -20,7 +20,6 @@
#include "application.h"
#include "highlight.h"
#include "sound.h"
#include "emoticons.h"
#include "notificationhandler.h"
#include <QDrag>
......@@ -1214,8 +1213,6 @@ QString IRCView::filter(const QString& line, const QString& defaultColor, const
QLatin1String("\">") + filteredLine + QLatin1String("</font>");
}
filteredLine = Konversation::Emoticons::parseEmoticons(filteredLine);
return filteredLine;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment