GlossiConfig: Fix build; Actually delete fiels when renaming

pull/130/head
Peter Repukat 3 years ago
parent 0370f84f56
commit cc266d921d

@ -20,9 +20,6 @@ limitations under the License.
#include <QJsonDocument>
#include "TargetConfig.h"
UIModel::UIModel() : QObject(nullptr)
{
auto path = std::filesystem::temp_directory_path()
@ -100,6 +97,12 @@ void UIModel::updateTarget(int index, QVariant shortcut)
writeTarget(wtf, map["name"].toString());
auto oldName = targets_[index].toMap()["name"].toString() + ".json";
auto path = config_path_;
path /= config_dir_name_.toStdString();
path /= (oldName).toStdString();
std::filesystem::remove(path);
targets_.replace(index, json.toVariant());
emit targetListChanged();
}

@ -49,11 +49,21 @@ GridView {
font.pixelSize: 16
}
Button {
text: qsTr("Edit")
Row {
anchors.right: parent.right
anchors.bottom: parent.bottom
onClicked: editClicked(index, modelData)
spacing: 4
Button {
text: qsTr("Add to Steam") // TODO
onClicked: console.log("TODO") // TODO
highlighted: true
}
Button {
text: qsTr("Edit")
onClicked: editClicked(index, modelData)
}
}
}

Loading…
Cancel
Save