mirror of
				https://github.com/arcan1s/awesome-widgets.git
				synced 2025-10-30 21:03:41 +00:00 
			
		
		
		
	migrate to ksystemstats
This commit is contained in:
		| @ -97,7 +97,7 @@ void AWListFormatter::setFilter(const QString &_filter) | ||||
|     qCDebug(LOG_LIB) << "Filter" << _filter; | ||||
|  | ||||
|     m_filter = _filter; | ||||
|     m_regex = QRegExp(m_filter); | ||||
|     m_regex = QRegularExpression(m_filter); | ||||
| } | ||||
|  | ||||
|  | ||||
|  | ||||
| @ -18,6 +18,8 @@ | ||||
| #ifndef AWLISTFORMATTER_H | ||||
| #define AWLISTFORMATTER_H | ||||
|  | ||||
| #include <QRegularExpression> | ||||
|  | ||||
| #include "awabstractformatter.h" | ||||
|  | ||||
|  | ||||
| @ -58,7 +60,7 @@ private: | ||||
|     QString m_filter = ""; | ||||
|     QString m_separator = ""; | ||||
|     bool m_sorted = false; | ||||
|     QRegExp m_regex; | ||||
|     QRegularExpression m_regex; | ||||
| }; | ||||
|  | ||||
|  | ||||
|  | ||||
| @ -20,6 +20,7 @@ | ||||
|  | ||||
| #include <KI18n/KLocalizedString> | ||||
|  | ||||
| #include <QRegularExpression> | ||||
| #include <QSettings> | ||||
| #include <QTextCodec> | ||||
|  | ||||
| @ -217,7 +218,7 @@ void ExtUpgrade::updateValue() | ||||
|     QString qoutput = QTextCodec::codecForMib(106)->toUnicode(m_process->readAllStandardOutput()).trimmed(); | ||||
|     m_values[tag("pkgcount")] = [this](const QString &output) { | ||||
|         return filter().isEmpty() ? output.split('\n', Qt::SkipEmptyParts).count() - null() | ||||
|                                   : output.split('\n', Qt::SkipEmptyParts).filter(QRegExp(filter())).count(); | ||||
|                                   : output.split('\n', Qt::SkipEmptyParts).filter(QRegularExpression(filter())).count(); | ||||
|     }(qoutput); | ||||
|  | ||||
|     emit(dataReceived(m_values)); | ||||
|  | ||||
		Reference in New Issue
	
	Block a user