diff options
author | Holger Schroeder <holger.schroeder.ext@basyskom.de> | 2010-09-10 16:20:08 +0200 |
---|---|---|
committer | Jörgen Scheibengruber <jorgen.scheibengruber@nokia.com> | 2010-09-13 13:46:25 +0300 |
commit | 2709d179f9fece477db78f0ef9a4ed8bb7b43c0e (patch) | |
tree | 8d7f7199507701a3914d1ee5e664ce0259eebbbc | |
parent | 5e997484f91d17cef5c42e2a5a954337c2924b96 (diff) |
Changes: Fix some krazy issues
RevBy: TrustMe
27 files changed, 66 insertions, 53 deletions
diff --git a/demos/widgetsgallery/bubblelistmodel.h b/demos/widgetsgallery/bubblelistmodel.h index 11a5bb40..7ef0b5df 100644 --- a/demos/widgetsgallery/bubblelistmodel.h +++ b/demos/widgetsgallery/bubblelistmodel.h @@ -17,8 +17,8 @@ ** ****************************************************************************/ -#ifndef BUBBLEMODEL_H -#define BUBBLEMODEL_H +#ifndef BUBBLELISTMODEL_H +#define BUBBLELISTMODEL_H #include <QAbstractItemModel> #include <QList> diff --git a/demos/widgetsgallery/bubblepage.cpp b/demos/widgetsgallery/bubblepage.cpp index 82ef5f3b..3ddcb5be 100644 --- a/demos/widgetsgallery/bubblepage.cpp +++ b/demos/widgetsgallery/bubblepage.cpp @@ -17,6 +17,8 @@ ** ****************************************************************************/ +#include "bubblepage.h" + #include <QDir> #include <QGraphicsLinearLayout> #include <QGraphicsGridLayout> @@ -29,7 +31,6 @@ #include <MBubbleItem> #include "utils.h" -#include "bubblepage.h" #include "bubblelistmodel.h" static MBubbleItem *createBubbleItem(const QModelIndex& index) @@ -161,7 +162,7 @@ QString BubblePage::timedemoTitle() void BubblePage::bubbleLinkActivated(QString url) { //% "Link activated" - messageBox = new MMessageBox(qtTrId("xx_wg_bubblepage_linkactivated") + " " + url); + messageBox = new MMessageBox(qtTrId("xx_wg_bubblepage_linkactivated") + ' ' + url); messageBox->appear(MSceneWindow::DestroyWhenDone); } diff --git a/demos/widgetsgallery/buttongrouppage.cpp b/demos/widgetsgallery/buttongrouppage.cpp index 2665053c..f57f8747 100644 --- a/demos/widgetsgallery/buttongrouppage.cpp +++ b/demos/widgetsgallery/buttongrouppage.cpp @@ -28,7 +28,6 @@ #include <MButtonGroup> #include <MDebug> #include <MApplication> -#include <MButtonGroup> ButtonGroupPage::ButtonGroupPage() : TemplatePage(TemplatePage::Buttons), diff --git a/demos/widgetsgallery/gridimagewidget.h b/demos/widgetsgallery/gridimagewidget.h index 100a4f0e..513d70da 100644 --- a/demos/widgetsgallery/gridimagewidget.h +++ b/demos/widgetsgallery/gridimagewidget.h @@ -17,6 +17,9 @@ ** ****************************************************************************/ +#ifndef GRIDIMAGEWIDGET_H +#define GRIDIMAGEWIDGET_H + #include <MImageWidget> #include <QString> #include "gridmodel.h" @@ -44,3 +47,5 @@ private: QString m_id; MGridPage* m_page; }; + +#endif diff --git a/demos/widgetsgallery/gridmodel.cpp b/demos/widgetsgallery/gridmodel.cpp index b6e13c53..6f0f3348 100644 --- a/demos/widgetsgallery/gridmodel.cpp +++ b/demos/widgetsgallery/gridmodel.cpp @@ -17,12 +17,12 @@ ** ****************************************************************************/ +#include "gridmodel.h" + #include <QImage> #include <QPixmap> #include <QPainter> -#include "gridmodel.h" - GridModel::GridModel(const QSize &size, const QString &dir) : QAbstractTableModel(), m_loader(new Loader(size)), @@ -93,7 +93,7 @@ void GridModel::createItems() if( videoTypes.contains( file.suffix() )) { #ifdef HAVE_GSTREAMER - if( file.fileName().startsWith("thumb-") ) { + if( file.fileName().startsWith( QLatin1String( "thumb-" ) ) ) { m.path = path; m.type = MediaType::Video; } else { @@ -129,7 +129,7 @@ void GridModel::insertImage(QImage image, int index) void GridModel::rateImage(MediaType::Rating rating, const QString& id) { int index = 0; - foreach(QVariant v, m_items) { + foreach(const QVariant& v, m_items) { if( v.canConvert<MediaType>() ) { MediaType m = m_items[index].value<MediaType>(); diff --git a/demos/widgetsgallery/gridvideowidget.cpp b/demos/widgetsgallery/gridvideowidget.cpp index 57402034..e2843f03 100644 --- a/demos/widgetsgallery/gridvideowidget.cpp +++ b/demos/widgetsgallery/gridvideowidget.cpp @@ -17,10 +17,10 @@ ** ****************************************************************************/ -#include <QGraphicsSceneMouseEvent> - #include "gridvideowidget.h" +#include <QGraphicsSceneMouseEvent> + #ifdef HAVE_GSTREAMER GridVideoWidget::GridVideoWidget(QGraphicsItem *parent) diff --git a/demos/widgetsgallery/itemdetailpage.h b/demos/widgetsgallery/itemdetailpage.h index 1038b4c8..e690642f 100644 --- a/demos/widgetsgallery/itemdetailpage.h +++ b/demos/widgetsgallery/itemdetailpage.h @@ -1,4 +1,4 @@ - /*************************************************************************** +/*************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. @@ -17,6 +17,9 @@ ** ****************************************************************************/ +#ifndef ITEMDETAILPAGE_H +#define ITEMDETAILPAGE_H + #include "timedemopage.h" #include "gridmodel.h" @@ -152,3 +155,5 @@ private: qreal scaleFactor; qreal lastScaleFactor; }; + +#endif diff --git a/demos/widgetsgallery/mgridpage.cpp b/demos/widgetsgallery/mgridpage.cpp index 58a8bb58..c2ce1e38 100644 --- a/demos/widgetsgallery/mgridpage.cpp +++ b/demos/widgetsgallery/mgridpage.cpp @@ -17,6 +17,8 @@ ** ****************************************************************************/ +#include "mgridpage.h" + #include <QDir> #include <QGraphicsLinearLayout> #include <QGraphicsGridLayout> @@ -38,7 +40,6 @@ #include <MGridLayoutPolicy> #include "utils.h" -#include "mgridpage.h" #include "gridmodel.h" #include "gridimagewidget.h" diff --git a/demos/widgetsgallery/mgridpage.h b/demos/widgetsgallery/mgridpage.h index 1a2e7194..01af7cd9 100644 --- a/demos/widgetsgallery/mgridpage.h +++ b/demos/widgetsgallery/mgridpage.h @@ -17,8 +17,8 @@ ** ****************************************************************************/ -#ifndef DUIGRIDPAGE_H -#define DUIGRIDPAGE_H +#ifndef MGRIDPAGE_H +#define MGRIDPAGE_H #include <MList> #include <MVideoWidget> diff --git a/demos/widgetsgallery/mlistpage.cpp b/demos/widgetsgallery/mlistpage.cpp index bf699ebb..e7f182fd 100644 --- a/demos/widgetsgallery/mlistpage.cpp +++ b/demos/widgetsgallery/mlistpage.cpp @@ -139,7 +139,7 @@ public: QVariant data = index.data(Qt::DisplayRole); PhoneBookEntry *entry = static_cast<PhoneBookEntry *>(data.value<void *>()); - if(highlightText == "") { + if(highlightText.isEmpty()) { listCell->setTitle(entry->fullName); } else { QString highlightedTitle = entry->fullName; @@ -545,9 +545,9 @@ void MListPage::liveFilteringTextChanged() return; // With HWKB live filtering text edit is hidden when empty and shown when user enters text - if(list->filtering()->editor()->text() == "" && list->filtering()->editor()->isOnDisplay()) + if(list->filtering()->editor()->text().isEmpty() && list->filtering()->editor()->isOnDisplay()) QTimer::singleShot(1500, this, SLOT(hideEmptyTextEdit())); - else if(list->filtering()->editor()->text() != "" && !list->filtering()->editor()->isOnDisplay()) + else if( !list->filtering()->editor()->text().isEmpty() && !list->filtering()->editor()->isOnDisplay()) showTextEdit(true); // Load images for items which match filtering @@ -571,7 +571,7 @@ void MListPage::filteringVKB() void MListPage::hideEmptyTextEdit() { - if (list->filtering()->enabled() && list->filtering()->editor()->text() == "") { + if (list->filtering()->enabled() && list->filtering()->editor()->text().isEmpty()) { showTextEdit(false); } } diff --git a/demos/widgetsgallery/phonebookmodel.cpp b/demos/widgetsgallery/phonebookmodel.cpp index da8cdb7f..23f0c413 100644 --- a/demos/widgetsgallery/phonebookmodel.cpp +++ b/demos/widgetsgallery/phonebookmodel.cpp @@ -291,7 +291,7 @@ void PhoneBookImageLoader::addJob(const QModelIndex &index) if (entry == NULL) return; - foreach (Job job, thumbnailLoadingJobs) { + foreach (const Job& job, thumbnailLoadingJobs) { if (job.entry == entry) return; } diff --git a/demos/widgetsgallery/pushbuttonpage.cpp b/demos/widgetsgallery/pushbuttonpage.cpp index 35392519..32bc49b7 100644 --- a/demos/widgetsgallery/pushbuttonpage.cpp +++ b/demos/widgetsgallery/pushbuttonpage.cpp @@ -451,7 +451,7 @@ void PushButtonPage::retranslateUi() /*% "1. Single button" */ text2->setText(qtTrId("xx_push_button_text2")); - /*% "When using a button that literally has no other button next to it (neither in rows or colums) set the Object name to <i>#CommonSingleButton.</i>" */ + /*% "When using a button that literally has no other button next to it (neither in rows or columns) set the Object name to <i>#CommonSingleButton.</i>" */ text3->setText(qtTrId("xx_push_button_text3")); /*% "Multiple buttons" */ diff --git a/demos/widgetsgallery/swaphook.cpp b/demos/widgetsgallery/swaphook.cpp index ee758063..926c31e7 100644 --- a/demos/widgetsgallery/swaphook.cpp +++ b/demos/widgetsgallery/swaphook.cpp @@ -1,3 +1,5 @@ +#include "swaphook.h" + #include <cstdio> #include <ctime> @@ -9,7 +11,6 @@ #include <MApplication> #include <MWindow> -#include "swaphook.h" #ifdef EGL #include <dlfcn.h> #endif @@ -79,10 +80,10 @@ SwapHookPrivate::SwapHookPrivate() : #ifdef EGL QString preload = qgetenv("LD_PRELOAD"); - QStringList libs = preload.split(":", QString::SkipEmptyParts); + QStringList libs = preload.split(':', QString::SkipEmptyParts); libs << QString("libEGL.so"); - foreach (QString candidate, libs) { + foreach (const QString& candidate, libs) { lib = dlopen(candidate.toAscii().data(), RTLD_NOW); diff --git a/demos/widgetsgallery/swaphook.h b/demos/widgetsgallery/swaphook.h index e02ad1c7..a7a1435c 100644 --- a/demos/widgetsgallery/swaphook.h +++ b/demos/widgetsgallery/swaphook.h @@ -1,5 +1,5 @@ -#ifndef __SWAPHOOK_H__ -#define __SWAPHOOK_H__ +#ifndef SWAPHOOK_H +#define SWAPHOOK_H // Used to store time in milliseconds. typedef unsigned long long timestamp; diff --git a/demos/widgetsgallery/textentrypage.h b/demos/widgetsgallery/textentrypage.h index d1a04adf..628942fc 100644 --- a/demos/widgetsgallery/textentrypage.h +++ b/demos/widgetsgallery/textentrypage.h @@ -38,7 +38,7 @@ class CustomTextEdit: public MTextEdit { Q_OBJECT public: - CustomTextEdit(const QString &text = QString(), QGraphicsItem *parent = 0); + explicit CustomTextEdit(const QString &text = QString(), QGraphicsItem *parent = 0); public slots: void changeLabel(); void changeButton(); diff --git a/demos/widgetsgallery/timedemo.cpp b/demos/widgetsgallery/timedemo.cpp index 01f2d486..6dd93595 100644 --- a/demos/widgetsgallery/timedemo.cpp +++ b/demos/widgetsgallery/timedemo.cpp @@ -99,7 +99,7 @@ void Timedemo::showFirstPage() demoPages.append(page); } } else { - foreach(const QString title, demoPageTitles) { + foreach(const QString& title, demoPageTitles) { TimedemoPage *page; if (title == m_pFrontPage->timedemoTitle()) { page = m_pFrontPage; @@ -303,7 +303,7 @@ void Timedemo::saveFramelog() { framelog.writeTextElement("type", resultIter->type); framelog.writeTextElement("runtime", QString::number(resultIter->runtime())); QString timestamps; - foreach(const timestamp ts, resultIter->timestamps) { + foreach(const timestamp& ts, resultIter->timestamps) { timestamps.append(QString::number(ts - firstTs) + ','); } timestamps.truncate(timestamps.size() - 1); diff --git a/plainqt/style/qtmaemo6clicklabel.cpp b/plainqt/style/qtmaemo6clicklabel.cpp index ea554820..ddbdd27c 100644 --- a/plainqt/style/qtmaemo6clicklabel.cpp +++ b/plainqt/style/qtmaemo6clicklabel.cpp @@ -17,9 +17,11 @@ ** ****************************************************************************/ +#include <qtmaemo6clicklabel.h> + #include <QPainter> #include <QPixmap> -#include <qtmaemo6clicklabel.h> + #include <qtmaemo6style.h> QtMaemo6ClickLabel::QtMaemo6ClickLabel(QWidget *parent) diff --git a/plainqt/style/qtmaemo6kineticscrolling.cpp b/plainqt/style/qtmaemo6kineticscrolling.cpp index 6c4e0870..8ae44a4d 100644 --- a/plainqt/style/qtmaemo6kineticscrolling.cpp +++ b/plainqt/style/qtmaemo6kineticscrolling.cpp @@ -62,7 +62,7 @@ void QtMaemo6KineticScrolling::enableOn(QAbstractScrollArea *scrollArea) if(QAbstractItemView* itemView = qobject_cast<QAbstractItemView*>(scrollArea)) { //FIXME: public API usage... scrollPerItem prevents the kinetic from working - // proberly + // properly itemView->setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel); itemView->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel); } @@ -327,7 +327,7 @@ void QtMaemo6KineticScrolling::timerEvent(QTimerEvent *event) } if (data->state() == KineticData::BounceBack) { QPoint pos = data->scrollArea->viewport()->pos(); - //bounce back to orignal position, this is required if e.g. headers are enabled + //bounce back to original position, this is required if e.g. headers are enabled pos -= data->viewportOrigPos; QPoint bounceStep; diff --git a/plainqt/style/qtmaemo6kineticscrolling.h b/plainqt/style/qtmaemo6kineticscrolling.h index e5f6154f..fbb08a7e 100644 --- a/plainqt/style/qtmaemo6kineticscrolling.h +++ b/plainqt/style/qtmaemo6kineticscrolling.h @@ -90,7 +90,7 @@ public: }; /*! - * \brief Returns the current intervall in milliseconds the deacceleration methode is called. + * \brief Returns the current interval in milliseconds the deacceleration methode is called. * After a press event a move must been made with at least this manhattan * length before the scrolling starts. If there is no move within this length * the mouse press event is forwarded to the widget under the mouse. diff --git a/plainqt/style/qtmaemo6style.h b/plainqt/style/qtmaemo6style.h index 27021437..dc0c060a 100644 --- a/plainqt/style/qtmaemo6style.h +++ b/plainqt/style/qtmaemo6style.h @@ -50,7 +50,7 @@ QPixmap setPixmapOpacity(const QPixmap &pixmap, double opacity); /*! * This class emulates the M windowdecoration, it provides a emulation - * of the M titlebar, adds scrolling functionallity and places a statusbar + * of the M titlebar, adds scrolling functionality and places a statusbar * on the bottom of the screen, if the application has one. * This class inherits indirectly from QPlastiqueStyle and reimplements * necessarry methods for doing the correct m-like styling. @@ -138,7 +138,7 @@ public: int kineticScrollStartOffset() const; /*! - * \brief Returns the current intervall in milliseconds the deacceleration methode + * \brief Returns the current interval in milliseconds the deacceleration methode * is called. * * After a press event a move must been made with at least this manhattan diff --git a/plainqt/style/qtmaemo6titlebar.cpp b/plainqt/style/qtmaemo6titlebar.cpp index c9b21ac8..6bc85c41 100644 --- a/plainqt/style/qtmaemo6titlebar.cpp +++ b/plainqt/style/qtmaemo6titlebar.cpp @@ -21,7 +21,6 @@ #include "qtmaemo6clicklabel.h" #include "qtmaemo6style_p.h" -#include "qtmaemo6clicklabel.h" #include <QCoreApplication> #include <QToolButton> #include <QPushButton> @@ -37,7 +36,6 @@ #include <mlabelstyle.h> #include <MTheme> #include <mnavigationbarstyle.h> -#include <mlabelstyle.h> diff --git a/plainqt/style/qtmaemo6windowdecoration.cpp b/plainqt/style/qtmaemo6windowdecoration.cpp index 65cdbda0..f293c406 100644 --- a/plainqt/style/qtmaemo6windowdecoration.cpp +++ b/plainqt/style/qtmaemo6windowdecoration.cpp @@ -17,8 +17,8 @@ ** ****************************************************************************/ -#include "qtmaemo6style.h" #include "qtmaemo6windowdecoration.h" +#include "qtmaemo6style.h" #include "qtmaemo6titlebar.h" #include "qtmaemo6menuproxy.h" #include "qtmaemo6style_p.h" diff --git a/plainqt/style/qtmeegofilepicker.cpp b/plainqt/style/qtmeegofilepicker.cpp index 4de83e42..4b1ae289 100644 --- a/plainqt/style/qtmeegofilepicker.cpp +++ b/plainqt/style/qtmeegofilepicker.cpp @@ -229,7 +229,7 @@ void MeegoFilePicker::contentItemsSelected(const QString &aCallerId, mSelectedFileNames.clear(); - foreach(QString contentItem, aContentItems) + foreach(const QString& contentItem, aContentItems) { Live<nfo::FileDataObject> data = ::tracker()->liveNode(QUrl(contentItem)); diff --git a/plainqt/style/qtmeegofilepicker.h b/plainqt/style/qtmeegofilepicker.h index fd1ba71e..6400a65e 100644 --- a/plainqt/style/qtmeegofilepicker.h +++ b/plainqt/style/qtmeegofilepicker.h @@ -17,8 +17,8 @@ ** ****************************************************************************/ -#ifndef MFILEPICKER_H -#define MFILEPICKER_H +#ifndef QTMEEGOFILEPICKER_H +#define QTMEEGOFILEPICKER_H #include <MApplication> #include <MApplicationWindow> diff --git a/src/corelib/i18n/mlocale.cpp b/src/corelib/i18n/mlocale.cpp index 9576bad4..e6616092 100644 --- a/src/corelib/i18n/mlocale.cpp +++ b/src/corelib/i18n/mlocale.cpp @@ -364,7 +364,8 @@ void MLocalePrivate::dateFormatTo12h(icu::DateFormat *df) const bool amPmMarkerWritten = false; QString language = categoryName(MLocale::MLcTime); bool writeAmPmMarkerBeforeHours = false; - if (language.startsWith("ja") || language.startsWith("zh")) + if (language.startsWith( QLatin1String("ja")) + || language.startsWith( QLatin1String("zh"))) writeAmPmMarkerBeforeHours = true; if (writeAmPmMarkerBeforeHours) { for (int i = 0; i < icuFormatQString.size(); ++i) { @@ -1006,7 +1007,7 @@ void MLocalePrivate::setCategoryLocale(MLocale *mlocale, _telephoneLocale = localeName; // here we set the phone number grouping depending on the // setting in the gconf key - if ( _telephoneLocale.startsWith( "en_US" ) ) { + if ( _telephoneLocale.startsWith( QLatin1String( "en_US" ) ) ) { _phoneNumberGrouping = MLocale::NorthAmericanPhoneNumberGrouping; } else { _phoneNumberGrouping = MLocale::NoPhoneNumberGrouping; @@ -2837,7 +2838,7 @@ QString MLocale::formatPhoneNumber( const QString& phoneNumber, // system setting for the grouping if ( tmpGrouping == DefaultPhoneNumberGrouping ) { - if ( d->_telephoneLocale.startsWith( "en_US" ) ) { + if ( d->_telephoneLocale.startsWith( QLatin1String( "en_US" ) ) ) { tmpGrouping = NorthAmericanPhoneNumberGrouping; } else { tmpGrouping = NoPhoneNumberGrouping; @@ -3014,7 +3015,7 @@ QString MLocalePrivate::formatPhoneNumber( const QString& phoneNumber, // 00 is not a valid country calling code in north america // -> do not do grouping in this case at all if ( ( grouping == MLocale::NorthAmericanPhoneNumberGrouping ) - && phoneNumber.startsWith( "00" ) ) + && phoneNumber.startsWith( QLatin1String( "00" ) ) ) { return phoneNumber; } @@ -3036,13 +3037,13 @@ QString MLocalePrivate::formatPhoneNumber( const QString& phoneNumber, result.append( '+' ); remaining.remove( 0, 1 ); } - else if ( remaining.startsWith( "00" ) ) + else if ( remaining.startsWith( QLatin1String( "00" ) ) ) { foundCountryCodeIndicator = true; result.append( "00 " ); remaining.remove( 0, 2 ); } - else if ( remaining.startsWith( "011" ) ) + else if ( remaining.startsWith( QLatin1String( "011" ) ) ) { foundCountryCodeIndicator = true; result.append( "011 " ); @@ -3108,7 +3109,7 @@ QString MLocalePrivate::formatPhoneNumber( const QString& phoneNumber, return result; } // 11 is an invalid code, so disable grouping for this case - else if ( remaining.startsWith( "11" ) ) + else if ( remaining.startsWith( QLatin1String( "11" ) ) ) { result.append( remaining ); return result; diff --git a/src/corelib/i18n/mlocationdatabase.cpp b/src/corelib/i18n/mlocationdatabase.cpp index 26f977c1..e2b2aa54 100644 --- a/src/corelib/i18n/mlocationdatabase.cpp +++ b/src/corelib/i18n/mlocationdatabase.cpp @@ -212,7 +212,7 @@ QList<MCountry> MLocationDatabase::countries() QList<MCountry> list; - foreach( MCountry country, d->countries ) + foreach( const MCountry& country, d->countries ) { list.append( country ); } @@ -226,7 +226,7 @@ QList<MCity> MLocationDatabase::cities() QList<MCity> list; - foreach( MCity city, d->cities ) + foreach( const MCity& city, d->cities ) { list.append( city ); } @@ -240,7 +240,7 @@ QList<MCity> MLocationDatabase::citiesInCountry( const QString& countryKey ) QList<MCity> list; - foreach( MCity city, d->cities ) + foreach( const MCity& city, d->cities ) { if ( city.country().key() == countryKey ) { diff --git a/src/corelib/i18n/mlocationdatabase.h b/src/corelib/i18n/mlocationdatabase.h index 5a0052e6..f447dda3 100644 --- a/src/corelib/i18n/mlocationdatabase.h +++ b/src/corelib/i18n/mlocationdatabase.h @@ -17,8 +17,8 @@ ** ****************************************************************************/ -#ifndef MCITYLIST_H -#define MCITYLIST_H +#ifndef MLOCATIONDATABASE_H +#define MLOCATIONDATABASE_H #include "mexport.h" |