handled the case when the map is not available
authorpavelpa <pavelpa@localhost>
Tue, 19 Jan 2010 08:27:46 +0000 (08:27 +0000)
committerpavelpa <pavelpa@localhost>
Tue, 19 Jan 2010 08:27:46 +0000 (08:27 +0000)
src/gui/mainwindow.cpp
src/maps.qrc
src/maps/rooms/not-available.png [new file with mode: 0644]

index 8682e5a6758f95ed8228663f3ed58e9a8dfa2b66..049c52daca51adaf2091cf0e9f4f0ddf4c2f1efc 100644 (file)
@@ -200,6 +200,8 @@ void MainWindow::displayMap(const QModelIndex &aIndex)
 {
     Event *event = static_cast<Event*>(aIndex.internalPointer());
     QString mapPath = QString(":/maps/rooms/%1.png").arg(event->room());
+    if(!QFile::exists(mapPath))
+        mapPath = QString(":/maps/rooms/not-available.png");
     QPixmap map(mapPath);
     MapWindow window(map,this);
     window.exec();
index 8f2e299a31587a249eba23308d04aa888b72d98d..de7c3687ba28bae4b78cdd3d24f9d0bbcea19a6e 100644 (file)
@@ -24,6 +24,7 @@
     <file>maps/rooms/janson.png</file>
     <file>maps/rooms/lameere.png</file>
     <file>maps/rooms/ua2114.png</file>
+    <file>maps/rooms/not-available.png</file>
 </qresource>
 </RCC>
 
diff --git a/src/maps/rooms/not-available.png b/src/maps/rooms/not-available.png
new file mode 100644 (file)
index 0000000..ebfedad
Binary files /dev/null and b/src/maps/rooms/not-available.png differ