mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-07-16 07:09:58 +00:00
refactor: refresh shared library
This commit is contained in:
@ -121,6 +121,6 @@ void AWActions::sendNotification(const QString &_eventId, const QString &_messag
|
||||
{
|
||||
qCDebug(LOG_AW) << "Event" << _eventId << "with message" << _message;
|
||||
|
||||
auto *event = KNotification::event(_eventId, QString("Awesome Widget ::: %1").arg(_eventId), _message);
|
||||
auto event = KNotification::event(_eventId, QString("Awesome Widget ::: %1").arg(_eventId), _message);
|
||||
event->setComponentName("plasma-applet-org.kde.plasma.awesome-widget");
|
||||
}
|
||||
|
@ -84,8 +84,7 @@ bool AWConfigHelper::exportConfiguration(QObject *_nativeConfig, const QString &
|
||||
|
||||
// extensions
|
||||
for (auto &item : m_dirs) {
|
||||
QStringList items
|
||||
= QDir(QString("%1/%2").arg(m_baseDir, item)).entryList({"*.desktop"}, QDir::Files);
|
||||
QStringList items = QDir(QString("%1/%2").arg(m_baseDir, item)).entryList({"*.desktop"}, QDir::Files);
|
||||
settings.beginGroup(item);
|
||||
for (auto &it : items)
|
||||
copyExtensions(it, item, settings, false);
|
||||
|
@ -161,7 +161,7 @@ void AWFormatterHelper::initFormatters()
|
||||
// check if already exists
|
||||
auto values = m_formattersClasses.values();
|
||||
if (std::any_of(values.cbegin(), values.cend(),
|
||||
[&filePath](const AWAbstractFormatter *item) { return (item->fileName() == filePath); }))
|
||||
[&filePath](const AWAbstractFormatter *item) { return (item->filePath() == filePath); }))
|
||||
continue;
|
||||
|
||||
auto metadata = readMetadata(filePath);
|
||||
|
@ -80,7 +80,7 @@ QStringList AWKeyOperations::dictKeys() const
|
||||
{
|
||||
QStringList allKeys;
|
||||
// weather
|
||||
for (auto &item : m_extWeather->activeItems()) {
|
||||
for (auto item : m_extWeather->activeItems()) {
|
||||
allKeys.append(item->tag("weatherId"));
|
||||
allKeys.append(item->tag("weather"));
|
||||
allKeys.append(item->tag("humidity"));
|
||||
@ -140,10 +140,10 @@ QStringList AWKeyOperations::dictKeys() const
|
||||
allKeys.append(QString("battotal%1").arg(i));
|
||||
}
|
||||
// package manager
|
||||
for (auto &item : m_extUpgrade->activeItems())
|
||||
for (auto item : m_extUpgrade->activeItems())
|
||||
allKeys.append(item->tag("pkgcount"));
|
||||
// quotes
|
||||
for (auto &item : m_extQuotes->activeItems()) {
|
||||
for (auto item : m_extQuotes->activeItems()) {
|
||||
allKeys.append(item->tag("price"));
|
||||
allKeys.append(item->tag("pricechg"));
|
||||
allKeys.append(item->tag("percpricechg"));
|
||||
@ -152,13 +152,13 @@ QStringList AWKeyOperations::dictKeys() const
|
||||
allKeys.append(item->tag("percvolumechg"));
|
||||
}
|
||||
// custom
|
||||
for (auto &item : m_extScripts->activeItems())
|
||||
for (auto item : m_extScripts->activeItems())
|
||||
allKeys.append(item->tag("custom"));
|
||||
// network requests
|
||||
for (auto &item : m_extNetRequest->activeItems())
|
||||
for (auto item : m_extNetRequest->activeItems())
|
||||
allKeys.append(item->tag("response"));
|
||||
// bars
|
||||
for (auto &item : m_graphicalItems->activeItems())
|
||||
for (auto item : m_graphicalItems->activeItems())
|
||||
allKeys.append(item->tag("bar"));
|
||||
// user defined keys
|
||||
allKeys.append(m_customKeys->keys());
|
||||
|
@ -71,7 +71,7 @@ bool AWUpdateHelper::checkVersion()
|
||||
qCInfo(LOG_AW) << "Found version" << version << "actual one is" << m_foundVersion;
|
||||
|
||||
if ((version != m_foundVersion) && (!QString(CHANGELOG).isEmpty())) {
|
||||
sendNotification(i18nc("Changelog of %1", VERSION), QString(CHANGELOG).replace('@', '\n'));
|
||||
sendNotification(i18n("Changelog of %1", VERSION), QString(CHANGELOG).replace('@', '\n'));
|
||||
return true;
|
||||
} else if (version != m_foundVersion) {
|
||||
qCWarning(LOG_AW) << "No changelog information provided";
|
||||
@ -106,7 +106,7 @@ void AWUpdateHelper::showUpdates(const QVersionNumber &_version)
|
||||
qCDebug(LOG_AW) << "Version" << _version;
|
||||
|
||||
QString text;
|
||||
text += i18nc("Current version : %1", VERSION);
|
||||
text += i18n("Current version : %1", VERSION);
|
||||
text += QString(COMMIT_SHA).isEmpty() ? "\n" : QString(" (%1)\n").arg(QString(COMMIT_SHA));
|
||||
text += i18n("New version : %1", _version.toString()) + "\n\n";
|
||||
text += i18n("Click \"Ok\" to download");
|
||||
|
Reference in New Issue
Block a user