summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFriedrich W. H. Kossebau <kossebau@kde.org>2016-09-02 23:34:29 (GMT)
committerFriedrich W. H. Kossebau <kossebau@kde.org>2016-09-03 01:49:47 (GMT)
commit40cbcf1a2b03ffea333a897936e783f70718403a (patch)
treef08420a1e2255f2a030f09bcb2bbdd6980521287
parent77a4ce271b6780361a4fb43971f8f27f880ef6dd (diff)
Use QStringLiteral with all example apps
-rw-r--r--examples/cpp/geopainter/main.cpp2
-rw-r--r--examples/cpp/marble-game/ClickOnThat.cpp15
-rw-r--r--examples/cpp/marble-game/CountryByFlag.cpp18
-rw-r--r--examples/cpp/marble-game/CountryByShape.cpp13
-rw-r--r--examples/cpp/marble-game/GameMainWindow.cpp8
-rw-r--r--examples/cpp/marble-game/gamemain.cpp8
-rw-r--r--examples/cpp/marbleQuick2/main.cpp6
-rw-r--r--examples/cpp/search/main.cpp2
-rw-r--r--examples/cpp/squad-interpolation/squad-interpolation.cpp8
-rw-r--r--examples/cpp/vehicletracking/vehicletracking.cpp4
10 files changed, 50 insertions, 34 deletions
diff --git a/examples/cpp/geopainter/main.cpp b/examples/cpp/geopainter/main.cpp
index 5a5518f..1400324 100644
--- a/examples/cpp/geopainter/main.cpp
+++ b/examples/cpp/geopainter/main.cpp
@@ -27,7 +27,7 @@ void MyMarbleWidget::customPaint(GeoPainter* painter)
painter->setPen(Qt::green);
painter->drawEllipse(home, 7, 7);
painter->setPen(Qt::black);
- painter->drawText(home, "Hello Marble!");
+ painter->drawText(home, QStringLiteral("Hello Marble!"));
}
int main(int argc, char** argv)
diff --git a/examples/cpp/marble-game/ClickOnThat.cpp b/examples/cpp/marble-game/ClickOnThat.cpp
index 09c083f..6531423 100644
--- a/examples/cpp/marble-game/ClickOnThat.cpp
+++ b/examples/cpp/marble-game/ClickOnThat.cpp
@@ -47,10 +47,15 @@ public:
m_countryNames( 0 ),
m_countryBoundaries( 0 )
{
- m_continentsAndOceans << "Asia" << "Africa" << "North America" << "South America"
- << "Antarctica" << "Europe" << "Australia" << "Arctic Ocean" << "Indian Ocean"
- << "North Atlantic Ocean" << "North Pacific Ocean" << "South Pacific Ocean"
- << "South Atlantic Ocean" << "Southern Ocean" ;
+ m_continentsAndOceans
+ << QStringLiteral("Asia") << QStringLiteral("Africa")
+ << QStringLiteral("North America") << QStringLiteral("South America")
+ << QStringLiteral("Antarctica") << QStringLiteral("Europe")
+ << QStringLiteral("Australia")
+ << QStringLiteral("Arctic Ocean") << QStringLiteral("Indian Ocean")
+ << QStringLiteral("North Atlantic Ocean") << QStringLiteral("North Pacific Ocean")
+ << QStringLiteral("South Pacific Ocean") << QStringLiteral("South Atlantic Ocean")
+ << QStringLiteral("Southern Ocean");
}
~ClickOnThatPrivate()
@@ -254,7 +259,7 @@ void ClickOnThat::updateSelectPin(bool result, const GeoDataCoordinates &clicked
iconPath += QLatin1String("/MapTackRoundHeadRed.png");
}
- GeoDataStyle::Ptr style = d->m_selectPinDocument->style("answer");
+ GeoDataStyle::Ptr style = d->m_selectPinDocument->style(QStringLiteral("answer"));
style->iconStyle().setIconPath( iconPath );
d->m_selectPinDocument->addStyle( style );
diff --git a/examples/cpp/marble-game/CountryByFlag.cpp b/examples/cpp/marble-game/CountryByFlag.cpp
index 90197b5..5db2ba4 100644
--- a/examples/cpp/marble-game/CountryByFlag.cpp
+++ b/examples/cpp/marble-game/CountryByFlag.cpp
@@ -41,10 +41,15 @@ public:
m_parent( 0 ),
m_countryNames( 0 )
{
- m_continentsAndOceans << "Asia" << "Africa" << "North America" << "South America"
- << "Antarctica" << "Europe" << "Australia" << "Arctic Ocean" << "Indian Ocean"
- << "North Atlantic Ocean" << "North Pacific Ocean" << "South Pacific Ocean"
- << "South Atlantic Ocean" << "Southern Ocean" ;
+ m_continentsAndOceans
+ << QStringLiteral("Asia") << QStringLiteral("Africa")
+ << QStringLiteral("North America") << QStringLiteral("South America")
+ << QStringLiteral("Antarctica") << QStringLiteral("Europe")
+ << QStringLiteral("Australia")
+ << QStringLiteral("Arctic Ocean") << QStringLiteral("Indian Ocean")
+ << QStringLiteral("North Atlantic Ocean") << QStringLiteral("North Pacific Ocean")
+ << QStringLiteral("South Pacific Ocean") << QStringLiteral("South Atlantic Ocean")
+ << QStringLiteral("Southern Ocean");
}
MarbleWidget *m_marbleWidget;
@@ -136,10 +141,11 @@ void CountryByFlag::postQuestion( QObject *gameObject )
placemark = countryPlacemarks[randomIndex];
if ( !d->m_continentsAndOceans.contains(placemark->name(), Qt::CaseSensitive) ) {
- flagPath = MarbleDirs::path(QLatin1String("flags/flag_") + placemark->countryCode().toLower() + QLatin1String(".svg"));
+ const QString countryCode = placemark->countryCode().toLower();
+ flagPath = MarbleDirs::path(QLatin1String("flags/flag_") + countryCode + QLatin1String(".svg"));
QImage flag = QFile::exists( flagPath ) ? QImage( flagPath ) : QImage();
if ( !flag.isNull() ) {
- flagPath = QString("%1flag_%2.svg").arg("../../../data/flags/").arg(placemark->countryCode().toLower());
+ flagPath = QLatin1String("../../../data/flags/flag_") + countryCode + QLatin1String(".svg");
found = true;
}
}
diff --git a/examples/cpp/marble-game/CountryByShape.cpp b/examples/cpp/marble-game/CountryByShape.cpp
index f6e3193..a88250a 100644
--- a/examples/cpp/marble-game/CountryByShape.cpp
+++ b/examples/cpp/marble-game/CountryByShape.cpp
@@ -46,10 +46,15 @@ public:
m_countryNames( 0 ),
m_countryBoundaries( 0 )
{
- m_continentsAndOceans << "Asia" << "Africa" << "North America" << "South America"
- << "Antarctica" << "Europe" << "Australia" << "Arctic Ocean" << "Indian Ocean"
- << "North Atlantic Ocean" << "North Pacific Ocean" << "South Pacific Ocean"
- << "South Atlantic Ocean" << "Southern Ocean" ;
+ m_continentsAndOceans
+ << QStringLiteral("Asia") << QStringLiteral("Africa")
+ << QStringLiteral("North America") << QStringLiteral("South America")
+ << QStringLiteral("Antarctica") << QStringLiteral("Europe")
+ << QStringLiteral("Australia")
+ << QStringLiteral("Arctic Ocean") << QStringLiteral("Indian Ocean")
+ << QStringLiteral("North Atlantic Ocean") << QStringLiteral("North Pacific Ocean")
+ << QStringLiteral("South Pacific Ocean") << QStringLiteral("South Atlantic Ocean")
+ << QStringLiteral("Southern Ocean");
}
CountryByShape *m_parent;
diff --git a/examples/cpp/marble-game/GameMainWindow.cpp b/examples/cpp/marble-game/GameMainWindow.cpp
index e25eeee..0549ea4 100644
--- a/examples/cpp/marble-game/GameMainWindow.cpp
+++ b/examples/cpp/marble-game/GameMainWindow.cpp
@@ -114,7 +114,7 @@ void Private::setupGameSignals()
if ( root ) {
m_parent->connect( root, SIGNAL(browseMapButtonClicked()),
m_parent, SLOT(browseMapButtonClicked()) );
- QObject *gameOptions = root->findChild<QObject*>("gameOptions");
+ QObject *gameOptions = root->findChild<QObject*>(QStringLiteral("gameOptions"));
m_parent->connect( gameOptions, SIGNAL(nextButtonClicked()),
m_parent, SLOT(createQuestion()) );
@@ -156,7 +156,7 @@ MainWindow::MainWindow( const QString &marbleDataPath, QWidget *parent, Qt::Wind
d->setupMarbleWidget();
setCentralWidget( d->m_marbleWidget );
- d->m_view.setSource( QUrl( "qrc:/Window.qml" ) );
+ d->m_view.setSource(QUrl(QStringLiteral("qrc:/Window.qml")));
QWidget *leftPanel = QWidget::createWindowContainer( &d->m_view, d->dockWidgetContents );
QVBoxLayout *layout = new QVBoxLayout( d->dockWidgetContents );
@@ -178,7 +178,7 @@ MarbleWidget *MainWindow::marbleWidget()
void MainWindow::createQuestion()
{
- QObject *gameObject = d->m_view.rootObject()->findChild<QObject*>("gameOptions");
+ QObject *gameObject = d->m_view.rootObject()->findChild<QObject*>(QStringLiteral("gameOptions"));
if ( gameObject ) {
emit postQuestion( gameObject );
}
@@ -260,7 +260,7 @@ void MainWindow::enableClickOnThatGame()
void MainWindow::displayResult(bool result )
{
- QObject *gameObject = d->m_view.rootObject()->findChild<QObject*>("gameOptions");
+ QObject *gameObject = d->m_view.rootObject()->findChild<QObject*>(QStringLiteral("gameOptions"));
if ( gameObject ) {
QMetaObject::invokeMethod( gameObject, "displayResult",
Q_ARG(QVariant, QVariant(result)) );
diff --git a/examples/cpp/marble-game/gamemain.cpp b/examples/cpp/marble-game/gamemain.cpp
index 3fc653b..50513a2 100644
--- a/examples/cpp/marble-game/gamemain.cpp
+++ b/examples/cpp/marble-game/gamemain.cpp
@@ -28,9 +28,9 @@ using namespace Marble;
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
- app.setApplicationName( "Marble Game" );
- app.setOrganizationName( "KDE" );
- app.setOrganizationDomain( "kde.org" );
+ app.setApplicationName(QStringLiteral("Marble Game"));
+ app.setOrganizationName(QStringLiteral("KDE"));
+ app.setOrganizationDomain(QStringLiteral("kde.org"));
// Widget translation
QString lang = QLocale::system().name().section(QLatin1Char('_'), 0, 0);
@@ -54,7 +54,7 @@ int main(int argc, char *argv[])
QStringList args = QApplication::arguments();
- if ( args.contains( "-h" ) || args.contains( "--help" ) ) {
+ if (args.contains(QStringLiteral("-h")) || args.contains(QStringLiteral("--help"))) {
qWarning() << "Usage: marble [options]";
qWarning();
qWarning() << "general options:";
diff --git a/examples/cpp/marbleQuick2/main.cpp b/examples/cpp/marbleQuick2/main.cpp
index 3fbaf2d..fc3543a 100644
--- a/examples/cpp/marbleQuick2/main.cpp
+++ b/examples/cpp/marbleQuick2/main.cpp
@@ -29,7 +29,7 @@ public:
void componentComplete()
{
- QQuickItem *pinch = findChild<QQuickItem*>("pinchArea");
+ QQuickItem *pinch = findChild<QQuickItem*>(QStringLiteral("pinchArea"));
if (pinch)
{
pinch->installEventFilter(getEventFilter());
@@ -69,7 +69,7 @@ public:
{
MarbleDeclarativePlugin plugin;
plugin.registerTypes("org.kde.marble");
- setSource(QUrl("qrc:/main.qml"));
+ setSource(QUrl(QStringLiteral("qrc:/main.qml")));
if(status()!=QQuickView::Ready)
qDebug("can't initialise view");
@@ -79,7 +79,7 @@ public:
setFormat(format);
setClearBeforeRendering(true);
setColor(QColor(Qt::transparent));
- setTitle("Marble in QML 2.0 demo");
+ setTitle(QStringLiteral("Marble in QML 2.0 demo"));
show();
}
diff --git a/examples/cpp/search/main.cpp b/examples/cpp/search/main.cpp
index 79a96bb..915d43c 100644
--- a/examples/cpp/search/main.cpp
+++ b/examples/cpp/search/main.cpp
@@ -25,7 +25,7 @@ int main(int argc, char** argv)
MarbleModel model;
SearchRunnerManager manager( &model );
- QVector<GeoDataPlacemark*> searchResult = manager.searchPlacemarks( "Karlsruhe" );
+ QVector<GeoDataPlacemark*> searchResult = manager.searchPlacemarks(QStringLiteral("Karlsruhe"));
foreach( const GeoDataPlacemark* placemark, searchResult ) {
qDebug() << "Found" << placemark->name() << "at" << placemark->coordinate().toString();
}
diff --git a/examples/cpp/squad-interpolation/squad-interpolation.cpp b/examples/cpp/squad-interpolation/squad-interpolation.cpp
index 541e1f9..ae5393c 100644
--- a/examples/cpp/squad-interpolation/squad-interpolation.cpp
+++ b/examples/cpp/squad-interpolation/squad-interpolation.cpp
@@ -73,12 +73,12 @@ bool MyPaintLayer::render ( GeoPainter *painter, ViewportParams *viewport, const
painter->drawEllipse ( a2, 8, 8 );
qreal x, y;
if ( viewport->screenCoordinates ( a2, x, y ) ) {
- painter->drawText( x+5, y, "A" );
+ painter->drawText(x+5, y, QStringLiteral("A"));
}
GeoDataCoordinates b1 = basePoint( m_cities[1], m_cities[2], m_cities[3] );
painter->drawEllipse ( b1, 8, 8 );
if ( viewport->screenCoordinates ( b1, x, y ) ) {
- painter->drawText( x+5, y, "B" );
+ painter->drawText(x+5, y, QStringLiteral("B"));
}
QPen grapePen = Marble::Oxygen::grapeViolet4;
@@ -102,7 +102,7 @@ bool MyPaintLayer::render ( GeoPainter *painter, ViewportParams *viewport, const
QPen greenPen = Marble::Oxygen::forestGreen4;
greenPen.setWidth ( 3 );
painter->setPen ( greenPen );
- painter->drawPolyline ( m_interpolated, "Squad\nInterpolation", LineEnd );
+ painter->drawPolyline ( m_interpolated, QStringLiteral("Squad\nInterpolation"), LineEnd );
// Increasing city indices with some transparency effect for readability
QFont font = painter->font();
@@ -219,7 +219,7 @@ int main ( int argc, char** argv )
using namespace Marble;
QApplication app ( argc, argv );
MarbleWidget *mapWidget = new MarbleWidget;
- mapWidget->setWindowTitle( "Marble - Squad Interpolation" );
+ mapWidget->setWindowTitle(QStringLiteral("Marble - Squad Interpolation"));
// Create and register our paint layer
MyPaintLayer* layer = new MyPaintLayer ( mapWidget );
diff --git a/examples/cpp/vehicletracking/vehicletracking.cpp b/examples/cpp/vehicletracking/vehicletracking.cpp
index 2dc79c9..d6d1887 100644
--- a/examples/cpp/vehicletracking/vehicletracking.cpp
+++ b/examples/cpp/vehicletracking/vehicletracking.cpp
@@ -76,8 +76,8 @@ Window::Window(QWidget *parent) :
m_marbleWidget->centerOn(Kiev);
m_marbleWidget->setZoom(2300);
- m_carFirst = new GeoDataPlacemark("Bus");
- m_carSecond = new GeoDataPlacemark("Car");
+ m_carFirst = new GeoDataPlacemark(QStringLiteral("Bus"));
+ m_carSecond = new GeoDataPlacemark(QStringLiteral("Car"));
GeoDataDocument *document = new GeoDataDocument;