Commit 8173e1d6 authored by Ahmad Samir's avatar Ahmad Samir Committed by Fushan Wen
Browse files

Use QString() for empty strings

GIT_SILENT
parent 8fb84c2f
Pipeline #123620 passed with stage
in 2 minutes and 40 seconds
......@@ -109,7 +109,7 @@ QStringList MimeTypesModel::checkedTypes() const
return list;
}
return QStringList(QLatin1String(""));
return QStringList(QString());
}
void MimeTypesModel::setCheckedTypes(const QStringList &list)
......
......@@ -72,7 +72,7 @@ void ComponentChooser::load()
QVariantMap application;
application["name"] = i18n("Other…");
application["icon"] = QStringLiteral("application-x-shellscript");
application["storageId"] = QLatin1String("");
application["storageId"] = QString();
m_applications += application;
if (m_index == -1) {
m_index = 0;
......
......@@ -18,7 +18,7 @@
ComponentChooserTerminal::ComponentChooserTerminal(QObject *parent)
: ComponentChooser(parent,
QLatin1String(""),
QString(),
QStringLiteral("TerminalEmulator"),
QStringLiteral("org.kde.konsole.desktop"),
i18n("Select default terminal emulator"))
......@@ -73,7 +73,7 @@ void ComponentChooserTerminal::load()
QVariantMap application;
application["name"] = i18n("Other…");
application["icon"] = QStringLiteral("application-x-shellscript");
application["storageId"] = QLatin1String("");
application["storageId"] = QString();
m_applications += application;
if (m_index == -1) {
m_index = 0;
......
......@@ -80,7 +80,7 @@ void CalDialog::calibrate()
else if (i == 1)
hint = i18n("(usually Y)");
else
hint = QLatin1String("");
hint = QString();
// minimum position
text->setText(
......
......@@ -35,7 +35,7 @@ QString JoyDevice::errText(ErrorCode code) const
{
switch (code) {
case SUCCESS:
return QLatin1String("");
return QString();
case OPEN_FAILED: {
return i18n("The given device %1 could not be opened: %2", devName, strerror(errno));
......@@ -177,7 +177,7 @@ void JoyDevice::close()
::close(joyFd);
joyFd = -1;
descr = QLatin1String("");
descr = QString();
delete[] amin;
delete[] amax;
......
......@@ -204,7 +204,7 @@ void JoyWidget::restoreCurrDev()
{
if (!joydev) // no device open
{
device->setEditText(QLatin1String(""));
device->setEditText(QString());
calibrate->setEnabled(false);
} else {
// try to find the current open device in the combobox list
......
......@@ -109,7 +109,7 @@ void AddLayoutDialog::accept()
{
QString label = layoutDialogUi->labelEdit->text();
if (label == selectedLayout) {
label = QLatin1String("");
label = QString();
}
selectedLayoutUnit.setDisplayName(label);
selectedLayoutUnit.setShortcut(layoutDialogUi->kkeysequencewidget->keySequence());
......
......@@ -44,7 +44,7 @@ static bool isDefaultLayoutConfig(const LayoutSet &layout, const QList<LayoutUni
QString LayoutMemoryPersister::getLayoutMapAsString()
{
if (!canPersist())
return QLatin1String("");
return QString();
QDomDocument doc(DOC_NAME);
QDomElement root = doc.createElement(ROOT_NODE);
......@@ -54,7 +54,7 @@ QString LayoutMemoryPersister::getLayoutMapAsString()
if (layoutMemory.keyboardConfig.switchingPolicy() == KeyboardConfig::SWITCH_POLICY_GLOBAL) {
if (!globalLayout.isValid())
return QLatin1String("");
return QString();
QDomElement item = doc.createElement(ITEM_NODE);
item.setAttribute(CURRENT_LAYOUT_ATTRIBUTE, globalLayout.toString());
......
......@@ -382,7 +382,7 @@ LayoutUnit::LayoutUnit(const QString &fullLayoutName)
{
QStringList lv = fullLayoutName.split(LAYOUT_VARIANT_SEPARATOR_PREFIX);
m_layout = lv[0];
m_variant = lv.size() > 1 ? stripVariantName(lv[1]) : QLatin1String("");
m_variant = lv.size() > 1 ? stripVariantName(lv[1]) : QString();
}
QString LayoutUnit::toString() const
......
......@@ -36,14 +36,14 @@ static const QString COMMAND_OPTIONS_SEPARATOR(QStringLiteral(","));
static QString getSetxkbmapExe()
{
if (setxkbmapNotFound)
return QLatin1String("");
return QString();
if (setxkbmapExe.isEmpty()) {
setxkbmapExe = QStandardPaths::findExecutable(SETXKBMAP_EXEC);
if (setxkbmapExe.isEmpty()) {
setxkbmapNotFound = true;
qCCritical(KCM_KEYBOARD) << "Can't find" << SETXKBMAP_EXEC << "- keyboard layouts won't be configured";
return QLatin1String("");
return QString();
}
}
return setxkbmapExe;
......@@ -116,7 +116,7 @@ bool XkbHelper::initializeKeyboardLayouts(const QList<LayoutUnit> &layoutUnits)
QStringList setxkbmapCommandArguments;
setxkbmapCommandArguments.append(QStringLiteral("-layout"));
setxkbmapCommandArguments.append(layouts.join(COMMAND_OPTIONS_SEPARATOR));
if (!variants.join(QLatin1String("")).isEmpty()) {
if (!variants.join(QString()).isEmpty()) {
setxkbmapCommandArguments.append(QStringLiteral("-variant"));
setxkbmapCommandArguments.append(variants.join(COMMAND_OPTIONS_SEPARATOR));
}
......@@ -146,7 +146,7 @@ bool XkbHelper::initializeKeyboardLayouts(KeyboardConfig &config)
setxkbmapCommandArguments.append(QStringLiteral("-layout"));
setxkbmapCommandArguments.append(layouts.join(COMMAND_OPTIONS_SEPARATOR));
if (!variants.join(QLatin1String("")).isEmpty()) {
if (!variants.join(QString()).isEmpty()) {
setxkbmapCommandArguments.append(QStringLiteral("-variant"));
setxkbmapCommandArguments.append(variants.join(COMMAND_OPTIONS_SEPARATOR));
}
......
......@@ -35,7 +35,7 @@ ActionItem::ActionItem(const QString &pathToDesktop, const QString &action, QObj
configGroups.append(desktopFileWrite->actionGroup(actionName));
actionGroups.insert(ActionItem::GroupAction, &configGroups.last());
const QString predicateString = readKey(ActionItem::GroupDesktop, QStringLiteral("X-KDE-Solid-Predicate"), QLatin1String(""));
const QString predicateString = readKey(ActionItem::GroupDesktop, QStringLiteral("X-KDE-Solid-Predicate"), QString());
predicateItem = Solid::Predicate::fromString(predicateString);
}
......@@ -54,17 +54,17 @@ bool ActionItem::isUserSupplied() const
QString ActionItem::icon() const
{
return readKey(ActionItem::GroupAction, QStringLiteral("Icon"), QLatin1String(""));
return readKey(ActionItem::GroupAction, QStringLiteral("Icon"), QString());
}
QString ActionItem::exec() const
{
return readKey(ActionItem::GroupAction, QStringLiteral("Exec"), QLatin1String(""));
return readKey(ActionItem::GroupAction, QStringLiteral("Exec"), QString());
}
QString ActionItem::name() const
{
return readKey(ActionItem::GroupAction, QStringLiteral("Name"), QLatin1String(""));
return readKey(ActionItem::GroupAction, QStringLiteral("Name"), QString());
}
Solid::Predicate ActionItem::predicate() const
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment