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 Apr 1, 2024
1 parent 78149eb commit 4103321
Show file tree
Hide file tree
Showing 20 changed files with 36 additions and 55 deletions.
2 changes: 1 addition & 1 deletion core/probe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,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
3 changes: 1 addition & 2 deletions plugins/codecbrowser/codecbrowserwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ CodecBrowserWidget::CodecBrowserWidget(QWidget *parent)

connect(ui->codecText, &QLineEdit::textChanged, this, &CodecBrowserWidget::textChanged);

m_stateManager.setDefaultSizes(ui->mainSplitter, UISizeVector() << "50%"
<< "50%");
m_stateManager.setDefaultSizes(ui->mainSplitter, UISizeVector() << "50%" << "50%");
}

CodecBrowserWidget::~CodecBrowserWidget() = default;
Expand Down
3 changes: 1 addition & 2 deletions plugins/fontbrowser/fontbrowserwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@ FontBrowserWidget::FontBrowserWidget(QWidget *parent)
m_fontBrowser->toggleUnderlineFont(ui->underlineBox->isChecked());
m_fontBrowser->setPointSize(ui->pointSize->value());

m_stateManager.setDefaultSizes(ui->mainSplitter, UISizeVector() << "50%"
<< "50%");
m_stateManager.setDefaultSizes(ui->mainSplitter, UISizeVector() << "50%" << "50%");
QMetaObject::invokeMethod(this, "delayedInit", Qt::QueuedConnection);
}

Expand Down
4 changes: 2 additions & 2 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 @@ -213,7 +213,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
4 changes: 1 addition & 3 deletions plugins/modelinspector/modelinspectorwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,7 @@ ModelInspectorWidget::ModelInspectorWidget(QWidget *parent)
ui->modelCellView->setModel(ObjectBroker::model(QStringLiteral(
"com.kdab.GammaRay.ModelCellModel")));

m_stateManager.setDefaultSizes(ui->mainSplitter, UISizeVector() << "33%"
<< "33%"
<< "33%");
m_stateManager.setDefaultSizes(ui->mainSplitter, UISizeVector() << "33%" << "33%" << "33%");

cellDataChanged();
}
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
6 changes: 2 additions & 4 deletions plugins/quickinspector/quickinspectorwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,8 @@ QuickInspectorWidget::QuickInspectorWidget(QWidget *parent)
addAction(createSeparator(this));
addAction(ui->actionSlowDownMode);

m_stateManager.setDefaultSizes(ui->mainSplitter, UISizeVector() << "50%"
<< "50%");
m_stateManager.setDefaultSizes(ui->previewTreeSplitter, UISizeVector() << "50%"
<< "50%");
m_stateManager.setDefaultSizes(ui->mainSplitter, UISizeVector() << "50%" << "50%");
m_stateManager.setDefaultSizes(ui->previewTreeSplitter, UISizeVector() << "50%" << "50%");

connect(ui->actionSaveAsImage, &QAction::triggered, this, &QuickInspectorWidget::saveAsImage);
connect(ui->actionSaveAsImageWithDecoration, &QAction::triggered, this, &QuickInspectorWidget::saveAsImage);
Expand Down
6 changes: 2 additions & 4 deletions plugins/sceneinspector/sceneinspectorwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,8 @@ SceneInspectorWidget::SceneInspectorWidget(QWidget *parent)
else if (ui->sceneComboBox->currentIndex() >= 0) // no server-side selection yet, but there's data available
sceneSelected(ui->sceneComboBox->currentIndex());

m_stateManager.setDefaultSizes(ui->mainSplitter, UISizeVector() << "50%"
<< "50%");
m_stateManager.setDefaultSizes(ui->previewSplitter, UISizeVector() << "50%"
<< "50%");
m_stateManager.setDefaultSizes(ui->mainSplitter, UISizeVector() << "50%" << "50%");
m_stateManager.setDefaultSizes(ui->previewSplitter, UISizeVector() << "50%" << "50%");

connect(ui->scenePropertyWidget, &PropertyWidget::tabsUpdated, this, &SceneInspectorWidget::propertyWidgetTabsChanged);

