Skip to content

Commit

Permalink
Merge branch 'master' into devel
Browse files Browse the repository at this point in the history
  • Loading branch information
hmatuschek committed Oct 14, 2023
2 parents 2cbfba6 + 31a5135 commit 1f5374e
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/radiolimits.cc
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ RadioLimitRefList::verify(const ConfigItem *item, const QMetaProperty &prop, Rad

if ((0 <= _maxSize) && (_maxSize < plist->count())) {
auto &msg = context.newMessage(RadioLimitIssue::Warning);
msg << "List '" << prop.name() << "' takes at most " << _minSize
msg << "List '" << prop.name() << "' takes at most " << _maxSize
<< " elements, " << plist->count() << " elements found.";
return false;
}
Expand Down Expand Up @@ -855,7 +855,7 @@ RadioLimitGroupCallRefList::verify(const ConfigItem *item, const QMetaProperty &

if ((0 <= _maxSize) && (_maxSize < plist->count())) {
auto &msg = context.newMessage(RadioLimitIssue::Warning);
msg << "List '" << prop.name() << "' takes at most " << _minSize
msg << "List '" << prop.name() << "' takes at most " << _maxSize
<< " elements, " << plist->count() << " elements found.";
return false;
}
Expand Down
8 changes: 8 additions & 0 deletions lib/roamingzone.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ RoamingZone::clear() {
_channel.clear();
}

bool
RoamingZone::contains(const RoamingChannel *ch) const {
for (int i=0; i<count(); i++)
if (ch == channel(i))
return true;
return false;
}

RoamingChannel*
RoamingZone::channel(int idx) const {
if ((idx < 0) || (idx >= count()))
Expand Down
2 changes: 2 additions & 0 deletions lib/roamingzone.hh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ public:
/** Clears the zone list. */
void clear();

/** Returns @c true, if the given roaming channel is member of this zone. */
bool contains(const RoamingChannel *ch) const;
/** Returns the roaming channel, which is the member at index @c idx (0-based).
* @param idx Specifies the index of the member channel. */
RoamingChannel *channel(int idx) const;
Expand Down
13 changes: 12 additions & 1 deletion src/configitemwrapper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ RoamingChannelListWrapper::RoamingChannelListWrapper(RoamingChannelList *list, Q
int
RoamingChannelListWrapper::columnCount(const QModelIndex &index) const {
Q_UNUSED(index);
return 5;
return 6;
}

QVariant
Expand All @@ -524,6 +524,16 @@ RoamingChannelListWrapper::data(const QModelIndex &index, int role) const {
}
}
return tr("[Selected]");
case 5: {
QStringList zones;
for(int i=0;i<ch->config()->roamingZones()->count(); i++) {
RoamingZone *zone = ch->config()->roamingZones()->zone(i);
if (zone->contains(ch))
zones.append(zone->name());
}
return zones.join(", ");
} break;

default: break;
}

Expand All @@ -540,6 +550,7 @@ RoamingChannelListWrapper::headerData(int section, Qt::Orientation orientation,
case 2: return tr("TX Frequency");
case 3: return tr("CC");
case 4: return tr("TS");
case 5: return tr("Zones");
default: break;
}
return QVariant();
Expand Down

0 comments on commit 1f5374e

Please sign in to comment.