@@ -214,25 +214,26 @@ void ConfigDialog::updateProfileList() {
214214 qcbProfiles->clear ();
215215
216216 // Always sort the default profile before anything else
217- qcbProfiles->addItem (Profiles::s_default_profile_name);
217+ qcbProfiles->addItem (QString::fromStdString ( Profiles::s_default_profile_name) );
218218
219- QStringList profiles = Global::get ().profiles .allProfiles .keys ();
220- profiles.sort ( );
221- for (const QString &profile : profiles) {
219+ QList< std::string > profiles = Global::get ().profiles .allProfiles .keys ();
220+ std::sort ( profiles.begin (), profiles. end () );
221+ for (const std::string &profile : profiles) {
222222 if (profile == Profiles::s_default_profile_name) {
223223 continue ;
224224 }
225- qcbProfiles->addItem (profile);
225+ qcbProfiles->addItem (QString::fromStdString ( profile) );
226226 }
227227
228- qcbProfiles->setCurrentIndex (qcbProfiles->findText (Global::get ().profiles .activeProfileName ));
228+ qcbProfiles->setCurrentIndex (
229+ qcbProfiles->findText (QString::fromStdString (Global::get ().profiles .activeProfileName )));
229230
230- bool isDefault = qcbProfiles->currentText () == Profiles::s_default_profile_name;
231+ bool isDefault = qcbProfiles->currentText (). toStdString () == Profiles::s_default_profile_name;
231232 qpbProfileRename->setEnabled (!isDefault);
232233 qpbProfileDelete->setEnabled (!isDefault);
233234}
234235
235- void ConfigDialog::switchProfile (const QString &newProfile, bool saveActiveProfile) {
236+ void ConfigDialog::switchProfile (const std::string &newProfile, bool saveActiveProfile) {
236237 Profiles &profiles = Global::get ().profiles ;
237238
238239 if (saveActiveProfile) {
@@ -248,7 +249,7 @@ void ConfigDialog::switchProfile(const QString &newProfile, bool saveActiveProfi
248249}
249250
250251void ConfigDialog::on_qcbProfiles_currentIndexChanged (int ) {
251- QString selectedProfile = qcbProfiles->currentText ();
252+ std::string selectedProfile = qcbProfiles->currentText (). toStdString ();
252253
253254 Profiles &profiles = Global::get ().profiles ;
254255
@@ -265,11 +266,12 @@ void ConfigDialog::on_qcbProfiles_currentIndexChanged(int) {
265266
266267void ConfigDialog::on_qpbProfileAdd_clicked () {
267268 bool ok;
268- QString profileName =
269+ std::string profileName =
269270 QInputDialog::getText (this , tr (" Creating settings profile" ), tr (" Enter new settings profile name" ),
270- QLineEdit::Normal, Global::get ().profiles .activeProfileName , &ok);
271+ QLineEdit::Normal, QString::fromStdString (Global::get ().profiles .activeProfileName ), &ok)
272+ .toStdString ();
271273
272- if (!ok || profileName.isEmpty ()) {
274+ if (!ok || profileName.empty ()) {
273275 return ;
274276 }
275277
@@ -289,18 +291,19 @@ void ConfigDialog::on_qpbProfileAdd_clicked() {
289291}
290292
291293void ConfigDialog::on_qpbProfileRename_clicked () {
292- QString oldProfileName = qcbProfiles->currentText ();
294+ std::string oldProfileName = qcbProfiles->currentText (). toStdString ();
293295
294296 if (oldProfileName == Profiles::s_default_profile_name) {
295297 return ;
296298 }
297299
298300 bool ok;
299- QString profileName =
301+ std::string profileName =
300302 QInputDialog::getText (this , tr (" Renaming settings profile" ), tr (" Enter new settings profile name" ),
301- QLineEdit::Normal, oldProfileName, &ok);
303+ QLineEdit::Normal, QString::fromStdString (oldProfileName), &ok)
304+ .toStdString ();
302305
303- if (!ok || profileName.isEmpty ()) {
306+ if (!ok || profileName.empty ()) {
304307 return ;
305308 }
306309
@@ -316,7 +319,7 @@ void ConfigDialog::on_qpbProfileRename_clicked() {
316319}
317320
318321void ConfigDialog::on_qpbProfileDelete_clicked () {
319- QString oldProfileName = qcbProfiles->currentText ();
322+ std::string oldProfileName = qcbProfiles->currentText (). toStdString ();
320323
321324 if (oldProfileName == Profiles::s_default_profile_name) {
322325 return ;
@@ -326,9 +329,10 @@ void ConfigDialog::on_qpbProfileDelete_clicked() {
326329 return ;
327330 }
328331
329- QMessageBox::StandardButton confirmation = QMessageBox::question (
330- this , tr (" Delete settings profile" ),
331- tr (" Are you sure you want to permanently delete settings profile '%1'" ).arg (oldProfileName));
332+ QMessageBox::StandardButton confirmation =
333+ QMessageBox::question (this , tr (" Delete settings profile" ),
334+ tr (" Are you sure you want to permanently delete settings profile '%1'" )
335+ .arg (QString::fromStdString (oldProfileName)));
332336
333337 if (confirmation != QMessageBox::Yes) {
334338 return ;
0 commit comments