From 59296fb52067e62adbc458f76d9e4448b160fbec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dar=C3=ADo=20Andr=C3=A9s=20Rodr=C3=ADguez?= Date: Tue, 13 Oct 2009 12:40:13 +0000 Subject: [PATCH] - Fix several minor issues reported by Krazy2 (http://reviewboard.kde.org/r/1837/) svn path=/trunk/KDE/kdelibs/; revision=1034756 --- containmentactions.cpp | 2 +- context.cpp | 1 + framesvg.cpp | 2 +- popupapplet.cpp | 2 +- private/desktoptoolbox.cpp | 8 ++++---- private/nativetabbar.cpp | 2 +- private/wallpaperrenderthread.cpp | 2 +- runnersyntax.cpp | 4 ++-- widgets/checkbox.cpp | 2 +- widgets/frame.cpp | 2 +- widgets/itembackground.h | 2 +- widgets/label.cpp | 2 +- widgets/pushbutton.cpp | 2 +- widgets/radiobutton.cpp | 2 +- widgets/toolbutton.cpp | 2 +- 15 files changed, 19 insertions(+), 18 deletions(-) diff --git a/containmentactions.cpp b/containmentactions.cpp index bbb15286c..dd9cbc3a7 100644 --- a/containmentactions.cpp +++ b/containmentactions.cpp @@ -275,7 +275,7 @@ QString ContainmentActions::eventToString(QEvent *event) int k = QObject::staticQtMetaObject.indexOfEnumerator("KeyboardModifiers"); QMetaEnum kbd = QObject::staticQtMetaObject.enumerator(k); - trigger += ";"; + trigger += ';'; trigger += kbd.valueToKeys(modifiers); return trigger; diff --git a/context.cpp b/context.cpp index b43bb7dc0..47663fba9 100644 --- a/context.cpp +++ b/context.cpp @@ -42,6 +42,7 @@ Context::~Context() void Context::createActivity(const QString &name) { + Q_UNUSED(name); } QStringList Context::listActivities() const diff --git a/framesvg.cpp b/framesvg.cpp index 49397236a..a79dcdce8 100644 --- a/framesvg.cpp +++ b/framesvg.cpp @@ -354,7 +354,7 @@ QPixmap FrameSvgPrivate::alphaMask(const QString &maskType) QString maskPrefix; - if (q->hasElement("mask-" + maskType + "-" + prefix + "center")) { + if (q->hasElement("mask-" + maskType + '-' + prefix + "center")) { maskPrefix = "mask-" + QString("-") + maskType; } else if (q->hasElement("mask-" + prefix + "center")) { maskPrefix = "mask-"; diff --git a/popupapplet.cpp b/popupapplet.cpp index 389a63013..5a790b781 100644 --- a/popupapplet.cpp +++ b/popupapplet.cpp @@ -121,7 +121,7 @@ void PopupApplet::setWidget(QWidget *widget) if (d->widget) { if (d->dialog) { d->dialog->setGraphicsWidget(0); - QVBoxLayout *lay; + QVBoxLayout *lay = 0; if (d->dialog->layout()) { lay = static_cast(lay); } else { diff --git a/private/desktoptoolbox.cpp b/private/desktoptoolbox.cpp index 06ab07c05..ed8bc0658 100644 --- a/private/desktoptoolbox.cpp +++ b/private/desktoptoolbox.cpp @@ -251,7 +251,7 @@ QSize DesktopToolBox::fullWidth() const int extraSpace = 0; if (!d->containment->activity().isNull()) { - extraSpace = Plasma::Theme::defaultTheme()->fontMetrics().width(d->containment->activity()+"x"); + extraSpace = Plasma::Theme::defaultTheme()->fontMetrics().width(d->containment->activity()+'x'); } return QSize(size() + left + right + extraSpace, size() + bottom); @@ -266,7 +266,7 @@ QSize DesktopToolBox::fullHeight() const int extraSpace = 0; if (!d->containment->activity().isNull()) { - extraSpace = Plasma::Theme::defaultTheme()->fontMetrics().width(d->containment->activity()+"x"); + extraSpace = Plasma::Theme::defaultTheme()->fontMetrics().width(d->containment->activity()+'x'); } return QSize(size() + left, size() + top + bottom + extraSpace); @@ -299,7 +299,7 @@ QRectF DesktopToolBox::boundingRect() const //keep space for the label and a character more if (!d->containment->activity().isNull()) { - extraSpace = Plasma::Theme::defaultTheme()->fontMetrics().width(d->containment->activity()+"x"); + extraSpace = Plasma::Theme::defaultTheme()->fontMetrics().width(d->containment->activity()+'x'); } qreal left, top, right, bottom; @@ -375,7 +375,7 @@ void DesktopToolBox::paint(QPainter *painter, const QStyleOptionGraphicsItem *op QSize textSize; if (cornerElement.isNull()) { activityName = d->containment->activity(); - textSize = Plasma::Theme::defaultTheme()->fontMetrics().size(Qt::TextSingleLine, activityName+"x"); + textSize = Plasma::Theme::defaultTheme()->fontMetrics().size(Qt::TextSingleLine, activityName+'x'); } d->adjustBackgroundBorders(); diff --git a/private/nativetabbar.cpp b/private/nativetabbar.cpp index 5d5ec654d..5101b1799 100644 --- a/private/nativetabbar.cpp +++ b/private/nativetabbar.cpp @@ -315,7 +315,7 @@ void NativeTabBar::paintEvent(QPaintEvent *event) } } - if (isCloseButtonEnabled()) { + if (tabsClosable()) { d->closeIcon.paint(&painter, QRect(closeButtonPos(i), QSize(KIconLoader::SizeSmall, KIconLoader::SizeSmall)) ); } } diff --git a/private/wallpaperrenderthread.cpp b/private/wallpaperrenderthread.cpp index 38d74c01a..3d8a8666e 100644 --- a/private/wallpaperrenderthread.cpp +++ b/private/wallpaperrenderthread.cpp @@ -122,7 +122,7 @@ void WallpaperRenderThread::run() QPoint pos(0, 0); bool tiled = false; - bool scalable = file.endsWith("svg") || file.endsWith("svgz"); + bool scalable = file.endsWith(QLatin1String("svg")) || file.endsWith(QLatin1String("svgz")); QSize scaledSize; QImage img; diff --git a/runnersyntax.cpp b/runnersyntax.cpp index 17f531d36..2984d7a22 100644 --- a/runnersyntax.cpp +++ b/runnersyntax.cpp @@ -72,7 +72,7 @@ QStringList RunnerSyntax::exampleQueries() const QStringList RunnerSyntax::exampleQueriesWithTermDescription() const { QStringList queries; - const QString termDesc("<" + searchTermDescription() + ">"); + const QString termDesc('<' + searchTermDescription() + '>'); foreach (QString query, d->exampleQueries) { queries << query.replace(":q:", termDesc); } @@ -88,7 +88,7 @@ void RunnerSyntax::setDescription(const QString &description) QString RunnerSyntax::description() const { QString description = d->description; - description.replace(":q:", "<" + searchTermDescription() + ">"); + description.replace(":q:", '<' + searchTermDescription() + '>'); return description; } diff --git a/widgets/checkbox.cpp b/widgets/checkbox.cpp index 894b5e30d..308d0b0fd 100644 --- a/widgets/checkbox.cpp +++ b/widgets/checkbox.cpp @@ -137,7 +137,7 @@ void CheckBox::setImage(const QString &path) #ifdef Q_WS_WIN !QDir::isRelativePath(path) #else - (path[0] == '/' || path.startsWith(":/")) + (path[0] == '/' || path.startsWith(QLatin1String(":/"))) #endif ; diff --git a/widgets/frame.cpp b/widgets/frame.cpp index 7d4aa5b90..3aba7157a 100644 --- a/widgets/frame.cpp +++ b/widgets/frame.cpp @@ -171,7 +171,7 @@ void Frame::setImage(const QString &path) #ifdef Q_WS_WIN !QDir::isRelativePath(path) #else - (path[0] == '/' || path.startsWith(":/")) + (path[0] == '/' || path.startsWith(QLatin1String(":/"))) #endif ; diff --git a/widgets/itembackground.h b/widgets/itembackground.h index 94e46f6c3..e1c7e35fc 100644 --- a/widgets/itembackground.h +++ b/widgets/itembackground.h @@ -21,7 +21,7 @@ #ifndef ITEMBACKGROUND_H #define ITEMBACKGROUND_H -#include +#include #include diff --git a/widgets/label.cpp b/widgets/label.cpp index 5a5bb0da0..885c59748 100644 --- a/widgets/label.cpp +++ b/widgets/label.cpp @@ -155,7 +155,7 @@ void Label::setImage(const QString &path) #ifdef Q_WS_WIN !QDir::isRelativePath(path) #else - (path[0] == '/' || path.startsWith(":/")) + (path[0] == '/' || path.startsWith(QLatin1String(":/"))) #endif ; diff --git a/widgets/pushbutton.cpp b/widgets/pushbutton.cpp index b334ec73d..efe3d5933 100644 --- a/widgets/pushbutton.cpp +++ b/widgets/pushbutton.cpp @@ -216,7 +216,7 @@ void PushButton::setImage(const QString &path) #ifdef Q_WS_WIN !QDir::isRelativePath(path) #else - (path[0] == '/' || path.startsWith(":/")) + (path[0] == '/' || path.startsWith(QLatin1String(":/"))) #endif ; diff --git a/widgets/radiobutton.cpp b/widgets/radiobutton.cpp index 1a336ac60..b2114260c 100644 --- a/widgets/radiobutton.cpp +++ b/widgets/radiobutton.cpp @@ -129,7 +129,7 @@ void RadioButton::setImage(const QString &path) #ifdef Q_WS_WIN !QDir::isRelativePath(path) #else - (path[0] == '/' || path.startsWith(":/")) + (path[0] == '/' || path.startsWith(QLatin1String(":/"))) #endif ; diff --git a/widgets/toolbutton.cpp b/widgets/toolbutton.cpp index 0b6edb8ad..e4ba94098 100644 --- a/widgets/toolbutton.cpp +++ b/widgets/toolbutton.cpp @@ -235,7 +235,7 @@ void ToolButton::setImage(const QString &path) #ifdef Q_WS_WIN !QDir::isRelativePath(path) #else - (path[0] == '/' || path.startsWith(":/")) + (path[0] == '/' || path.startsWith(QLatin1String(":/"))) #endif ;