Browse code

Coding style fixes

Make sure there is a whitespace between ) and {.

Stefan Beller authored on 29/04/2012 15:59:14 • Thorbjørn Lindeijer committed on 10/06/2012 19:35:10
Showing 5 changed files
... ...
@@ -104,7 +104,7 @@ bool DroidcraftPlugin::write(const Tiled::Map *map, const QString &fileName)
104 104
     TileLayer *mapLayer = map->layerAt(0)->asTileLayer();
105 105
 
106 106
     // Check layer size
107
-    if (mapLayer->width() != 48 || mapLayer->height() != 48){
107
+    if (mapLayer->width() != 48 || mapLayer->height() != 48) {
108 108
         mError = tr("The layer must have a size of 48 x 48 tiles!");
109 109
         return false;
110 110
     }
... ...
@@ -66,7 +66,7 @@ Tiled::Map *JsonPlugin::read(const QString &fileName)
66 66
 bool JsonPlugin::write(const Tiled::Map *map, const QString &fileName)
67 67
 {
68 68
     QFile file(fileName);
69
-    if (!file.open(QIODevice::WriteOnly | QIODevice::Text)){
69
+    if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
70 70
         mError = tr("Could not open file for writing.");
71 71
         return false;
72 72
     }
... ...
@@ -276,7 +276,7 @@ bool TenginePlugin::write(const Tiled::Map *map, const QString &fileName)
276 276
         for (int x = 0; x < width; ++x) {
277 277
             out << itemStart << asciiMap[x + (y * width)] << itemStop << seperator;
278 278
         }
279
-        if (y == height - 1){
279
+        if (y == height - 1) {
280 280
             out << lineStop << returnStop;
281 281
         } else {
282 282
             out << lineStop << endl;
... ...
@@ -172,7 +172,7 @@ bool AutomappingManager::loadFile(const QString &filePath)
172 172
             ret = false;
173 173
             continue;
174 174
         }
175
-        if (rulePath.endsWith(QLatin1String(".tmx"), Qt::CaseInsensitive)){
175
+        if (rulePath.endsWith(QLatin1String(".tmx"), Qt::CaseInsensitive)) {
176 176
             TmxMapReader mapReader;
177 177
 
178 178
             Map *rules = mapReader.read(rulePath);
... ...
@@ -199,7 +199,7 @@ bool AutomappingManager::loadFile(const QString &filePath)
199 199
                 delete autoMapper;
200 200
             }
201 201
         }
202
-        if (rulePath.endsWith(QLatin1String(".txt"), Qt::CaseInsensitive)){
202
+        if (rulePath.endsWith(QLatin1String(".txt"), Qt::CaseInsensitive)) {
203 203
             if (!loadFile(rulePath))
204 204
                 ret = false;
205 205
         }
... ...
@@ -71,7 +71,7 @@ void QuickStampManager::saveQuickStamp(int index)
71 71
     AbstractTool *selectedTool = ToolManager::instance()->selectedTool();
72 72
     TileLayer *copy = 0;
73 73
     if (dynamic_cast<StampBrush*>(selectedTool)) {
74
-        TileLayer *stamp = (dynamic_cast<StampBrush*>(selectedTool))->stamp();
74
+        TileLayer *stamp = (static_cast<StampBrush*>(selectedTool))->stamp();
75 75
         if (!stamp)
76 76
             return;
77 77
 
... ...
@@ -89,7 +89,7 @@ void QuickStampManager::saveQuickStamp(int index)
89 89
         copy = tileLayer->copy(selection.translated(-tileLayer->x(),
90 90
                                                     -tileLayer->y()));
91 91
     } else if (dynamic_cast<BucketFillTool*>(selectedTool)) {
92
-        TileLayer *stamp = (dynamic_cast<BucketFillTool*>(selectedTool))->stamp();
92
+        TileLayer *stamp = (static_cast<BucketFillTool*>(selectedTool))->stamp();
93 93
         if (!stamp)
94 94
             return;
95 95