SkylandersPortalWindow: Remove unnecessary string conversions

Same behavior without a bit of churn.
This commit is contained in:
Lioncash 2023-11-25 21:31:56 -05:00
parent c16e98a31f
commit 6d47d6c08e

View File

@ -44,7 +44,7 @@ SkylanderPortalWindow::SkylanderPortalWindow(QWidget* parent) : QWidget(parent)
{
setWindowTitle(tr("Skylanders Manager"));
setWindowIcon(Resources::GetAppIcon());
setObjectName(QString::fromStdString("skylanders_manager"));
setObjectName(QStringLiteral("skylanders_manager"));
setMinimumSize(QSize(650, 500));
m_only_show_collection = new QCheckBox(tr("Only Show Collection"));
@ -64,9 +64,9 @@ SkylanderPortalWindow::SkylanderPortalWindow(QWidget* parent) : QWidget(parent)
QDir skylanders_folder;
// skylanders folder in user directory
QString user_path =
QString::fromStdString(File::GetUserPath(D_USER_IDX)) + QString::fromStdString("Skylanders");
QString::fromStdString(File::GetUserPath(D_USER_IDX)) + QStringLiteral("Skylanders");
// first time initialize path in config
if (Config::Get(Config::MAIN_SKYLANDERS_PATH) == "")
if (Config::Get(Config::MAIN_SKYLANDERS_PATH).empty())
{
Config::SetBase(Config::MAIN_SKYLANDERS_PATH, user_path.toStdString());
skylanders_folder = QDir(user_path);
@ -185,7 +185,7 @@ QVBoxLayout* SkylanderPortalWindow::CreateSlotLayout()
}
auto* hbox_skylander = new QHBoxLayout();
auto* label_skyname = new QLabel(QString(tr("Skylander %1")).arg(i + 1));
auto* label_skyname = new QLabel(tr("Skylander %1").arg(i + 1));
m_edit_skylanders[i] = new QLineEdit();
m_edit_skylanders[i]->setEnabled(false);
@ -589,8 +589,7 @@ void SkylanderPortalWindow::CreateSkylanderAdvanced()
auto* label_var = new QLabel(tr("Variant:"));
auto* edit_id = new QLineEdit(tr("0"));
auto* edit_var = new QLineEdit(tr("0"));
auto* rxv =
new QRegularExpressionValidator(QRegularExpression(QString::fromStdString("\\d*")), this);
auto* rxv = new QRegularExpressionValidator(QRegularExpression(QStringLiteral("\\d*")), this);
edit_id->setValidator(rxv);
edit_var->setValidator(rxv);
hbox_idvar->addWidget(label_id);
@ -803,7 +802,7 @@ void SkylanderPortalWindow::CreateSkyfile(const QString& path, bool load_after)
}
figure.Close();
}
m_last_skylander_path = QFileInfo(path).absolutePath() + QString::fromStdString("/");
m_last_skylander_path = QFileInfo(path).absolutePath() + QLatin1Char{'/'};
if (load_after)
LoadSkyfilePath(GetCurrentSlot(), path);