mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-07-14 22:35:49 +00:00
rewrite formtatter* and customkeys* to share their code
This commit is contained in:
@ -20,11 +20,12 @@
|
||||
#define AWFORMATTERHELPER_H
|
||||
|
||||
#include "abstractextitemaggregator.h"
|
||||
|
||||
#include "awabstractformatter.h"
|
||||
#include "awabstractpairhelper.h"
|
||||
|
||||
|
||||
class AWFormatterHelper : public AbstractExtItemAggregator
|
||||
class AWFormatterHelper : public AbstractExtItemAggregator,
|
||||
public AWAbstractPairHelper
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@ -33,14 +34,14 @@ public:
|
||||
virtual ~AWFormatterHelper();
|
||||
// read-write methods
|
||||
void initItems();
|
||||
bool writeItems(const QHash<QString, QString> &_configuration) const;
|
||||
// methods
|
||||
QString convert(const QVariant &_value, const QString &_name) const;
|
||||
QStringList definedFormatters() const;
|
||||
QHash<QString, QString> getFormatters() const;
|
||||
QList<AbstractExtItem *> items() const;
|
||||
QStringList knownFormatters() const;
|
||||
bool removeUnusedFormatters(const QStringList &_keys) const;
|
||||
// configuration related
|
||||
virtual void editPairs();
|
||||
virtual QStringList leftKeys();
|
||||
virtual QStringList rightKeys();
|
||||
|
||||
public slots:
|
||||
void editItems();
|
||||
@ -50,15 +51,11 @@ private:
|
||||
AWAbstractFormatter::FormatterClass
|
||||
defineFormatterClass(const QString &_stringType) const;
|
||||
void initFormatters();
|
||||
void initKeys();
|
||||
void installDirectories();
|
||||
QPair<QString, AWAbstractFormatter::FormatterClass>
|
||||
readMetadata(const QString &_filePath) const;
|
||||
// parent methods
|
||||
void doCreateItem();
|
||||
// properties
|
||||
QStringList m_directories;
|
||||
QString m_filePath;
|
||||
QHash<QString, AWAbstractFormatter *> m_formatters;
|
||||
QHash<QString, AWAbstractFormatter *> m_formattersClasses;
|
||||
};
|
||||
|
Reference in New Issue
Block a user