Browse code

Fixed handling of tileset renaming by terrains dock

By adding missing slot implementation.

Also removed an unused variable.

Thorbjørn Lindeijer authored on 04/06/2012 19:02:40
Showing 2 changed files
... ...
@@ -218,15 +218,12 @@ void TerrainDock::insertTilesetView(int index, Tileset *tileset)
218 218
 
219 219
 void TerrainDock::updateActions()
220 220
 {
221
-    bool external = false;
222 221
     TerrainView *view = 0;
223 222
     const int index = mTabBar->currentIndex();
224 223
     if (index > -1) {
225 224
         view = terrainViewAt(index);
226
-        if (view) {
225
+        if (view)
227 226
             mViewStack->setCurrentWidget(view);
228
-            external = view->terrainModel()->tileset()->isExternal();
229
-        }
230 227
     }
231 228
 }
232 229
 
... ...
@@ -296,6 +293,17 @@ void TerrainDock::tilesetMoved(int from, int to)
296 293
     }
297 294
 }
298 295
 
296
+void TerrainDock::tilesetNameChanged(Tileset *tileset)
297
+{
298
+    for (int i = 0; i < mTabBar->count(); i++) {
299
+        TerrainView *view = terrainViewAt(i);
300
+        if (tileset == view->terrainModel()->tileset()) {
301
+            mTabBar->setTabText(i, tileset->name());
302
+            return;
303
+        }
304
+    }
305
+}
306
+
299 307
 /**
300 308
  * Removes the currently selected tileset.
301 309
  */
... ...
@@ -97,6 +97,7 @@ private slots:
97 97
     void tilesetChanged(Tileset *tileset);
98 98
     void tilesetRemoved(Tileset *tileset);
99 99
     void tilesetMoved(int from, int to);
100
+    void tilesetNameChanged(Tileset *tileset);
100 101
 
101 102
     void removeTileset();
102 103
     void removeTileset(int index);