Changeset 58eb7cc for src/gui/tabcontainer.cpp
- Timestamp:
- 05/05/10 15:56:57 (13 years ago)
- Branches:
- master, qt5
- Children:
- 0d995ed
- Parents:
- cec47c6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/gui/tabcontainer.cpp
rcec47c6 r58eb7cc 28 28 #include "eventdialog.h" 29 29 #include "mapwindow.h" 30 #include "room.h" 31 #include "errormessage.h" 30 32 31 33 #include "conflictsdialog.h" … … 84 86 Event *event = static_cast<Event*>(aIndex.internalPointer()); 85 87 86 // room names are stored in lower-case format 87 // room names are stored without dots in the name, eg. "aw.1124.png" -> "aw1124.png" 88 QString mapPath = QString(":/maps/rooms/%1.png").arg(event->room().toLower().remove(".")); 89 if(!QFile::exists(mapPath)) 90 mapPath = QString(":/maps/rooms/not-available.png"); 91 92 QString roomName; 93 if(mapPath.contains("not-available", Qt::CaseInsensitive)) 94 roomName = QString("Map is not available: %1").arg(event->room()); 95 else 96 roomName = event->room(); 88 Room room = Room::retrieve(event->roomId()); 89 QVariant mapPathV = room.map(); 90 QString mapPath; 91 if (!mapPathV.isValid()) { 92 error_message("No map for this room"); 93 return; 94 } else { 95 mapPath = mapPathV.toString(); 96 if (!QFile::exists(mapPath)) { 97 error_message("Map for this room not found: " + mapPath); 98 return; 99 } 100 } 97 101 98 102 QPixmap map(mapPath); 99 MapWindow window(map, roomName,this);103 MapWindow window(map, room.name(),this); 100 104 window.exec(); 101 105 }
Note: See TracChangeset
for help on using the changeset viewer.