Expand Down
6 changes: 2 additions & 4 deletions plugins/statemachineviewer/statemachineviewerwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,8 @@ StateMachineViewerWidget::StateMachineViewerWidget(QWidget *parent, Qt::WindowFl
// share selection model
new SelectionModelSyncer(this);

m_stateManager.setDefaultSizes(m_ui->verticalSplitter, UISizeVector() << "50%"
<< "50%");
m_stateManager.setDefaultSizes(m_ui->horizontalSplitter, UISizeVector() << "30%"
<< "70%");
m_stateManager.setDefaultSizes(m_ui->verticalSplitter, UISizeVector() << "50%" << "50%");
m_stateManager.setDefaultSizes(m_ui->horizontalSplitter, UISizeVector() << "30%" << "70%");

loadSettings();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ TextDocumentInspectorWidget::TextDocumentInspectorWidget(QWidget *parent)
ui->tabWidget->hide();

m_stateManager.setDefaultSizes(ui->mainSplitter, UISizeVector() << 280 << -1 << -1);
m_stateManager.setDefaultSizes(ui->structureSplitter, UISizeVector() << "50%"
<< "50%");
m_stateManager.setDefaultSizes(ui->structureSplitter, UISizeVector() << "50%" << "50%");
}

TextDocumentInspectorWidget::~TextDocumentInspectorWidget() = default;
Expand Down
3 changes: 1 addition & 2 deletions plugins/translatorinspector/translatorinspectorwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ TranslatorInspectorWidget::TranslatorInspectorWidget(QWidget *parent)
new SearchLineController(ui->translationsSearchLine, ui->translationsView->model());
}

m_stateManager.setDefaultSizes(ui->mainSplitter, UISizeVector() << "50%"
<< "50%");
m_stateManager.setDefaultSizes(ui->mainSplitter, UISizeVector() << "50%" << "50%");

connect(ui->actionSendLanguageChange, &QAction::triggered, m_inspector, &TranslatorInspectorInterface::sendLanguageChangeEvent);
connect(ui->actionReset, &QAction::triggered, m_inspector, &TranslatorInspectorInterface::resetTranslations);
Expand Down
6 changes: 2 additions & 4 deletions plugins/widgetinspector/widgetinspectorwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,8 @@ WidgetInspectorWidget::WidgetInspectorWidget(QWidget *parent)

updateActions();

m_stateManager.setDefaultSizes(ui->mainSplitter, UISizeVector() << "50%"
<< "50%");
m_stateManager.setDefaultSizes(ui->previewSplitter, UISizeVector() << "50%"
<< "50%");
m_stateManager.setDefaultSizes(ui->mainSplitter, UISizeVector() << "50%" << "50%");
m_stateManager.setDefaultSizes(ui->previewSplitter, UISizeVector() << "50%" << "50%");
ui->tabWidget->findChild<QTabBar *>()->hide();

connect(ui->widgetPropertyWidget, &PropertyWidget::tabsUpdated, this, &WidgetInspectorWidget::propertyWidgetTabsChanged);
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
3 changes: 1 addition & 2 deletions ui/tools/messagehandler/messagehandlerwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ MessageHandlerWidget::MessageHandlerWidget(QWidget *parent)

ui->categoriesView->setModel(ObjectBroker::model(QStringLiteral("com.kdab.GammaRay.LoggingCategoryModel")));

m_stateManager.setDefaultSizes(ui->mainSplitter, UISizeVector() << "50%"
<< "50%");
m_stateManager.setDefaultSizes(ui->mainSplitter, UISizeVector() << "50%" << "50%");
m_stateManager.setDefaultSizes(ui->messageView->header(),
UISizeVector() << -1 << 300 << -1 << -1 << -1);
}
Expand Down
3 changes: 1 addition & 2 deletions ui/tools/objectinspector/objectinspectorwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ ObjectInspectorWidget::ObjectInspectorWidget(QWidget *parent)
connect(ui->objectTreeView, &QWidget::customContextMenuRequested,
this, &ObjectInspectorWidget::objectContextMenuRequested);

m_stateManager.setDefaultSizes(ui->mainSplitter, UISizeVector() << "60%"
<< "40%");
m_stateManager.setDefaultSizes(ui->mainSplitter, UISizeVector() << "60%" << "40%");

connect(ui->objectPropertyWidget, &PropertyWidget::tabsUpdated, this, &ObjectInspectorWidget::propertyWidgetTabsChanged);

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 4103321

Please sign in to comment.