diff --git a/Configuration.cpp b/Configuration.cpp index c9fb2a9..2819363 100644 --- a/Configuration.cpp +++ b/Configuration.cpp @@ -298,8 +298,8 @@ public: return { band, freq_.frequency(), - qMin(a, b), - qMax(a, b), + a, + b, description_.text ()}; } diff --git a/StationList.cpp b/StationList.cpp index fcdb06f..d325182 100644 --- a/StationList.cpp +++ b/StationList.cpp @@ -490,9 +490,8 @@ bool StationList::impl::setData (QModelIndex const& model_index, QVariant const& auto t = QTime::fromString(s); auto at = QDateTime(QDate(2000,1,1), t, Qt::UTC); auto until = stations_[row].switch_until_; - - stations_[row].switch_at_ = qMin(at, until); - stations_[row].switch_until_ = qMax(at, until); + stations_[row].switch_at_ = at; + stations_[row].switch_until_ = until; Q_EMIT dataChanged (model_index, model_index, roles); @@ -511,9 +510,8 @@ bool StationList::impl::setData (QModelIndex const& model_index, QVariant const& auto t = QTime::fromString(s); auto until = QDateTime(QDate(2000,1,1), t, Qt::UTC); auto at = stations_[row].switch_at_; - - stations_[row].switch_at_ = qMin(at, until); - stations_[row].switch_until_ = qMax(at, until); + stations_[row].switch_at_ = at; + stations_[row].switch_until_ = until; Q_EMIT dataChanged (model_index, model_index, roles); diff --git a/mainwindow.cpp b/mainwindow.cpp index 803ce1b..b8ed974 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -1339,8 +1339,7 @@ void MainWindow::tryBandHop(){ // and if we are switching to a different frequency than the last hop. this allows us to switch bands at that time, // but then later we can later switch to a different band if needed without the automatic band switching to take over bool canSwitch = ( - station.switch_at_ <= d && - d <= station.switch_until_ && + (station.switch_at_ <= d || d <= station.switch_until_) && (m_bandHopped || (!m_bandHopped && station.frequency_ != m_bandHoppedFreq)) && station.frequency_ != dialFreq );