QTfrontend/model/MapModel.cpp
branchwebgl
changeset 8833 c13ebed437cb
parent 8464 c708b4f5cffc
child 9080 9b42757d7e71
--- a/QTfrontend/model/MapModel.cpp	Wed Feb 20 02:21:58 2013 +0100
+++ b/QTfrontend/model/MapModel.cpp	Tue Apr 02 21:00:57 2013 +0200
@@ -26,6 +26,7 @@
 #include "physfs.h"
 #include "MapModel.h"
 #include "HWApplication.h"
+#include "hwconsts.h"
 
 MapModel::MapInfo MapModel::MapInfoRandom = {MapModel::GeneratedMap, "+rnd+", "", 0, "", "", ""};
 MapModel::MapInfo MapModel::MapInfoMaze = {MapModel::GeneratedMaze, "+maze+", "", 0, "", "", ""};
@@ -33,8 +34,6 @@
 
 void MapModel::loadMaps(MapType maptype)
 {
-    const QString appDir = QString(PHYSFS_getBaseDir());
-
     // this method resets the contents of this model (important to know for views).
     beginResetModel();
 
@@ -99,7 +98,7 @@
 
             // detect if map is dlc
             QString mapDir = PHYSFS_getRealDir(QString("Maps/%1/map.cfg").arg(map).toLocal8Bit().data());
-            dlc = !mapDir.startsWith(appDir);
+            dlc = !mapDir.startsWith(datadir->absolutePath());
 
             // let's use some semi-sane hedgehog limit, rather than none
             if (limit == 0)