Commit 45e687ae authored by Laurent Montel's avatar Laurent Montel 😁

Fix clazy warning

parent 4f95d012
...@@ -47,7 +47,7 @@ K_PLUGIN_FACTORY(KWalletFactory, registerPlugin<KWalletConfig>();) ...@@ -47,7 +47,7 @@ K_PLUGIN_FACTORY(KWalletFactory, registerPlugin<KWalletConfig>();)
KWalletConfig::KWalletConfig(QWidget *parent, const QVariantList &args) KWalletConfig::KWalletConfig(QWidget *parent, const QVariantList &args)
: KCModule(parent, args), : KCModule(parent, args),
_cfg(KSharedConfig::openConfig(QLatin1String("kwalletrc"), KConfig::NoGlobals)) _cfg(KSharedConfig::openConfig(QStringLiteral("kwalletrc"), KConfig::NoGlobals))
{ {
KAboutData *about = new KAboutData(QStringLiteral("kcmkwallet5"), KAboutData *about = new KAboutData(QStringLiteral("kcmkwallet5"),
i18n("KDE Wallet Control Module"), i18n("KDE Wallet Control Module"),
...@@ -87,7 +87,7 @@ KWalletConfig::KWalletConfig(QWidget *parent, const QVariantList &args) ...@@ -87,7 +87,7 @@ KWalletConfig::KWalletConfig(QWidget *parent, const QVariantList &args)
_wcw->_accessList->setContextMenuPolicy(Qt::CustomContextMenu); _wcw->_accessList->setContextMenuPolicy(Qt::CustomContextMenu);
updateWalletLists(); updateWalletLists();
if (QDBusConnection::sessionBus().interface()->isServiceRegistered(QLatin1String("org.kde.kwalletmanager"))) { if (QDBusConnection::sessionBus().interface()->isServiceRegistered(QStringLiteral("org.kde.kwalletmanager"))) {
_wcw->_launch->hide(); _wcw->_launch->hide();
} }
...@@ -172,12 +172,12 @@ void KWalletConfig::newNetworkWallet() ...@@ -172,12 +172,12 @@ void KWalletConfig::newNetworkWallet()
void KWalletConfig::launchManager() void KWalletConfig::launchManager()
{ {
if (!QDBusConnection::sessionBus().interface()->isServiceRegistered(QLatin1String("org.kde.kwalletmanager5"))) { if (!QDBusConnection::sessionBus().interface()->isServiceRegistered(QStringLiteral("org.kde.kwalletmanager5"))) {
QProcess::startDetached(QLatin1String("kwalletmanager5 --show")); QProcess::startDetached(QStringLiteral("kwalletmanager5 --show"));
} else { } else {
QDBusInterface kwalletd(QLatin1String("org.kde.kwalletmanager5"), QLatin1String("/kwalletmanager5/MainWindow_1")); QDBusInterface kwalletd(QStringLiteral("org.kde.kwalletmanager5"), QStringLiteral("/kwalletmanager5/MainWindow_1"));
kwalletd.call(QLatin1String("show")); kwalletd.call(QStringLiteral("show"));
kwalletd.call(QLatin1String("raise")); kwalletd.call(QStringLiteral("raise"));
} }
} }
...@@ -228,13 +228,13 @@ void KWalletConfig::load() ...@@ -228,13 +228,13 @@ void KWalletConfig::load()
// perform cleanup in the kwalletrc file, by removing entries that correspond to non-existent // perform cleanup in the kwalletrc file, by removing entries that correspond to non-existent
// (previously deleted, for example) wallets // (previously deleted, for example) wallets
QString path = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation); QString path = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation);
path.append(QString("/kwalletd/%1.kwl").arg(walletName)); path.append(QStringLiteral("/kwalletd/%1.kwl").arg(walletName));
if (!QFile::exists(path)) { if (!QFile::exists(path)) {
// if the wallet no longer exists, delete the entries from the configuration file and skip to next entry // if the wallet no longer exists, delete the entries from the configuration file and skip to next entry
KConfigGroup cfgAllow = KSharedConfig::openConfig("kwalletrc")->group("Auto Allow"); KConfigGroup cfgAllow = KSharedConfig::openConfig(QStringLiteral("kwalletrc"))->group("Auto Allow");
cfgAllow.deleteEntry(walletName); cfgAllow.deleteEntry(walletName);
KConfigGroup cfgDeny = KSharedConfig::openConfig("kwalletrc")->group("Auto Deny"); KConfigGroup cfgDeny = KSharedConfig::openConfig(QStringLiteral("kwalletrc"))->group("Auto Deny");
cfgDeny.deleteEntry(walletName); cfgDeny.deleteEntry(walletName);
continue; continue;
} }
...@@ -338,12 +338,12 @@ void KWalletConfig::save() ...@@ -338,12 +338,12 @@ void KWalletConfig::save()
_cfg->sync(); _cfg->sync();
// this restarts kwalletd if necessary // this restarts kwalletd if necessary
QDBusInterface kwalletd(QLatin1String("org.kde.kwalletd5"), QLatin1String("/modules/kwalletd"), QLatin1String(KWALLETMANAGERINTERFACE)); QDBusInterface kwalletd(QStringLiteral("org.kde.kwalletd5"), QStringLiteral("/modules/kwalletd"), QStringLiteral(KWALLETMANAGERINTERFACE));
// if wallet was deactivated, then kwalletd will exit upon start so check // if wallet was deactivated, then kwalletd will exit upon start so check
// the status before invoking reconfigure // the status before invoking reconfigure
if (kwalletd.isValid()) { if (kwalletd.isValid()) {
// this will eventually make kwalletd exit upon deactivation // this will eventually make kwalletd exit upon deactivation
kwalletd.call(QLatin1String("reconfigure")); kwalletd.call(QStringLiteral("reconfigure"));
} }
emit changed(false); emit changed(false);
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
KWalletFolderItem::KWalletFolderItem(KWallet::Wallet *w, QTreeWidget *parent, const QString &name, int entries) KWalletFolderItem::KWalletFolderItem(KWallet::Wallet *w, QTreeWidget *parent, const QString &name, int entries)
: QTreeWidgetItem(parent, KWalletFolderItemClass), _wallet(w), _name(name), _entries(entries) : QTreeWidgetItem(parent, KWalletFolderItemClass), _wallet(w), _name(name), _entries(entries)
{ {
setText(0, QString::fromLatin1("%1 (%2)").arg(_name).arg(_entries)); setText(0, QStringLiteral("%1 (%2)").arg(_name).arg(_entries));
setFlags(Qt::ItemIsSelectable | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled | Qt::ItemIsEnabled); setFlags(Qt::ItemIsSelectable | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled | Qt::ItemIsEnabled);
setIcon(0, getFolderIcon(KIconLoader::Small)); setIcon(0, getFolderIcon(KIconLoader::Small));
} }
...@@ -55,7 +55,7 @@ QPixmap KWalletFolderItem::getFolderIcon(KIconLoader::Group group) ...@@ -55,7 +55,7 @@ QPixmap KWalletFolderItem::getFolderIcon(KIconLoader::Group group)
pix = QIcon::fromTheme(_name.toLower()).pixmap(IconSize(group), IconSize(group)); pix = QIcon::fromTheme(_name.toLower()).pixmap(IconSize(group), IconSize(group));
if (pix.isNull()) if (pix.isNull())
pix = QIcon::fromTheme(QLatin1String("folder-red")).pixmap(IconSize(group), IconSize(group)); pix = QIcon::fromTheme(QStringLiteral("folder-red")).pixmap(IconSize(group), IconSize(group));
return pix; return pix;
} }
...@@ -64,7 +64,7 @@ void KWalletFolderItem::refresh() ...@@ -64,7 +64,7 @@ void KWalletFolderItem::refresh()
{ {
const QString saveFolder = _wallet->currentFolder(); const QString saveFolder = _wallet->currentFolder();
_wallet->setFolder(_name); _wallet->setFolder(_name);
setText(0, QString::fromLatin1("%1 (%2)").arg(_name).arg(_wallet->entryList().count())); setText(0, QStringLiteral("%1 (%2)").arg(_name).arg(_wallet->entryList().count()));
_wallet->setFolder(saveFolder); _wallet->setFolder(saveFolder);
} }
...@@ -82,7 +82,7 @@ void KWalletFolderItem::refreshItemsCount() ...@@ -82,7 +82,7 @@ void KWalletFolderItem::refreshItemsCount()
} }
} }
} }
setText(0, QString::fromLatin1("%1 (%2)").arg(_name).arg(visibleLeafCount)); setText(0, QStringLiteral("%1 (%2)").arg(_name).arg(visibleLeafCount));
} }
KWalletContainerItem *KWalletFolderItem::getContainer(KWallet::Wallet::EntryType type) KWalletContainerItem *KWalletFolderItem::getContainer(KWallet::Wallet::EntryType type)
...@@ -121,8 +121,8 @@ QTreeWidgetItem *KWalletFolderItem::getItem(const QString &key) ...@@ -121,8 +121,8 @@ QTreeWidgetItem *KWalletFolderItem::getItem(const QString &key)
bool KWalletFolderItem::acceptDrop(const QMimeData *mime) const bool KWalletFolderItem::acceptDrop(const QMimeData *mime) const
{ {
return mime->hasFormat("application/x-kwallet-entry") || return mime->hasFormat(QStringLiteral("application/x-kwallet-entry")) ||
mime->hasFormat("text/uri-list"); mime->hasFormat(QStringLiteral("text/uri-list"));
} }
QString KWalletFolderItem::name() const QString KWalletFolderItem::name() const
...@@ -295,8 +295,8 @@ void KWalletItem::processDropEvent(QDropEvent *e) ...@@ -295,8 +295,8 @@ void KWalletItem::processDropEvent(QDropEvent *e)
el = dynamic_cast<KWalletEntryList *>(e->source()->parent()); el = dynamic_cast<KWalletEntryList *>(e->source()->parent());
} }
if (e->mimeData()->hasFormat("application/x-kwallet-folder") || if (e->mimeData()->hasFormat(QStringLiteral("application/x-kwallet-folder")) ||
e->mimeData()->hasFormat("text/uri-list")) { e->mimeData()->hasFormat(QStringLiteral("text/uri-list"))) {
// FIXME: don't allow the drop if the wallet name is the same // FIXME: don't allow the drop if the wallet name is the same
KWallet::Wallet *_wallet = KWallet::Wallet::openWallet(text(), listWidget()->topLevelWidget()->winId()); KWallet::Wallet *_wallet = KWallet::Wallet::openWallet(text(), listWidget()->topLevelWidget()->winId());
if (!_wallet) { if (!_wallet) {
...@@ -308,8 +308,8 @@ void KWalletItem::processDropEvent(QDropEvent *e) ...@@ -308,8 +308,8 @@ void KWalletItem::processDropEvent(QDropEvent *e)
QByteArray data; QByteArray data;
if (e->mimeData()->hasFormat("application/x-kwallet-folder")) { if (e->mimeData()->hasFormat(QStringLiteral("application/x-kwallet-folder"))) {
data = e->mimeData()->data("application/x-kwallet-folder"); data = e->mimeData()->data(QStringLiteral("application/x-kwallet-folder"));
e->accept(); e->accept();
} else { // text/uri-list } else { // text/uri-list
const QList<QUrl> urls = e->mimeData()->urls(); const QList<QUrl> urls = e->mimeData()->urls();
...@@ -407,7 +407,7 @@ void KWalletEntryList::itemDropped(QDropEvent *e, QTreeWidgetItem *item) ...@@ -407,7 +407,7 @@ void KWalletEntryList::itemDropped(QDropEvent *e, QTreeWidgetItem *item)
} }
} }
if (e->mimeData()->hasFormat("application/x-kwallet-entry")) { if (e->mimeData()->hasFormat(QStringLiteral("application/x-kwallet-entry"))) {
//do nothing if we are in the same folder //do nothing if we are in the same folder
if (sel && sel->parent()->parent() == if (sel && sel->parent()->parent() ==
KWalletEntryList::getItemFolder(item)) { KWalletEntryList::getItemFolder(item)) {
...@@ -415,26 +415,26 @@ void KWalletEntryList::itemDropped(QDropEvent *e, QTreeWidgetItem *item) ...@@ -415,26 +415,26 @@ void KWalletEntryList::itemDropped(QDropEvent *e, QTreeWidgetItem *item)
return; return;
} }
isEntry = true; isEntry = true;
data = e->mimeData()->data("application/x-kwallet-entry"); data = e->mimeData()->data(QStringLiteral("application/x-kwallet-entry"));
if (data.isEmpty()) { if (data.isEmpty()) {
e->ignore(); e->ignore();
return; return;
} }
e->accept(); e->accept();
} else if (e->mimeData()->hasFormat("application/x-kwallet-folder")) { } else if (e->mimeData()->hasFormat(QStringLiteral("application/x-kwallet-folder"))) {
//do nothing if we are in the same wallet //do nothing if we are in the same wallet
if (this == el) { if (this == el) {
e->ignore(); e->ignore();
return; return;
} }
isEntry = false; isEntry = false;
data = e->mimeData()->data("application/x-kwallet-folder"); data = e->mimeData()->data(QStringLiteral("application/x-kwallet-folder"));
if (data.isEmpty()) { if (data.isEmpty()) {
e->ignore(); e->ignore();
return; return;
} }
e->accept(); e->accept();
} else if (e->mimeData()->hasFormat("text/uri-list")) { } else if (e->mimeData()->hasFormat(QStringLiteral("text/uri-list"))) {
const QList<QUrl> urls = e->mimeData()->urls(); const QList<QUrl> urls = e->mimeData()->urls();
if (urls.isEmpty()) { if (urls.isEmpty()) {
e->ignore(); e->ignore();
...@@ -549,7 +549,7 @@ QMimeData *KWalletEntryList::itemMimeData(const QTreeWidgetItem *i) const ...@@ -549,7 +549,7 @@ QMimeData *KWalletEntryList::itemMimeData(const QTreeWidgetItem *i) const
QByteArray value; QByteArray value;
ei->_wallet->readEntry(i->text(0), value); ei->_wallet->readEntry(i->text(0), value);
ds << value; ds << value;
sd->setData("application/x-kwallet-entry", a); sd->setData(QStringLiteral("application/x-kwallet-entry"), a);
} else if (i->type() == KWalletFolderItemClass) { } else if (i->type() == KWalletFolderItemClass) {
const KWalletFolderItem *fi = dynamic_cast<const KWalletFolderItem *>(i); const KWalletFolderItem *fi = dynamic_cast<const KWalletFolderItem *>(i);
if (!fi) { if (!fi) {
...@@ -563,7 +563,7 @@ QMimeData *KWalletEntryList::itemMimeData(const QTreeWidgetItem *i) const ...@@ -563,7 +563,7 @@ QMimeData *KWalletEntryList::itemMimeData(const QTreeWidgetItem *i) const
ds << KWALLETFOLDERMAGIC; ds << KWALLETFOLDERMAGIC;
ds << *fi; ds << *fi;
sd->setData("application/x-kwallet-folder", a); sd->setData(QStringLiteral("application/x-kwallet-folder"), a);
} }
return sd; return sd;
} }
...@@ -615,14 +615,14 @@ void KWalletEntryList::dragMoveEvent(QDragMoveEvent *e) ...@@ -615,14 +615,14 @@ void KWalletEntryList::dragMoveEvent(QDragMoveEvent *e)
QTreeWidgetItem *i = itemAt(e->pos()); QTreeWidgetItem *i = itemAt(e->pos());
e->ignore(); e->ignore();
if (i) { if (i) {
if (e->mimeData()->hasFormat("application/x-kwallet-entry") || if (e->mimeData()->hasFormat(QStringLiteral("application/x-kwallet-entry")) ||
e->mimeData()->hasFormat("text/uri-list")) { e->mimeData()->hasFormat(QStringLiteral("text/uri-list"))) {
e->accept(); e->accept();
} }
} }
if ((e->mimeData()->hasFormat("application/x-kwallet-folder") && if ((e->mimeData()->hasFormat(QStringLiteral("application/x-kwallet-folder")) &&
e->source() != viewport()) || e->source() != viewport()) ||
e->mimeData()->hasFormat("text/uri-list")) { e->mimeData()->hasFormat(QStringLiteral("text/uri-list"))) {
e->accept(); e->accept();
} }
} }
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
AuthorizedAppModel::AuthorizedAppModel(KWallet::Wallet *wallet): AuthorizedAppModel::AuthorizedAppModel(KWallet::Wallet *wallet):
QStandardItemModel(), QStandardItemModel(),
_cfg(KSharedConfig::openConfig(QLatin1String("kwalletrc"), KConfig::NoGlobals)), _cfg(KSharedConfig::openConfig(QStringLiteral("kwalletrc"), KConfig::NoGlobals)),
_wallet(wallet) _wallet(wallet)
{ {
// TODO: handle "Auto Deny" applications // TODO: handle "Auto Deny" applications
...@@ -41,7 +41,7 @@ AuthorizedAppModel::AuthorizedAppModel(KWallet::Wallet *wallet): ...@@ -41,7 +41,7 @@ AuthorizedAppModel::AuthorizedAppModel(KWallet::Wallet *wallet):
int row = 0; int row = 0;
Q_FOREACH(QString appName, apps) { Q_FOREACH(QString appName, apps) {
setItem(row, 0, new QStandardItem(appName)); setItem(row, 0, new QStandardItem(appName));
setItem(row, 1, new QStandardItem("dummy")); // this item will be hidden by the disconnect button, see below setIndexWidget call setItem(row, 1, new QStandardItem(QStringLiteral("dummy"))); // this item will be hidden by the disconnect button, see below setIndexWidget call
_authorizedAppsIndexMap.insert(appName, QPersistentModelIndex(index(row, 0))); _authorizedAppsIndexMap.insert(appName, QPersistentModelIndex(index(row, 0)));
row++; row++;
} }
......
...@@ -44,7 +44,7 @@ void ConnectedAppModel::refresh() ...@@ -44,7 +44,7 @@ void ConnectedAppModel::refresh()
item->setEditable(false); item->setEditable(false);
setItem(row, 0, item); setItem(row, 0, item);
// this item will be hidden by the disconnect button, see below setIndexWidget call // this item will be hidden by the disconnect button, see below setIndexWidget call
setItem(row, 1, new QStandardItem("dummy")); setItem(row, 1, new QStandardItem(QStringLiteral("dummy")));
_connectedAppsIndexMap.insert(appName, QPersistentModelIndex(index(row, 0))); _connectedAppsIndexMap.insert(appName, QPersistentModelIndex(index(row, 0)));
row++; row++;
} }
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
DisconnectAppButton::DisconnectAppButton(const QString &appName, KWallet::Wallet *wallet) : DisconnectAppButton::DisconnectAppButton(const QString &appName, KWallet::Wallet *wallet) :
_appName(appName), _wallet(wallet) _appName(appName), _wallet(wallet)
{ {
setObjectName(QString("Disconnect_%1").arg(appName)); setObjectName(QStringLiteral("Disconnect_%1").arg(appName));
setText(i18n("Disconnect")); setText(i18n("Disconnect"));
connect(this, &DisconnectAppButton::clicked, this, &DisconnectAppButton::onClicked); connect(this, &DisconnectAppButton::clicked, this, &DisconnectAppButton::onClicked);
} }
......
...@@ -86,8 +86,8 @@ KWalletEditor::KWalletEditor(QWidget *parent, const char *name) ...@@ -86,8 +86,8 @@ KWalletEditor::KWalletEditor(QWidget *parent, const char *name)
_splitter->setStretchFactor(1, 2); _splitter->setStretchFactor(1, 2);
_contextMenu = new QMenu(this); _contextMenu = new QMenu(this);
_undoChanges->setIcon(QIcon::fromTheme(QLatin1String("edit-undo"))); _undoChanges->setIcon(QIcon::fromTheme(QStringLiteral("edit-undo")));
_saveChanges->setIcon(QIcon::fromTheme(QLatin1String("document-save"))); _saveChanges->setIcon(QIcon::fromTheme(QStringLiteral("document-save")));
_hasUnsavedChanges = false; _hasUnsavedChanges = false;
QVBoxLayout *box = new QVBoxLayout(_entryListFrame); QVBoxLayout *box = new QVBoxLayout(_entryListFrame);
...@@ -196,47 +196,47 @@ KActionCollection *KWalletEditor::actionCollection() ...@@ -196,47 +196,47 @@ KActionCollection *KWalletEditor::actionCollection()
void KWalletEditor::createActions(KActionCollection *actionCollection) void KWalletEditor::createActions(KActionCollection *actionCollection)
{ {
_newFolderAction = actionCollection->addAction(QLatin1String("create_folder")); _newFolderAction = actionCollection->addAction(QStringLiteral("create_folder"));
_newFolderAction->setText(i18n("&New Folder...")); _newFolderAction->setText(i18n("&New Folder..."));
_newFolderAction->setIcon(QIcon::fromTheme(QLatin1String("folder-new"))); _newFolderAction->setIcon(QIcon::fromTheme(QStringLiteral("folder-new")));
_deleteFolderAction = actionCollection->addAction(QLatin1String("delete_folder")); _deleteFolderAction = actionCollection->addAction(QStringLiteral("delete_folder"));
_deleteFolderAction->setText(i18n("&Delete Folder")); _deleteFolderAction->setText(i18n("&Delete Folder"));
_mergeAction = actionCollection->addAction(QLatin1String("wallet_merge")); _mergeAction = actionCollection->addAction(QStringLiteral("wallet_merge"));
_mergeAction->setText(i18n("&Import a wallet...")); _mergeAction->setText(i18n("&Import a wallet..."));
_importAction = actionCollection->addAction(QLatin1String("wallet_import")); _importAction = actionCollection->addAction(QStringLiteral("wallet_import"));
_importAction->setText(i18n("&Import XML...")); _importAction->setText(i18n("&Import XML..."));
_exportAction = actionCollection->addAction(QLatin1String("wallet_export")); _exportAction = actionCollection->addAction(QStringLiteral("wallet_export"));
_exportAction->setText(i18n("&Export as XML...")); _exportAction->setText(i18n("&Export as XML..."));
_copyPassAction = actionCollection->addAction(QLatin1String("copy_action")); _copyPassAction = actionCollection->addAction(QStringLiteral("copy_action"));
_copyPassAction->setText(i18n("&Copy")); _copyPassAction->setText(i18n("&Copy"));
actionCollection->setDefaultShortcut(_copyPassAction, Qt::Key_C + Qt::CTRL); actionCollection->setDefaultShortcut(_copyPassAction, Qt::Key_C + Qt::CTRL);
_copyPassAction->setEnabled(false); _copyPassAction->setEnabled(false);
_newEntryAction = actionCollection->addAction(QLatin1String("new_entry")); _newEntryAction = actionCollection->addAction(QStringLiteral("new_entry"));
_newEntryAction->setText(i18n("&New...")); _newEntryAction->setText(i18n("&New..."));
actionCollection->setDefaultShortcut(_newEntryAction, Qt::Key_Insert); actionCollection->setDefaultShortcut(_newEntryAction, Qt::Key_Insert);
_newEntryAction->setEnabled(false); _newEntryAction->setEnabled(false);
_renameEntryAction = actionCollection->addAction(QLatin1String("rename_entry")); _renameEntryAction = actionCollection->addAction(QStringLiteral("rename_entry"));
_renameEntryAction->setText(i18n("&Rename")); _renameEntryAction->setText(i18n("&Rename"));
actionCollection->setDefaultShortcut(_renameEntryAction, Qt::Key_F2); actionCollection->setDefaultShortcut(_renameEntryAction, Qt::Key_F2);
_renameEntryAction->setEnabled(false); _renameEntryAction->setEnabled(false);
_deleteEntryAction = actionCollection->addAction(QLatin1String("delete_entry")); _deleteEntryAction = actionCollection->addAction(QStringLiteral("delete_entry"));
_deleteEntryAction->setText(i18n("&Delete")); _deleteEntryAction->setText(i18n("&Delete"));
actionCollection->setDefaultShortcut(_deleteEntryAction, Qt::Key_Delete); actionCollection->setDefaultShortcut(_deleteEntryAction, Qt::Key_Delete);
_deleteEntryAction->setEnabled(false); _deleteEntryAction->setEnabled(false);
_alwaysShowContentsAction = actionCollection->addAction(QLatin1String("always_show_contents")); _alwaysShowContentsAction = actionCollection->addAction(QStringLiteral("always_show_contents"));
_alwaysShowContentsAction->setText(i18n("Always show contents")); _alwaysShowContentsAction->setText(i18n("Always show contents"));
_alwaysShowContentsAction->setCheckable(true); _alwaysShowContentsAction->setCheckable(true);
_alwaysHideContentsAction = actionCollection->addAction(QLatin1String("always_hide_contents")); _alwaysHideContentsAction = actionCollection->addAction(QStringLiteral("always_hide_contents"));
_alwaysHideContentsAction->setText(i18n("Always hide contents")); _alwaysHideContentsAction->setText(i18n("Always hide contents"));
_alwaysHideContentsAction->setCheckable(true); _alwaysHideContentsAction->setCheckable(true);
} }
...@@ -623,7 +623,7 @@ void KWalletEditor::entrySelectionChanged(QTreeWidgetItem *item) ...@@ -623,7 +623,7 @@ void KWalletEditor::entrySelectionChanged(QTreeWidgetItem *item)
if (fi) { if (fi) {
_currentFolder = fi->name(); _currentFolder = fi->name();
_entryTitle->setText(QString::fromLatin1("<font size=\"+1\">%1</font>").arg(fi->text(0))); _entryTitle->setText(QStringLiteral("<font size=\"+1\">%1</font>").arg(fi->text(0)));
_iconTitle->setPixmap(fi->getFolderIcon(KIconLoader::Toolbar)); _iconTitle->setPixmap(fi->getFolderIcon(KIconLoader::Toolbar));
} }
...@@ -716,7 +716,7 @@ void KWalletEditor::updateEntries(const QString &folder) ...@@ -716,7 +716,7 @@ void KWalletEditor::updateEntries(const QString &folder)
} }
fi->refresh(); fi->refresh();
if (fi->name() == _currentFolder) { if (fi->name() == _currentFolder) {
_entryTitle->setText(QString::fromLatin1("<font size=\"+1\">%1</font>").arg(fi->text(0))); _entryTitle->setText(QStringLiteral("<font size=\"+1\">%1</font>").arg(fi->text(0)));
} }
if (!_entryList->currentItem()) { if (!_entryList->currentItem()) {
_entryName->clear(); _entryName->clear();
...@@ -823,7 +823,7 @@ void KWalletEditor::newEntry() ...@@ -823,7 +823,7 @@ void KWalletEditor::newEntry()
_entryList->scrollToItem(ni); _entryList->scrollToItem(ni);
fi->refresh(); fi->refresh();
_entryTitle->setText(QString::fromLatin1("<font size=\"+1\">%1</font>").arg(fi->text(0))); _entryTitle->setText(QStringLiteral("<font size=\"+1\">%1</font>").arg(fi->text(0)));
} }
} }
...@@ -889,7 +889,7 @@ void KWalletEditor::deleteEntry() ...@@ -889,7 +889,7 @@ void KWalletEditor::deleteEntry()
delete item; delete item;
entrySelectionChanged(_entryList->currentItem()); entrySelectionChanged(_entryList->currentItem());
fi->refresh(); fi->refresh();
_entryTitle->setText(QString::fromLatin1("<font size=\"+1\">%1</font>").arg(fi->text(0))); _entryTitle->setText(QStringLiteral("<font size=\"+1\">%1</font>").arg(fi->text(0)));
} }
} }
} }
...@@ -937,7 +937,7 @@ enum MergePlan { Prompt = 0, Always = 1, Never = 2, Yes = 3, No = 4 }; ...@@ -937,7 +937,7 @@ enum MergePlan { Prompt = 0, Always = 1, Never = 2, Yes = 3, No = 4 };
void KWalletEditor::importWallet() void KWalletEditor::importWallet()
{ {
QUrl url = QFileDialog::getOpenFileUrl(this, QString(), QUrl(), QLatin1String("*.kwl")); QUrl url = QFileDialog::getOpenFileUrl(this, QString(), QUrl(), QStringLiteral("*.kwl"));
if (url.isEmpty()) { if (url.isEmpty()) {
return; return;
...@@ -976,7 +976,7 @@ void KWalletEditor::importWallet() ...@@ -976,7 +976,7 @@ void KWalletEditor::importWallet()
QMap<QString, QMap<QString, QString> > map; QMap<QString, QMap<QString, QString> > map;
QSet<QString> mergedkeys; // prevents re-merging already merged entries. QSet<QString> mergedkeys; // prevents re-merging already merged entries.
int rc; int rc;
rc = w->readMapList(QLatin1String("*"), map); rc = w->readMapList(QStringLiteral("*"), map);
if (rc == 0) { if (rc == 0) {
QMap<QString, QMap<QString, QString> >::ConstIterator me; QMap<QString, QMap<QString, QString> >::ConstIterator me;
for (me = map.constBegin(); me != map.constEnd(); ++me) { for (me = map.constBegin(); me != map.constEnd(); ++me) {
...@@ -1007,7 +1007,7 @@ void KWalletEditor::importWallet() ...@@ -1007,7 +1007,7 @@ void KWalletEditor::importWallet()
} }
QMap<QString, QString> pwd; QMap<QString, QString> pwd;
rc = w->readPasswordList(QLatin1String("*"), pwd); rc = w->readPasswordList(QStringLiteral("*"), pwd);
if (rc == 0) { if (rc == 0) {
QMap<QString, QString>::ConstIterator pe; QMap<QString, QString>::ConstIterator pe;
for (pe = pwd.constBegin(); pe != pwd.constEnd(); ++pe) { for (pe = pwd.constBegin(); pe != pwd.constEnd(); ++pe) {
...@@ -1038,7 +1038,7 @@ void KWalletEditor::importWallet() ...@@ -1038,7 +1038,7 @@ void KWalletEditor::importWallet()
} }
QMap<QString, QByteArray> ent; QMap<QString, QByteArray> ent;
rc = w->readEntryList(QLatin1String("*"), ent); rc = w->readEntryList(QStringLiteral("*"), ent);
if (rc == 0) { if (rc == 0) {
QMap<QString, QByteArray>::ConstIterator ee; QMap<QString, QByteArray>::ConstIterator ee;
for (ee = ent.constBegin(); ee != ent.constEnd(); ++ee) { for (ee = ent.constBegin(); ee != ent.constEnd(); ++ee) {
...@@ -1081,7 +1081,7 @@ void KWalletEditor::importWallet() ...@@ -1081,7 +1081,7 @@ void KWalletEditor::importWallet()
void KWalletEditor::importXML() void KWalletEditor::importXML()
{ {
QUrl url = QFileDialog::getOpenFileUrl(this, QString(), QUrl(), QLatin1String("*.xml")); QUrl url = QFileDialog::getOpenFileUrl(this, QString(), QUrl(), QStringLiteral("*.xml"));
if (url.isEmpty()) { if (url.isEmpty()) {
return; return;
...@@ -1115,7 +1115,7 @@ void KWalletEditor::importXML() ...@@ -1115,7 +1115,7 @@ void KWalletEditor::importXML()
continue; continue;
} }
QString fname = e.attribute(QLatin1String("name")); QString fname = e.attribute(QStringLiteral("name"));
if (fname.isEmpty()) { if (fname.isEmpty()) {
n = n.nextSibling(); n = n.nextSibling();
continue; continue;
...@@ -1128,7 +1128,7 @@ void KWalletEditor::importXML() ...@@ -1128,7 +1128,7 @@ void KWalletEditor::importXML()
while (!enode.isNull()) { while (!enode.isNull()) {
e = enode.toElement(); e = enode.toElement();
QString type = e.tagName().toLower(); QString type = e.tagName().toLower();
QString ename = e.attribute(QLatin1String("name")); QString ename = e.attribute(QStringLiteral("name"));
bool hasEntry = _w->hasEntry(ename); bool hasEntry = _w->hasEntry(ename);
if (hasEntry && mp == Prompt) { if (hasEntry && mp == Prompt) {