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>();)
KWalletConfig::KWalletConfig(QWidget *parent, const QVariantList &args)
: KCModule(parent, args),
_cfg(KSharedConfig::openConfig(QLatin1String("kwalletrc"), KConfig::NoGlobals))
_cfg(KSharedConfig::openConfig(QStringLiteral("kwalletrc"), KConfig::NoGlobals))
{
KAboutData *about = new KAboutData(QStringLiteral("kcmkwallet5"),
i18n("KDE Wallet Control Module"),
......@@ -87,7 +87,7 @@ KWalletConfig::KWalletConfig(QWidget *parent, const QVariantList &args)
_wcw->_accessList->setContextMenuPolicy(Qt::CustomContextMenu);
updateWalletLists();
if (QDBusConnection::sessionBus().interface()->isServiceRegistered(QLatin1String("org.kde.kwalletmanager"))) {
if (QDBusConnection::sessionBus().interface()->isServiceRegistered(QStringLiteral("org.kde.kwalletmanager"))) {
_wcw->_launch->hide();
}
......@@ -172,12 +172,12 @@ void KWalletConfig::newNetworkWallet()
void KWalletConfig::launchManager()
{
if (!QDBusConnection::sessionBus().interface()->isServiceRegistered(QLatin1String("org.kde.kwalletmanager5"))) {
QProcess::startDetached(QLatin1String("kwalletmanager5 --show"));
if (!QDBusConnection::sessionBus().interface()->isServiceRegistered(QStringLiteral("org.kde.kwalletmanager5"))) {
QProcess::startDetached(QStringLiteral("kwalletmanager5 --show"));
} else {
QDBusInterface kwalletd(QLatin1String("org.kde.kwalletmanager5"), QLatin1String("/kwalletmanager5/MainWindow_1"));
kwalletd.call(QLatin1String("show"));
kwalletd.call(QLatin1String("raise"));
QDBusInterface kwalletd(QStringLiteral("org.kde.kwalletmanager5"), QStringLiteral("/kwalletmanager5/MainWindow_1"));
kwalletd.call(QStringLiteral("show"));
kwalletd.call(QStringLiteral("raise"));
}
}
......@@ -228,13 +228,13 @@ void KWalletConfig::load()
// perform cleanup in the kwalletrc file, by removing entries that correspond to non-existent
// (previously deleted, for example) wallets
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 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);
KConfigGroup cfgDeny = KSharedConfig::openConfig("kwalletrc")->group("Auto Deny");
KConfigGroup cfgDeny = KSharedConfig::openConfig(QStringLiteral("kwalletrc"))->group("Auto Deny");
cfgDeny.deleteEntry(walletName);
continue;
}
......@@ -338,12 +338,12 @@ void KWalletConfig::save()
_cfg->sync();
// 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
// the status before invoking reconfigure
if (kwalletd.isValid()) {
// this will eventually make kwalletd exit upon deactivation
kwalletd.call(QLatin1String("reconfigure"));
kwalletd.call(QStringLiteral("reconfigure"));
}
emit changed(false);
......
......@@ -42,7 +42,7 @@
KWalletFolderItem::KWalletFolderItem(KWallet::Wallet *w, QTreeWidget *parent, const QString &name, int 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);
setIcon(0, getFolderIcon(KIconLoader::Small));
}
......@@ -55,7 +55,7 @@ QPixmap KWalletFolderItem::getFolderIcon(KIconLoader::Group group)
pix = QIcon::fromTheme(_name.toLower()).pixmap(IconSize(group), IconSize(group));
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;
}
......@@ -64,7 +64,7 @@ void KWalletFolderItem::refresh()
{
const QString saveFolder = _wallet->currentFolder();
_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);
}
......@@ -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)
......@@ -121,8 +121,8 @@ QTreeWidgetItem *KWalletFolderItem::getItem(const QString &key)
bool KWalletFolderItem::acceptDrop(const QMimeData *mime) const
{
return mime->hasFormat("application/x-kwallet-entry") ||
mime->hasFormat("text/uri-list");
return mime->hasFormat(QStringLiteral("application/x-kwallet-entry")) ||
mime->hasFormat(QStringLiteral("text/uri-list"));
}
QString KWalletFolderItem::name() const
......@@ -295,8 +295,8 @@ void KWalletItem::processDropEvent(QDropEvent *e)
el = dynamic_cast<KWalletEntryList *>(e->source()->parent());
}
if (e->mimeData()->hasFormat("application/x-kwallet-folder") ||
e->mimeData()->hasFormat("text/uri-list")) {
if (e->mimeData()->hasFormat(QStringLiteral("application/x-kwallet-folder")) ||
e->mimeData()->hasFormat(QStringLiteral("text/uri-list"))) {
// FIXME: don't allow the drop if the wallet name is the same
KWallet::Wallet *_wallet = KWallet::Wallet::openWallet(text(), listWidget()->topLevelWidget()->winId());
if (!_wallet) {
......@@ -308,8 +308,8 @@ void KWalletItem::processDropEvent(QDropEvent *e)
QByteArray data;
if (e->mimeData()->hasFormat("application/x-kwallet-folder")) {
data = e->mimeData()->data("application/x-kwallet-folder");
if (e->mimeData()->hasFormat(QStringLiteral("application/x-kwallet-folder"))) {
data = e->mimeData()->data(QStringLiteral("application/x-kwallet-folder"));
e->accept();
} else { // text/uri-list
const QList<QUrl> urls = e->mimeData()->urls();
......@@ -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
if (sel && sel->parent()->parent() ==
KWalletEntryList::getItemFolder(item)) {
......@@ -415,26 +415,26 @@ void KWalletEntryList::itemDropped(QDropEvent *e, QTreeWidgetItem *item)
return;
}
isEntry = true;
data = e->mimeData()->data("application/x-kwallet-entry");
data = e->mimeData()->data(QStringLiteral("application/x-kwallet-entry"));
if (data.isEmpty()) {
e->ignore();
return;
}
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
if (this == el) {
e->ignore();
return;
}
isEntry = false;
data = e->mimeData()->data("application/x-kwallet-folder");
data = e->mimeData()->data(QStringLiteral("application/x-kwallet-folder"));
if (data.isEmpty()) {
e->ignore();
return;
}
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();
if (urls.isEmpty()) {
e->ignore();
......@@ -549,7 +549,7 @@ QMimeData *KWalletEntryList::itemMimeData(const QTreeWidgetItem *i) const
QByteArray value;
ei->_wallet->readEntry(i->text(0), value);
ds << value;
sd->setData("application/x-kwallet-entry", a);
sd->setData(QStringLiteral("application/x-kwallet-entry"), a);
} else if (i->type() == KWalletFolderItemClass) {
const KWalletFolderItem *fi = dynamic_cast<const KWalletFolderItem *>(i);
if (!fi) {
......@@ -563,7 +563,7 @@ QMimeData *KWalletEntryList::itemMimeData(const QTreeWidgetItem *i) const
ds << KWALLETFOLDERMAGIC;
ds << *fi;
sd->setData("application/x-kwallet-folder", a);
sd->setData(QStringLiteral("application/x-kwallet-folder"), a);
}
return sd;
}
......@@ -615,14 +615,14 @@ void KWalletEntryList::dragMoveEvent(QDragMoveEvent *e)
QTreeWidgetItem *i = itemAt(e->pos());
e->ignore();
if (i) {
if (e->mimeData()->hasFormat("application/x-kwallet-entry") ||
e->mimeData()->hasFormat("text/uri-list")) {
if (e->mimeData()->hasFormat(QStringLiteral("application/x-kwallet-entry")) ||
e->mimeData()->hasFormat(QStringLiteral("text/uri-list"))) {
e->accept();
}
}
if ((e->mimeData()->hasFormat("application/x-kwallet-folder") &&
if ((e->mimeData()->hasFormat(QStringLiteral("application/x-kwallet-folder")) &&
e->source() != viewport()) ||
e->mimeData()->hasFormat("text/uri-list")) {
e->mimeData()->hasFormat(QStringLiteral("text/uri-list"))) {
e->accept();
}
}
......
......@@ -26,7 +26,7 @@
AuthorizedAppModel::AuthorizedAppModel(KWallet::Wallet *wallet):
QStandardItemModel(),
_cfg(KSharedConfig::openConfig(QLatin1String("kwalletrc"), KConfig::NoGlobals)),
_cfg(KSharedConfig::openConfig(QStringLiteral("kwalletrc"), KConfig::NoGlobals)),
_wallet(wallet)
{
// TODO: handle "Auto Deny" applications
......@@ -41,7 +41,7 @@ AuthorizedAppModel::AuthorizedAppModel(KWallet::Wallet *wallet):
int row = 0;
Q_FOREACH(QString appName, apps) {
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)));
row++;
}
......
......@@ -44,7 +44,7 @@ void ConnectedAppModel::refresh()
item->setEditable(false);
setItem(row, 0, item);
// 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)));
row++;
}
......
......@@ -25,7 +25,7 @@
DisconnectAppButton::DisconnectAppButton(const QString &appName, KWallet::Wallet *wallet) :
_appName(appName), _wallet(wallet)
{
setObjectName(QString("Disconnect_%1").arg(appName));
setObjectName(QStringLiteral("Disconnect_%1").arg(appName));
setText(i18n("Disconnect"));
connect(this, &DisconnectAppButton::clicked, this, &DisconnectAppButton::onClicked);
}
......
......@@ -86,8 +86,8 @@ KWalletEditor::KWalletEditor(QWidget *parent, const char *name)
_splitter->setStretchFactor(1, 2);
_contextMenu = new QMenu(this);
_undoChanges->setIcon(QIcon::fromTheme(QLatin1String("edit-undo")));
_saveChanges->setIcon(QIcon::fromTheme(QLatin1String("document-save")));
_undoChanges->setIcon(QIcon::fromTheme(QStringLiteral("edit-undo")));
_saveChanges->setIcon(QIcon::fromTheme(QStringLiteral("document-save")));
_hasUnsavedChanges = false;
QVBoxLayout *box = new QVBoxLayout(_entryListFrame);
......@@ -196,47 +196,47 @@ KActionCollection *KWalletEditor::actionCollection()
void KWalletEditor::createActions(KActionCollection *actionCollection)
{
_newFolderAction = actionCollection->addAction(QLatin1String("create_folder"));
_newFolderAction = actionCollection->addAction(QStringLiteral("create_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"));
_mergeAction = actionCollection->addAction(QLatin1String("wallet_merge"));
_mergeAction = actionCollection->addAction(QStringLiteral("wallet_merge"));
_mergeAction->setText(i18n("&Import a wallet..."));
_importAction = actionCollection->addAction(QLatin1String("wallet_import"));
_importAction = actionCollection->addAction(QStringLiteral("wallet_import"));
_importAction->setText(i18n("&Import XML..."));
_exportAction = actionCollection->addAction(QLatin1String("wallet_export"));
_exportAction = actionCollection->addAction(QStringLiteral("wallet_export"));
_exportAction->setText(i18n("&Export as XML..."));
_copyPassAction = actionCollection->addAction(QLatin1String("copy_action"));
_copyPassAction = actionCollection->addAction(QStringLiteral("copy_action"));
_copyPassAction->setText(i18n("&Copy"));
actionCollection->setDefaultShortcut(_copyPassAction, Qt::Key_C + Qt::CTRL);
_copyPassAction->setEnabled(false);
_newEntryAction = actionCollection->addAction(QLatin1String("new_entry"));
_newEntryAction = actionCollection->addAction(QStringLiteral("new_entry"));
_newEntryAction->setText(i18n("&New..."));
actionCollection->setDefaultShortcut(_newEntryAction, Qt::Key_Insert);
_newEntryAction->setEnabled(false);
_renameEntryAction = actionCollection->addAction(QLatin1String("rename_entry"));
_renameEntryAction = actionCollection->addAction(QStringLiteral("rename_entry"));
_renameEntryAction->setText(i18n("&Rename"));
actionCollection->setDefaultShortcut(_renameEntryAction, Qt::Key_F2);
_renameEntryAction->setEnabled(false);
_deleteEntryAction = actionCollection->addAction(QLatin1String("delete_entry"));
_deleteEntryAction = actionCollection->addAction(QStringLiteral("delete_entry"));
_deleteEntryAction->setText(i18n("&Delete"));
actionCollection->setDefaultShortcut(_deleteEntryAction, Qt::Key_Delete);
_deleteEntryAction->setEnabled(false);
_alwaysShowContentsAction = actionCollection->addAction(QLatin1String("always_show_contents"));
_alwaysShowContentsAction = actionCollection->addAction(QStringLiteral("always_show_contents"));
_alwaysShowContentsAction->setText(i18n("Always show contents"));
_alwaysShowContentsAction->setCheckable(true);
_alwaysHideContentsAction = actionCollection->addAction(QLatin1String("always_hide_contents"));
_alwaysHideContentsAction = actionCollection->addAction(QStringLiteral("always_hide_contents"));
_alwaysHideContentsAction->setText(i18n("Always hide contents"));
_alwaysHideContentsAction->setCheckable(true);
}
......@@ -623,7 +623,7 @@ void KWalletEditor::entrySelectionChanged(QTreeWidgetItem *item)
if (fi) {
_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));
}
......@@ -716,7 +716,7 @@ void KWalletEditor::updateEntries(const QString &folder)
}
fi->refresh();
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()) {
_entryName->clear();
......@@ -823,7 +823,7 @@ void KWalletEditor::newEntry()
_entryList->scrollToItem(ni);
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()
delete item;
entrySelectionChanged(_entryList->currentItem());
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 };
void KWalletEditor::importWallet()
{
QUrl url = QFileDialog::getOpenFileUrl(this, QString(), QUrl(), QLatin1String("*.kwl"));
QUrl url = QFileDialog::getOpenFileUrl(this, QString(), QUrl(), QStringLiteral("*.kwl"));
if (url.isEmpty()) {
return;
......@@ -976,7 +976,7 @@ void KWalletEditor::importWallet()
QMap<QString, QMap<QString, QString> > map;
QSet<QString> mergedkeys; // prevents re-merging already merged entries.
int rc;
rc = w->readMapList(QLatin1String("*"), map);
rc = w->readMapList(QStringLiteral("*"), map);
if (rc == 0) {
QMap<QString, QMap<QString, QString> >::ConstIterator me;
for (me = map.constBegin(); me != map.constEnd(); ++me) {
......@@ -1007,7 +1007,7 @@ void KWalletEditor::importWallet()
}
QMap<QString, QString> pwd;
rc = w->readPasswordList(QLatin1String("*"), pwd);
rc = w->readPasswordList(QStringLiteral("*"), pwd);
if (rc == 0) {
QMap<QString, QString>::ConstIterator pe;
for (pe = pwd.constBegin(); pe != pwd.constEnd(); ++pe) {
......@@ -1038,7 +1038,7 @@ void KWalletEditor::importWallet()
}
QMap<QString, QByteArray> ent;
rc = w->readEntryList(QLatin1String("*"), ent);
rc = w->readEntryList(QStringLiteral("*"), ent);
if (rc == 0) {
QMap<QString, QByteArray>::ConstIterator ee;
for (ee = ent.constBegin(); ee != ent.constEnd(); ++ee) {
......@@ -1081,7 +1081,7 @@ void KWalletEditor::importWallet()
void KWalletEditor::importXML()
{
QUrl url = QFileDialog::getOpenFileUrl(this, QString(), QUrl(), QLatin1String("*.xml"));
QUrl url = QFileDialog::getOpenFileUrl(this, QString(), QUrl(), QStringLiteral("*.xml"));
if (url.isEmpty()) {
return;
......@@ -1115,7 +1115,7 @@ void KWalletEditor::importXML()
continue;
}
QString fname = e.attribute(QLatin1String("name"));
QString fname = e.attribute(QStringLiteral("name"));
if (fname.isEmpty()) {
n = n.nextSibling();
continue;
......@@ -1128,7 +1128,7 @@ void KWalletEditor::importXML()
while (!enode.isNull()) {
e = enode.toElement();
QString type = e.tagName().toLower();
QString ename = e.attribute(QLatin1String("name"));
QString ename = e.attribute(QStringLiteral("name"));
bool hasEntry = _w->hasEntry(ename);
if (hasEntry && mp == Prompt) {
KBetterThanKDialogBase *bd;
......@@ -1162,7 +1162,7 @@ void KWalletEditor::importXML()
while (!mapNode.isNull()) {
QDomElement mape = mapNode.toElement();
if (mape.tagName().toLower() == QLatin1String("mapentry")) {
map[mape.attribute(QLatin1String("name"))] = mape.text();
map[mape.attribute(QStringLiteral("name"))] = mape.text();
}
mapNode = mapNode.nextSibling();
}
......@@ -1186,11 +1186,11 @@ void KWalletEditor::exportXML()
xml.writeStartDocument();
const QStringList fl = _w->folderList();
xml.writeStartElement(QLatin1String("wallet"));
xml.writeAttribute(QLatin1String("name"), _walletName);
xml.writeStartElement(QStringLiteral("wallet"));
xml.writeAttribute(QStringLiteral("name"), _walletName);
for (QStringList::const_iterator i = fl.constBegin(); i != fl.constEnd(); ++i) {
xml.writeStartElement(QLatin1String("folder"));
xml.writeAttribute(QLatin1String("name"), *i);
xml.writeStartElement(QStringLiteral("folder"));
xml.writeAttribute(QStringLiteral("name"), *i);
_w->setFolder(*i);
QStringList entries = _w->entryList();
for (QStringList::const_iterator j = entries.constBegin(); j != entries.constEnd(); ++j) {
......@@ -1198,8 +1198,8 @@ void KWalletEditor::exportXML()
case KWallet::Wallet::Password: {
QString pass;
if (_w->readPassword(*j, pass) == 0) {
xml.writeStartElement(QLatin1String("password"));
xml.writeAttribute(QLatin1String("name"), *j);
xml.writeStartElement(QStringLiteral("password"));
xml.writeAttribute(QStringLiteral("name"), *j);
xml.writeCharacters(pass);
xml.writeEndElement();
}
......@@ -1208,8 +1208,8 @@ void KWalletEditor::exportXML()
case KWallet::Wallet::Stream: {
QByteArray ba;
if (_w->readEntry(*j, ba) == 0) {
xml.writeStartElement(QLatin1String("stream"));
xml.writeAttribute(QLatin1String("name"), *j);
xml.writeStartElement(QStringLiteral("stream"));
xml.writeAttribute(QStringLiteral("name"), *j);
xml.writeCharacters(QLatin1String(KCodecs::base64Encode(ba)));
xml.writeEndElement();
}
......@@ -1218,11 +1218,11 @@ void KWalletEditor::exportXML()
case KWallet::Wallet::Map: {
QMap<QString, QString> map;
if (_w->readMap(*j, map) == 0) {
xml.writeStartElement(QLatin1String("map"));
xml.writeAttribute(QLatin1String("name"), *j);
xml.writeStartElement(QStringLiteral("map"));
xml.writeAttribute(QStringLiteral("name"), *j);
for (QMap<QString, QString>::ConstIterator k = map.constBegin(); k != map.constEnd(); ++k) {
xml.writeStartElement(QLatin1String("mapentry"));
xml.writeAttribute(QLatin1String("name"), k.key());
xml.writeStartElement(QStringLiteral("mapentry"));
xml.writeAttribute(QStringLiteral("name"), k.key());
xml.writeCharacters(k.value());
xml.writeEndElement();
}
......@@ -1242,7 +1242,7 @@ void KWalletEditor::exportXML()
xml.writeEndDocument();
tf.flush();
QUrl url = QFileDialog::getSaveFileUrl(this, QString(), QUrl(), QLatin1String("*.xml"));
QUrl url = QFileDialog::getSaveFileUrl(this, QString(), QUrl(), QStringLiteral("*.xml"));
if (url.isEmpty()) {
return;
......
......@@ -62,7 +62,7 @@ KWalletManager::KWalletManager(QWidget *parent, const char *name, Qt::WindowFlag
}
void KWalletManager::beginConfiguration() {
KConfig cfg(QLatin1String("kwalletrc")); // not sure why this setting isn't in kwalletmanagerrc...
KConfig cfg(QStringLiteral("kwalletrc")); // not sure why this setting isn't in kwalletmanagerrc...
KConfigGroup walletConfigGroup(&cfg, "Wallet");
if (walletConfigGroup.readEntry("Enabled", true)){
QTimer::singleShot(0, this, SLOT(configUI()));
......@@ -79,23 +79,23 @@ void KWalletManager::beginConfiguration() {
}
void KWalletManager::configUI() {
QDBusConnection::sessionBus().registerObject(QLatin1String("/KWalletManager"), this, QDBusConnection::ExportScriptableSlots);
KConfig cfg(QLatin1String("kwalletrc")); // not sure why this setting isn't in kwalletmanagerrc...
QDBusConnection::sessionBus().registerObject(QStringLiteral("/KWalletManager"), this, QDBusConnection::ExportScriptableSlots);
KConfig cfg(QStringLiteral("kwalletrc")); // not sure why this setting isn't in kwalletmanagerrc...
KConfigGroup walletConfigGroup(&cfg, "Wallet");
if (walletConfigGroup.readEntry("Launch Manager", false)) {
_tray = new KStatusNotifierItem(this);
_tray->setObjectName(QLatin1String("kwalletmanager tray"));
_tray->setObjectName(QStringLiteral("kwalletmanager tray"));
_tray->setCategory(KStatusNotifierItem::SystemServices);
_tray->setStatus(KStatusNotifierItem::Passive);
_tray->setIconByName(QLatin1String("wallet-closed"));
_tray->setToolTip(QLatin1String("wallet-closed"), i18n("Wallet"), i18n("No wallets open."));
_tray->setIconByName(QStringLiteral("wallet-closed"));
_tray->setToolTip(QStringLiteral("wallet-closed"), i18n("Wallet"), i18n("No wallets open."));
//connect(_tray, SIGNAL(quitSelected()), SLOT(shuttingDown()));
const QStringList wl = KWallet::Wallet::walletList();
bool isOpen = false;
for (QStringList::ConstIterator it = wl.begin(); it != wl.end(); ++it) {
if (KWallet::Wallet::isOpen(*it)) {
_tray->setIconByName(QLatin1String("wallet-open"));
_tray->setToolTip(QLatin1String("wallet-open"), i18n("Wallet"), i18n("A wallet is open."));
_tray->setIconByName(QStringLiteral("wallet-open"));
_tray->setToolTip(QStringLiteral("wallet-open"), i18n("Wallet"), i18n("A wallet is open."));
isOpen = true;
break;
}
......@@ -114,11 +114,11 @@ void KWalletManager::configUI() {
updateWalletDisplay();
setCentralWidget(_managerWidget);
setAutoSaveSettings(QLatin1String("MainWindow"), true);
setAutoSaveSettings(QStringLiteral("MainWindow"), true);
QFontMetrics fm = fontMetrics();
_managerWidget->setMinimumSize(16*fm.height(), 18*fm.height());
m_kwalletdModule = new org::kde::KWallet(QLatin1String("org.kde.kwalletd5"), QLatin1String("/modules/kwalletd5"), QDBusConnection::sessionBus());
m_kwalletdModule = new org::kde::KWallet(QStringLiteral("org.kde.kwalletd5"), QStringLiteral("/modules/kwalletd5"), QDBusConnection::sessionBus());
connect(QDBusConnection::sessionBus().interface(), SIGNAL(serviceOwnerChanged(QString,QString,QString)), this,
SLOT(possiblyRescan(QString,QString,QString)));
connect(m_kwalletdModule, &OrgKdeKWalletInterface::allWalletsClosed, this, &KWalletManager::allWalletsClosed);
......@@ -133,39 +133,39 @@ void KWalletManager::configUI() {
// wallet closes before we are done opening. We will then stay
// open. Must check that a wallet is still open here.
QAction *action = actionCollection()->addAction(QLatin1String("wallet_create"));
QAction *action = actionCollection()->addAction(QStringLiteral("wallet_create"));
action->setText(i18n("&New Wallet..."));
action->setIcon(QIcon::fromTheme(QLatin1String("kwalletmanager")));
action->setIcon(QIcon::fromTheme(QStringLiteral("kwalletmanager")));
connect(action, SIGNAL(triggered()), SLOT(createWallet()));
action = actionCollection()->addAction(QLatin1String("wallet_open"));
action = actionCollection()->addAction(QStringLiteral("wallet_open"));
action->setText(i18n("Open Wallet..."));
connect(action, SIGNAL(triggered()), this, SLOT(openWallet()));
action = actionCollection()->addAction(QLatin1String("wallet_delete"));
action = actionCollection()->addAction(QStringLiteral("wallet_delete"));
action->setText(i18n("&Delete Wallet..."));
action->setIcon(QIcon::fromTheme(QLatin1String("trash-empty")));
action->setIcon(QIcon::fromTheme(QStringLiteral("trash-empty")));
connect(action, &QAction::triggered, this, &KWalletManager::deleteWallet);
_walletsExportAction = actionCollection()->addAction("wallet_export_encrypted");
_walletsExportAction = actionCollection()->addAction(QStringLiteral("wallet_export_encrypted"));
_walletsExportAction->setText(i18n("Export as encrypted"));
_walletsExportAction->setIcon(QIcon::fromTheme("document-export"));
_walletsExportAction->setIcon(QIcon::fromTheme(QStringLiteral("document-export")));
connect(_walletsExportAction, &QAction::triggered, this, &KWalletManager::exportWallets);
action = actionCollection()->addAction("wallet_import_encrypted");
action = actionCollection()->addAction(QStringLiteral("wallet_import_encrypted"));
action->setText(i18n("&Import encrypted"));
action->setIcon(QIcon::fromTheme("document-import"));
action->setIcon(QIcon::fromTheme(QStringLiteral("document-import")));
connect(action, &QAction::triggered, this, &KWalletManager::importWallets);
QAction *act = actionCollection()->addAction(QLatin1String("wallet_settings"));
QAction *act = actionCollection()->addAction(QStringLiteral("wallet_settings"));
act->setText(i18n("Configure &Wallet..."));
act->setIcon(QIcon::fromTheme(QLatin1String("configure")));
act->setIcon(QIcon::fromTheme(QStringLiteral("configure")));
connect(act, &QAction::triggered, this, &KWalletManager::setupWallet);
if (_tray) {
_tray->contextMenu()->addAction(act);
}
act = actionCollection()->addAction(QLatin1String("close_all_wallets"));
act = actionCollection()->addAction(QStringLiteral("close_all_wallets"));
act->setText(i18n("Close &All Wallets"));
connect(act, &QAction::triggered, this, &KWalletManager::closeAllWallets);
if (_tray) {
......@@ -175,7 +175,7 @@ void KWalletManager::configUI() {
KStandardAction::keyBindings(guiFactory(), SLOT(configureShortcuts()),
actionCollection());
setupGUI(Keys | Save | Create, QLatin1String("kwalletmanager.rc"));
setupGUI(Keys | Save | Create, QStringLiteral("kwalletmanager.rc"));
setStandardToolBarMenuEnabled(false);
if (_tray) {
......@@ -185,7 +185,7 @@ void KWalletManager::configUI() {
}
_walletsExportAction->setDisabled(KWallet::Wallet::walletList().isEmpty());
qApp->setObjectName(QLatin1String("kwallet")); // hack to fix docs
qApp->setObjectName(QStringLiteral("kwallet")); // hack to fix docs
}
KWalletManager::~KWalletManager()
......@@ -220,12 +220,12 @@ bool KWalletManager::queryClose()
void KWalletManager::aWalletWasOpened()
{
if (_tray) {
_tray->setIconByName(QLatin1String("wallet-open"));
_tray->setToolTip(QLatin1String("wallet-open"), i18n("Wallet"), i18n("A wallet is open."));
_tray->setIconByName(QStringLiteral("wallet-open"));
_tray->setToolTip(QStringLiteral("wallet-open"), i18n(