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);
}
......
This diff is collapsed.
......@@ -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("Wallet"), i18n("A wallet is open."));
_tray->setStatus(KStatusNotifierItem::Active);
}
updateWalletDisplay();
createGUI(QLatin1String("kwalletmanager.rc"));
createGUI(QStringLiteral("kwalletmanager.rc"));
}
void KWalletManager::updateWalletDisplay()
......@@ -280,8 +280,8 @@ void KWalletManager::openWalletFile(const QString &path)
void KWalletManager::allWalletsClosed()
{
if (_tray) {
_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."));
_tray->setStatus(KStatusNotifierItem::Passive);
}
possiblyQuit();
......@@ -289,7 +289,7 @@ void KWalletManager::allWalletsClosed()
void KWalletManager::possiblyQuit()
{
KConfig _cfg(QLatin1String("kwalletrc"));
KConfig _cfg(QStringLiteral("kwalletrc"));
KConfigGroup cfg(&_cfg, "Wallet");
if (_windows.isEmpty() &&
!isVisible() &&
......@@ -405,7 +405,7 @@ void KWalletManager::shuttingDown()
void KWalletManager::setupWallet()
{
KToolInvocation::startServiceByDesktopName(QLatin1String("kwalletconfig5"));
KToolInvocation::startServiceByDesktopName(QStringLiteral("kwalletconfig5"));
}
void KWalletManager::closeAllWallets()
......@@ -426,7 +426,7 @@ void KWalletManager::exportWallets()
Q_ASSERT(dir.exists());
const QStringList filesList = dir.entryList(QStringList() << "*.kwl" << "*.salt",
const QStringList filesList = dir.entryList(QStringList() << QStringLiteral("*.kwl") << QStringLiteral("*.salt"),
QDir::Files | QDir::Readable | QDir::NoSymLinks);
Q_ASSERT(!filesList.isEmpty());
......@@ -468,7 +468,7 @@ void KWalletManager::importWallets()
for (int i = 0; i < archiveEntries.size(); i++) {
if (QFile::exists(destinationDir + archiveEntries.at(i))
&& archiveEntries.at(i).endsWith(".kwl")) {
&& archiveEntries.at(i).endsWith(QLatin1String(".kwl"))) {
QString walletName = archiveEntries.at(i);
// remove ".kwl"
walletName.chop(4);
......
......@@ -127,7 +127,7 @@ QString KWalletManagerWidget::activeWalletName() const
void KWalletManagerWidget::dragEnterEvent(QDragEnterEvent *e)
{
if (e->mimeData()->hasFormat("application/x-kwallet-wallet")) {
if (e->mimeData()->hasFormat(QStringLiteral("application/x-kwallet-wallet"))) {
e->accept();
} else {
e->ignore();
......
......@@ -34,9 +34,9 @@ KWalletManagerWidgetItem::KWalletManagerWidgetItem(QWidget *widgetParent, const
void KWalletManagerWidgetItem::updateWalletDisplay()
{
if (KWallet::Wallet::isOpen(_walletName)) {
setIcon(QIcon::fromTheme(QLatin1String("wallet-open")));
setIcon(QIcon::fromTheme(QStringLiteral("wallet-open")));
} else {
setIcon(QIcon::fromTheme(QLatin1String("wallet-closed")));
setIcon(QIcon::fromTheme(QStringLiteral("wallet-closed")));
}
_controlWidget->updateWalletDisplay();
}
......
......@@ -33,21 +33,21 @@ KWalletPopup::KWalletPopup(const QString &wallet, QWidget *parent, const char *n
addSection(wallet);
setObjectName(QLatin1String(name));
KActionCollection *ac = new KActionCollection(this/*, "kwallet context actions"*/);
ac->setObjectName(QLatin1String("kwallet context actions"));
ac->setObjectName(QStringLiteral("kwallet context actions"));
QAction *act;
act = ac->addAction(QLatin1String("wallet_create"));
act = ac->addAction(QStringLiteral("wallet_create"));
act->setText(i18n("&New Wallet..."));
connect(act, &QAction::triggered, this, &KWalletPopup::createWallet);
addAction(act);
act = ac->addAction(QLatin1String("wallet-open"));
act = ac->addAction(QStringLiteral("wallet-open"));
act->setText(i18n("&Open..."));
connect(act, &QAction::triggered, this, &KWalletPopup::openWallet);
act->setShortcut(QKeySequence(Qt::Key_Return));
addAction(act);
act = ac->addAction(QLatin1String("wallet_password"));
act = ac->addAction(QStringLiteral("wallet_password"));
act->setText(i18n("Change &Password..."));
connect(act, &QAction::triggered, this, &KWalletPopup::changeWalletPassword);
addAction(act);
......@@ -55,7 +55,7 @@ KWalletPopup::KWalletPopup(const QString &wallet, QWidget *parent, const char *n
const QStringList ul = KWallet::Wallet::users(wallet);
if (!ul.isEmpty()) {
QMenu *pm = new QMenu(this);
pm->setObjectName(QLatin1String("Disconnect Apps"));
pm->setObjectName(QStringLiteral("Disconnect Apps"));
int id = 7000;
for (QStringList::const_iterator it = ul.begin(); it != ul.end(); ++it) {
QAction *a = pm->addAction(*it, this, SLOT(disconnectApp()));
......@@ -68,13 +68,13 @@ KWalletPopup::KWalletPopup(const QString &wallet, QWidget *parent, const char *n
act = KStandardAction::close(this,
SLOT(closeWallet()), ac);
ac->addAction(QLatin1String("wallet_close"), act);
ac->addAction(QStringLiteral("wallet_close"), act);
// FIXME: let's track this inside the manager so we don't need a dcop
// roundtrip here.
act->setEnabled(KWallet::Wallet::isOpen(wallet));
addAction(act);
act = ac->addAction(QLatin1String("wallet_delete"));
act = ac->addAction(QStringLiteral("wallet_delete"));
act->setText(i18n("&Delete"));
connect(act, &QAction::triggered, this, &KWalletPopup::deleteWallet);
......
......@@ -156,7 +156,7 @@ void KWMapEditor::reload()
setRowCount(_map.count());
for (int x = row; x < rowCount(); ++x) {
QToolButton *b = new QToolButton(this);
b->setIcon(QIcon::fromTheme("edit-delete"));
b->setIcon(QIcon::fromTheme(QStringLiteral("edit-delete")));
b->setToolTip(i18n("Delete Entry"));
connect(b, &QToolButton::clicked, this, &KWMapEditor::erase);
setCellWidget(x, 0, b);
......@@ -207,7 +207,7 @@ void KWMapEditor::addEntry()
int x = rowCount();
insertRow(x);
QToolButton *b = new QToolButton(this);
b->setIcon(QIcon::fromTheme("edit-delete"));
b->setIcon(QIcon::fromTheme(QStringLiteral("edit-delete")));
b->setToolTip(i18n("Delete Entry"));
connect(b, &QToolButton::clicked, this, &KWMapEditor::erase);
setCellWidget(x, 0, b);
......
......@@ -78,19 +78,19 @@ int main(int argc, char **argv)
parser.addHelpOption();
parser.addVersionOption();
parser.addOption(QCommandLineOption("show", i18n("Show window on startup")));
parser.addOption(QCommandLineOption("kwalletd", i18n("For use by kwalletd only")));
parser.addOption(QCommandLineOption("name", i18n("A wallet name")));
parser.addOption(QCommandLineOption(QStringLiteral("show"), i18n("Show window on startup")));
parser.addOption(QCommandLineOption(QStringLiteral("kwalletd"), i18n("For use by kwalletd only")));
parser.addOption(QCommandLineOption(QStringLiteral("name"), i18n("A wallet name")));
parser.process(a);
KWalletManager wm;
QObject::connect(&dbssvc, &KDBusService::activateRequested, &wm, &QWidget::activateWindow);
if (parser.isSet("show")) {
if (parser.isSet(QStringLiteral("show"))) {
wm.show();
}
if (parser.isSet("kwalletd")) {
if (parser.isSet(QStringLiteral("kwalletd"))) {
wm.kwalletdLaunch();
}
......@@ -101,7 +101,7 @@ int main(int argc, char **argv)
QMimeDatabase mimeDb;
QMimeType mt = mimeDb.mimeTypeForFile(fn, QMimeDatabase::MatchContent);
if (mt.isValid() && mt.inherits(QLatin1String("application/x-kwallet"))) {
if (mt.isValid() && mt.inherits(QStringLiteral("application/x-kwallet"))) {
wm.openWalletFile(fn);
}
} else {
......
......@@ -25,7 +25,7 @@ RevokeAuthButton::RevokeAuthButton(const QString &appName, KWallet::Wallet *wall
_appName(appName),
_wallet(wallet)
{
setObjectName(QString("Revoke_%1").arg(appName));
setObjectName(QStringLiteral("Revoke_%1").arg(appName));
setText(i18n("Revoke Authorization"));
connect(this, &RevokeAuthButton::clicked, this, &RevokeAuthButton::onClicked);
}
......
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