on xenial help sign in
clazy fixes
8437a8fAlbert Astals Cid
plugins/Dash/plugin.cpp+6−6
@@ -28,12 +28,12 @@
28static QUrl oauthCleanedUrl(QUrl u)
28static QUrl oauthCleanedUrl(QUrl u)
29{
29{
30 QUrlQuery q(u);
30 QUrlQuery q(u);
31− q.removeQueryItem("oauth_nonce");
31+ q.removeQueryItem(QStringLiteral("oauth_nonce"));
32− q.removeQueryItem("oauth_timestamp");
32+ q.removeQueryItem(QStringLiteral("oauth_timestamp"));
33− q.removeQueryItem("oauth_consumer_key");
33+ q.removeQueryItem(QStringLiteral("oauth_consumer_key"));
34− q.removeQueryItem("oauth_signature_method");
34+ q.removeQueryItem(QStringLiteral("oauth_signature_method"));
35− q.removeQueryItem("oauth_version");
35+ q.removeQueryItem(QStringLiteral("oauth_version"));
36− q.removeQueryItem("oauth_signature");
36+ q.removeQueryItem(QStringLiteral("oauth_signature"));
37 u.setQuery(q);
37 u.setQuery(q);
38 return u;
38 return u;
39}
39}
plugins/GlobalShortcut/globalshortcutregistry.cpp+3−3
@@ -35,13 +35,13 @@ GlobalShortcutList GlobalShortcutRegistry::shortcuts() const
35
35
36bool GlobalShortcutRegistry::hasShortcut(const QVariant &seq) const
36bool GlobalShortcutRegistry::hasShortcut(const QVariant &seq) const
37{
37{
38− return m_shortcuts.keys().contains(seq);
38+ return m_shortcuts.contains(seq);
39}
39}
40
40
41void GlobalShortcutRegistry::addShortcut(const QVariant &seq, GlobalShortcut *sc)
41void GlobalShortcutRegistry::addShortcut(const QVariant &seq, GlobalShortcut *sc)
42{
42{
43 if (sc) {
43 if (sc) {
44− if (!m_shortcuts.keys().contains(seq)) { // create a new entry
44+ if (!m_shortcuts.contains(seq)) { // create a new entry
45 m_shortcuts.insert(seq, {sc});
45 m_shortcuts.insert(seq, {sc});
46 } else { // append to an existing one
46 } else { // append to an existing one
47 auto shortcuts = m_shortcuts[seq];
47 auto shortcuts = m_shortcuts[seq];
@@ -76,7 +76,7 @@ bool GlobalShortcutRegistry::eventFilter(QObject *obj, QEvent *event)
76 if (event->type() == QEvent::KeyPress) {
76 if (event->type() == QEvent::KeyPress) {
77 QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event);
77 QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event);
78 QKeySequence seq = QKeySequence(keyEvent->key() + keyEvent->modifiers());
78 QKeySequence seq = QKeySequence(keyEvent->key() + keyEvent->modifiers());
79− if (m_shortcuts.keys().contains(seq)) {
79+ if (m_shortcuts.contains(seq)) {
80 const auto shortcuts = m_shortcuts.value(seq);
80 const auto shortcuts = m_shortcuts.value(seq);
81 Q_FOREACH(const auto &shortcut, shortcuts) {
81 Q_FOREACH(const auto &shortcut, shortcuts) {
82 if (shortcut) {
82 if (shortcut) {
plugins/Unity/Indicators/indicatorsmanager.cpp+2−2
@@ -116,7 +116,7 @@ void IndicatorsManager::loadFile(const QFileInfo& file_info)
116 QSettings indicator_settings(file_info.absoluteFilePath(), QSettings::IniFormat, this);
116 QSettings indicator_settings(file_info.absoluteFilePath(), QSettings::IniFormat, this);
117 const QString name = indicator_settings.value(QStringLiteral("Indicator Service/Name")).toString();
117 const QString name = indicator_settings.value(QStringLiteral("Indicator Service/Name")).toString();
118
118
119− if (m_platform.isPC() && name == "indicator-keyboard") {
119+ if (m_platform.isPC() && name == QLatin1String("indicator-keyboard")) {
120 return; // convergence: skip this indicator until it works in Mir
120 return; // convergence: skip this indicator until it works in Mir
121 }
121 }
122
122
@@ -293,7 +293,7 @@ Indicator::Ptr IndicatorsManager::indicator(const QString& indicator_name)
293 // The rest of the indicators respect their default profile (which is "phone", even on desktop PCs)
293 // The rest of the indicators respect their default profile (which is "phone", even on desktop PCs)
294 if ((new_indicator->identifier() == QStringLiteral("indicator-session") && m_platform.isMultiSession())
294 if ((new_indicator->identifier() == QStringLiteral("indicator-session") && m_platform.isMultiSession())
295 || (new_indicator->identifier() == QStringLiteral("indicator-power") && m_platform.isPC())) {
295 || (new_indicator->identifier() == QStringLiteral("indicator-power") && m_platform.isPC())) {
296− new_indicator->setProfile("desktop");
296+ new_indicator->setProfile(QStringLiteral("desktop"));
297 } else {
297 } else {
298 new_indicator->setProfile(m_profile);
298 new_indicator->setProfile(m_profile);
299 }
299 }
plugins/Unity/Indicators/rootstateparser.h+1
@@ -23,6 +23,7 @@
23
23
24class UNITYINDICATORS_EXPORT RootStateParser : public ActionStateParser
24class UNITYINDICATORS_EXPORT RootStateParser : public ActionStateParser
25{
25{
26+Q_OBJECT
26public:
27public:
27 RootStateParser(QObject* parent = nullptr);
28 RootStateParser(QObject* parent = nullptr);
28 virtual QVariant toQVariant(GVariant* state) const override;
29 virtual QVariant toQVariant(GVariant* state) const override;
plugins/Unity/Launcher/desktopfilehandler.cpp+2−2
@@ -146,9 +146,9 @@ QString DesktopFileHandler::icon() const
146 QString iconString = settings.value(QStringLiteral("Icon")).toString();
146 QString iconString = settings.value(QStringLiteral("Icon")).toString();
147 QString pathString = settings.value(QStringLiteral("Path")).toString();
147 QString pathString = settings.value(QStringLiteral("Path")).toString();
148
148
149− if (QFileInfo(iconString).exists()) {
149+ if (QFileInfo::exists(iconString)) {
150 return QFileInfo(iconString).absoluteFilePath();
150 return QFileInfo(iconString).absoluteFilePath();
151− } else if (QFileInfo(pathString + '/' + iconString).exists()) {
151+ } else if (QFileInfo::exists(pathString + '/' + iconString)) {
152 return pathString + '/' + iconString;
152 return pathString + '/' + iconString;
153 }
153 }
154 return "image://theme/" + iconString;
154 return "image://theme/" + iconString;
src/CachingNetworkManagerFactory.h+1
@@ -25,6 +25,7 @@
25
25
26class CachingNetworkAccessManager : public QNetworkAccessManager
26class CachingNetworkAccessManager : public QNetworkAccessManager
27{
27{
28+Q_OBJECT
28public:
29public:
29 CachingNetworkAccessManager(QObject *parent = 0);
30 CachingNetworkAccessManager(QObject *parent = 0);
30
31