LeechCraft 0.6.70-19424-g027e980fd1
Modular cross-platform feature rich live environment.
Loading...
Searching...
No Matches
tagsfoldersproxymodel.cpp
Go to the documentation of this file.
1/**********************************************************************
2 * LeechCraft - modular cross-platform feature rich internet client.
3 * Copyright (C) 2006-2014 Georg Rudoy
4 *
5 * Distributed under the Boost Software License, Version 1.0.
6 * (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
7 **********************************************************************/
8
10#include <util/sll/qtutil.h>
14
15namespace LC::Util
16{
17 namespace
18 {
19 FlatToFoldersProxyModel::Config MakeConfig (const ITagsManager& tm)
20 {
21 return
22 {
23 .KeysOf_ = [&tm] (const QModelIndex& index)
24 {
25 return tm.GetTags (index.data (+CustomDataRoles::Tags).value<QList<TagId>> ());
26 },
27 .UnkeyedLabel_ = TagsFoldersProxyModel::tr ("untagged"),
28 .DropFormat_ = "x-leechcraft/tag"_qs,
29 };
30 }
31 }
32
41}
Tags manager's interface.
virtual QStringList GetTags(const LC::TagId &id) const =0
Returns the tags denoted by the given id.
const LC::Util::Emitters::TagsManager & GetEmitter() const
Returns the emitter of this manager's signals.
void nameReplaced(const QString &old, const QStringList &newNames)
Emitted after the name old was replaced with newNames on every tag that had it.
void ReplaceKey(const QString &old, const QStringList &newKeys)
Updates the folders after the key old was replaced with newKeys on every row that had it,...
FlatToFoldersProxyModel(Config, QObject *=nullptr)
QModelIndex parent(const QModelIndex &) const override
TagsFoldersProxyModel(const ITagsManager &, QObject *=nullptr)