mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-07-01 16:05:56 +00:00
newest qt fixes
This commit is contained in:
@ -19,9 +19,9 @@
|
||||
|
||||
#include <QDir>
|
||||
#include <QLocalServer>
|
||||
#include <QRandomGenerator>
|
||||
#include <QSettings>
|
||||
#include <QStandardPaths>
|
||||
#include <QTime>
|
||||
|
||||
#include "abstractextitemaggregator.h"
|
||||
#include "qcronscheduler.h"
|
||||
@ -241,8 +241,7 @@ void AbstractExtItem::setNumber(int _number)
|
||||
_number = []() {
|
||||
qCWarning(LOG_LIB) << "Number is empty, generate new one";
|
||||
// we suppose that currentTIme().msec() is always valid time
|
||||
qsrand(static_cast<uint>(QTime::currentTime().msec()));
|
||||
int n = qrand() % 1000;
|
||||
int n = QRandomGenerator::global()->generate() % 1000;
|
||||
qCInfo(LOG_LIB) << "Generated number is" << n;
|
||||
return n;
|
||||
}();
|
||||
|
@ -178,7 +178,7 @@ QVariant AWJsonFormatter::getFromMap(const QVariant &_value, const QString &_key
|
||||
void AWJsonFormatter::initPath()
|
||||
{
|
||||
m_splittedPath.clear();
|
||||
QStringList splittedByDot = m_path.split('.', QString::SkipEmptyParts);
|
||||
QStringList splittedByDot = m_path.split('.', Qt::SkipEmptyParts);
|
||||
|
||||
for (auto &element : splittedByDot) {
|
||||
bool ok;
|
||||
|
@ -235,7 +235,7 @@ void ExtScript::readConfiguration()
|
||||
setStrRedirect(settings.value("X-AW-Redirect", strRedirect()).toString());
|
||||
// api == 3
|
||||
setFilters(
|
||||
settings.value("X-AW-Filters", filters()).toString().split(',', QString::SkipEmptyParts));
|
||||
settings.value("X-AW-Filters", filters()).toString().split(',', Qt::SkipEmptyParts));
|
||||
settings.endGroup();
|
||||
|
||||
bumpApi(AW_EXTSCRIPT_API);
|
||||
|
@ -220,8 +220,8 @@ void ExtUpgrade::updateValue()
|
||||
= QTextCodec::codecForMib(106)->toUnicode(m_process->readAllStandardOutput()).trimmed();
|
||||
m_values[tag("pkgcount")] = [this](const QString &output) {
|
||||
return filter().isEmpty()
|
||||
? output.split('\n', QString::SkipEmptyParts).count() - null()
|
||||
: output.split('\n', QString::SkipEmptyParts).filter(QRegExp(filter())).count();
|
||||
? output.split('\n', Qt::SkipEmptyParts).count() - null()
|
||||
: output.split('\n', Qt::SkipEmptyParts).filter(QRegExp(filter())).count();
|
||||
}(qoutput);
|
||||
|
||||
emit(dataReceived(m_values));
|
||||
|
@ -367,14 +367,8 @@ void ExtWeather::initProvider()
|
||||
{
|
||||
delete m_providerObject;
|
||||
|
||||
switch (m_provider) {
|
||||
case Provider::OWM:
|
||||
m_providerObject = new OWMWeatherProvider(this);
|
||||
break;
|
||||
case Provider::Yahoo:
|
||||
m_providerObject = new YahooWeatherProvider(this);
|
||||
break;
|
||||
}
|
||||
// in the future release it is possible to change provider here
|
||||
m_providerObject = new OWMWeatherProvider(this);
|
||||
|
||||
return m_providerObject->initUrl(city(), country(), ts());
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ QList<int> QCronScheduler::parseField(const QString &_value, const int _min, con
|
||||
parsedField.fromRange(field.split('/').first(), _min, _max);
|
||||
if (field.contains('/')) {
|
||||
bool status;
|
||||
parsedField.div = field.split('/', QString::SkipEmptyParts).at(1).toInt(&status);
|
||||
parsedField.div = field.split('/', Qt::SkipEmptyParts).at(1).toInt(&status);
|
||||
if (!status)
|
||||
parsedField.div = 1;
|
||||
}
|
||||
@ -107,7 +107,7 @@ void QCronScheduler::QCronField::fromRange(const QString &_range, const int _min
|
||||
minValue = _min;
|
||||
maxValue = _max;
|
||||
} else if (_range.contains("-")) {
|
||||
auto interval = _range.split('-', QString::SkipEmptyParts);
|
||||
auto interval = _range.split('-', Qt::SkipEmptyParts);
|
||||
if (interval.count() != 2)
|
||||
return;
|
||||
bool status;
|
||||
|
Reference in New Issue
Block a user