mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
profile: don't use global dc_number variable in profile
The profile knows which divecomputer it is plotting. No point in accessing a global variable (which isn't even defined on mobile). Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
12406786f1
commit
5b4d4813f2
1 changed files with 6 additions and 3 deletions
|
@ -669,11 +669,14 @@ void ProfileWidget2::makeFirstDC()
|
||||||
void ProfileWidget2::renameCurrentDC()
|
void ProfileWidget2::renameCurrentDC()
|
||||||
{
|
{
|
||||||
bool ok;
|
bool ok;
|
||||||
|
struct divecomputer *currentdc = get_dive_dc(mutable_dive(), dc);
|
||||||
|
if (!currentdc)
|
||||||
|
return;
|
||||||
QString newName = QInputDialog::getText(this, tr("Edit nickname"),
|
QString newName = QInputDialog::getText(this, tr("Edit nickname"),
|
||||||
tr("Set new nickname for %1 (serial %2):").arg(current_dc->model).arg(current_dc->serial),
|
tr("Set new nickname for %1 (serial %2):").arg(currentdc->model).arg(currentdc->serial),
|
||||||
QLineEdit::Normal, get_dc_nickname(current_dc), &ok);
|
QLineEdit::Normal, get_dc_nickname(currentdc), &ok);
|
||||||
if (ok)
|
if (ok)
|
||||||
Command::editDeviceNickname(current_dc, newName);
|
Command::editDeviceNickname(currentdc, newName);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProfileWidget2::hideEvents(DiveEventItem *item)
|
void ProfileWidget2::hideEvents(DiveEventItem *item)
|
||||||
|
|
Loading…
Add table
Reference in a new issue