StelSkyCultureMgr.cpp   StelSkyCultureMgr.cpp 
skipping to change at line 37 skipping to change at line 37
#include <QString> #include <QString>
#include <QStringList> #include <QStringList>
#include <QVariant> #include <QVariant>
#include <QDebug> #include <QDebug>
#include <QMap> #include <QMap>
#include <QMapIterator> #include <QMapIterator>
StelSkyCultureMgr::StelSkyCultureMgr() StelSkyCultureMgr::StelSkyCultureMgr()
{ {
QSet<QString> cultureDirNames; QSet<QString> cultureDirNames;
StelFileMgr& fileMan(StelApp::getInstance().getFileMgr());
try try
{ {
cultureDirNames = fileMan.listContents("skycultures",StelFil eMgr::Directory); cultureDirNames = StelFileMgr::listContents("skycultures",St elFileMgr::Directory);
} }
catch (std::runtime_error& e) catch (std::runtime_error& e)
{ {
qWarning() << "ERROR while trying list sky cultures:" << e.w hat(); qWarning() << "ERROR while trying list sky cultures:" << e.w hat();
} }
for (QSet<QString>::iterator dir=cultureDirNames.begin(); dir!=cultu reDirNames.end(); dir++) foreach (const QString& dir, cultureDirNames)
{ {
try try
{ {
QSettings pd(fileMan.findFile("skycultures/" + *dir QSettings pd(StelFileMgr::findFile("skycultures/" +
+ "/info.ini"), StelIniFormat); dir + "/info.ini"), StelIniFormat);
dirToNameEnglish[*dir].englishName = pd.value("info/ dirToNameEnglish[dir].englishName = pd.value("info/n
name").toString(); ame").toString();
dirToNameEnglish[*dir].author = pd.value("info/autho dirToNameEnglish[dir].author = pd.value("info/author
r").toString(); ").toString();
} }
catch (std::runtime_error& e) catch (std::runtime_error& e)
{ {
qWarning() << "WARNING: unable to successfully read info.ini file from skyculture dir" << *dir; qWarning() << "WARNING: unable to successfully read info.ini file from skyculture dir" << dir;
} }
} }
} }
StelSkyCultureMgr::~StelSkyCultureMgr() StelSkyCultureMgr::~StelSkyCultureMgr()
{ {
} }
//! Init itself from a config file. //! Init itself from a config file.
void StelSkyCultureMgr::init() void StelSkyCultureMgr::init()
skipping to change at line 133 skipping to change at line 132
QStringList cultures; QStringList cultures;
QMapIterator<QString, StelSkyCulture> i(dirToNameEnglish); QMapIterator<QString, StelSkyCulture> i(dirToNameEnglish);
while (i.hasNext()) while (i.hasNext())
{ {
i.next(); i.next();
cultures += q_(i.value().englishName); cultures += q_(i.value().englishName);
} }
return cultures; return cultures;
} }
QStringList StelSkyCultureMgr::getSkyCultureListIDs(void)
{
return dirToNameEnglish.keys();
}
QString StelSkyCultureMgr::directoryToSkyCultureEnglish(const QString& dire ctory) QString StelSkyCultureMgr::directoryToSkyCultureEnglish(const QString& dire ctory)
{ {
return dirToNameEnglish[directory].englishName; return dirToNameEnglish[directory].englishName;
} }
QString StelSkyCultureMgr::directoryToSkyCultureI18(const QString& director y) const QString StelSkyCultureMgr::directoryToSkyCultureI18(const QString& director y) const
{ {
QString culture = dirToNameEnglish[directory].englishName; QString culture = dirToNameEnglish[directory].englishName;
if (culture=="") if (culture=="")
{ {
 End of changes. 6 change blocks. 
10 lines changed or deleted 14 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/