#include <QTextLayout>
#include <QMenu>
+#include "action.h"
#include "buffermodel.h"
#include "bufferview.h"
#include "chatline.h"
using Label = UiStyle::MessageLabel;
using Format = UiStyle::Format;
- Label itemLabel = data(ChatLineModel::MsgLabelRole).value<Label>();
+ auto itemLabel = data(ChatLineModel::MsgLabelRole).value<Label>();
const auto &fmtList = formatList();
struct LabelFormat {
ContentsChatItemPrivate *ContentsChatItem::privateData() const
{
if (!_data) {
- ContentsChatItem *that = const_cast<ContentsChatItem *>(this);
+ auto *that = const_cast<ContentsChatItem *>(this);
that->_data = new ContentsChatItemPrivate(ClickableList::fromString(data(ChatLineModel::DisplayRole).toString()), that);
}
return _data;
Clickable click = privateData()->currentClickable;
switch (click.type()) {
case Clickable::Url:
+ {
privateData()->activeClickable = click;
- menu->addAction(icon::get("edit-copy"), tr("Copy Link Address"),
- &_actionProxy, SLOT(copyLinkToClipboard()))->setData(QVariant::fromValue<void *>(this));
+ auto action = new Action{icon::get("edit-copy"), tr("Copy Link Address"), menu, &_actionProxy, SLOT(copyLinkToClipboard())};
+ action->setData(QVariant::fromValue<void *>(this));
+ menu->addAction(action);
break;
+ }
case Clickable::Channel:
{
// Remove existing menu actions, they confuse us when right-clicking on a clickable
}
-ContentsChatItem::WrapColumnFinder::~WrapColumnFinder()
-{
-}
-
-
qint16 ContentsChatItem::WrapColumnFinder::nextWrapColumn(qreal width)
{
if (wordidx >= wrapList.count())