9 #include "ui_suggest_dialog.h"
18 restoreGeometry(settings.value(
"SuggestDialog.geometry").toByteArray());
20 ui->lineEditX->setText(QString::fromStdString(name_x));
21 ui->lineEditY->setText(QString::fromStdString(name_y));
28 settings.setValue(
"SuggestDialog.geometry", saveGeometry());
34 return ui->lineEditX->text();
39 return ui->lineEditY->text();
44 return ui->lineEditName->text();
49 std::string common_prefix;
50 std::string name_x =
ui->lineEditX->text().toStdString();
51 std::string name_y =
ui->lineEditY->text().toStdString();
53 if (name_x.size() > name_y.size())
57 common_prefix = std::string(
58 name_x.begin(), std::mismatch(name_x.begin(), name_x.end(), name_y.begin()).first);
60 std::string suffix_x = name_x.substr(common_prefix.size());
61 std::string suffix_y = name_y.substr(common_prefix.size());
63 std::string suggestion = common_prefix +
"[" + suffix_x +
";" + suffix_y +
"]";
64 ui->lineEditName->setText(QString::fromStdString(suggestion));
69 auto temp =
ui->lineEditX->text();
70 ui->lineEditX->setText(
ui->lineEditY->text());
71 ui->lineEditY->setText(temp);