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 /demos | |
parent | 5e997484f91d17cef5c42e2a5a954337c2924b96 (diff) |
Changes: Fix some krazy issues
RevBy: TrustMe
Diffstat (limited to 'demos')
-rw-r--r-- | demos/widgetsgallery/bubblelistmodel.h | 4 | ||||
-rw-r--r-- | demos/widgetsgallery/bubblepage.cpp | 5 | ||||
-rw-r--r-- | demos/widgetsgallery/buttongrouppage.cpp | 1 | ||||
-rw-r--r-- | demos/widgetsgallery/gridimagewidget.h | 5 | ||||
-rw-r--r-- | demos/widgetsgallery/gridmodel.cpp | 8 | ||||
-rw-r--r-- | demos/widgetsgallery/gridvideowidget.cpp | 4 | ||||
-rw-r--r-- | demos/widgetsgallery/itemdetailpage.h | 7 | ||||
-rw-r--r-- | demos/widgetsgallery/mgridpage.cpp | 3 | ||||
-rw-r--r-- | demos/widgetsgallery/mgridpage.h | 4 | ||||
-rw-r--r-- | demos/widgetsgallery/mlistpage.cpp | 8 | ||||
-rw-r--r-- | demos/widgetsgallery/phonebookmodel.cpp | 2 | ||||
-rw-r--r-- | demos/widgetsgallery/pushbuttonpage.cpp | 2 | ||||
-rw-r--r-- | demos/widgetsgallery/swaphook.cpp | 7 | ||||
-rw-r--r-- | demos/widgetsgallery/swaphook.h | 4 | ||||
-rw-r--r-- | demos/widgetsgallery/textentrypage.h | 2 | ||||
-rw-r--r-- | demos/widgetsgallery/timedemo.cpp | 4 |
16 files changed, 41 insertions, 29 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); |