mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: make event name an std::string
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
408b31b6ce
commit
b8c7b173c6
20 changed files with 149 additions and 152 deletions
|
@ -697,7 +697,7 @@ void ProfileWidget2::hideEventType(DiveEventItem *item)
|
|||
{
|
||||
const struct event *event = item->getEvent();
|
||||
|
||||
if (!empty_string(event->name)) {
|
||||
if (!event->name.empty()) {
|
||||
hide_event_type(event);
|
||||
|
||||
replot();
|
||||
|
@ -727,7 +727,7 @@ void ProfileWidget2::removeEvent(DiveEventItem *item)
|
|||
|
||||
if (QMessageBox::question(this, TITLE_OR_TEXT(
|
||||
tr("Remove the selected event?"),
|
||||
tr("%1 @ %2:%3").arg(event->name).arg(event->time.seconds / 60).arg(event->time.seconds % 60, 2, 10, QChar('0'))),
|
||||
tr("%1 @ %2:%3").arg(QString::fromStdString(event->name)).arg(event->time.seconds / 60).arg(event->time.seconds % 60, 2, 10, QChar('0'))),
|
||||
QMessageBox::Ok | QMessageBox::Cancel) == QMessageBox::Ok)
|
||||
Command::removeEvent(mutable_dive(), dc, event);
|
||||
}
|
||||
|
@ -786,7 +786,7 @@ void ProfileWidget2::editName(DiveEventItem *item)
|
|||
bool ok;
|
||||
QString newName = QInputDialog::getText(this, tr("Edit name of bookmark"),
|
||||
tr("Custom name:"), QLineEdit::Normal,
|
||||
event->name, &ok);
|
||||
event->name.c_str(), &ok);
|
||||
if (ok && !newName.isEmpty()) {
|
||||
if (newName.length() > 22) { //longer names will display as garbage.
|
||||
QMessageBox lengthWarning;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue