Skip to content

Commit

Permalink
fix: workaround GCC < 5.x bugs in implicit casts
Browse files Browse the repository at this point in the history
The following error happens when building with GCC 4.8.5:

    no matching function for call to ‘QObject::connect(QPointer<T>&, ...)’
    no matching function for call to ‘QObject::disconnect(QPointer<T>&, ...)’

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 <[email protected]>
  • Loading branch information
rexut committed Sep 28, 2018
1 parent 3d08ce3 commit ee027cb
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/card/base/CardConnectionWorker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}


Expand Down
8 changes: 4 additions & 4 deletions src/qml/HistoryModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>(), &ProviderConfiguration::fireUpdated, this, &HistoryModel::onProvidersChanged);
}

Expand Down Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion src/widget/DiagnosisGui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/widget/SetupAssistantGui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/widget/step/StepChooseCardGui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ StepChooseCardGui::StepChooseCardGui(const QSharedPointer<AuthContext>& 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);
}


Expand Down

0 comments on commit ee027cb

Please sign in to comment.