LeechCraft
0.6.70-19214-g121e5318a7
Modular cross-platform feature rich live environment.
Toggle main menu visibility
Loading...
Searching...
No Matches
itemsfinder.h
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
9
#pragma once
10
11
#include <memory>
12
#include <QObject>
13
#include <QHash>
14
#include <
interfaces/core/icoreproxy.h
>
15
#include <
util/threads/coro/corocontext.h
>
16
#include "
xdgconfig.h
"
17
18
namespace
LC::Util::XDG
19
{
20
class
UTIL_XDG_API
Item
;
21
using
Item_ptr
= std::shared_ptr<Item>;
22
23
using
Cat2Items_t
= QHash<QString, QList<Item_ptr>>;
24
25
enum class
Type
;
26
41
class
UTIL_XDG_API
ItemsFinder
:
public
QObject
42
{
43
Q_OBJECT
44
45
ICoreProxy_ptr
Proxy_;
46
Cat2Items_t
Items_;
47
48
bool
IsReady_ =
false
;
49
bool
IsScanning_ =
false
;
50
51
const
QList<Type>
Types_;
52
public
:
67
ItemsFinder
(
const
ICoreProxy_ptr
&,
const
QList<Type>
& types, QObject *parent =
nullptr
);
68
78
bool
IsReady
()
const
;
79
91
Cat2Items_t
GetItems
()
const
;
92
100
Item_ptr
FindItem
(
const
QString& permanentID)
const
;
101
protected
:
102
void
Update
();
103
signals:
106
void
itemsListChanged
();
107
108
LC_CORO_CONTEXT
109
};
110
}
LC::Util::XDG::Item
Describes a single XDG .desktop entry.
Definition
item.h:36
LC::Util::XDG::ItemsFinder::IsReady
bool IsReady() const
Checks whether this items finder is ready.
Definition
itemsfinder.cpp:32
LC::Util::XDG::ItemsFinder::ItemsFinder
ItemsFinder(const ICoreProxy_ptr &, const QList< Type > &types, QObject *parent=nullptr)
Constructs the items finder for the given types.
Definition
itemsfinder.cpp:23
LC::Util::XDG::ItemsFinder::FindItem
Item_ptr FindItem(const QString &permanentID) const
Finds an XDG item for the given permanent ID.
Definition
itemsfinder.cpp:42
LC::Util::XDG::ItemsFinder::itemsListChanged
void itemsListChanged()
Notifies when the list of items changes in any way.
LC::Util::XDG::ItemsFinder::GetItems
Cat2Items_t GetItems() const
Returns the categorized list of XDG items.
Definition
itemsfinder.cpp:37
LC::Util::XDG::ItemsFinder::Update
void Update()
Definition
itemsfinder.cpp:216
QList
Definition
ianrulesstorage.h:14
corocontext.h
LC_CORO_CONTEXT
#define LC_CORO_CONTEXT
Declares the coroutine context of the enclosing QObject-derived class.
Definition
corocontext.h:93
icoreproxy.h
ICoreProxy_ptr
std::shared_ptr< ICoreProxy > ICoreProxy_ptr
Definition
icoreproxy.h:177
LC::Util::XDG
Definition
desktopparser.cpp:16
LC::Util::XDG::Cat2Items_t
QHash< QString, QList< Item_ptr > > Cat2Items_t
Definition
itemsfinder.h:23
LC::Util::XDG::Item_ptr
std::shared_ptr< Item > Item_ptr
Definition
item.h:24
LC::Util::XDG::Type
Type
Describes the various types of XDG .desktop files.
Definition
itemtypes.h:20
xdgconfig.h
UTIL_XDG_API
#define UTIL_XDG_API
Definition
xdgconfig.h:16
src
util
xdg
itemsfinder.h
Generated by
1.18.0