123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154 |
- #include <QFileInfo>
- #include <QDir>
- #include <QDebug>
- #include "defines.h"
- #include "generatordata.h"
- #include "symbian/symbiandefines.h" // TODO remove eventually
- #include "maemo5/maemo5defines.h" // TODO remove eventually
- GeneratorData::GeneratorData()
- {
- m_isRemotelyCompiled = false;
- }
- void GeneratorData::clearAll()
- {
- m_configXmlData.clear();
- m_infoPlistData.clear();
- m_widgetSrcFiles.clear();
- m_pluginSrcFiles.clear();
- m_environmentVariables.clear();
- m_basePath.clear();
- }
- QString GeneratorData::infoPlistValue(const QString &key) const
- {
- return m_infoPlistData.value(key);
- }
- QString GeneratorData::configXmlValue(const QString &key) const
- {
- return m_configXmlData.value(key);
- }
- void GeneratorData::initPaths(QString projectFile,
- QString platformName)
- {
- QFileInfo targetInfo(projectFile);
- QString fileName = targetInfo.fileName().replace(QRegExp("\\s"), "_");
- m_buildDirectory = QString("/hag_build_");
- m_buildDirectory += platformName;
- m_buildDirectory += "/";
- /* OBS
- m_projectDirectory = QString("/hag_build/%1/").arg(fileName);
- m_widgetDirectory = QString("/hag_build/%1/widget/").arg(fileName);
- m_fwDirectory = QString("/hag_build/%1/fw/").arg(fileName);
- m_mwDirectory = QString("/hag_build/%1/mw/").arg(fileName);
- */
- m_projectDirectory = m_buildDirectory + QString("%1/").arg(fileName);
- if (platformName == SYMBIAN_PLATFORMNAME)
- {
- m_srcDirectory = m_projectDirectory;
- m_widgetDirectory = m_projectDirectory + QString("widget/");
- }
- else if (platformName == MAEMO5_PLATFORMNAME)
- {
- m_srcDirectory = m_projectDirectory + QString("src/");
- m_widgetDirectory = m_srcDirectory + QString("widget/");
- }
- else
- {
- ; // TODO this kind of code should not be here
- // TODO GeneratorData eventually should also be platform
- // specific
- }
- m_fwDirectory = m_projectDirectory + QString("fw/");
- m_mwDirectory = m_projectDirectory + QString("mw/");
- m_m5DataDirectory = m_projectDirectory + QString("data/");
- m_m5DebianDirectory = m_projectDirectory + QString("debian/");
- m_widgetFileName = fileName;
- if (targetInfo.canonicalPath().contains(QRegExp("\\s")))
- {
- // Widget path contains spaces -- use temp dir to make abld work
- m_basePath = QDir::tempPath() + HAG_TEMP_DIR;
- }
- else
- {
- // No spaces, use widget path
- m_basePath = targetInfo.canonicalPath();
- }
- }
- QString GeneratorData::basePath() const
- {
- return m_basePath;
- }
- QString GeneratorData::widgetFileName() const
- {
- return m_widgetFileName;
- }
- QString GeneratorData::buildDirectory() const
- {
- return m_basePath + m_buildDirectory;
- }
- QString GeneratorData::projectDirectory() const
- {
- return m_basePath + m_projectDirectory;
- }
- QString GeneratorData::widgetDirectory() const
- {
- return m_basePath + m_widgetDirectory;
- }
- QString GeneratorData::fwDirectory() const
- {
- return m_basePath + m_fwDirectory;
- }
- QString GeneratorData::mwDirectory() const
- {
- return m_basePath + m_mwDirectory;
- }
- QString GeneratorData::srcDirectory() const
- {
- return m_basePath + m_srcDirectory;
- }
- QString GeneratorData::m5DataDirectory() const
- {
- return m_basePath + m_m5DataDirectory;
- }
- QString GeneratorData::m5DebianDirectory() const
- {
- return m_basePath + m_m5DebianDirectory;
- }
- bool GeneratorData::isRemotelyCompiled() const
- {
- return m_isRemotelyCompiled;
- }
- void GeneratorData::setRemotelyCompiled(bool remotelyCompiled)
- {
- m_isRemotelyCompiled = remotelyCompiled;
- }
|