Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 7, 2024
1 parent c392d77 commit 8414466
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 27 deletions.
2 changes: 1 addition & 1 deletion core/probe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ void Probe::objectRemoved(QObject *obj)
EXPENSIVE_ASSERT(!instance()->isObjectCreationQueued(obj));

if (instance()->thread() == QThread::currentThread())
emit instance()->objectDestroyed(obj);
emit instance() -> objectDestroyed(obj);
else
instance()->queueDestroyedObject(obj);
}
Expand Down
2 changes: 1 addition & 1 deletion core/tools/objectinspector/connectionsextension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ using namespace GammaRay;

ConnectionsExtension::ConnectionsExtension(PropertyController *controller)
: ConnectionsExtensionInterface(
controller->objectBaseName() + ".connectionsExtension", controller)
controller->objectBaseName() + ".connectionsExtension", controller)
, PropertyControllerExtension(controller->objectBaseName() + ".connections")
{
m_inboundModel = new InboundConnectionsModel(controller);
Expand Down
2 changes: 1 addition & 1 deletion launcher/core/injector/basicwindllinjector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
do { \
} while (false)
#define ERROR_CHECK(condition) ERROR_ASSERT( \
condition, do {} while (false));
condition, do { } while (false));

BOOL BasicWinDllInjector::addDllDirectory(HANDLE destProcess, wchar_t *dllDirPath)
{
Expand Down
7 changes: 3 additions & 4 deletions plugins/localeinspector/localedataaccessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ void LocaleDataAccessorRegistry::init()

LOCALE_SIMPLE_ACCESSOR(TextDirection,
return locale.textDirection() == Qt::LeftToRight ? QStringLiteral(
"LTR")
"LTR")
: QStringLiteral("RTL");)

LOCALE_SIMPLE_DEFAULT_ACCESSOR(TimeFormatLong,
Expand Down Expand Up @@ -167,8 +167,7 @@ void LocaleDataAccessorRegistry::init()
const auto wds = locale.weekdays();
QStringList resultList;
resultList.reserve(wds.size());
for (Qt::DayOfWeek dayNumber
: wds) {
for (Qt::DayOfWeek dayNumber : wds) {
resultList << QLocale().dayName(dayNumber);
} return QLocale()
.createSeparatedList(resultList);)
Expand Down Expand Up @@ -213,7 +212,7 @@ void LocaleDataAccessorRegistry::init()
return locale.measurementSystem()
== QLocale::ImperialSystem
? QStringLiteral(
"Imperial")
"Imperial")
: QStringLiteral("Metric");)

LOCALE_SIMPLE_DEFAULT_ACCESSOR(FloatFormat,
Expand Down
4 changes: 2 additions & 2 deletions plugins/localeinspector/localedataaccessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ struct LocaleDataAccessor
{ \
explicit Locale##NAME##Accessor(LocaleDataAccessorRegistry *registry) \
: LocaleDataAccessor( \
registry) \
registry) \
{ \
} \
QString accessorName() override \
Expand All @@ -95,7 +95,7 @@ struct LocaleDataAccessor
{ \
explicit Locale##NAME##Accessor(LocaleDataAccessorRegistry *registry) \
: LocaleDataAccessor( \
registry, true) \
registry, true) \
{ \
} \
\
Expand Down
16 changes: 8 additions & 8 deletions plugins/network/networkreplywidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,14 @@ NetworkReplyWidget::NetworkReplyWidget(QWidget *parent)
}
#else

QTextCodec::ConverterState state;
QTextCodec *codec = QTextCodec::codecForName("UTF-8");
const QString text = codec->toUnicode(response.constData(), response.size(), &state);
if (state.invalidChars > 0) {
ui->responseTextEdit->setPlainText(tr("%1: Unable to show response preview").arg(qApp->applicationName()));
} else {
ui->responseTextEdit->setPlainText(text);
}
QTextCodec::ConverterState state;
QTextCodec *codec = QTextCodec::codecForName("UTF-8");
const QString text = codec->toUnicode(response.constData(), response.size(), &state);
if (state.invalidChars > 0) {
ui->responseTextEdit->setPlainText(tr("%1: Unable to show response preview").arg(qApp->applicationName()));
} else {
ui->responseTextEdit->setPlainText(text);
}
#endif
});
ui->responseTextEdit->setFont(QFontDatabase::systemFont(QFontDatabase::FixedFont));
Expand Down
6 changes: 3 additions & 3 deletions plugins/positioning/geopositioninfosourcefactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ QGeoPositionInfoSource *GeoPositionInfoSourceFactory::positionInfoSource(QObject
const auto rData = metaData.at(rhs).toCbor();
return lData.value(QStringLiteral("Priority")).toInteger() > rData.value(QStringLiteral("Priority")).toInteger();
#else
const auto lData = metaData.at(lhs).value(QStringLiteral("MetaData")).toObject();
const auto rData = metaData.at(rhs).value(QStringLiteral("MetaData")).toObject();
return lData.value(QStringLiteral("Priority")).toInt() > rData.value(QStringLiteral("Priority")).toInt();
const auto lData = metaData.at(lhs).value(QStringLiteral("MetaData")).toObject();
const auto rData = metaData.at(rhs).value(QStringLiteral("MetaData")).toObject();
return lData.value(QStringLiteral("Priority")).toInt() > rData.value(QStringLiteral("Priority")).toInt();
#endif
});

Expand Down
7 changes: 2 additions & 5 deletions plugins/quickinspector/quickinspector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -718,14 +718,11 @@ void QuickInspector::setSlowMode(bool slow)
auto it = connections.find(window);

if (it == connections.end()) {
connections.insert(window, connect(
window, &QQuickWindow::beforeRendering, this, [this, window]() {
connections.insert(window, connect(window, &QQuickWindow::beforeRendering, this, [this, window]() {
auto it = connections.find(window);
QUnifiedTimer::instance()->setSlowModeEnabled(m_slowDownEnabled);
QObject::disconnect(it.value());
connections.erase(it);
},
Qt::DirectConnection));
connections.erase(it); }, Qt::DirectConnection));
}
}

Expand Down
2 changes: 1 addition & 1 deletion ui/codeeditor/codeeditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ void CodeEditor::toggleFold(const QTextBlock &startBlock)
// redraw document
document()->markContentsDirty(startBlock.position(), endBlock.position() - startBlock.position() + 1);
// update scrollbars
emit document()->documentLayout()->documentSizeChanged(document()->documentLayout()->documentSize());
emit document() -> documentLayout()->documentSizeChanged(document()->documentLayout()->documentSize());
#else
Q_UNUSED(startBlock);
#endif
Expand Down
2 changes: 1 addition & 1 deletion ui/uiintegration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ UiIntegration *UiIntegration::instance()
void UiIntegration::requestNavigateToCode(const QUrl &url, int lineNumber, int columnNumber)
{
if (UiIntegration::instance())
emit UiIntegration::instance()->navigateToCode(url, lineNumber, columnNumber);
emit UiIntegration::instance() -> navigateToCode(url, lineNumber, columnNumber);
}

bool UiIntegration::hasDarkUI()
Expand Down

0 comments on commit 8414466

Please sign in to comment.