Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 7814eff7 authored by Laurent Montel's avatar Laurent Montel 😁

Fix some clazy warning

parent 52f8c52d
......@@ -49,9 +49,9 @@ static QSharedPointer<KConfig> openConfig(const QString &filePath)
ActionReply SddmAuthHelper::save(const QVariantMap &args)
{
ActionReply reply = ActionReply::HelperErrorReply();
QSharedPointer<KConfig> sddmConfig = openConfig(args[QLatin1String("sddm.conf")].toString());
QSharedPointer<KConfig> sddmConfig = openConfig(args[QStringLiteral("sddm.conf")].toString());
QSharedPointer<KConfig> themeConfig;
QString themeConfigFile = args[QLatin1String("theme.conf.user")].toString();
QString themeConfigFile = args[QStringLiteral("theme.conf.user")].toString();
if (!themeConfigFile.isEmpty()) {
themeConfig = openConfig(themeConfigFile);
......
......@@ -58,7 +58,7 @@ int main(int argc, char **argv)
return 0;
}
if (parser.isSet(QLatin1String("install"))) {
if (parser.isSet(QStringLiteral("install"))) {
const QFileInfo themefile(args.first());
if (!themefile.exists()) {
qWarning() << "Specified theme file does not exists";
......@@ -81,7 +81,7 @@ int main(int argc, char **argv)
cg.writeEntry(themefile.absoluteFilePath(), job->data().value(QStringLiteral("installedPaths")).toStringList());
return 0;
}
if (parser.isSet(QLatin1String("uninstall"))) {
if (parser.isSet(QStringLiteral("uninstall"))) {
KConfigGroup cg(KSharedConfig::openConfig(QStringLiteral("sddmthemeinstallerrc"), KConfig::SimpleConfig), "DownloadedThemes");
const QStringList installed = cg.readEntry(args.first(), QStringList());
for (const QString &installedTheme: installed) {
......
......@@ -48,11 +48,11 @@ AdvanceConfig::AdvanceConfig(const KSharedConfigPtr &config, QWidget *parent) :
connect(configUi->rebootCommand, SIGNAL(textChanged(QString)), SIGNAL(changed()));
connect(configUi->cursorList, SIGNAL(activated(int)), SIGNAL(changed()));
connect(configUi->minimumUid, SIGNAL(textChanged(QString)), SIGNAL(changed()));
connect(configUi->minimumUid, SIGNAL(textChanged(QString)), SLOT(slotUidRangeChanged()));
connect(configUi->minimumUid, &QLineEdit::textChanged, this, &AdvanceConfig::slotUidRangeChanged);
connect(configUi->maximumUid, SIGNAL(textChanged(QString)), SIGNAL(changed()));
connect(configUi->maximumUid, SIGNAL(textChanged(QString)), SLOT(slotUidRangeChanged()));
connect(configUi->autoLogin, SIGNAL(clicked()), SIGNAL(changed()));
connect(configUi->reloginAfterQuit, SIGNAL(clicked()), SIGNAL(changed()));
connect(configUi->maximumUid, &QLineEdit::textChanged, this, &AdvanceConfig::slotUidRangeChanged);
connect(configUi->autoLogin, &QGroupBox::clicked, this, &AdvanceConfig::changed);
connect(configUi->reloginAfterQuit, &QAbstractButton::clicked, this, &AdvanceConfig::changed);
}
AdvanceConfig::~AdvanceConfig()
......
......@@ -39,8 +39,8 @@ SelectImageButton::SelectImageButton(QWidget *parent)
setIconSize(QSize(64,64));
menu->addAction(QIcon::fromTheme(QLatin1String("document-open-folder")), i18n("Load from file..."), this, SLOT(onLoadImageFromFile()));
menu->addAction(QIcon::fromTheme(QLatin1String("edit-clear")), i18n("Clear Image"), this, SLOT(onClearImage()));
menu->addAction(QIcon::fromTheme(QStringLiteral("document-open-folder")), i18n("Load from file..."), this, &SelectImageButton::onLoadImageFromFile);
menu->addAction(QIcon::fromTheme(QStringLiteral("edit-clear")), i18n("Clear Image"), this, &SelectImageButton::onClearImage);
setMenu(menu);
onClearImage();
......@@ -61,7 +61,7 @@ void SelectImageButton::setImagePath(const QString &imagePath) {
imageIcon.addPixmap(image.scaled(iconSize().boundedTo(image.size()), Qt::KeepAspectRatio));
setIcon(imageIcon);
} else {
setIcon(QIcon::fromTheme(QLatin1String("image-x-generic")));
setIcon(QIcon::fromTheme(QStringLiteral("image-x-generic")));
}
Q_EMIT imagePathChanged(m_imagePath);
}
......
......@@ -282,7 +282,7 @@ bool CursorThemeModel::handleDefault(const QDir &themeDir)
return true;
}
defaultName = QLatin1String("default");
defaultName = QStringLiteral("default");
return false;
}
......@@ -363,7 +363,7 @@ void CursorThemeModel::insertThemes()
// The theme Xcursor will end up using if no theme is configured
if (defaultName.isNull() || !hasTheme(defaultName))
defaultName = QLatin1String("KDE_Classic");
defaultName = QStringLiteral("KDE_Classic");
}
......
......@@ -45,7 +45,7 @@ K_PLUGIN_FACTORY(SddmKcmFactory, registerPlugin<SddmKcm>();)
SddmKcm::SddmKcm(QWidget *parent, const QVariantList &args) :
KCModule(parent, args)
{
KAboutData* aboutData = new KAboutData(QStringLiteral("kcmsddm"), i18n("SDDM KDE Config"), QString::fromLatin1(PROJECT_VERSION));
KAboutData* aboutData = new KAboutData(QStringLiteral("kcmsddm"), i18n("SDDM KDE Config"), QLatin1String(PROJECT_VERSION));
aboutData->setShortDescription(i18n("Login screen using the SDDM"));
aboutData->setLicense(KAboutLicense::GPL_V2);
......@@ -57,11 +57,11 @@ SddmKcm::SddmKcm(QWidget *parent, const QVariantList &args) :
setAboutData(aboutData);
setNeedsAuthorization(true);
mSddmConfig = KSharedConfig::openConfig(QString::fromLatin1(SDDM_CONFIG_FILE), KConfig::CascadeConfig);
mSddmConfig = KSharedConfig::openConfig(QStringLiteral(SDDM_CONFIG_FILE), KConfig::CascadeConfig);
// This does not listen for new config files in the directory.
QStringList configFiles = QDir(QString::fromLatin1(SDDM_CONFIG_DIR)).entryList(QDir::Files | QDir::NoDotAndDotDot, QDir::LocaleAware),
systemConfigFiles = QDir(QString::fromLatin1(SDDM_SYSTEM_CONFIG_DIR)).entryList(QDir::Files | QDir::NoDotAndDotDot, QDir::LocaleAware);
QStringList configFiles = QDir(QLatin1String(SDDM_CONFIG_DIR)).entryList(QDir::Files | QDir::NoDotAndDotDot, QDir::LocaleAware),
systemConfigFiles = QDir(QLatin1String(SDDM_SYSTEM_CONFIG_DIR)).entryList(QDir::Files | QDir::NoDotAndDotDot, QDir::LocaleAware);
// QStringBuilder keeps dangling references, so force return of QString (QTBUG-47066)
std::transform(systemConfigFiles.begin(), systemConfigFiles.end(), systemConfigFiles.begin(),
......@@ -82,7 +82,7 @@ void SddmKcm::save()
{
QVariantMap args;
args[QStringLiteral("sddm.conf")] = QString::fromLatin1(SDDM_CONFIG_FILE);
args[QStringLiteral("sddm.conf")] = QLatin1String(SDDM_CONFIG_FILE);
if (!mThemeConfig->themeConfigPath().isEmpty()) {
args[QStringLiteral("theme.conf.user")] = QString(mThemeConfig->themeConfigPath() + QLatin1String(".user"));
......
......@@ -58,7 +58,7 @@ SessionModel::~SessionModel() {
void SessionModel::loadDir(const QString &path, SessionType type)
{
QDir dir(path);
dir.setNameFilters(QStringList() << QLatin1String("*.desktop"));
dir.setNameFilters(QStringList() << QStringLiteral("*.desktop"));
dir.setFilter(QDir::Files);
// read session
foreach(const QString &session, dir.entryList()) {
......
......@@ -54,9 +54,9 @@ ThemeConfig::ThemeConfig(const KSharedConfigPtr &config, QWidget *parent) :
model->populate();
connect(this, &ThemeConfig::themesChanged, model, &ThemesModel::populate);
connect(configUi->themesListView, SIGNAL(activated(QModelIndex)), SLOT(themeSelected(QModelIndex)));
connect(configUi->themesListView, SIGNAL(clicked(QModelIndex)), SLOT(themeSelected(QModelIndex)));
connect(configUi->selectBackgroundButton, SIGNAL(imagePathChanged(QString)), SLOT(backgroundChanged(QString)));
connect(configUi->themesListView, &QAbstractItemView::activated, this, &ThemeConfig::themeSelected);
connect(configUi->themesListView, &QAbstractItemView::clicked, this, &ThemeConfig::themeSelected);
connect(configUi->selectBackgroundButton, &SelectImageButton::imagePathChanged, this, &ThemeConfig::backgroundChanged);
connect(configUi->getNewButton, &QPushButton::clicked, this, &ThemeConfig::getNewStuffClicked);
connect(configUi->installFromFileButton, &QPushButton::clicked, this, &ThemeConfig::installFromFileClicked);
......
......@@ -90,7 +90,7 @@ void ThemesModel::populate()
endResetModel();
}
QString themesBaseDir = KSharedConfig::openConfig(QString::fromLatin1(SDDM_CONFIG_FILE), KConfig::SimpleConfig)->group("Theme").readEntry("ThemeDir");
QString themesBaseDir = KSharedConfig::openConfig(QStringLiteral(SDDM_CONFIG_FILE), KConfig::SimpleConfig)->group("Theme").readEntry("ThemeDir");
if (themesBaseDir.isEmpty()) {
themesBaseDir = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("sddm/themes"), QStandardPaths::LocateDirectory);
......
Markdown is supported
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