mirror of
https://github.com/overte-org/overte.git
synced 2025-08-14 17:45:31 +02:00
Update User Locations window to update name when it changes on update
This commit is contained in:
parent
51e42221be
commit
15d60df420
1 changed files with 10 additions and 3 deletions
|
@ -56,9 +56,14 @@ void UserLocation::handleRenameResponse(const QJsonObject& responseData) {
|
|||
|
||||
qDebug() << responseData;
|
||||
QJsonValue status = responseData["status"];
|
||||
if (status.isUndefined() || status.toString() != "success") {
|
||||
if (!status.isUndefined() && status.toString() == "success") {
|
||||
QString updatedName = responseData["data"].toObject()["name"].toString();
|
||||
_name = updatedName;
|
||||
} else {
|
||||
_name = _previousName;
|
||||
qDebug() << "There was an error renaming location '" + _name + "'";
|
||||
QString msg = "There was an error renaming location '" + _name + "'";
|
||||
qDebug() << msg;
|
||||
QMessageBox::warning(Application::getInstance()->getWindow(), "Error", msg);
|
||||
}
|
||||
|
||||
emit updated(_name);
|
||||
|
@ -94,7 +99,9 @@ void UserLocation::handleDeleteResponse(const QJsonObject& responseData) {
|
|||
if (!status.isUndefined() && status.toString() == "success") {
|
||||
emit deleted(_name);
|
||||
} else {
|
||||
qDebug() << "There was an error deleting location '" + _name + "'";
|
||||
QString msg = "There was an error deleting location '" + _name + "'";
|
||||
qDebug() << msg;
|
||||
QMessageBox::warning(Application::getInstance()->getWindow(), "Error", msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue