![]() |
LeechCraft
0.6.70-15082-g543737046d
Modular cross-platform feature rich live environment.
|
Namespaces | |
AN | |
CacheStrat | |
detail | |
IntSeq | |
oral | |
SvcAuth | |
SysInfo | |
Views | |
XDG | |
Classes | |
class | AddressesModelManager |
Manages an XML settings model with a list of network interfaces selected by the user from the list of available ones. More... | |
class | ApplicativeTest |
class | AssocCache |
struct | AsTypelist |
struct | AsTypelist< OtherList< Args... > > |
class | AutoResizeMixin |
Automatically moves a widget to fit a rectangle on resize. More... | |
class | BackendSelector |
A common dialog to select storage backend. More... | |
class | BaseHookInterconnector |
Base class for signal-slot relays in plugin APIs. More... | |
class | BasicDeletePolicy |
class | BitFlags |
struct | Caster |
class | CategorySelector |
The CategorySelector widget provides a way to select amongst a group of items. More... | |
class | ChoiceDeletePolicy |
Delegates the SlotClosure deletion decision to the signal handler. More... | |
class | ClearLineEditAddon |
Provides a "clear text" action for line edits. More... | |
class | ClosingDB |
class | ColorButton |
A button for choosing a color. More... | |
class | ColorThemeProxy |
Proxy for QML files to use colors from current color theme. More... | |
class | ConcurrentException |
A concurrent exception that plays nicely with Qt. More... | |
class | ConsistencyChecker |
struct | CoreProxyHolder |
class | CpuFeatures |
class | CurryImpl |
class | CurryTest |
class | CustomCookieJar |
A customized cookie jar with additional features. More... | |
class | CustomNetworkReply |
A network reply with customizable content and reply headers. More... | |
class | DBLock |
Provides database transaction lock. More... | |
class | DefaultHookProxy |
Standard implementation of IHookProxy. More... | |
class | DeleteLaterPolicy |
Deletes a SlotClosure object after its signal has fired. More... | |
class | DetectorTest |
class | DndActionsMixin |
Abstracts away differences between Qt4 and Qt5 in model DnD support. More... | |
class | DomChildrenRangeTest |
struct | DownloadParams |
class | DummyObject |
class | Dumper |
class | Either |
class | EitherCont |
A peir of two functions, typically a continuation and an error handler. More... | |
class | EitherTest |
struct | ErrorInfo |
class | ExtensionsData |
class | FailedImpl |
class | FDGuard |
class | FindNotification |
A horizontal bar with typical widgets for text search. More... | |
class | FindNotificationWE |
A helper class to aid connecting FindNotification with QtWebEngine. More... | |
class | FindNotificationWk |
A helper class to aid connecting FindNotification with Qt WebKit. More... | |
class | FlatItemsModel |
class | FlatItemsModelBase |
class | FlatItemsModelTypedBase |
class | FlattenFilterModel |
Proxy model flattening a hierarchical model. More... | |
class | FlatToFoldersProxyModel |
struct | FlatTreeItem |
class | FlowLayout |
A simple flow layout implementation. More... | |
class | FontChooserWidget |
Provides a widget for choosing a font. More... | |
class | FunctorTest |
class | FuturesTest |
struct | Head |
struct | Head< List< H, T... > > |
class | IDPool |
A simple pool of identificators of the given type. More... | |
struct | InstanceApplicative |
struct | InstanceApplicative< Either< L, R > > |
struct | InstanceApplicative< std::optional< T > > |
struct | InstanceFunctor |
The Functor class is used for types that can be mapped over. More... | |
struct | InstanceFunctor< Either< L, R > > |
struct | InstanceFunctor< QFuture< T > > |
struct | InstanceFunctor< std::optional< T > > |
Implementation of the Functor class for std::optional. More... | |
struct | InstanceMonad |
struct | InstanceMonad< Either< L, R > > |
struct | InstanceMonad< std::optional< T > > |
struct | InstanceMonadPlus |
struct | InstanceMonadPlus< std::optional< T > > |
class | Introspectable |
class | LazyInitializer |
Provides lazy initialization on first access to an object. More... | |
class | LineEditButtonManager |
Manages additional overlay buttons in a QLineEdit. More... | |
struct | Literal |
class | MassFontChangeDialog |
class | MergeModel |
struct | MimeDetector |
class | ModelItem |
Provides a proxying API on top of an QAbstractItemModel. More... | |
class | ModelItemBase |
Base class for model items for tree-like models. More... | |
class | ModelIterator |
Provides an iterator-based API to a Qt model. More... | |
class | MonadicFuturesTest |
class | MonadPlusTest |
class | MonadTest |
class | NetworkDiskCache |
A thread-safe garbage-collected network disk cache. More... | |
class | NetworkDiskCacheGC |
Garbage collection for a set of network disk caches. More... | |
class | NewType |
A somewhat "strong" typedef. More... | |
struct | NoDefaultCtor |
class | NoDeletePolicy |
Does not delete a SlotClosure object. More... | |
struct | Not |
class | NotificationActionHandler |
Aids in adding actions to notifications. More... | |
class | OralFKeyTest |
class | OralTest |
class | OralTest_SimpleRecord |
class | OralTest_SimpleRecord_Bench |
class | PageNotification |
A horizontal widget embedding into the parent layout of the passed parent widget. More... | |
class | PlotItem |
class | PreludeTest |
struct | QStringToLower |
struct | QStringTrimmed |
class | QueueManager |
A simple scheduling manager for a queue of functors. More... | |
class | RegExp |
struct | RegExpImpl |
struct | ReplyError |
struct | ReplyWithHeaders |
struct | RequiresInit |
class | ResourceLoader |
Utility class for loading a file from a set of locations. More... | |
struct | ResultInfo |
class | RoledItemsModel |
struct | RoledMemberField |
class | RoleNamesMixin |
Wraps differences between role names handling in Qt4 and Qt5. More... | |
struct | S1 |
struct | S2 |
class | ScopeGuardTest |
class | ScreensaverProhibitor |
class | SelectableBrowser |
A "browser" that shows HTML either via QTextBrowser or a browser plugin. More... | |
struct | ServiceInfo |
class | SettableIconProvider |
QML image provider with settable icons for each path. More... | |
class | ShortcutManager |
Aids in providing configurable shortcuts. More... | |
class | SlotClosure |
Executes a given functor upon a signal (or a list of signals). More... | |
class | SlotClosureBase |
Base class for SlotClosure. More... | |
class | SlotClosureTest |
struct | SpaceInfo |
Contains information about a partition's disk space. More... | |
class | SslCertificateInfoWidget |
class | StandardNAMFactory |
A standard QML QNetworkAccessManager factory. More... | |
class | StdDataFilterMenuCreator |
Adds actions to handle some data with relevant IDataFilter plugins to a menu. More... | |
class | StlizeTest |
class | StringPathTrie |
class | StringPathTrieTest |
class | TagsCompleter |
Completer suitable for tag completion. More... | |
class | TagsCompletionModel |
A QStringListModel providing additional methods for tags. More... | |
class | TagsFilterModel |
Provides filter model with additional tags filter mode. More... | |
class | TagsLineEdit |
A line edit class suitable for use with TagsCompleter. More... | |
class | ThemeImageProvider |
Provides icons from the current theme by their FDO name. More... | |
struct | Tokenize |
class | TokenizeTest |
class | ToolTipItem |
ToolTip for Qml objects. More... | |
class | TypeGetterTest |
struct | Typelist |
class | TypelistTest |
class | UnhideListModel |
A model to be used with UnhideListViewBase. More... | |
class | UnhideListViewBase |
Base class for a view of a list of items to be unclosed. More... | |
class | UnhoverDeleteMixin |
Allows to hide a widget or popup after mouse leave. More... | |
struct | Upcaster |
struct | Upcaster< To * > |
class | UrlAccessor |
class | UrlOperator |
Manipulates query part of an QUrl object. More... | |
class | UtilTest |
class | ViewsTest |
class | Visitor |
class | VisitorTest |
struct | Void |
A proper void type, akin to unit (or () ) type in functional languages. More... | |
class | WidthIconProvider |
Provides scalable icons to QML. More... | |
class | WkFontsWidget |
A settings widget for configuring WebKit fonts. More... | |
struct | Worker |
class | WorkerThread |
class | WorkerThreadBase |
class | WorkerThreadTest |
struct | WrapType |
struct | WrapType< QList< QString > > |
class | XWrapper |
Typedefs | |
typedef std::shared_ptr< XmlSettingsDialog > | XmlSettingsDialog_ptr |
using | FlatTreeItem_ptr = std::shared_ptr< FlatTreeItem > |
typedef std::shared_ptr< ModelItem > | ModelItem_ptr |
typedef std::weak_ptr< ModelItem > | ModelItem_wtr |
typedef QVector< ModelItem_ptr > | ModelItemsList_t |
typedef std::shared_ptr< const ModelItem > | ModelItem_cptr |
typedef QList< QPair< QString, QString > > | AddrList_t |
template<typename AF , typename AV > | |
using | GSLResult_t = typename InstanceApplicative< AF >::template GSLResult< AV >::Type_t |
template<typename Type , template< typename... > class Op, typename... Args> | |
using | IsDetected_t = typename detail::IsDetected< Type, void, Op, Args... >::type |
template<typename T , typename F > | |
using | FmapResult_t = typename InstanceFunctor< T >::template FmapResult_t< F > |
The result type of the contents of the functor T mapped by function F. More... | |
template<typename T > | |
using | Lazy_t = std::function< T()> |
template<typename MV , typename F > | |
using | BindResult_t = typename InstanceMonad< MV >::template BindResult_t< F > |
template<typename T > | |
using | WrapType_t = typename WrapType< T >::type |
using | SerializeResult_t = Either< QString, Void > |
template<typename T > | |
using | DoSmthDetector = decltype(std::declval< T >().DoSmth(QString {})) |
using | SomeEither_t = Either< int, QString > |
using | IntTrie = StringPathTrie< int > |
using | FindResult = IntTrie::FindResult |
using | QSVV = QList< QStringView > |
template<typename T > | |
using | IsVoid_t = std::is_same< T, void > |
using | Variant_t = std::variant< int, char, std::string, QString, double, float > |
using | SVariant_t = std::variant< S1, S2 > |
template<typename F , size_t Idx> | |
using | ArgType_t = std::tuple_element_t< Idx+1, decltype(detail::TypeGetter(*static_cast< F * >(nullptr)))> |
template<typename F > | |
using | RetType_t = std::tuple_element_t< 0, decltype(detail::TypeGetter(*static_cast< F * >(nullptr)))> |
template<typename PtrType > | |
using | MemberTypeType_t = typename detail::DecomposeMemberPtr< PtrType >::Value_t |
template<typename PtrType > | |
using | MemberTypeStruct_t = typename detail::DecomposeMemberPtr< PtrType >::StructType_t |
template<auto Ptr> | |
using | MemberPtrType_t = MemberTypeType_t< decltype(Ptr)> |
template<auto Ptr> | |
using | MemberPtrStruct_t = MemberTypeStruct_t< decltype(Ptr)> |
template<typename List > | |
using | Head_t = typename Head< List >::Head_t |
template<typename T > | |
using | AsTypelist_t = typename AsTypelist< T >::Result_t |
template<template< typename > class Name, typename Def , typename... Args> | |
using | Find = typename detail::Find< Name, Def, Args... >::type |
using | DefaultScopeGuard = detail::ScopeGuard< detail::DefaultScopeGuardDeleter > |
using | QIODevice_ptr = std::shared_ptr< QIODevice > |
using | QtException_t = QException |
using | QtException_ptr = std::shared_ptr< QtException_t > |
using | ConcurrentStdException = Util::ConcurrentException< Util::NewType< std::exception, struct StdException > > |
using | DefaultHookProxy_ptr = std::shared_ptr< DefaultHookProxy > |
using | TempResultType_t = Util::Either< IDownload::Error, QByteArray > |
using | Introspect_f = std::function< QVariantMap(QVariant)> |
using | LazyNotificationPixmap_t = std::function< std::optional< QFuture< QImage > >()> |
Enumerations | |
enum | FitFlag { NoFlags, NoOverlap = 0x01 } |
enum | QueuePriority { QueuePriority::Normal, QueuePriority::High } |
The priority of the action in the queue. More... | |
enum | SysPath { SysPath::QML, SysPath::Share } |
Describes various root paths recognized by GetSysPath(). More... | |
enum | UserDir { UserDir::Cache, UserDir::LC } |
Describes various user-specific paths. More... | |
enum | WinStateFlag { NoState = 0, Modal = 1 << 0, Sticky = 1 << 1, MaximizedVert = 1 << 2, MaximizedHorz = 1 << 3, Shaded = 1 << 4, SkipTaskbar = 1 << 5, SkipPager = 1 << 6, Hidden = 1 << 7, Fullscreen = 1 << 8, OnTop = 1 << 9, OnBottom = 1 << 10, Attention = 1 << 11 } |
enum | AllowedActionFlag { NoAction = 0, Move = 1 << 0, Resize = 1 << 1, Minimize = 1 << 2, Shade = 1 << 3, Stick = 1 << 4, MaximizeHorz = 1 << 5, MaximizeVert = 1 << 6, ShowFullscreen = 1 << 7, ChangeDesktop = 1 << 8, Close = 1 << 9, MoveToTop = 1 << 10, MoveToBottom = 1 << 11 } |
Functions | |
QSqlDatabase | MakeDatabase (const QString &name=":memory:") |
template<typename T > | |
auto | PrepareRecords (QSqlDatabase db, int count=3) |
QSqlQuery | RunTextQuery (const QSqlDatabase &db, const QString &text) |
Runs the given query text on the given db. More... | |
QString | LoadQuery (const QString &plugin, const QString &filename) |
Loads the query text from the given resource file. More... | |
void | RunQuery (const QSqlDatabase &db, const QString &plugin, const QString &filename) |
Loads the query from the given resource file and runs it. More... | |
QString | GenConnectionName (const QString &base) |
Generates an unique thread-safe connection name. More... | |
template<typename T = int> | |
T | GetLastId (const QSqlQuery &query) |
Gets the last insert ID for the given query. More... | |
QPoint | FitRectScreen (QPoint pos, const QSize &size, FitFlags flags=NoFlags, const QPoint &shiftAdd=QPoint(0, 0)) |
Tries to fit a rectangle (like a dialog or popup) into screen. More... | |
QPoint | FitRect (QPoint pos, const QSize &size, const QRect &geometry, FitFlags flags=NoFlags, const QPoint &shiftAdd=QPoint(0, 0)) |
Tries to fit a rectangle (like a dialog or popup) into geometry. More... | |
QScreen * | GetScreenWithFallback (const QPoint &p) |
QRect | AvailableGeometry (const QPoint &p) |
QRect | ScreenGeometry (const QPoint &p) |
Q_DECLARE_FLAGS (FitFlags, FitFlag) | |
QDialog * | MakeCertificateViewerDialog (const QSslCertificate &cert, QWidget *parent) |
QLabel * | ShowPixmapLabel (const QPixmap &pixmap, const QPoint &pos=QPoint()) |
Shows a pixmap at the given pos. More... | |
QColor | TintColors (const QColor &c1, const QColor &c2, double alpha=0.5) |
Mixes two colors with the given weights. More... | |
QString | ElideProgressBarText (const QString &text, const QStyleOptionViewItem &option) |
void | TintPalette (QWidget *widget, const QColor &color, double alpha=0.5, const QList< QPalette::ColorRole > &roles={ QPalette::ColorRole::Text, QPalette::ColorRole::WindowText }) |
Mixes some of the widget's palette roles with the given color. More... | |
QString | FormatName (const QString &name) |
HTML-formats the name to let the user know it is not a part of the fixed dialog text. More... | |
QPixmap | DrawOverlayText (QPixmap px, const QString &text, QFont font, const QPen &pen, const QBrush &brush) |
template<typename T > | |
void | Save2MimeData (QMimeData *mimeData, const QString &name, const T &t) |
FlatTreeItem * | ToFlat (const QModelIndex &idx) |
bool | operator== (const ModelIterator &left, const ModelIterator &right) |
bool | operator!= (const ModelIterator &left, const ModelIterator &right) |
template<typename F > | |
void | EnumerateChildren (const QModelIndex &idx, bool includingRoot, F &&f) |
AddrList_t | GetLocalAddresses (int port=0) |
Returns all local addresses. More... | |
QList< QHostAddress > | GetAllAddresses () |
Returns all addresses likely accessible "from the outside". More... | |
template<typename F > | |
void | HandleNetworkReply (QObject *context, QNetworkReply *reply, F f) |
template<typename... Args> | |
auto | HandleReply (QNetworkReply *reply, QObject *context) |
template<typename... Args> | |
auto | HandleReplySeq (QNetworkReply *reply, QObject *context) |
QString | GetServiceUrl (const ServiceInfo &info, const QString &path) |
QString | GetSocketErrorString (QAbstractSocket::SocketError error) |
Returns an error string for the given socket error. More... | |
QTreeWidgetItem * | SslError2TreeItem (const QSslError &error) |
Builds a tree widget representation of the given SSL error. More... | |
void | WatchQmlErrors (QQuickWidget *view) |
Utility function for logging errors from a QML view. More... | |
void | EnableTransparency (QQuickWidget *widget) |
void | CreateShortcuts (const QList< QKeySequence > &seqs, const std::function< void()> &func, QWidget *parent) |
Makes func invokable with shortcuts in seq. More... | |
void | CreateShortcuts (const QList< QKeySequence > &seqs, QObject *object, const char *metamethod, QWidget *parent) |
Makes metamethod invokable with shortcuts in seq. More... | |
template<typename Obj > | |
void | CreateShortcuts (const QList< QKeySequence > &seqs, Obj *obj, void(Obj::*member)(), QWidget *parent) |
template<template< typename... > class Applicative, typename... Args, typename T > | |
auto | Pure (const T &v) |
template<typename Applicative , typename T > | |
auto | Pure (const T &v) -> decltype(InstanceApplicative< Applicative >::Pure(v)) |
template<typename AF , typename AV > | |
GSLResult_t< AF, AV > | GSL (const AF &af, const AV &av) |
template<typename AF , typename AV > | |
auto | operator* (const AF &af, const AV &av) -> decltype(GSL(af, av)) |
QDomElement | BuildTagsTree (QStringList tags, QDomNode &node, QDomDocument &document, const QString &elementName, const std::function< QString(QDomElement)> &tagGetter, const std::function< void(QDomElement &, QString)> &tagSetter) |
Builds a nested sequence of DOM elements representing a list of tags. More... | |
template<typename T > | |
auto | AsSet (const T &cont) |
template<typename F , typename... Args> | |
CurryImpl< std::decay_t< F >, Args... > | Curry (F &&f, Args &&... args) |
auto | DomChildren (const QDomNode &parent, const QString &tag) |
Creates a range iterating over direct children named tag. More... | |
template<typename F > | |
detail::Dropper< F > | DropArgs (const F &f) |
template<typename L , typename R , typename F , typename = std::result_of_t<F ()>> | |
R | RightOr (const Either< L, R > &either, F &&f) |
template<typename L , typename R > | |
R | RightOr (const Either< L, R > &either, const R &r) |
template<template< typename > class Cont, typename L , typename R > | |
std::pair< Cont< L >, Cont< R > > | PartitionEithers (const Cont< Either< L, R >> &eithers) |
template<typename Left , typename Right , typename... Args> | |
auto | Visit (const Either< Left, Right > &either, Args &&... args) |
template<typename R , typename B , typename C , typename... Args> | |
auto | BindMemFn (R(B::*fn)(Args...), C *c) |
Binds an instance of an object to its member function. More... | |
template<typename R , typename B , typename C , typename... Args> | |
auto | BindMemFn (R(B::*fn)(Args...) const, const C *c) |
template<typename T > | |
constexpr bool | IsFunctor () |
Checks whether the given type has a Functor instance for it. More... | |
template<typename T , typename F , typename = std::enable_if_t<IsFunctor<T> ()>> | |
FmapResult_t< T, F > | Fmap (const T &functor, const F &function) |
Apply the function f to the elements in functor. More... | |
template<typename T , typename F > | |
auto | operator* (const F &function, const T &functor) -> decltype(Fmap(functor, function)) |
An operator-style alias for Fmap(). More... | |
template<typename T , typename F > | |
auto | operator* (const T &functor, const F &function) -> decltype(Fmap(functor, function)) |
An operator-style alias for Fmap(). More... | |
template<typename F > | |
auto | MakeLambdaEventFilter (F &&f, QObject *parent=nullptr) |
template<typename T > | |
Lazy_t< T > | MakeLazy (const T &t) |
template<typename R , typename F > | |
Lazy_t< R > | MakeLazyF (const F &l) |
template<template< typename... > class Monad, typename... Args, typename V > | |
auto | Return (const V &v) |
template<typename MV , typename F > | |
BindResult_t< MV, F > | Bind (const MV &value, const F &f) |
template<typename MV , typename F > | |
auto | operator>> (const MV &value, const F &f) -> decltype(Bind(value, f)) |
template<typename MV > | |
auto | Do (const MV &value) |
template<typename MV , typename FHead , typename... FArgs> | |
auto | Do (const MV &value, const FHead &fHead, const FArgs &... fArgs) |
template<typename T > | |
constexpr bool | IsMonadPlus () |
template<typename MP > | |
MP | Mzero () |
template<typename MP > | |
auto | operator+ (const MP &m1, const MP &m2) -> decltype(Mplus(m1)(m2)) |
QVariant | ParseJson (const QByteArray &bytes, const char *context) |
Parses JSON content in the given bytearray. More... | |
QVariant | ParseJson (QIODevice *device, const char *context) |
Utility function parsing JSON from the device. More... | |
template<template< typename U > class Container, typename T1 , typename T2 , typename F > | |
auto | ZipWith (const Container< T1 > &c1, const Container< T2 > &c2, F f) -> WrapType_t< Container< std::decay_t< std::result_of_t< F(T1, T2)>>>> |
template<typename T1 , typename T2 , template< typename U > class Container, template< typename U1, typename U2 > class Pair = QPair> | |
auto | Zip (const Container< T1 > &c1, const Container< T2 > &c2) -> Container< Pair< T1, T2 >> |
template<typename Container , typename F > | |
auto | Map (Container &&c, F &&f) noexcept(noexcept(std::is_nothrow_invocable_v< F, decltype(*c.begin())>)) |
template<template< typename... > class Fallback, typename Container , typename F > | |
auto | MapAs (Container &&c, F &&f) noexcept(noexcept(std::is_nothrow_invocable_v< F, decltype(*c.begin())>)) |
template<typename T , template< typename U > class Container, typename F > | |
Container< T > | Filter (const Container< T > &c, F f) |
template<template< typename > class Container, typename T > | |
Container< T > | Concat (const Container< Container< T >> &containers) |
template<template< typename... > class Container, typename... ContArgs> | |
auto | Concat (const Container< ContArgs... > &containers) -> std::decay_t< decltype(*containers.begin())> |
template<typename Cont , typename F > | |
auto | ConcatMap (Cont &&c, F &&f) |
template<template< typename > class Container, typename T > | |
Container< Container< T > > | SplitInto (size_t numChunks, const Container< T > &container) |
template<typename Cont > | |
decltype(auto) | Sorted (Cont &&cont) |
template<typename R > | |
auto | ComparingBy (R r) |
template<typename R > | |
auto | EqualityBy (R r) |
template<typename F > | |
auto | First (F &&f) |
template<typename F > | |
auto | Second (F &&f) |
template<typename Assoc > | |
auto | Stlize (Assoc &&assoc) noexcept |
Converts an Qt's associative sequence assoc to an STL-like iteratable range. More... | |
QByteArray | AsByteArray (std::string_view view) noexcept |
Convert the view into a QByteArray without copying. More... | |
QByteArray | ToByteArray (std::string_view view) noexcept |
Create a QByteArray with the data referenced by the view. More... | |
std::string_view | AsStringView (const QByteArray &arr) noexcept |
Create a std::string_view referring the data within a QByteArray. More... | |
template<typename T , typename S > | |
std::pair< T, T > | BreakAt (const T &str, S c) noexcept |
auto | MakeEndGroupScopeGuard (QSettings &settings) |
Creates a scope guard that ends the current group on settings. More... | |
auto | BeginGroup (QSettings &settings, const QString &group) |
Begins the group on settings and returns a scope guard ending that group. More... | |
QByteArray | SerializeJson (const QVariant &var, bool compact=true) |
Serializes the given var to JSON representation. More... | |
SerializeResult_t | SerializeJsonToFile (const QString &filename, const QVariant &var, bool compact) |
template<typename K > | |
constexpr uint64_t | DefaultHashImpl (K) |
template<> | |
constexpr uint64_t | DefaultHashImpl (std::string_view name) |
constexpr uint64_t | DefaultHash (auto val) |
template<typename K , typename V , auto Hasher = DefaultHash<K>> | |
consteval auto | MakeHash (auto &&... commands) |
template<typename V > | |
consteval auto | MakeStringHash (auto &&... commands) |
QVector< QStringView > | AsRefs (const QVector< QString > &lst) |
auto | TokenizeFwd (QStringView str) |
auto | TokenizeRev (QStringView str) |
auto | Reversed (auto container) |
template<template< typename... > class List, typename H , typename... T> | |
constexpr List< T... > | Tail (List< H, T... >) |
template<int N, template< typename... > class List, typename... Args> | |
constexpr detail::DropImpl< N, List< Args... > >::Result_t | Drop (List< Args... >) |
template<template< typename... > class List, typename... Args1, typename... Args2> | |
constexpr List< Args1..., Args2... > | Concat (List< Args1... >, List< Args2... >) |
template<template< typename... > class List> | |
constexpr List | Reverse (List<>) |
template<template< typename... > class List, typename Head , typename... Tail> | |
constexpr auto | Reverse (List< Head, Tail... >) -> decltype(Concat(Reverse(List< Tail... > |
template<typename F , typename G , typename Def , typename Head , typename... Args> | |
auto | FirstMatching (F f, G g, Def def, Util::Typelist< Head, Args... >) |
void | Unreachable () |
template<typename F > | |
detail::ScopeGuard< F > | MakeScopeGuard (const F &f) |
Returns an object performing passed function on scope exit. More... | |
template<typename... Vars, typename... Args> | |
decltype(auto) | Visit (const std::variant< Vars... > &v, Args &&... args) |
template<typename... Vars, typename... Args> | |
decltype(auto) | Visit (std::variant< Vars... > &v, Args &&... args) |
template<typename... Args> | |
Visitor (Args &&...) -> Visitor< Void, Args... > | |
template<typename T , typename... Args> | |
auto | InvokeOn (T &&t, Args &&... args) |
void | swap (FDGuard &g1, FDGuard &g2) |
QByteArray | DetectFileMime (const QString &path) |
QStringList | GetPathCandidates (SysPath path, QString subfolder) |
Returns possible full paths for the path and subfolder. More... | |
QString | GetSysPath (SysPath path, const QString &subfolder, const QString &filename) |
Returns path to the file in the given root path and subfolder. More... | |
QUrl | GetSysPathUrl (SysPath path, const QString &subfolder, const QString &filename) |
Returns path to the file in the given root path and subfolder. More... | |
QStringList | GetSystemPaths () |
Returns the components of the system PATH variable. More... | |
QString | FindInSystemPath (const QString &name, const QStringList &paths, const std::function< bool(QFileInfo)> &filter={}) |
Searches for a file in system paths according to a filter. More... | |
QDir | GetUserDir (UserDir dir, const QString &subpath) |
QDir | CreateIfNotExists (QString path) |
Creates a path if it doesn't exist. More... | |
QString | GetTemporaryName (const QString &pattern={}) |
Returns a temporary filename. More... | |
SpaceInfo | GetSpaceInfo (const QString &path) |
Returns the disk space info of the partition containing path. More... | |
bool | HasSupportedImageExtension (const QString &filename) |
Checks if the given filename has a known image extension. More... | |
bool | IsOSXLoadFromBundle () |
QString | GetDefaultTagsSeparator () |
auto | MkWaiter () |
QString | GetAsBase64Src (const QImage &image) |
Returns the given image in a Base64-encoded form. More... | |
QString | MakePrettySize (qint64 sourceSize) |
Makes a formatted size from number. More... | |
QString | MakePrettySizeShort (qint64 size) |
Converts a bytes count to a string representation with appropriately chosen units. More... | |
QString | MakeTimeFromLong (ulong time) |
Makes a formatted time from number. More... | |
QTranslator * | LoadTranslator (const QString &baseName, const QString &localeName, const QString &prefix, const QString &appName) |
QTranslator * | InstallTranslator (const QString &base, const QString &prefix=LCLowercase, const QString &appname=LCLowercase) |
Loads and installs a translator. More... | |
QString | GetLocaleName () |
Returns the current locale name, like en_US. More... | |
QString | GetInternetLocaleName (const QLocale &locale) |
QString | GetLanguage () |
Returns the current language name. More... | |
QModelIndexList | GetSummarySelectedRows (QObject *sender) |
QAction * | CreateSeparator (QObject *parent) |
Returns the action that is set to act as a separator. More... | |
QString | GetErrorString (IDownload::Error::Type type) |
std::optional< QFuture< TempResultType_t > > | DownloadAsTemporary (IEntityManager *iem, const QUrl &url, DownloadParams params) |
QString | GetPassword (const QString &keyName, const QString &dialogText, const ICoreProxy_ptr &proxy, bool useStore=true) |
Returns password for the key, possibly asking the user. More... | |
void | GetPassword (const QString &key, const QString &diaText, const ICoreProxy_ptr &proxy, const EitherCont< void(), void(QString)> &cont, QObject *depender, bool useStored) |
void | SavePassword (const QString &password, const QString &keyName, const ICoreProxy_ptr &proxy) |
Saves the password to be retrieved later via GetPassword(). More... | |
QList< ANFieldData > | GetStdANFields (const QString &category) |
Returns the list of the standard AN fields for the given category. More... | |
Entity | MakeAN (const QString &header, const QString &text, Priority priority, const QString &senderID, const QString &cat, const QString &type, const QString &id, const QStringList &visualPath, int delta=1, int count=0, const QString &fullText=QString(), const QString &extendedText=QString()) |
Creates an Advanced Notifications-enabled notify entity. More... | |
Entity | MakeANRule (const QString &title, const QString &senderID, const QString &category, const QStringList &types, AN::NotifyFlags flags=AN::NotifyNone, bool openConfiguration=false, const QList< QPair< QString, ANFieldValue >> &fields={}) |
Creates an Entity defining an Advanced Notifications rule. More... | |
QList< QObject * > | GetDataFilters (const QVariant &data, IEntityManager *manager) |
Returns the data filter plugins that can handle data. More... | |
Entity | MakeEntity (const QVariant &entity, const QString &location, TaskParameters tp, const QString &mime) |
Entity | MakeNotification (const QString &header, const QString &text, Priority priority) |
An utility function to make a Entity with notification. More... | |
Entity | MakeANCancel (const Entity &event) |
Makes an event for canceling another Advanced Notifications event. More... | |
Entity | MakeANCancel (const QString &senderId, const QString &eventId) |
Makes an event for canceling another Advanced Notifications event. More... | |
QVariant | GetPersistentData (const QByteArray &key, const ICoreProxy_ptr &proxy) |
Returns persistent data stored under given key. More... | |
void | SetJobHolderProgress (const QList< QStandardItem * > &row, qint64 done, qint64 total, const QString &text) |
Sets the progress values on the given row. More... | |
void | SetJobHolderProgress (QStandardItem *item, qint64 done, qint64 total) |
Sets the done and total progress values on the given item. More... | |
void | InitJobHolderRow (const QList< QStandardItem * > &row) |
UTIL_XPC_API Entity | MakeEntity (const QVariant &entity, const QString &location, LC::TaskParameters tp, const QString &mime=QString()) |
An utility function to make a Entity. More... | |
XmlSettingsDialog * | OpenXSD (const QString &title, const QString &filename, Util::BaseSettingsManager *bsm) |
Opens XML settings dialog for the given XML filename. More... | |
Variables | |
template<Literal RoleArg, auto GetterArg> | |
RoledMemberField< RoleArg, GetterArg > | RoledMemberField_v |
template<template< typename... > class Op, typename... Args> | |
constexpr bool | IsDetected_v = detail::IsDetected<void, void, Op, Args...>::value_t::value |
template<typename To > | |
constexpr auto | Upcast = Upcaster<To> {} |
struct { | |
} | Mplus |
struct { | |
} | Msum |
constexpr auto | Id = [] (auto&& t) -> decltype (auto) { return std::forward<decltype (t)> (t); } |
constexpr auto | Apply = [] (const auto& t) { return t (); } |
constexpr auto | Fst = [] (const auto& pair) { return pair.first; } |
constexpr auto | Snd = [] (const auto& pair) { return pair.second; } |
template<typename Cont > | |
concept | StringViewContainer = std::is_same_v<typename std::decay_t<Cont>::value_type, QStringView> |
template<template< typename > class Pred, typename... Args> | |
constexpr auto | AllOf = (Pred<Args> {} && ...) |
template<template< typename > class Pred, typename... Args> | |
constexpr auto | AnyOf = (Pred<Args> {} || ...) |
List< Head > | |
const int | RoleTag = Qt::UserRole |
const QString | LCLowercase = QStringLiteral ("leechcraft") |
The "leechcraft" literal, with no run-time overhead. More... | |
const int | SourcePager = 2 |
const int | StateRemove = 0 |
const int | StateAdd = 1 |
typedef QList<QPair<QString, QString> > LC::Util::AddrList_t |
Definition at line 21 of file addresses.h.
using LC::Util::ArgType_t = typedef std::tuple_element_t<Idx + 1, decltype (detail::TypeGetter (*static_cast<F*> (nullptr)))> |
Definition at line 40 of file typegetter.h.
using LC::Util::AsTypelist_t = typedef typename AsTypelist<T>::Result_t |
Definition at line 152 of file typelist.h.
using LC::Util::BindResult_t = typedef typename InstanceMonad<MV>::template BindResult_t<F> |
using LC::Util::ConcurrentStdException = typedef Util::ConcurrentException<Util::NewType<std::exception, struct StdException> > |
Definition at line 90 of file concurrentexception.h.
using LC::Util::DefaultHookProxy_ptr = typedef std::shared_ptr<DefaultHookProxy> |
Definition at line 109 of file defaulthookproxy.h.
using LC::Util::DoSmthDetector = typedef decltype (std::declval<T> ().DoSmth (QString {})) |
Definition at line 32 of file detectortest.cpp.
using LC::Util::Find = typedef typename detail::Find<Name, Def, Args...>::type |
Definition at line 188 of file typelist.h.
using LC::Util::FindResult = typedef IntTrie::FindResult |
Definition at line 26 of file stringpathtrietest.cpp.
using LC::Util::FlatTreeItem_ptr = typedef std::shared_ptr<FlatTreeItem> |
Definition at line 22 of file flattofoldersproxymodel.h.
using LC::Util::FmapResult_t = typedef typename InstanceFunctor<T>::template FmapResult_t<F> |
using LC::Util::GSLResult_t = typedef typename InstanceApplicative<AF>::template GSLResult<AV>::Type_t |
Definition at line 34 of file applicative.h.
using LC::Util::Head_t = typedef typename Head<List>::Head_t |
Definition at line 44 of file typelist.h.
using LC::Util::Introspect_f = typedef std::function<QVariantMap (QVariant)> |
Definition at line 25 of file introspectable.h.
using LC::Util::IntTrie = typedef StringPathTrie<int> |
Definition at line 24 of file stringpathtrietest.cpp.
using LC::Util::IsDetected_t = typedef typename detail::IsDetected<Type, void, Op, Args...>::type |
Definition at line 50 of file detector.h.
using LC::Util::IsVoid_t = typedef std::is_same<T, void> |
Definition at line 43 of file typelisttest.cpp.
using LC::Util::Lazy_t = typedef std::function<T ()> |
using LC::Util::LazyNotificationPixmap_t = typedef std::function<std::optional<QFuture<QImage> > ()> |
using LC::Util::MemberPtrStruct_t = typedef MemberTypeStruct_t<decltype (Ptr)> |
Definition at line 70 of file typegetter.h.
using LC::Util::MemberPtrType_t = typedef MemberTypeType_t<decltype (Ptr)> |
Definition at line 67 of file typegetter.h.
using LC::Util::MemberTypeStruct_t = typedef typename detail::DecomposeMemberPtr<PtrType>::StructType_t |
Definition at line 64 of file typegetter.h.
using LC::Util::MemberTypeType_t = typedef typename detail::DecomposeMemberPtr<PtrType>::Value_t |
Definition at line 61 of file typegetter.h.
typedef std::shared_ptr<const ModelItem> LC::Util::ModelItem_cptr |
Definition at line 28 of file modelitem.h.
typedef std::shared_ptr<ModelItem> LC::Util::ModelItem_ptr |
Definition at line 23 of file modelitem.h.
typedef std::weak_ptr<ModelItem> LC::Util::ModelItem_wtr |
Definition at line 26 of file modelitem.h.
typedef QVector<ModelItem_ptr> LC::Util::ModelItemsList_t |
Definition at line 27 of file modelitem.h.
using LC::Util::QIODevice_ptr = typedef std::shared_ptr<QIODevice> |
Definition at line 27 of file resourceloader.h.
using LC::Util::QSVV = typedef QList<QStringView> |
Definition at line 23 of file tokenizetest.cpp.
using LC::Util::QtException_ptr = typedef std::shared_ptr<QtException_t> |
Definition at line 25 of file concurrentexception.h.
using LC::Util::QtException_t = typedef QException |
Definition at line 23 of file concurrentexception.h.
using LC::Util::RetType_t = typedef std::tuple_element_t<0, decltype (detail::TypeGetter (*static_cast<F*> (nullptr)))> |
Definition at line 43 of file typegetter.h.
using LC::Util::SerializeResult_t = typedef Either<QString, Void> |
Definition at line 36 of file serializejson.cpp.
using LC::Util::SomeEither_t = typedef Either<int, QString> |
Definition at line 35 of file eithertest.cpp.
using LC::Util::SVariant_t = typedef std::variant<S1, S2> |
Definition at line 45 of file visitortest.cpp.
using LC::Util::TempResultType_t = typedef Util::Either<IDownload::Error, QByteArray> |
Definition at line 24 of file downloadhelpers.h.
using LC::Util::Variant_t = typedef std::variant<int, char, std::string, QString, double, float> |
Definition at line 31 of file visitortest.cpp.
using LC::Util::WrapType_t = typedef typename WrapType<T>::type |
typedef std::shared_ptr<XmlSettingsDialog> LC::Util::XmlSettingsDialog_ptr |
Definition at line 30 of file ihavesettings.h.
Enumerator | |
---|---|
NoAction | |
Move | |
Resize | |
Minimize | |
Shade | |
Stick | |
MaximizeHorz | |
MaximizeVert | |
ShowFullscreen | |
ChangeDesktop | |
Close | |
MoveToTop | |
MoveToBottom |
Definition at line 40 of file winflags.h.
|
strong |
The priority of the action in the queue.
Enumerator | |
---|---|
Normal | Standard priority. |
High | Higher priority. |
Definition at line 27 of file queuemanager.h.
|
strong |
Describes various root paths recognized by GetSysPath().
|
strong |
Enumerator | |
---|---|
NoState | |
Modal | |
Sticky | |
MaximizedVert | |
MaximizedHorz | |
Shaded | |
SkipTaskbar | |
SkipPager | |
Hidden | |
Fullscreen | |
OnTop | |
OnBottom | |
Attention |
Definition at line 21 of file winflags.h.
|
inlinenoexcept |
Convert the view into a QByteArray without copying.
The lifetime of the view should be not less than the lifetime of the returned QByteArray and any of its copies.
For a version without this requirement, see ToByteArray()
view | An std::string_view to be represented as a QByteArray. |
Definition at line 74 of file qtutil.h.
Referenced by LC::Util::XWrapper::GetAvailableGeometry().
QVector<QStringView> LC::Util::AsRefs | ( | const QVector< QString > & | lst | ) |
Definition at line 28 of file stringpathtrietest.cpp.
References LC::Util::StringPathTrie< V >::Find().
auto LC::Util::AsSet | ( | const T & | cont | ) |
Definition at line 22 of file containerconversions.h.
|
inlinenoexcept |
UTIL_GUI_API QRect LC::Util::AvailableGeometry | ( | const QPoint & | p | ) |
Definition at line 72 of file geometry.cpp.
References GetScreenWithFallback().
|
inline |
Begins the group on settings and returns a scope guard ending that group.
[in] | settings | The QSettings object. |
[in] | group | The name of the group to begin. |
QSettings::endGroup()
on the settings object on scope exit.Definition at line 48 of file scopeguards.h.
BindResult_t<MV, F> LC::Util::Bind | ( | const MV & | value, |
const F & | f | ||
) |
Definition at line 75 of file monad.h.
Referenced by LC::Util::detail::declptr(), and operator>>().
auto LC::Util::BindMemFn | ( | R(B::*)(Args...) const | fn, |
const C * | c | ||
) |
Definition at line 49 of file functional.h.
auto LC::Util::BindMemFn | ( | R(B::*)(Args...) | fn, |
C * | c | ||
) |
Binds an instance of an object to its member function.
[in] | fn | The member function of class T. |
[in] | c | The instance of class T to bind to the member function fn. |
R | The return type of the function. |
T | The type of the object. |
Args | The arguments to the function, besides the object itself. |
Definition at line 42 of file functional.h.
References LC::Util::Caster< To >::operator()().
|
noexcept |
QDomElement LC::Util::BuildTagsTree | ( | QStringList | tags, |
QDomNode & | node, | ||
QDomDocument & | document, | ||
const QString & | elementName, | ||
const std::function< QString(QDomElement)> & | tagGetter, | ||
const std::function< void(QDomElement &, QString)> & | tagSetter | ||
) |
Builds a nested sequence of DOM elements representing a list of tags.
This function tries to implement projection from tags to a hierarchical structure in form of XML. It traverses the tags list and creates child nodes from the document, appending the hierarchical structure's tree root to the node. It returns the parent element to which the item should be appended.
For empty tags list it just returns node converted to the QDomElement.
[in] | tags | List of tags. |
[in] | node | The parent-most node to which all other nodes are appended. |
[in] | document | The document containing all these nodes. |
[in] | elementName | The name of the XML element that carries info about the tags. |
[in] | tagSetter | Setter function for the tags for the given element. |
[in] | tagGetter | Getter function for the tags for the given element. |
Definition at line 20 of file buildtagstree.cpp.
Container<T> LC::Util::Concat | ( | const Container< Container< T >> & | containers | ) |
Definition at line 171 of file prelude.h.
Referenced by ConcatMap().
auto LC::Util::Concat | ( | const Container< ContArgs... > & | containers | ) | -> std::decay_t<decltype (*containers.begin ())> |
Definition at line 180 of file prelude.h.
References LC::Util::detail::Append().
|
constexpr |
Definition at line 74 of file typelist.h.
auto LC::Util::ConcatMap | ( | Cont && | c, |
F && | f | ||
) |
Definition at line 190 of file prelude.h.
References Concat(), LC::Util::oral::sph::f, and Map().
UTIL_SYS_API QDir LC::Util::CreateIfNotExists | ( | QString | path | ) |
Creates a path if it doesn't exist.
Creates a relative path ~/.leechcraft/path and throws an exception if this could not be done or if such path already exists and it is not readable.
[in] | path | The path to create. |
std::runtime_error | Throws if the path could not be created. |
UTIL_API QAction * LC::Util::CreateSeparator | ( | QObject * | parent | ) |
void LC::Util::CreateShortcuts | ( | const QList< QKeySequence > & | seqs, |
Obj * | obj, | ||
void(Obj::*)() | member, | ||
QWidget * | parent | ||
) |
CurryImpl<std::decay_t<F>, Args...> LC::Util::Curry | ( | F && | f, |
Args &&... | args | ||
) |
|
constexpr |
Definition at line 58 of file statichash.h.
|
constexpr |
Definition at line 53 of file statichash.h.
|
constexpr |
Definition at line 44 of file statichash.h.
UTIL_SYS_API QByteArray LC::Util::DetectFileMime | ( | const QString & | path | ) |
Definition at line 31 of file mimedetector.cpp.
auto LC::Util::Do | ( | const MV & | value | ) |
Definition at line 89 of file monad.h.
Referenced by operator>>().
auto LC::Util::Do | ( | const MV & | value, |
const FHead & | fHead, | ||
const FArgs &... | fArgs | ||
) |
Definition at line 95 of file monad.h.
References LC::Util::oral::sph::f.
|
inline |
Creates a range iterating over direct children named tag.
The returned range is suitable for range-based for loops, in particular. For instance, the following is correct:
Modifying the underlying DOM tree will result in the same effects as modifying it during the canonical Qt-way of repeatedly calling QDomElement::nextSiblingElement()
until the element becomes null.
parent | The parent element whose children should be iterated over. |
tag | The tag name of the child nodes (or an empty string for . |
Definition at line 96 of file domchildrenrange.h.
UTIL_XPC_API std::optional< QFuture< TempResultType_t > > LC::Util::DownloadAsTemporary | ( | IEntityManager * | iem, |
const QUrl & | url, | ||
DownloadParams | params | ||
) |
Definition at line 28 of file downloadhelpers.cpp.
UTIL_GUI_API QPixmap LC::Util::DrawOverlayText | ( | QPixmap | px, |
const QString & | text, | ||
QFont | font, | ||
const QPen & | pen, | ||
const QBrush & | brush | ||
) |
|
constexpr |
Definition at line 68 of file typelist.h.
detail::Dropper<F> LC::Util::DropArgs | ( | const F & | f | ) |
Definition at line 115 of file dropargs.h.
UTIL_GUI_API QString LC::Util::ElideProgressBarText | ( | const QString & | text, |
const QStyleOptionViewItem & | option | ||
) |
Definition at line 98 of file util.cpp.
References TintColors().
UTIL_QML_API void LC::Util::EnableTransparency | ( | QQuickWidget * | widget | ) |
void LC::Util::EnumerateChildren | ( | const QModelIndex & | idx, |
bool | includingRoot, | ||
F && | f | ||
) |
Container<T> LC::Util::Filter | ( | const Container< T > & | c, |
F | f | ||
) |
Definition at line 161 of file prelude.h.
References LC::Util::detail::Append(), and LC::Util::oral::sph::f.
UTIL_SYS_API QString LC::Util::FindInSystemPath | ( | const QString & | name, |
const QStringList & | paths, | ||
const std::function< bool(QFileInfo)> & | filter = {} |
||
) |
Searches for a file in system paths according to a filter.
This function searches for a file named name in system paths passed in paths and returns the full path for the first file that matches filter, or an empty string if nothing is found.
paths are most possibly obtained via GetSystemPaths(), but an arbitrary set of paths is fine too.
[in] | name | The name of the file to search for. |
[in] | paths | The paths to search in. |
[in] | filter | The filter function for the candidates. |
auto LC::Util::First | ( | F && | f | ) |
Definition at line 245 of file prelude.h.
References LC::Util::oral::sph::f.
Referenced by LC::Util::oral::detail::Combine().
auto LC::Util::FirstMatching | ( | F | f, |
G | g, | ||
Def | def, | ||
Util::Typelist< Head, Args... > | |||
) |
Definition at line 155 of file typelist.h.
FmapResult_t<T, F> LC::Util::Fmap | ( | const T & | functor, |
const F & | function | ||
) |
Apply the function f to the elements in functor.
This function forwards the function f to the instance of the Functor class (namely, InstanceFunctor<T>) for the type T to do the actual function application.
[in] | functor | The functor whose values are subject to function. |
[in] | function | The function that should be applied to the values in the functor. |
T | The type of the functor. |
F | The type of the function to apply to the elements inside the functor. |
UTIL_GUI_API QString LC::Util::FormatName | ( | const QString & | name | ) |
HTML-formats the name to let the user know it is not a part of the fixed dialog text.
This function is useful to format an account name, a link title and similar entities in contexts like a dialog, a label or a tooltip. Using this function ensures this formatting is done in an uniform style across the whole GUI.
[in] | name | The source string. |
UTIL_API QString LC::Util::GetAsBase64Src | ( | const QImage & | image | ) |
UTIL_XPC_API QList< QObject * > LC::Util::GetDataFilters | ( | const QVariant & | data, |
IEntityManager * | manager | ||
) |
Returns the data filter plugins that can handle data.
This function queries all available data filters plugins if they can handle data and returns the list of object instances that can handle it. The object instances are guaranteed to implement the IDataFilter interface as well as IEntityHandler interface.
The manager is used to obtain the list of plugins. It can be obtained from the ICoreProxy_ptr object that is passed to your plugin's Init() function.
[in] | data | The data to query. |
[in] | manager | The manager used to get the plugins. |
Definition at line 71 of file util.cpp.
References IEntityManager::GetPossibleHandlers(), and MakeEntity().
UTIL_TAGS_API QString LC::Util::GetDefaultTagsSeparator | ( | ) |
UTIL_XPC_API QString LC::Util::GetErrorString | ( | IDownload::Error::Type | type | ) |
Definition at line 20 of file downloaderrorstrings.cpp.
UTIL_API QString LC::Util::GetInternetLocaleName | ( | const QLocale & | locale | ) |
UTIL_API QString LC::Util::GetLanguage | ( | ) |
Returns the current language name.
This function works as GetLocaleName() except it doesn't return (and doesn't query for) country name.
UTIL_API QString LC::Util::GetLocaleName | ( | ) |
Returns the current locale name, like en_US.
First, this function checks the locale value stored in "Language" key of settings object with organizationName() and applicationName(). If it's equal to "system", this function queries the LANG environment variable, and if it is empty or in invalid format (not like en_US), it takes the value of QLocale::system().name().
Then, if the resulting name the name of the language only, GetLocaleName() tries to find any countries for that language. If any countries are found, the code of the first found country is appended, else "_00" is appended.
UTIL_XPC_API void LC::Util::GetPassword | ( | const QString & | key, |
const QString & | diaText, | ||
const ICoreProxy_ptr & | proxy, | ||
const EitherCont< void(), void(QString)> & | cont, | ||
QObject * | depender, | ||
bool | useStored | ||
) |
Definition at line 80 of file passutils.cpp.
UTIL_XPC_API QString LC::Util::GetPassword | ( | const QString & | keyName, |
const QString & | dialogText, | ||
const ICoreProxy_ptr & | proxy, | ||
bool | useStore = true |
||
) |
Returns password for the key, possibly asking the user.
This function returns password for the given keyName. The password is typically stored in a storage plugin like SecMan.
If the password isn't found in any password stores (or there are no password stores) or useStore is set to false, this function asks the user for the password instead using the dialogText for the dialog and returns the user input instead. If user has canceled the dialog it returns an null string. Otherwise, if the user has entered some text this function automatically stores the password under the keyName.
[in] | keyName | The name of the key uniquely identifying the password. |
[in] | dialogText | The text of the dialog to present to the user if the password isn't found or useStore is false. |
[in] | proxy | The core proxy used to communicate with other plugins. |
[in] | useStore | Whether stored password should be used at all. Calling code may explicitly set this to false if the saved password is known to be invalid, for instance. |
Definition at line 61 of file passutils.cpp.
UTIL_SYS_API QStringList LC::Util::GetPathCandidates | ( | SysPath | path, |
QString | subfolder | ||
) |
Returns possible full paths for the path and subfolder.
This function returns a list of paths formed as the given root path identified by path plus the subfolder in it. The paths in the returned list aren't checked for existence.
For example, on Linux
will return { "/usr/share/leechcraft/flags", "/usr/local/share/leechcraft/flags" }
.
The subfolder can actually be a relative path, like flags/countries
, not just a single subfolder name.
This function hardly needs to be called from user code, consider using GetSysPath() instead.
[in] | path | The root path. |
[in] | subfolder | The subfolder inside the root path. |
UTIL_XPC_API QVariant LC::Util::GetPersistentData | ( | const QByteArray & | key, |
const ICoreProxy_ptr & | proxy | ||
) |
Returns persistent data stored under given key.
The persistent data itself is stored in plugins implementing the IPersistentStoragePlugin interface. This function uses the passed proxy to get the list of those.
If no data is found under the given key, a null QVariant is returned.
[in] | key | The key to look for. |
[in] | proxy | The ICoreProxy object for getting the list of persistent storage plugins. |
UTIL_GUI_API QScreen * LC::Util::GetScreenWithFallback | ( | const QPoint & | p | ) |
Definition at line 61 of file geometry.cpp.
Referenced by AvailableGeometry().
UTIL_NETWORK_API QString LC::Util::GetServiceUrl | ( | const ServiceInfo & | info, |
const QString & | path | ||
) |
Definition at line 46 of file lcserviceoverride.cpp.
UTIL_SYS_API SpaceInfo LC::Util::GetSpaceInfo | ( | const QString & | path | ) |
UTIL_XPC_API QList< ANFieldData > LC::Util::GetStdANFields | ( | const QString & | category | ) |
Returns the list of the standard AN fields for the given category.
[in] | category | The category of events to return fields for. |
Definition at line 23 of file stdanfields.cpp.
References LC::AN::Field::MediaAlbum, LC::AN::Field::MediaArtist, LC::AN::Field::MediaLength, LC::AN::Field::MediaTitle, and LC::AN::TypeIMEventTuneChange.
UTIL_SYS_API QString LC::Util::GetSysPath | ( | SysPath | path, |
const QString & | subfolder, | ||
const QString & | filename | ||
) |
Returns path to the file in the given root path and subfolder.
This function returns path to a file named filename and located in the path specified by path + subfolder. It actually checks whether the file exists and if it doesn't, returns a null string instead.
If LeechCraft is running on a system where multiple paths correspond to a single path, they are checked from more user-accessible to less user-accessible. For example, SysPath::Share corresponds to /usr/local/share/leechcraft
and then /usr/share/leechcraft
.
The subfolder can actually be a relative path, like flags/countries
, not just a single subfolder name.
Refer to GetPathCandidates() for more information.
[in] | path | The identifier of the root path. |
[in] | subfolder | The subfolder inside the path. |
[in] | filename | The filename inside the path + subfolder. |
UTIL_SYS_API QUrl LC::Util::GetSysPathUrl | ( | SysPath | path, |
const QString & | subfolder, | ||
const QString & | filename | ||
) |
Returns path to the file in the given root path and subfolder.
This function behaves exactly like GetSysPath(), but it returns the path as QUrl via the QUrl::fromLocalFile
, so it is suitable, for example, for QML views.
[in] | path | The identifier of the root path. |
[in] | subfolder | The subfolder inside the path. |
[in] | filename | The filename inside the path + subfolder. |
UTIL_SYS_API QStringList LC::Util::GetSystemPaths | ( | ) |
Returns the components of the system PATH variable.
This function gets the PATH variable from the environment, parses it and returns the list of the components to the caller.
UTIL_SYS_API QString LC::Util::GetTemporaryName | ( | const QString & | pattern = {} | ) |
UTIL_SYS_API QDir LC::Util::GetUserDir | ( | UserDir | dir, |
const QString & | subpath | ||
) |
GSLResult_t<AF, AV> LC::Util::GSL | ( | const AF & | af, |
const AV & | av | ||
) |
Definition at line 49 of file applicative.h.
Referenced by Pure().
void LC::Util::HandleNetworkReply | ( | QObject * | context, |
QNetworkReply * | reply, | ||
F | f | ||
) |
Definition at line 27 of file handlenetworkreply.h.
References LC::Util::oral::sph::f.
auto LC::Util::HandleReply | ( | QNetworkReply * | reply, |
QObject * | context | ||
) |
Definition at line 65 of file handlenetworkreply.h.
auto LC::Util::HandleReplySeq | ( | QNetworkReply * | reply, |
QObject * | context | ||
) |
Definition at line 111 of file handlenetworkreply.h.
UTIL_SYS_API bool LC::Util::HasSupportedImageExtension | ( | const QString & | filename | ) |
Checks if the given filename has a known image extension.
This function checks if the filename has an extension matching any image format known to QImageWriter.
[in] | filename | The name of the file, either relative or absolute. |
UTIL_XPC_API void LC::Util::InitJobHolderRow | ( | const QList< QStandardItem * > & | row | ) |
Definition at line 162 of file util.cpp.
References LC::JobProgress, LC::ProcessProgress, LC::ProcessState, LC::RoleJobHolderRow, and LC::ProcessStateInfo::Running.
UTIL_API QTranslator * LC::Util::InstallTranslator | ( | const QString & | base, |
const QString & | prefix = LCLowercase , |
||
const QString & | appname = LCLowercase |
||
) |
Loads and installs a translator.
Attempts to load and install a translator for the current locale. The name is formed like this: 'prefix_' + base + '_' + locale If base is an empty string, the second _ isn't appended.
First resources are searched (:/), then APPDIR/translations on Windows and /usr/[local/]share/appname/translations on Unix.
[in] | base | Base name of the translation file. |
[in] | prefix | The optional prefix of the translation (useful if it's not LC's one). |
[in] | appname | Base name of the application. |
auto LC::Util::InvokeOn | ( | T && | t, |
Args &&... | args | ||
) |
|
constexpr |
Checks whether the given type has a Functor instance for it.
T | The type to check. |
Definition at line 104 of file functor.h.
References LC::Util::InstanceFunctor< T >::Apply().
|
constexpr |
Definition at line 52 of file monadplus.h.
References Mplus.
UTIL_SYS_API bool LC::Util::IsOSXLoadFromBundle | ( | ) |
UTIL_API QTranslator * LC::Util::LoadTranslator | ( | const QString & | baseName, |
const QString & | localeName, | ||
const QString & | prefix, | ||
const QString & | appName | ||
) |
UTIL_XPC_API Entity LC::Util::MakeAN | ( | const QString & | header, |
const QString & | text, | ||
Priority | priority, | ||
const QString & | senderID, | ||
const QString & | cat, | ||
const QString & | type, | ||
const QString & | id, | ||
const QStringList & | visualPath, | ||
int | delta = 1 , |
||
int | count = 0 , |
||
const QString & | fullText = QString() , |
||
const QString & | extendedText = QString() |
||
) |
Creates an Advanced Notifications-enabled notify entity.
Returns an entity with the given header, text and a bunch of other parameters that can be handled by Advanced Notifications.
The returned entity will also be handled by a visual notifications plugin if AN is not present. To avoid this set the MIME type of the result to x-leechcraft/notification+advanced.
Refer to the hand-written documentation for more information about using Advanced Notifications.
[in] | header | The header of the notification. This field will also be used if AN is not present. |
[in] | text | The text of the notification. This field will also be used if AN is not present. |
[in] | priority | The priority of this notification. |
[in] | senderID | The ID of the plugin sending this notification. |
[in] | cat | The category of this notification (one of Cat constants in interfaces/an/constants.h). |
[in] | type | The type of this notification (one of Type constants in interfaces/an/constants.h). |
[in] | id | The ID of this notification, used to group consecutive notifications about similar events like incoming message from the same IM contact. |
[in] | visualPath | The list of names for a menu-like structure wishing to show this notification. |
[in] | delta | The change of count of events with this id, or 0 to use count. |
[in] | count | The total count of events with this id, used if delta is 0. |
[in] | fullText | The full text of this notification. If null, the text parameter is used. |
[in] | extendedText | The extended text of this notification. If null, the text parameter is used. |
Definition at line 23 of file util.cpp.
References LC::AN::EF::Count, LC::Util::oral::sph::count, LC::AN::EF::DeltaCount, LC::AN::EF::EventCategory, LC::AN::EF::EventID, LC::AN::EF::EventType, LC::AN::EF::ExtendedText, LC::AN::EF::FullText, MakeNotification(), LC::AN::EF::SenderID, and LC::AN::EF::VisualPath.
UTIL_XPC_API Entity LC::Util::MakeANCancel | ( | const Entity & | event | ) |
Makes an event for canceling another Advanced Notifications event.
Creates an Entity that cancels a previously generated Advanced Notifications event. The returned entity can be then emitted to notify plugins that the given event has been canceled.
[in] | event | The event to cancel. |
Definition at line 107 of file util.cpp.
References LC::Entity::Additional_, LC::AN::CatEventCancel, LC::Entity::Entity_, LC::AN::EF::EventCategory, LC::AN::EF::EventID, LC::Info, MakeNotification(), and LC::AN::EF::SenderID.
UTIL_XPC_API Entity LC::Util::MakeANCancel | ( | const QString & | senderId, |
const QString & | eventId | ||
) |
Makes an event for canceling another Advanced Notifications event.
Creates an Entity that cancels a previously generated Advanced Notifications event. The returned entity can be then emitted to notify plugins that the given event has been canceled.
This function doesn't take a previously created entity as the other overload does. Instead, it plainly creates the required entity from the given senderId and eventId. They should match those of the event in question.
[in] | senderId | The ID of the sender of the event that is to be canceled. |
[in] | eventId | The ID of the event that is to be canceled. |
Definition at line 116 of file util.cpp.
References LC::Entity::Additional_, LC::AN::CatEventCancel, LC::AN::EF::EventCategory, LC::AN::EF::EventID, LC::Info, MakeNotification(), and LC::AN::EF::SenderID.
UTIL_XPC_API Entity LC::Util::MakeANRule | ( | const QString & | title, |
const QString & | senderID, | ||
const QString & | category, | ||
const QStringList & | types, | ||
AN::NotifyFlags | flags = AN::NotifyNone , |
||
bool | openConfiguration = false , |
||
const QList< QPair< QString, ANFieldValue >> & | fields = {} |
||
) |
Creates an Entity defining an Advanced Notifications rule.
Returns an entity describing a notifications rule triggering under various conditions, defined by the parameters of this function.
[in] | title | The human-readable title of the rule. |
[in] | senderID | The plugin ID of the sender (must not be empty). |
[in] | category | The category of the event (must not be empty). |
[in] | types | The types of events in the given category. If this list is empty, every event type matches. |
[in] | flags | The flags describing the notification behavior for for this rule |
[in] | openConfiguration | Whether the configuration widget for the just created rule should be opened automatically. |
[in] | fields | The list of pairs of a field ID (as in ANFieldData::ID_) and corresponding field value as ANFieldValue. |
Definition at line 44 of file util.cpp.
References LC::Entity::Additional_, LC::AN::EF::EventCategory, LC::AN::EF::EventID, LC::AN::EF::EventType, LC::Util::oral::sph::fields, LC::AN::EF::IsSingleShot, MakeNotification(), LC::AN::EF::NotifyAudio, LC::AN::NotifyAudio, LC::AN::EF::NotifyPersistent, LC::AN::NotifyPersistent, LC::AN::NotifySingleShot, LC::AN::EF::NotifyTransient, LC::AN::NotifyTransient, LC::AN::EF::OpenConfiguration, and LC::AN::EF::SenderID.
UTIL_GUI_API QDialog * LC::Util::MakeCertificateViewerDialog | ( | const QSslCertificate & | cert, |
QWidget * | parent | ||
) |
Definition at line 77 of file sslcertificateinfowidget.cpp.
References Close.
QSqlDatabase LC::Util::MakeDatabase | ( | const QString & | name = ":memory:" | ) |
Definition at line 73 of file common.h.
References LC::Util::DBLock::DumpError(), GenConnectionName(), and RunTextQuery().
Referenced by BOOST_FUSION_ADAPT_STRUCT().
|
inline |
Creates a scope guard that ends the current group on settings.
[in] | settings | The QSettings object whose current group should be ended on scope exit. |
QSettings::endGroup()
on the settings object on scope exit.Definition at line 33 of file scopeguards.h.
UTIL_XPC_API Entity LC::Util::MakeEntity | ( | const QVariant & | entity, |
const QString & | location, | ||
LC::TaskParameters | tp, | ||
const QString & | mime = QString() |
||
) |
An utility function to make a Entity.
Creates a Entity that wraps the given entity from given location with parameterrs identified by tp and given mime type (which is null by default).
This function is provided for convenience and is equivalent to manually filling the Entity.
[in] | entity | The Entity_ field of the Entity. |
[in] | location | The Location_ field of the Entity. |
[in] | tp | The Params_ field of the Entity. |
[in] | mime | The Mime_ field of the Entity. |
Entity LC::Util::MakeEntity | ( | const QVariant & | entity, |
const QString & | location, | ||
TaskParameters | tp, | ||
const QString & | mime | ||
) |
Definition at line 82 of file util.cpp.
References LC::Entity::Entity_, LC::Entity::Location_, LC::Entity::Mime_, and LC::Entity::Parameters_.
Referenced by GetDataFilters(), MakeNotification(), and LC::Util::ShortcutManager::RegisterActionInfo().
consteval auto LC::Util::MakeHash | ( | auto &&... | commands | ) |
Definition at line 64 of file statichash.h.
auto LC::Util::MakeLambdaEventFilter | ( | F && | f, |
QObject * | parent = nullptr |
||
) |
Definition at line 58 of file lambdaeventfilter.h.
Lazy_t<T> LC::Util::MakeLazy | ( | const T & | t | ) |
Lazy_t<R> LC::Util::MakeLazyF | ( | const F & | l | ) |
UTIL_XPC_API Entity LC::Util::MakeNotification | ( | const QString & | header, |
const QString & | text, | ||
Priority | priority | ||
) |
An utility function to make a Entity with notification.
Creates a Entity that holds information about user-visible notification. These notifications have "x-leechcraft/notification" MIME.
You can further customize the returned Entity to suit your exact needs. See the documentation for Entity about such entities.
[in] | header | The header of the notification. |
[in] | text | The text of the notification. |
[in] | priority | The priority level of the notification. |
Definition at line 95 of file util.cpp.
References LC::Entity::Additional_, LC::AutoAccept, MakeEntity(), and LC::OnlyHandle.
Referenced by MakeAN(), MakeANCancel(), and MakeANRule().
UTIL_API QString LC::Util::MakePrettySize | ( | qint64 | sourceSize | ) |
Makes a formatted size from number.
Converts, for example, 1048576 to 1.0 MB.
[in] | sourceSize | Size in bytes. |
UTIL_API QString LC::Util::MakePrettySizeShort | ( | qint64 | size | ) |
Converts a bytes count to a string representation with appropriately chosen units.
Converts, for example, 1048576 to 1.0 M.
As opposed to MakePrettySize(), this function tries to keep the returned string short.
[in] | size | Size in bytes. |
detail::ScopeGuard<F> LC::Util::MakeScopeGuard | ( | const F & | f | ) |
Returns an object performing passed function on scope exit.
The returned object performs the passed function f upon destruction (and, thus, on scope exit).
The object is not copyable and not movable, and otherwise is implementation-defined.
Typical usage:
[in] | f | The function to execute on scope exit. Should be a callable without any arguments. |
Definition at line 148 of file util.h.
Referenced by LC::Util::CustomCookieJar::setCookiesFromUrl(), and LC::Util::Visitor< FinallyFunc, Args >::Visitor().
consteval auto LC::Util::MakeStringHash | ( | auto &&... | commands | ) |
Definition at line 85 of file statichash.h.
UTIL_API QString LC::Util::MakeTimeFromLong | ( | ulong | time | ) |
Makes a formatted time from number.
Converts, for example 256 to 00:04:16.
[in] | time | Time interval in seconds. |
|
noexcept |
Definition at line 149 of file prelude.h.
References LC::Util::oral::sph::f.
Referenced by ConcatMap(), and LC::Util::PlotItem::SetMultipoints().
|
noexcept |
Definition at line 155 of file prelude.h.
References LC::Util::oral::sph::f.
MP LC::Util::Mzero | ( | ) |
Definition at line 58 of file monadplus.h.
Referenced by LC::Util::detail::IsMonadPlusImpl(), and MakeLazy().
UTIL_XSD_API XmlSettingsDialog * LC::Util::OpenXSD | ( | const QString & | title, |
const QString & | filename, | ||
Util::BaseSettingsManager * | bsm | ||
) |
Opens XML settings dialog for the given XML filename.
The dialog is opened as non-modal and non-blocking and is automatically shown. The dialog is also set to be automatically deleted as soon as it is closed.
[in] | title | The title of the dialog. |
[in] | filename | The XML settings file to use to build the dialog. |
[in] | bsm | The instance of BaseSettingsManager to use for storing the settings. |
bool LC::Util::operator!= | ( | const ModelIterator & | left, |
const ModelIterator & | right | ||
) |
For iterators to not be equal at least either the model, parent index, row or column should be unequal. Traversal index is not taken into account.
[in] | left | First iterator to check for inequality. |
[in] | right | Second iterator to check for inequality. |
Definition at line 82 of file modeliterator.cpp.
auto LC::Util::operator* | ( | const AF & | af, |
const AV & | av | ||
) | -> decltype (GSL (af, av)) |
Definition at line 55 of file applicative.h.
auto LC::Util::operator* | ( | const F & | function, |
const T & | functor | ||
) | -> decltype (Fmap (functor, function)) |
An operator-style alias for Fmap().
This operator allows writing Fmap()'s in infix form. Internally, it just forwards the call to Fmap().
[in] | functor | The functor whose values are subject to function. |
[in] | function | The function that should be applied to the values in the functor. |
T | The type of the functor. |
F | The type of the function to apply to the elements inside the functor. |
auto LC::Util::operator* | ( | const T & | functor, |
const F & | function | ||
) | -> decltype (Fmap (functor, function)) |
An operator-style alias for Fmap().
This operator allows writing Fmap()'s in infix form. Internally, it just forwards the call to Fmap().
[in] | functor | The functor whose values are subject to function. |
[in] | function | The function that should be applied to the values in the functor. |
T | The type of the functor. |
F | The type of the function to apply to the elements inside the functor. |
auto LC::Util::operator+ | ( | const MP & | m1, |
const MP & | m2 | ||
) | -> decltype (Mplus (m1) (m2)) |
Definition at line 73 of file monadplus.h.
bool LC::Util::operator== | ( | const ModelIterator & | left, |
const ModelIterator & | right | ||
) |
For iterators to be equal the model, parent index, row and column should all be equal. Traversal index is not taken into account.
[in] | left | First iterator to check for equality. |
[in] | right | Second iterator to check for equality. |
Definition at line 74 of file modeliterator.cpp.
auto LC::Util::operator>> | ( | const MV & | value, |
const F & | f | ||
) | -> decltype (Bind (value, f)) |
|
inline |
Parses JSON content in the given bytearray.
This functions uses QJson on Qt4 (don't forget to link to it!) and Qt's native JSON parsers on Qt5.
[in] | bytes | The byte array to parse JSON from. |
[in] | context | The context string to be used in logging messages. |
Definition at line 43 of file parsejson.h.
|
inline |
Utility function parsing JSON from the device.
This function reads all available data from the device and passes it to the other ParseJson() overload.
[in] | device | The device from which JSON-encoded data should be read. |
[in] | context | The context string to be used in logging messages. |
Definition at line 68 of file parsejson.h.
std::pair<Cont<L>, Cont<R> > LC::Util::PartitionEithers | ( | const Cont< Either< L, R >> & | eithers | ) |
auto LC::Util::PrepareRecords | ( | QSqlDatabase | db, |
int | count = 3 |
||
) |
Definition at line 104 of file common.h.
References LC::Util::oral::sph::count.
auto LC::Util::Pure | ( | const T & | v | ) |
Definition at line 37 of file applicative.h.
References GSL().
auto LC::Util::Pure | ( | const T & | v | ) | -> decltype (InstanceApplicative<Applicative>::Pure (v)) |
Definition at line 43 of file applicative.h.
References GSL().
LC::Util::Q_DECLARE_FLAGS | ( | FitFlags | , |
FitFlag | |||
) |
auto LC::Util::Return | ( | const V & | v | ) |
|
constexpr |
Definition at line 86 of file typelist.h.
|
constexpr |
Definition at line 80 of file typelist.h.
auto LC::Util::Reversed | ( | auto | container | ) |
Definition at line 75 of file tokenizetest.cpp.
References TokenizeRev().
R LC::Util::RightOr | ( | const Either< L, R > & | either, |
const R & | r | ||
) |
R LC::Util::RightOr | ( | const Either< L, R > & | either, |
F && | f | ||
) |
void LC::Util::Save2MimeData | ( | QMimeData * | mimeData, |
const QString & | name, | ||
const T & | t | ||
) |
UTIL_XPC_API void LC::Util::SavePassword | ( | const QString & | password, |
const QString & | keyName, | ||
const ICoreProxy_ptr & | proxy | ||
) |
Saves the password to be retrieved later via GetPassword().
This function stores the password under the given keyName. The password is typically stored in a storage plugin like SecMan.
If there are no storage plugins, this function does nothing.
[in] | password | The password string to save. |
[in] | keyName | The name of the key uniquely identifying the password. |
[in] | proxy | The core proxy used to communicate with other plugins. |
Definition at line 123 of file passutils.cpp.
UTIL_GUI_API QRect LC::Util::ScreenGeometry | ( | const QPoint & | p | ) |
Definition at line 77 of file geometry.cpp.
auto LC::Util::Second | ( | F && | f | ) |
Definition at line 251 of file prelude.h.
References LC::Util::oral::sph::f.
UTIL_SLL_API QByteArray LC::Util::SerializeJson | ( | const QVariant & | var, |
bool | compact = true |
||
) |
Serializes the given var to JSON representation.
This function abstracts away differences between Qt4 and Qt5. It uses QJson on Qt4 (don't forget to link to it!) and native JSON functions on Qt5.
[in] | var | The recursive variant to be serialized to JSON. |
[in] | compact | Whether the output should be compacitified (this parameter may have no effect). |
Definition at line 30 of file serializejson.cpp.
UTIL_SLL_API Either< QString, Void > LC::Util::SerializeJsonToFile | ( | const QString & | filename, |
const QVariant & | var, | ||
bool | compact | ||
) |
Definition at line 38 of file serializejson.cpp.
References LC::Util::Either< L, R >::Left().
UTIL_XPC_API void LC::Util::SetJobHolderProgress | ( | const QList< QStandardItem * > & | row, |
qint64 | done, | ||
qint64 | total, | ||
const QString & | text | ||
) |
Sets the progress values on the given row.
This function first retrieves the QStandardItem object at the position defined by JobHolderColumn::JobProgress in the passed row and then sets its text to text and updates the ProcessStateInfo structure under the JobHolderRole::ProcessState role to have the given amount of done and total.
[in] | row | The row to set data on. |
[in] | done | The amount of work done. |
[in] | total | The total amount of work. |
[in] | text | The text that the progress-related item should have in the row. |
Definition at line 143 of file util.cpp.
References LC::JobProgress.
UTIL_XPC_API void LC::Util::SetJobHolderProgress | ( | QStandardItem * | item, |
qint64 | done, | ||
qint64 | total | ||
) |
Sets the done and total progress values on the given item.
This function updates the ProcessStateInfo structure stored under the JobHolderRole::ProcessState role in the given item.
[in] | item | The item to set data on. |
[in] | done | The amount of work done. |
[in] | total | The total amount of work. |
Definition at line 154 of file util.cpp.
References LC::ProcessStateInfo::Done_, and LC::ProcessState.
decltype(auto) LC::Util::Sorted | ( | Cont && | cont | ) |
Container<Container<T> > LC::Util::SplitInto | ( | size_t | numChunks, |
const Container< T > & | container | ||
) |
|
noexcept |
Converts an Qt's associative sequence assoc to an STL-like iteratable range.
This function takes an associative container assoc (one of Qt's containers like QHash and QMap) and returns a range with value_type
equal to std::pair<K, V>
.
This way, both the key and the value of each pair in the assoc can be accessed in a range-for loop, for example.
Example usage:
All kinds of accesses are supported: elements of a non-const container may be modified via the iterators in the returned range.
[in] | assoc | The Qt's associative container to iterate over. |
value_type
.Assoc | The type of the source Qt associative container. |
Definition at line 58 of file fdguard.cpp.
|
constexpr |
Definition at line 47 of file typelist.h.
|
inlinenoexcept |
Create a QByteArray with the data referenced by the view.
The data within view is copied into the returned QByteArray, so, unlike AsByteArray(), there are no requirements on the lifetime of view.
view | An std::string_view to be represented as a QByteArray. |
FlatTreeItem* LC::Util::ToFlat | ( | const QModelIndex & | idx | ) |
Definition at line 56 of file flattofoldersproxymodel.cpp.
Referenced by LC::Util::FlatToFoldersProxyModel::columnCount().
auto LC::Util::TokenizeFwd | ( | QStringView | str | ) |
Definition at line 25 of file tokenizetest.cpp.
auto LC::Util::TokenizeRev | ( | QStringView | str | ) |
Definition at line 65 of file tokenizetest.cpp.
Referenced by Reversed().
|
inline |
Definition at line 27 of file unreachable.h.
auto LC::Util::Visit | ( | const Either< Left, Right > & | either, |
Args &&... | args | ||
) |
Definition at line 212 of file either.h.
Referenced by PartitionEithers(), and LC::Util::Visitor< FinallyFunc, Args >::Visitor().
decltype(auto) LC::Util::Visit | ( | const std::variant< Vars... > & | v, |
Args &&... | args | ||
) |
decltype(auto) LC::Util::Visit | ( | std::variant< Vars... > & | v, |
Args &&... | args | ||
) |
Definition at line 58 of file visitor.h.
References LC::Util::Visitor< FinallyFunc, Args >::Visitor().
LC::Util::Visitor | ( | Args && | ... | ) | -> Visitor< Void, Args... > |
auto LC::Util::Zip | ( | const Container< T1 > & | c1, |
const Container< T2 > & | c2 | ||
) | -> Container<Pair<T1, T2>> |
auto LC::Util::ZipWith | ( | const Container< T1 > & | c1, |
const Container< T2 > & | c2, | ||
F | f | ||
) | -> WrapType_t<Container<std::decay_t<std::result_of_t<F (T1, T2)>>>> |
Definition at line 43 of file prelude.h.
References LC::Util::oral::sph::f.
Referenced by Zip().
|
constexpr |
Definition at line 46 of file typelevel.h.
|
constexpr |
Definition at line 49 of file typelevel.h.
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
Definition at line 47 of file detector.h.
const Q_DECL_IMPORT QString LC::Util::LCLowercase = QStringLiteral ("leechcraft") |
LC::Util::List< Head > |
Definition at line 86 of file typelist.h.
const { ... } LC::Util::Mplus |
Referenced by IsMonadPlus().
const { ... } LC::Util::Msum |
RoledMemberField<RoleArg, GetterArg> LC::Util::RoledMemberField_v |
Definition at line 40 of file roleditemsmodel.h.
const int LC::Util::RoleTag = Qt::UserRole |
Definition at line 31 of file categoryselector.cpp.
Referenced by LC::Util::CategorySelector::SetPossibleSelections().
|
constexpr |
const int LC::Util::SourcePager = 2 |
Definition at line 36 of file xwrapper.cpp.
Referenced by LC::Util::XWrapper::MinimizeWindow(), LC::Util::XWrapper::ResizeWindow(), and LC::Util::XWrapper::ShadeWindow().
const int LC::Util::StateAdd = 1 |
Definition at line 39 of file xwrapper.cpp.
Referenced by LC::Util::XWrapper::MinimizeWindow(), LC::Util::XWrapper::ResizeWindow(), and LC::Util::XWrapper::UnshadeWindow().
const int LC::Util::StateRemove = 0 |
Definition at line 38 of file xwrapper.cpp.
Referenced by LC::Util::XWrapper::ShadeWindow(), and LC::Util::XWrapper::UnshadeWindow().
concept LC::Util::StringViewContainer = std::is_same_v<typename std::decay_t<Cont>::value_type, QStringView> |
Definition at line 27 of file stringpathtrie.h.
|
constexpr |
Definition at line 85 of file functional.h.