renaming HWDataManager -> DataManager
authorsheepluva
Thu, 26 Apr 2012 07:22:05 +0200
changeset 6930 d187ea93fc4f
parent 6929 c305d31642ac
child 6931 86c951cd0f3f
renaming HWDataManager -> DataManager
QTfrontend/hwform.cpp
QTfrontend/main.cpp
QTfrontend/model/hats.cpp
QTfrontend/ui/mouseoverfilter.cpp
QTfrontend/ui/page/pageeditteam.cpp
QTfrontend/ui/page/pagetraining.cpp
QTfrontend/ui/widget/chatwidget.cpp
QTfrontend/ui/widget/gamecfgwidget.cpp
QTfrontend/ui/widget/qpushbuttonwithsound.cpp
QTfrontend/util/DataManager.cpp
QTfrontend/util/DataManager.h
QTfrontend/util/HWDataManager.cpp
QTfrontend/util/HWDataManager.h
QTfrontend/util/SDLInteraction.h
QTfrontend/util/namegen.cpp
project_files/hedgewars.pro
--- a/QTfrontend/hwform.cpp	Wed Apr 25 17:44:48 2012 +0200
+++ b/QTfrontend/hwform.cpp	Thu Apr 26 07:22:05 2012 +0200
@@ -91,7 +91,7 @@
 #include "mouseoverfilter.h"
 #include "roomslistmodel.h"
 
-#include "HWDataManager.h"
+#include "DataManager.h"
 
 #ifdef __APPLE__
 #include "M3Panel.h"
