- Fix several minor issues reported by Krazy2

(http://reviewboard.kde.org/r/1837/)


svn path=/trunk/KDE/kdelibs/; revision=1034756
This commit is contained in:
Darío Andrés Rodríguez 2009-10-13 12:40:13 +00:00
parent 2822ce65cd
commit 59296fb520
15 changed files with 19 additions and 18 deletions

View File

@ -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;

View File

@ -42,6 +42,7 @@ Context::~Context()
void Context::createActivity(const QString &name)
{
Q_UNUSED(name);
}
QStringList Context::listActivities() const

View File

@ -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-";

View File

@ -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<QVBoxLayout *>(lay);
} else {

View File

@ -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();

View File

@ -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)) );
}
}

View File

@ -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;

View File

@ -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;
}

View File

@ -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
;

View File

@ -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
;

View File

@ -21,7 +21,7 @@
#ifndef ITEMBACKGROUND_H
#define ITEMBACKGROUND_H
#include <QGraphicsWidget>
#include <QtGui/QGraphicsWidget>
#include <plasma/plasma_export.h>

View File

@ -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
;

View File

@ -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
;

View File

@ -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
;

View File

@ -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
;