mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-07-06 10:25:52 +00:00
Stabilizing commit
* move request timeout settings to the configuration header * initial support of requiredby dictionary * add AWPatternFunctions namespace * improve components communication * update UI to recent abilities * rewrite qCDebug messages and update CONTRIBUTING.md accordingly
This commit is contained in:
@ -33,8 +33,9 @@ AbstractExtItem::AbstractExtItem(QWidget *parent, const QString desktopName,
|
||||
, m_dirs(directories)
|
||||
{
|
||||
qCDebug(LOG_LIB) << __PRETTY_FUNCTION__;
|
||||
qCDebug(LOG_LIB) << "Desktop name" << desktopName;
|
||||
qCDebug(LOG_LIB) << "Directories" << directories;
|
||||
|
||||
qCDebug(LOG_LIB) << "Desktop name" << desktopName << "directories"
|
||||
<< directories;
|
||||
|
||||
m_name = m_fileName;
|
||||
}
|
||||
|
@ -91,10 +91,8 @@ void AbstractExtItemAggregator::setConfigArgs(const QVariant _configArgs)
|
||||
}
|
||||
|
||||
|
||||
void AbstractExtItemAggregator::editItemActivated(QListWidgetItem *item)
|
||||
void AbstractExtItemAggregator::editItemActivated(QListWidgetItem *)
|
||||
{
|
||||
Q_UNUSED(item)
|
||||
|
||||
return editItem();
|
||||
}
|
||||
|
||||
|
@ -48,7 +48,7 @@ public:
|
||||
void setConfigArgs(const QVariant _configArgs);
|
||||
|
||||
private slots:
|
||||
void editItemActivated(QListWidgetItem *item);
|
||||
void editItemActivated(QListWidgetItem *);
|
||||
void editItemButtonPressed(QAbstractButton *button);
|
||||
|
||||
private:
|
||||
|
@ -37,8 +37,9 @@ public:
|
||||
{
|
||||
qSetMessagePattern(LOG_FORMAT);
|
||||
qCDebug(LOG_LIB) << __PRETTY_FUNCTION__;
|
||||
foreach (const QString metadata, getBuildData())
|
||||
for (auto metadata : getBuildData())
|
||||
qCDebug(LOG_LIB) << metadata;
|
||||
|
||||
qCDebug(LOG_LIB) << "Type" << type;
|
||||
|
||||
initItems();
|
||||
@ -66,7 +67,7 @@ public:
|
||||
qCDebug(LOG_LIB) << "Tag" << _tag;
|
||||
|
||||
T *found = nullptr;
|
||||
foreach (T *item, m_items) {
|
||||
for (auto item : m_items) {
|
||||
if (item->tag() != _tag)
|
||||
continue;
|
||||
found = item;
|
||||
@ -83,7 +84,7 @@ public:
|
||||
qCDebug(LOG_LIB) << "Number" << _number;
|
||||
|
||||
T *found = nullptr;
|
||||
foreach (T *item, m_items) {
|
||||
for (auto item : m_items) {
|
||||
if (item->number() != _number)
|
||||
continue;
|
||||
found = item;
|
||||
@ -102,7 +103,7 @@ public:
|
||||
return nullptr;
|
||||
|
||||
T *found = nullptr;
|
||||
foreach (T *item, m_items) {
|
||||
for (auto item : m_items) {
|
||||
if (item->fileName() != widgetItem->text())
|
||||
continue;
|
||||
found = item;
|
||||
@ -120,7 +121,7 @@ public:
|
||||
int uniqNumber() const
|
||||
{
|
||||
QList<int> tagList;
|
||||
foreach (T *item, m_items)
|
||||
for (auto item : m_items)
|
||||
tagList.append(item->number());
|
||||
int number = 0;
|
||||
while (tagList.contains(number))
|
||||
@ -152,9 +153,9 @@ private:
|
||||
QStandardPaths::LocateDirectory);
|
||||
QStringList names;
|
||||
QList<T *> items;
|
||||
foreach (QString dir, dirs) {
|
||||
for (auto dir : dirs) {
|
||||
QStringList files = QDir(dir).entryList(QDir::Files, QDir::Name);
|
||||
foreach (QString file, files) {
|
||||
for (auto file : files) {
|
||||
if ((!file.endsWith(QString(".desktop")))
|
||||
|| (names.contains(file)))
|
||||
continue;
|
||||
@ -177,7 +178,7 @@ private:
|
||||
m_activeItems.clear();
|
||||
|
||||
m_items = getItems();
|
||||
foreach (T *item, m_items) {
|
||||
for (auto item : m_items) {
|
||||
if (!item->isActive())
|
||||
continue;
|
||||
m_activeItems.append(item);
|
||||
@ -187,7 +188,7 @@ private:
|
||||
void repaint()
|
||||
{
|
||||
widgetDialog->clear();
|
||||
foreach (T *_item, m_items) {
|
||||
for (auto _item : m_items) {
|
||||
QListWidgetItem *item
|
||||
= new QListWidgetItem(_item->fileName(), widgetDialog);
|
||||
QStringList tooltip;
|
||||
|
@ -150,7 +150,7 @@ QVariantHash ExtQuotes::run()
|
||||
qCInfo(LOG_LIB) << "Send request";
|
||||
isRunning = true;
|
||||
QNetworkReply *reply = manager->get(QNetworkRequest(QUrl(url())));
|
||||
new QReplyTimeout(reply, 1000);
|
||||
new QReplyTimeout(reply, REQUEST_TIMEOUT);
|
||||
}
|
||||
|
||||
// update value
|
||||
@ -208,8 +208,8 @@ void ExtQuotes::writeConfiguration() const
|
||||
|
||||
void ExtQuotes::quotesReplyReceived(QNetworkReply *reply)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "Return code" << reply->error();
|
||||
qCDebug(LOG_LIB) << "Reply error message" << reply->errorString();
|
||||
qCDebug(LOG_LIB) << "Return code" << reply->error() << "with message"
|
||||
<< reply->errorString();
|
||||
|
||||
isRunning = false;
|
||||
QJsonParseError error;
|
||||
|
@ -64,8 +64,7 @@ ExtScript::~ExtScript()
|
||||
|
||||
ExtScript *ExtScript::copy(const QString _fileName, const int _number)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "File" << _fileName;
|
||||
qCDebug(LOG_LIB) << "Number" << _number;
|
||||
qCDebug(LOG_LIB) << "File" << _fileName << "with number" << _number;
|
||||
|
||||
ExtScript *item = new ExtScript(static_cast<QWidget *>(parent()), _fileName,
|
||||
directories());
|
||||
@ -206,8 +205,7 @@ QString ExtScript::applyFilters(QString _value) const
|
||||
|
||||
void ExtScript::updateFilter(const QString _filter, const bool _add)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "Filter" << _filter;
|
||||
qCDebug(LOG_LIB) << "Should be added" << _add;
|
||||
qCDebug(LOG_LIB) << "Should be added filters" << _add << "from" << _filter;
|
||||
|
||||
if (_add) {
|
||||
if (m_filters.contains(_filter))
|
||||
|
@ -60,8 +60,7 @@ ExtUpgrade::~ExtUpgrade()
|
||||
|
||||
ExtUpgrade *ExtUpgrade::copy(const QString _fileName, const int _number)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "File" << _fileName;
|
||||
qCDebug(LOG_LIB) << "Number" << _number;
|
||||
qCDebug(LOG_LIB) << "File" << _fileName << "with number" << _number;
|
||||
|
||||
ExtUpgrade *item = new ExtUpgrade(static_cast<QWidget *>(parent()),
|
||||
_fileName, directories());
|
||||
|
@ -74,8 +74,7 @@ ExtWeather::~ExtWeather()
|
||||
|
||||
ExtWeather *ExtWeather::copy(const QString _fileName, const int _number)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "File" << _fileName;
|
||||
qCDebug(LOG_LIB) << "Number" << _number;
|
||||
qCDebug(LOG_LIB) << "File" << _fileName << "number" << _number;
|
||||
|
||||
ExtWeather *item = new ExtWeather(static_cast<QWidget *>(parent()),
|
||||
_fileName, directories());
|
||||
@ -236,7 +235,7 @@ QVariantHash ExtWeather::run()
|
||||
qCInfo(LOG_LIB) << "Send request";
|
||||
isRunning = true;
|
||||
QNetworkReply *reply = manager->get(QNetworkRequest(QUrl(url())));
|
||||
new QReplyTimeout(reply, 5000);
|
||||
new QReplyTimeout(reply, REQUEST_TIMEOUT);
|
||||
}
|
||||
|
||||
// update value
|
||||
@ -304,7 +303,7 @@ void ExtWeather::writeConfiguration() const
|
||||
|
||||
void ExtWeather::weatherReplyReceived(QNetworkReply *reply)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "Return code" << reply->error();
|
||||
qCDebug(LOG_LIB) << "Return code" << reply->error() << "with messa";
|
||||
qCDebug(LOG_LIB) << "Reply error message" << reply->errorString();
|
||||
|
||||
isRunning = false;
|
||||
|
@ -65,8 +65,7 @@ GraphicalItem::~GraphicalItem()
|
||||
|
||||
GraphicalItem *GraphicalItem::copy(const QString _fileName, const int _number)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "File" << _fileName;
|
||||
qCDebug(LOG_LIB) << "Number" << _number;
|
||||
qCDebug(LOG_LIB) << "File" << _fileName << "with number" << _number;
|
||||
|
||||
GraphicalItem *item = new GraphicalItem(static_cast<QWidget *>(parent()),
|
||||
_fileName, directories());
|
||||
|
Reference in New Issue
Block a user