Commit 30bb2e04 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix some clazy warning

parent c015e820
......@@ -149,7 +149,7 @@ QList<KBookmarkOwner::FutureBookmark> BookmarkManager::currentBookmarkList() con
void BookmarkManager::addManualBookmark(const QUrl &url, const QString &text)
{
m_manager->root().addBookmark(text, url, QString());
Q_EMIT m_manager->emitChanged();
m_manager->emitChanged();
}
KBookmarkManager* BookmarkManager::getManager()
......@@ -174,12 +174,12 @@ const QStringList BookmarkManager::findBookmarkAddresses(const KBookmarkGroup &g
return bookmarkAddresses;
}
void BookmarkManager::removeByUrl(KBookmarkManager *manager, const QString &url, bool ignoreHistory, const QString updateTitle)
void BookmarkManager::removeByUrl(KBookmarkManager *manager, const QString &url, bool ignoreHistory, const QString &updateTitle)
{
const QStringList addresses = findBookmarkAddresses(manager->root(), url);
for (const QString &address : addresses) {
KBookmark bm = manager->findByAddress(address);
if (ignoreHistory && bm.parentGroup().metaDataItem(QLatin1String("krdc-history")) == QLatin1String("historyfolder")) {
if (ignoreHistory && bm.parentGroup().metaDataItem(QStringLiteral("krdc-history")) == QLatin1String("historyfolder")) {
if (!updateTitle.isEmpty()) {
qCDebug(KRDC) << "Update" << bm.fullText();
bm.setFullText(updateTitle);
......
......@@ -35,7 +35,7 @@ public:
void addManualBookmark(const QUrl &url, const QString &text);
KBookmarkManager* getManager();
// removes all bookmarks with url, possibly ignore the history folder and update it's title there if it's set
static void removeByUrl(KBookmarkManager *manager, const QString &url, bool ignoreHistory = false, const QString updateTitle = QString());
static void removeByUrl(KBookmarkManager *manager, const QString &url, bool ignoreHistory = false, const QString &updateTitle = QString());
static void updateTitle(KBookmarkManager *manager, const QString &url, const QString &title);
// returns a QStringList for all bookmarks that point to this url using KBookmark::address()
static const QStringList findBookmarkAddresses(const KBookmarkGroup &group, const QString &url);
......
......@@ -16,25 +16,25 @@
#include <KPluginInfo>
PreferencesDialog::PreferencesDialog(QWidget *parent, KConfigSkeleton *skeleton)
: KConfigDialog(parent, QLatin1String("preferences"), skeleton)
: KConfigDialog(parent, QStringLiteral("preferences"), skeleton)
, m_settingsChanged(false)
{
QWidget *generalPage = new QWidget(this);
Ui::General generalUi;
generalUi.setupUi(generalPage);
addPage(generalPage, i18nc("General Config", "General"), QLatin1String("krdc"), i18n("General Configuration"));
addPage(generalPage, i18nc("General Config", "General"), QStringLiteral("krdc"), i18n("General Configuration"));
HostPreferencesList *hostPreferencesList = new HostPreferencesList(this,
qobject_cast<MainWindow *>(parent),
skeleton->config()->group("hostpreferences"));
addPage(hostPreferencesList, i18n("Hosts"), QLatin1String("computer"), i18n("Host Configuration"));
addPage(hostPreferencesList, i18n("Hosts"), QStringLiteral("computer"), i18n("Host Configuration"));
m_pluginSelector = new KPluginSelector();
const QList<KPluginInfo> offers = KPluginInfo::fromMetaData(KPluginLoader::findPlugins(QStringLiteral("krdc")));
m_pluginSelector->addPlugins(offers, KPluginSelector::ReadConfigFile,
i18n("Plugins"), QLatin1String("Service"), KSharedConfig::openConfig());
i18n("Plugins"), QStringLiteral("Service"), KSharedConfig::openConfig());
m_pluginSelector->load();
addPage(m_pluginSelector, i18n("Plugins"), QLatin1String("preferences-plugin"), i18n("Plugin Configuration"));
addPage(m_pluginSelector, i18n("Plugins"), QStringLiteral("preferences-plugin"), i18n("Plugin Configuration"));
connect(this, SIGNAL(accepted()), SLOT(saveState()));
QPushButton *defaultsButton = buttonBox()->button(QDialogButtonBox::RestoreDefaults);
......
......@@ -54,7 +54,7 @@ void ConnectionDelegate::paint(QPainter *painter, const QStyleOptionViewItem &op
QVariant value = index.data(Qt::CheckStateRole);
if (value.isValid()) {
Qt::CheckState checkState = static_cast<Qt::CheckState>(value.toInt());
QIcon favIcon = QIcon::fromTheme(QLatin1String("bookmarks"));
QIcon favIcon = QIcon::fromTheme(QStringLiteral("bookmarks"));
QIcon::Mode mode = (checkState == Qt::Checked) ? QIcon::Active : QIcon::Disabled;
favIcon.paint(painter, option.rect, option.decorationAlignment, mode);
......
......@@ -917,7 +917,7 @@ void MainWindow::updateConfiguration()
if (!Settings::showStatusBar())
statusBar()->deleteLater();
else
statusBar()->showMessage(QStringLiteral("")); // force creation of statusbar
statusBar()->showMessage({}); // force creation of statusbar
m_tabWidget->tabBar()->setHidden((m_tabWidget->count() <= 1 && !Settings::showTabBar()) || m_fullscreenWindow);
m_tabWidget->setTabPosition((QTabWidget::TabPosition) Settings::tabPosition());
......
......@@ -225,7 +225,7 @@ void TabbedViewWidget::mouseDoubleClickEvent(QMouseEvent * event)
void TabbedViewWidget::mouseReleaseEvent(QMouseEvent *event)
{
if (event->button() == Qt::MidButton) {
if (event->button() == Qt::MiddleButton) {
if (isEmptyTabbarSpace(event->pos())) {
Q_EMIT mouseMiddleClick(-1);
return;
......
......@@ -603,14 +603,14 @@ void VncView::mouseEventHandler(QMouseEvent *e)
(e->type() == QEvent::MouseButtonDblClick)) {
if (e->button() & Qt::LeftButton)
m_buttonMask |= 0x01;
if (e->button() & Qt::MidButton)
if (e->button() & Qt::MiddleButton)
m_buttonMask |= 0x02;
if (e->button() & Qt::RightButton)
m_buttonMask |= 0x04;
} else if (e->type() == QEvent::MouseButtonRelease) {
if (e->button() & Qt::LeftButton)
m_buttonMask &= 0xfe;
if (e->button() & Qt::MidButton)
if (e->button() & Qt::MiddleButton)
m_buttonMask &= 0xfd;
if (e->button() & Qt::RightButton)
m_buttonMask &= 0xfb;
......
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