From 06836ad54b3533dd3f24a60aef785bcc1a8c690a Mon Sep 17 00:00:00 2001 From: Stephan Linz Date: Mon, 13 Aug 2018 18:54:19 +0200 Subject: [PATCH] fix: workaround GCC < 5.x bugs in implicit casts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The following error happens when building with GCC 4.8.5: no matching function for call to ‘QObject::connect(QPointer&, ...)’ no matching function for call to ‘QObject::disconnect(QPointer&, ...)’ There is a simular problem in qtlocation, see Qt bug report: https://bugreports.qt.io/browse/QTBUG-69512 It's apparently a compiler bug fixed in GCC 5.x and later. Signed-off-by: Stephan Linz --- src/card/base/CardConnectionWorker.cpp | 6 +++--- src/qml/HistoryModel.cpp | 8 ++++---- src/widget/DiagnosisGui.cpp | 2 +- src/widget/SetupAssistantGui.cpp | 2 +- src/widget/step/StepChooseCardGui.cpp | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/card/base/CardConnectionWorker.cpp b/src/card/base/CardConnectionWorker.cpp index f2b951c..7f359e5 100644 --- a/src/card/base/CardConnectionWorker.cpp +++ b/src/card/base/CardConnectionWorker.cpp @@ -18,9 +18,9 @@ CardConnectionWorker::CardConnectionWorker(Reader* pReader) , mReader(pReader) , mSecureMessaging() { - connect(mReader, &Reader::fireCardInserted, this, &CardConnectionWorker::onReaderInfoChanged); - connect(mReader, &Reader::fireCardRemoved, this, &CardConnectionWorker::onReaderInfoChanged); - connect(mReader, &Reader::fireCardRetryCounterChanged, this, &CardConnectionWorker::onReaderInfoChanged); + connect(mReader.data(), &Reader::fireCardInserted, this, &CardConnectionWorker::onReaderInfoChanged); + connect(mReader.data(), &Reader::fireCardRemoved, this, &CardConnectionWorker::onReaderInfoChanged); + connect(mReader.data(), &Reader::fireCardRetryCounterChanged, this, &CardConnectionWorker::onReaderInfoChanged); } diff --git a/src/qml/HistoryModel.cpp b/src/qml/HistoryModel.cpp index a2a8fb3..548ec74 100644 --- a/src/qml/HistoryModel.cpp +++ b/src/qml/HistoryModel.cpp @@ -119,8 +119,8 @@ HistoryModel::HistoryModel(HistorySettings* pHistorySettings, QObject* pParent) mFilterModel.setFilterCaseSensitivity(Qt::CaseInsensitive); mNameFilterModel.setSourceModel(this); mHistoryModelSearchFilter.setSourceModel(this); - connect(mHistorySettings, &HistorySettings::fireHistoryInfosChanged, this, &HistoryModel::onHistoryEntriesChanged); - connect(mHistorySettings, &HistorySettings::fireEnabledChanged, this, &HistoryModel::fireEnabledChanged); + connect(mHistorySettings.data(), &HistorySettings::fireHistoryInfosChanged, this, &HistoryModel::onHistoryEntriesChanged); + connect(mHistorySettings.data(), &HistorySettings::fireEnabledChanged, this, &HistoryModel::fireEnabledChanged); connect(Env::getSingleton(), &ProviderConfiguration::fireUpdated, this, &HistoryModel::onProvidersChanged); } @@ -366,9 +366,9 @@ bool HistoryModel::removeRows(int pRow, int pCount, const QModelIndex& pParent) entries.remove(pRow, pCount); // disconnect the signal, otherwise this model gets reset - disconnect(mHistorySettings, &HistorySettings::fireHistoryInfosChanged, this, &HistoryModel::onHistoryEntriesChanged); + disconnect(mHistorySettings.data(), &HistorySettings::fireHistoryInfosChanged, this, &HistoryModel::onHistoryEntriesChanged); mHistorySettings->setHistoryInfos(entries); - connect(mHistorySettings, &HistorySettings::fireHistoryInfosChanged, this, &HistoryModel::onHistoryEntriesChanged); + connect(mHistorySettings.data(), &HistorySettings::fireHistoryInfosChanged, this, &HistoryModel::onHistoryEntriesChanged); mHistorySettings->save(); diff --git a/src/widget/DiagnosisGui.cpp b/src/widget/DiagnosisGui.cpp index f41bb04..088dc22 100644 --- a/src/widget/DiagnosisGui.cpp +++ b/src/widget/DiagnosisGui.cpp @@ -47,7 +47,7 @@ void DiagnosisGui::activate() auto context = new DiagnosisContext(); mDialog = new DiagnosisDialog(context, dialogParent); - connect(mDialog, &QDialog::finished, this, &DiagnosisGui::fireFinished); + connect(mDialog.data(), &QDialog::finished, this, &DiagnosisGui::fireFinished); mDialog->show(); auto controller = new DiagnosisController(context, mDialog); diff --git a/src/widget/SetupAssistantGui.cpp b/src/widget/SetupAssistantGui.cpp index d880858..5a20bc2 100644 --- a/src/widget/SetupAssistantGui.cpp +++ b/src/widget/SetupAssistantGui.cpp @@ -36,7 +36,7 @@ void SetupAssistantGui::activate() } mWizard = new SetupAssistantWizard(dialogParent); - connect(mWizard, &SetupAssistantWizard::fireChangePinButtonClicked, this, &SetupAssistantGui::fireChangePinButtonClicked); + connect(mWizard.data(), &SetupAssistantWizard::fireChangePinButtonClicked, this, &SetupAssistantGui::fireChangePinButtonClicked); } mWizard->exec(); diff --git a/src/widget/step/StepChooseCardGui.cpp b/src/widget/step/StepChooseCardGui.cpp index bd88554..1da1a4e 100644 --- a/src/widget/step/StepChooseCardGui.cpp +++ b/src/widget/step/StepChooseCardGui.cpp @@ -39,7 +39,7 @@ StepChooseCardGui::StepChooseCardGui(const QSharedPointer& pContext mDeviceButton = mInformationMessageBox->addButton(tr("Settings"), QMessageBox::YesRole); mDeviceButton->setFocus(); - connect(mReaderDeviceGui, &ReaderDeviceGui::fireFinished, this, &StepChooseCardGui::onSubDialogFinished); + connect(mReaderDeviceGui.data(), &ReaderDeviceGui::fireFinished, this, &StepChooseCardGui::onSubDialogFinished); }