Fix compiler errors reported by other users (#909)

* Fix utf8_str compiler error reported by users when using wxWidgets 3.0.

* Bring back RIGCAPS_NOT_CONST check to keep things compiling on distros still on Hamlib 4.5.
v2.0-dev
Mooneer Salem 2025-06-02 13:02:57 -07:00 committed by GitHub
parent 2fcc6aa379
commit 44b3f52d9d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 11 additions and 3 deletions

View File

@ -539,7 +539,7 @@ void FreeDVReporterDialog::setReporter(std::shared_ptr<FreeDVReporter> reporter)
{
// Update status message
auto statusMsg = m_statusMessage->GetValue();
reporter->updateMessage(statusMsg.utf8_string());
reporter->updateMessage((const char*)statusMsg.utf8_str());
}
}
@ -649,7 +649,7 @@ void FreeDVReporterDialog::OnSendQSY(wxCommandEvent& event)
void FreeDVReporterDialog::OnOpenWebsite(wxCommandEvent& event)
{
std::string url = "https://" + wxGetApp().appConfiguration.reportingConfiguration.freedvReporterHostname->utf8_string() + "/";
std::string url = std::string("https://") + (const char*)wxGetApp().appConfiguration.reportingConfiguration.freedvReporterHostname->utf8_str() + "/";
wxLaunchDefaultBrowser(url);
DeselectItem();
}

View File

@ -161,7 +161,7 @@ class FreeDVReporterDialog : public wxFrame
{
if (reporter_)
{
reporter_->updateMessage(statusMsg.utf8_string());
reporter_->updateMessage((const char*)statusMsg.utf8_str());
}
}

View File

@ -37,7 +37,11 @@ HamlibRigController::RigList HamlibRigController::RigList_;
HamlibRigController::RigNameList HamlibRigController::RigNameList_;
std::mutex HamlibRigController::RigListMutex_;
#if RIGCAPS_NOT_CONST
int HamlibRigController::BuildRigList_(struct rig_caps *rig, rig_ptr_t rigList) {
#else
int HamlibRigController::BuildRigList_(const struct rig_caps *rig, rig_ptr_t rigList) {
#endif // RIGCAPS_NOT_CONST
((HamlibRigController::RigList *)rigList)->push_back(rig);
return 1;
}

View File

@ -107,7 +107,11 @@ private:
static bool RigCompare_(const struct rig_caps *rig1, const struct rig_caps *rig2);
#if RIGCAPS_NOT_CONST
static int BuildRigList_(struct rig_caps *rig, rig_ptr_t);
#else
static int BuildRigList_(const struct rig_caps *rig, rig_ptr_t);
#endif // RIGCAPS_NOT_CONST
};
#endif // HAMLIB_RIG_CONTROLLER_H