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 8682e5a..049c52d 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 8f2e299..de7c368 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