@@ -120,7 +120,7 @@
 {
     // set music track
     SDLInteraction::instance().setMusicTrack(
-        HWDataManager::instance().findFileForRead("Music/main_theme.ogg")
+        DataManager::instance().findFileForRead("Music/main_theme.ogg")
     );
 
 #ifdef USE_XFIRE
@@ -1540,7 +1540,7 @@
     HWTeam team(ui.pageCampaign->CBTeam->currentText());
     ui.pageCampaign->CBSelect->clear();
 
-    QStringList entries = HWDataManager::instance().entryList(
+    QStringList entries = DataManager::instance().entryList(
                               "Missions/Campaign",
                               QDir::Files,
                               QStringList("*#*.lua")
--- a/QTfrontend/main.cpp	Wed Apr 25 17:44:48 2012 +0200
+++ b/QTfrontend/main.cpp	Thu Apr 26 07:22:05 2012 +0200
@@ -32,7 +32,7 @@
 #include "hwconsts.h"
 #include "newnetclient.h"
 
-#include "HWDataManager.h"
+#include "DataManager.h"
 
 #ifdef _WIN32
 #include <Shlobj.h>
@@ -209,7 +209,7 @@
         return 1;
     }
 
-    HWDataManager & dataMgr = HWDataManager::instance();
+    DataManager & dataMgr = DataManager::instance();
 
     {
         QStringList themes;
--- a/QTfrontend/model/hats.cpp	Wed Apr 25 17:44:48 2012 +0200
+++ b/QTfrontend/model/hats.cpp	Thu Apr 26 07:22:05 2012 +0200
@@ -23,12 +23,12 @@
 #include "hwform.h"
 #include "hats.h"
 
-#include "HWDataManager.h"
+#include "DataManager.h"
 
 HatsModel::HatsModel(QObject* parent) :
     QAbstractListModel(parent)
 {
-    HWDataManager & dataMgr = HWDataManager::instance();
+    DataManager & dataMgr = DataManager::instance();
 
     QPixmap hhpix = QPixmap(
                         dataMgr.findFileForRead("Graphics/Hedgehog/Idle.png")
--- a/QTfrontend/ui/mouseoverfilter.cpp	Wed Apr 25 17:44:48 2012 +0200
+++ b/QTfrontend/ui/mouseoverfilter.cpp	Thu Apr 26 07:22:05 2012 +0200
@@ -11,7 +11,7 @@
 #include "ui_hwform.h"
 #include "hwform.h"
 #include "gameuiconfig.h"
-#include "HWDataManager.h"
+#include "DataManager.h"
 #include "SDLInteraction.h"
 
 MouseOverFilter::MouseOverFilter(QObject *parent) :
@@ -41,7 +41,7 @@
         QTabWidget * tab = dynamic_cast<QTabWidget*>(dist);
         if (HWForm::config->isFrontendSoundEnabled() && (button || textfield || checkbox || droplist || slider || tab))
         {
-            HWDataManager & dataMgr = HWDataManager::instance();
+            DataManager & dataMgr = DataManager::instance();
             SDLInteraction::instance().playSoundFile(dataMgr.findFileForRead("Sounds/steps.ogg"));
         }
 
--- a/QTfrontend/ui/page/pageeditteam.cpp	Wed Apr 25 17:44:48 2012 +0200
+++ b/QTfrontend/ui/page/pageeditteam.cpp	Thu Apr 26 07:22:05 2012 +0200
@@ -32,7 +32,7 @@
 #include "hats.h"
 #include "HWApplication.h"
 
-#include "HWDataManager.h"
+#include "DataManager.h"
 
 #include "pageeditteam.h"
 
@@ -245,7 +245,7 @@
 
     m_playerHash = "0000000000000000000000000000000000000000";
 
-    HWDataManager & dataMgr = HWDataManager::instance();
+    DataManager & dataMgr = DataManager::instance();
 
     QStringList list;
 
@@ -333,14 +333,14 @@
 
 void PageEditTeam::CBFort_activated(const QString & fortname)
 {
-    HWDataManager & dataMgr = HWDataManager::instance();
+    DataManager & dataMgr = DataManager::instance();
     QPixmap pix(dataMgr.findFileForRead("Forts/" + fortname + "L.png"));
     FortPreview->setPixmap(pix);
 }
 
 void PageEditTeam::testSound()
 {
-    HWDataManager & dataMgr = HWDataManager::instance();
+    DataManager & dataMgr = DataManager::instance();
 
     QString voiceDir = QString("Sounds/voices/") + CBVoicepack->currentText();
 
--- a/QTfrontend/ui/page/pagetraining.cpp	Wed Apr 25 17:44:48 2012 +0200
+++ b/QTfrontend/ui/page/pagetraining.cpp	Thu Apr 26 07:22:05 2012 +0200
@@ -28,7 +28,7 @@
 #include <QSettings>
 
 #include "hwconsts.h"
-#include "HWDataManager.h"
+#include "DataManager.h"
 
 #include "pagetraining.h"
 
@@ -115,7 +115,7 @@
 {
     initPage();
 
-    HWDataManager & dataMgr = HWDataManager::instance();
+    DataManager & dataMgr = DataManager::instance();
 
     // get locale
     QSettings settings(cfgdir->absolutePath() + "/hedgewars.ini",
@@ -186,7 +186,7 @@
 
 void PageTraining::updateInfo()
 {
-    HWDataManager & dataMgr = HWDataManager::instance();
+    DataManager & dataMgr = DataManager::instance();
 
     if (lstMissions->currentItem())
     {
--- a/QTfrontend/ui/widget/chatwidget.cpp	Wed Apr 25 17:44:48 2012 +0200
+++ b/QTfrontend/ui/widget/chatwidget.cpp	Thu Apr 26 07:22:05 2012 +0200
@@ -37,7 +37,7 @@
 #include <QMessageBox>
 
 
-#include "HWDataManager.h"
+#include "DataManager.h"
 #include "hwconsts.h"
 #include "gameuiconfig.h"
 
@@ -126,7 +126,7 @@
     if (orgStyleSheet.isEmpty())
     {
         // load external stylesheet if there is any
-        QFile extFile(HWDataManager::instance().findFileForRead("css/chat.css"));
+        QFile extFile(DataManager::instance().findFileForRead("css/chat.css"));
 
         QFile resFile(":/res/css/chat.css");
 
@@ -256,11 +256,11 @@
 
         foreach (QString vp, vpList)
         {
-            m_helloSounds.append(HWDataManager::instance().findFileForRead(
+            m_helloSounds.append(DataManager::instance().findFileForRead(
                                QString("Sounds/voices/%1/Hello.ogg").arg(vp)));
         }
 
-        m_hilightSound = HWDataManager::instance().findFileForRead(
+        m_hilightSound = DataManager::instance().findFileForRead(
                              "Sounds/beep.ogg");
 
     }
@@ -986,7 +986,7 @@
 void HWChatWidget::saveStyleSheet()
 {
     QString dest =
-        HWDataManager::instance().findFileForWrite("css/chat.css");
+        DataManager::instance().findFileForWrite("css/chat.css");
 
     QFile file(dest);
     if (file.open(QIODevice::WriteOnly | QIODevice::Text))
--- a/QTfrontend/ui/widget/gamecfgwidget.cpp	Wed Apr 25 17:44:48 2012 +0200
+++ b/QTfrontend/ui/widget/gamecfgwidget.cpp	Thu Apr 26 07:22:05 2012 +0200
@@ -28,7 +28,7 @@
 
 #include "gamecfgwidget.h"
 #include "igbox.h"
-#include "HWDataManager.h"
+#include "DataManager.h"
 #include "hwconsts.h"
 #include "ammoSchemeModel.h"
 #include "proto.h"
@@ -64,7 +64,7 @@
         QString script = (*scriptList)[i].remove(".lua", Qt::CaseInsensitive);
         QList<QVariant> scriptInfo;
         scriptInfo.push_back(script);
-        QFile scriptCfgFile(HWDataManager::instance().findFileForRead(
+        QFile scriptCfgFile(DataManager::instance().findFileForRead(
                                 QString("Scripts/Multiplayer/%2.cfg").arg(script)));
         if (scriptCfgFile.exists() && scriptCfgFile.open(QFile::ReadOnly))
         {
--- a/QTfrontend/ui/widget/qpushbuttonwithsound.cpp	Wed Apr 25 17:44:48 2012 +0200
+++ b/QTfrontend/ui/widget/qpushbuttonwithsound.cpp	Thu Apr 26 07:22:05 2012 +0200
@@ -2,7 +2,7 @@
 #include <QDir>
 
 #include "qpushbuttonwithsound.h"
-#include "HWDataManager.h"
+#include "DataManager.h"
 #include "SDLInteraction.h"
 #include "hwform.h"
 #include "gameuiconfig.h"
@@ -19,7 +19,7 @@
     if ( !isSoundEnabled || !HWForm::config->isFrontendSoundEnabled())
         return;
 
-    HWDataManager & dataMgr = HWDataManager::instance();
+    DataManager & dataMgr = DataManager::instance();
 
     if (this->isEnabled())
         SDLInteraction::instance().playSoundFile(dataMgr.findFileForRead("Sounds/roperelease.ogg"));
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QTfrontend/util/DataManager.cpp	Thu Apr 26 07:22:05 2012 +0200
@@ -0,0 +1,117 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2006-2007 Igor Ulyanov <iulyanov@gmail.com>
+ * Copyright (c) 2007-2012 Andrey Korotaev <unC0Rr@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+/**
+ * @file
+ * @brief DataManager class implementation
+ */
+
+#include <QMap>
+#include <QStringList>
+
+#include <QFileInfo>
+
+#include "hwconsts.h"
+
+#include "DataManager.h"
+
+
+DataManager::DataManager()
+{
+    userData = new QDir(cfgdir->absolutePath());
+    if (!userData->cd("Data"))
+        userData = NULL;
+
+    defaultData = new QDir(datadir->absolutePath());
+}
+
+
+DataManager & DataManager::instance()
+{
+    static DataManager instance;
+    return instance;
+}
+
+
+QStringList DataManager::entryList(
+    const QString & subDirectory,
+    QDir::Filters filters,
+    const QStringList & nameFilters
+) const
+{
+    QStringList result;
+
+    if (userData != NULL)
+    {
+        QDir tmpDir(*userData);
+        if (tmpDir.cd(subDirectory))
+            result.append(tmpDir.entryList(nameFilters, filters));
+    }
+
+    QDir tmpDir(*defaultData);
+    if (tmpDir.cd(subDirectory))
+        result.append(tmpDir.entryList(nameFilters, filters));
+
+    result.removeDuplicates();
+
+    // sort case-insensitive
+    QMap<QString, QString> sortedFileNames;
+    foreach ( QString fn, result)
+    {
+        sortedFileNames.insert(fn.toLower(), fn);
+    }
+    result = sortedFileNames.values();
+
+    return result;
+}
+
+
+QString DataManager::findFileForRead(
+    const QString & relativeDataFilePath) const
+{
+    QString path;
+
+    if (userData != NULL)
+        path = userData->absolutePath()+"/"+relativeDataFilePath;
+
+    if ((!path.isEmpty()) && (!QFile::exists(path)))
+        path = defaultData->absolutePath()+"/"+relativeDataFilePath;
+
+    return path;
+}
+
+
+QString DataManager::findFileForWrite(
+    const QString & relativeDataFilePath) const
+{
+    if (userData != NULL)
+    {
+        QString path = userData->absolutePath()+"/"+relativeDataFilePath;
+
+        // create folders if needed
+        QDir tmp;
+        tmp.mkpath(QFileInfo(path).absolutePath());
+
+        return path;
+    }
+
+
+    return "";
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QTfrontend/util/DataManager.h	Thu Apr 26 07:22:05 2012 +0200
@@ -0,0 +1,107 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2006-2007 Igor Ulyanov <iulyanov@gmail.com>
+ * Copyright (c) 2007-2012 Andrey Korotaev <unC0Rr@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+/**
+ * @file
+ * @brief DataManager class definition
+ */
+
+#ifndef HEDGEWARS_DATAMANAGER_H
+#define HEDGEWARS_DATAMANAGER_H
+
+#include <QDir>
+#include <QFile>
+
+#include <QStringList>
+
+class QDir;
+class QFile;
+class QStringList;
+
+/**
+ * @brief Offers access to the data files of hedgewars.
+ *
+ * @see <a href="http://en.wikipedia.org/wiki/Singleton_pattern">singleton pattern</a>
+ *
+ * @author sheepluva
+ * @since 0.9.17
+ */
+class DataManager
+{
+    public:
+        /**
+         * @brief Returns reference to the <i>singleton</i> instance of this class.
+         *
+         * @see <a href="http://en.wikipedia.org/wiki/Singleton_pattern">singleton pattern</a>
+         *
+         * @return reference to the instance.
+         */
+        static DataManager & instance();
+
+        /**
+         * @brief Returns a sorted list of data directory entries.
+         *
+         * @param subDirectory sub-directory to search.
+         * @param filters filters for entry type.
+         * @param nameFilters filters by name patterns.
+         * @return a sorted list of matches in the subDirectory of data directory.
+         */
+        QStringList entryList(const QString & subDirectory,
+                              QDir::Filters filters = QDir::NoFilter,
+                              const QStringList & nameFilters = QStringList("*")
+                             ) const;
+
+        /**
+         * @brief Returns the path for the desires data file.
+         *
+         * Use this method if you want to read an existing data file.
+         *
+         * @param relativeDataFilePath relative path of the data file.
+         * @return real path to the file.
+         */
+        QString findFileForRead(const QString & relativeDataFilePath) const;
+
+
+        /**
+         * @brief Returns the path for the data file that is to be written.
+         *
+         * Use this method if you want to create or write into a data file.
+         *
+         * @param relativeDataFilePath relative path of data file write path.
+         * @return destination of path data file.
+         */
+        QString findFileForWrite(const QString & relativeDataFilePath) const;
+
+
+    private:
+        /**
+         * @brief Class constructor of the <i>singleton</i>.
+         *
+         * Not to be used from outside the class,
+         * use the static {@link DataManager::instance()} instead.
+         *
+         * @see <a href="http://en.wikipedia.org/wiki/Singleton_pattern">singleton pattern</a>
+         */
+        DataManager();
+
+        QDir * defaultData; ///< directory of the installed data
+        QDir * userData;    ///< directory of custom data in the user's directory
+};
+
+#endif // HEDGEWARS_DATAMANAGER_H
--- a/QTfrontend/util/HWDataManager.cpp	Wed Apr 25 17:44:48 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,117 +0,0 @@
-/*
- * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2007 Igor Ulyanov <iulyanov@gmail.com>
- * Copyright (c) 2007-2012 Andrey Korotaev <unC0Rr@gmail.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
- */
-
-/**
- * @file
- * @brief HWDataManager class implementation
- */
-
-#include <QMap>
-#include <QStringList>
-
-#include <QFileInfo>
-
-#include "hwconsts.h"
-
-#include "HWDataManager.h"
-
-
-HWDataManager::HWDataManager()
-{
-    userData = new QDir(cfgdir->absolutePath());
-    if (!userData->cd("Data"))
-        userData = NULL;
-
-    defaultData = new QDir(datadir->absolutePath());
-}
-
-
-HWDataManager & HWDataManager::instance()
-{
-    static HWDataManager instance;
-    return instance;
-}
-
-
-QStringList HWDataManager::entryList(
-    const QString & subDirectory,
-    QDir::Filters filters,
-    const QStringList & nameFilters
-) const
-{
-    QStringList result;
-
-    if (userData != NULL)
-    {
-        QDir tmpDir(*userData);
-        if (tmpDir.cd(subDirectory))
-            result.append(tmpDir.entryList(nameFilters, filters));
-    }
-
-    QDir tmpDir(*defaultData);
-    if (tmpDir.cd(subDirectory))
-        result.append(tmpDir.entryList(nameFilters, filters));
-
-    result.removeDuplicates();
-
-    // sort case-insensitive
-    QMap<QString, QString> sortedFileNames;
-    foreach ( QString fn, result)
-    {
-        sortedFileNames.insert(fn.toLower(), fn);
-    }
-    result = sortedFileNames.values();
-
-    return result;
-}
-
-
-QString HWDataManager::findFileForRead(
-    const QString & relativeDataFilePath) const
-{
-    QString path;
-
-    if (userData != NULL)
-        path = userData->absolutePath()+"/"+relativeDataFilePath;
-
-    if ((!path.isEmpty()) && (!QFile::exists(path)))
-        path = defaultData->absolutePath()+"/"+relativeDataFilePath;
-
-    return path;
-}
-
-
-QString HWDataManager::findFileForWrite(
-    const QString & relativeDataFilePath) const
-{
-    if (userData != NULL)
-    {
-        QString path = userData->absolutePath()+"/"+relativeDataFilePath;
-
-        // create folders if needed
-        QDir tmp;
-        tmp.mkpath(QFileInfo(path).absolutePath());
-
-        return path;
-    }
-
-
-    return "";
-}
-
--- a/QTfrontend/util/HWDataManager.h	Wed Apr 25 17:44:48 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,107 +0,0 @@
-/*
- * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2007 Igor Ulyanov <iulyanov@gmail.com>
- * Copyright (c) 2007-2012 Andrey Korotaev <unC0Rr@gmail.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
- */
-
-/**
- * @file
- * @brief HWDataManager class definition
- */
-
-#ifndef HEDGEWARS_HWDATAMANAGER_H
-#define HEDGEWARS_HWDATAMANAGER_H
-
-#include <QDir>
-#include <QFile>
-
-#include <QStringList>
-
-class QDir;
-class QFile;
-class QStringList;
-
-/**
- * @brief Offers access to the data files of hedgewars.
- *
- * @see <a href="http://en.wikipedia.org/wiki/Singleton_pattern">singleton pattern</a>
- *
- * @author sheepluva
- * @since 0.9.17
- */
-class HWDataManager
-{
-    public:
-        /**
-         * @brief Returns reference to the <i>singleton</i> instance of this class.
-         *
-         * @see <a href="http://en.wikipedia.org/wiki/Singleton_pattern">singleton pattern</a>
-         *
-         * @return reference to the instance.
-         */
-        static HWDataManager & instance();
-
-        /**
-         * @brief Returns a sorted list of data directory entries.
-         *
-         * @param subDirectory sub-directory to search.
-         * @param filters filters for entry type.
-         * @param nameFilters filters by name patterns.
-         * @return a sorted list of matches in the subDirectory of data directory.
-         */
-        QStringList entryList(const QString & subDirectory,
-                              QDir::Filters filters = QDir::NoFilter,
-                              const QStringList & nameFilters = QStringList("*")
-                             ) const;
-
-        /**
-         * @brief Returns the path for the desires data file.
-         *
-         * Use this method if you want to read an existing data file.
-         *
-         * @param relativeDataFilePath relative path of the data file.
-         * @return real path to the file.
-         */
-        QString findFileForRead(const QString & relativeDataFilePath) const;
-
-
-        /**
-         * @brief Returns the path for the data file that is to be written.
-         *
-         * Use this method if you want to create or write into a data file.
-         *
-         * @param relativeDataFilePath relative path of data file write path.
-         * @return destination of path data file.
-         */
-        QString findFileForWrite(const QString & relativeDataFilePath) const;
-
-
-    private:
-        /**
-         * @brief Class constructor of the <i>singleton</i>.
-         *
-         * Not to be used from outside the class,
-         * use the static {@link HWDataManager::instance()} instead.
-         *
-         * @see <a href="http://en.wikipedia.org/wiki/Singleton_pattern">singleton pattern</a>
-         */
-        HWDataManager();
-
-        QDir * defaultData; ///< directory of the installed data
-        QDir * userData;    ///< directory of custom data in the user's directory
-};
-
-#endif // HEDGEWARS_HWDATAMANAGER_H
--- a/QTfrontend/util/SDLInteraction.h	Wed Apr 25 17:44:48 2012 +0200
+++ b/QTfrontend/util/SDLInteraction.h	Thu Apr 26 07:22:05 2012 +0200
@@ -43,7 +43,7 @@
          * @brief Class constructor of the <i>singleton</i>.
          *
          * Not to be used from outside the class,
-         * use the static {@link HWDataManager::instance()} instead.
+         * use the static {@link DataManager::instance()} instead.
          *
          * @see <a href="http://en.wikipedia.org/wiki/Singleton_pattern">singleton pattern</a>
          */
--- a/QTfrontend/util/namegen.cpp	Wed Apr 25 17:44:48 2012 +0200
+++ b/QTfrontend/util/namegen.cpp	Thu Apr 26 07:22:05 2012 +0200
@@ -23,7 +23,7 @@
 #include <QLineEdit>
 
 #include "hwform.h"
-#include "HWDataManager.h"
+#include "DataManager.h"
 
 #include "namegen.h"
 
@@ -125,7 +125,7 @@
     QStringList list;
 
     // find .txt to load the names from
-    QFile * file = new QFile(HWDataManager::instance().findFileForRead(QString(
+    QFile * file = new QFile(DataManager::instance().findFileForRead(QString(
                                  "Names/%1.txt").arg(filename)));
 
     if (file->exists() && file->open(QIODevice::ReadOnly | QIODevice::Text))
@@ -154,7 +154,7 @@
     QStringList list;
 
     // find .cfg to load the dicts from
-    QFile * file = new QFile(HWDataManager::instance().findFileForRead(QString(
+    QFile * file = new QFile(DataManager::instance().findFileForRead(QString(
                                  "Names/%1.cfg").arg(hatname)));
 
     if (file->exists() && file->open(QIODevice::ReadOnly | QIODevice::Text))
@@ -184,7 +184,7 @@
 
     // find .ini to load the names from
     QFile * file = new QFile(
-        HWDataManager::instance().findFileForRead(QString("Names/types.ini")));
+        DataManager::instance().findFileForRead(QString("Names/types.ini")));
 
 
     if (file->exists() && file->open(QIODevice::ReadOnly | QIODevice::Text))
@@ -243,7 +243,7 @@
     QStringList Graves;
 
     //list all available Graves
-    Graves.append(HWDataManager::instance().entryList(
+    Graves.append(DataManager::instance().entryList(
                       "Graphics/Graves",
                       QDir::Files,
                       QStringList("*.png")
@@ -265,7 +265,7 @@
     QStringList Forts;
 
     //list all available Forts
-    Forts.append(HWDataManager::instance().entryList(
+    Forts.append(DataManager::instance().entryList(
                      "Forts",
                      QDir::Files,
                      QStringList("*L.png")
--- a/project_files/hedgewars.pro	Wed Apr 25 17:44:48 2012 +0200
+++ b/project_files/hedgewars.pro	Thu Apr 26 07:22:05 2012 +0200
@@ -72,7 +72,7 @@
     ../QTfrontend/ui/widget/mapContainer.h \
     ../QTfrontend/ui/widget/HistoryLineEdit.h \
     ../QTfrontend/ui/widget/SmartLineEdit.h \
-    ../QTfrontend/util/HWDataManager.h \
+    ../QTfrontend/util/DataManager.h \
     ../QTfrontend/net/netregister.h \
     ../QTfrontend/net/netserver.h \
     ../QTfrontend/net/netudpwidget.h \
@@ -153,7 +153,7 @@
     ../QTfrontend/ui/widget/mapContainer.cpp \
     ../QTfrontend/ui/widget/HistoryLineEdit.cpp \
     ../QTfrontend/ui/widget/SmartLineEdit.cpp \
-    ../QTfrontend/util/HWDataManager.cpp \
+    ../QTfrontend/util/DataManager.cpp \
     ../QTfrontend/net/tcpBase.cpp \
     ../QTfrontend/net/netregister.cpp \
     ../QTfrontend/net/proto.cpp \