tizenqtversion.cpp 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. /****************************************************************************
  2. **
  3. ** Copyright (C) 2013 Jarek Pelczar <jpelczar@gmail.com>
  4. ** Copyright (C) 2014 Tomasz Olszak <olszak.tomasz@gmail.com>
  5. **
  6. ** This file is part of Qt Creator.
  7. **
  8. ** Commercial License Usage
  9. ** Licensees holding valid commercial Qt licenses may use this file in
  10. ** accordance with the commercial license agreement provided with the
  11. ** Software or, alternatively, in accordance with the terms contained in
  12. ** a written agreement between you and Digia. For licensing terms and
  13. ** conditions see http://qt.digia.com/licensing. For further information
  14. ** use the contact form at http://qt.digia.com/contact-us.
  15. **
  16. ** GNU Lesser General Public License Usage
  17. ** Alternatively, this file may be used under the terms of the GNU Lesser
  18. ** General Public License version 2.1 as published by the Free Software
  19. ** Foundation and appearing in the file LICENSE.LGPL included in the
  20. ** packaging of this file. Please review the following information to
  21. ** ensure the GNU Lesser General Public License version 2.1 requirements
  22. ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
  23. **
  24. ** In addition, as a special exception, Digia gives you certain additional
  25. ** rights. These rights are described in the Digia Qt LGPL Exception
  26. ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
  27. **
  28. ****************************************************************************/
  29. #include "tizendebug.h"
  30. #include "tizenqtversion.h"
  31. #include "tizenconstants.h"
  32. #include <qtsupport/qtsupportconstants.h>
  33. #include <QCoreApplication>
  34. using namespace QtSupport;
  35. namespace Tizen {
  36. namespace Internal {
  37. TizenQtVersion::TizenQtVersion()
  38. {
  39. }
  40. TizenQtVersion::TizenQtVersion(const Utils::FileName &path, bool isAutodetected, const QString &autodetectionSource) :
  41. BaseQtVersion(path, isAutodetected, autodetectionSource)
  42. {
  43. setDisplayName(defaultDisplayName(qtVersionString(), path, false));
  44. qCDebug(QTC_TIZEN) << path.toString();
  45. if (path.endsWith(QStringLiteral("qmake-gbs-host"))) {
  46. m_gbsBuildRoot = Utils::FileName::fromString(path.toString().remove(QLatin1Literal("/usr/bin/qmake-gbs-host")));
  47. }
  48. }
  49. TizenQtVersion::~TizenQtVersion()
  50. {
  51. }
  52. TizenQtVersion * TizenQtVersion::clone() const
  53. {
  54. return new TizenQtVersion(*this);
  55. }
  56. QString TizenQtVersion::type() const
  57. {
  58. return QLatin1String(Constants::TIZEN_QT);
  59. }
  60. QList<ProjectExplorer::Abi> TizenQtVersion::detectQtAbis() const
  61. {
  62. return qtAbisFromLibrary(qtCorePaths(versionInfo(), qtVersionString()));
  63. }
  64. QString TizenQtVersion::description() const
  65. {
  66. return QCoreApplication::translate("QtVersion", "Tizen Qt", "Qt version used for Tizen application development");
  67. }
  68. QString TizenQtVersion::platformName() const
  69. {
  70. return QLatin1String(Constants::TIZEN_PLATFORM);
  71. }
  72. QString TizenQtVersion::platformDisplayName() const
  73. {
  74. return QLatin1String(Constants::TIZEN_PLATFORM_TR);
  75. }
  76. Utils::FileName TizenQtVersion::gbsBuildRoot() const
  77. {
  78. return m_gbsBuildRoot;
  79. }
  80. void TizenQtVersion::fromMap(const QVariantMap &map)
  81. {
  82. QString gbsKey(QString::fromLatin1(Constants::TIZEN_QT_GBS_BUILD_ROOT_KEY));
  83. if (map.contains(gbsKey)) {
  84. m_gbsBuildRoot = Utils::FileName::fromString(map.value(gbsKey).toString());
  85. }
  86. BaseQtVersion::fromMap(map);
  87. }
  88. QVariantMap TizenQtVersion::toMap() const
  89. {
  90. QVariantMap result = BaseQtVersion::toMap();
  91. if (!m_gbsBuildRoot.isEmpty()) {
  92. result.insert(QString::fromLatin1(Constants::TIZEN_QT_GBS_BUILD_ROOT_KEY), m_gbsBuildRoot.toString());
  93. }
  94. return result;
  95. }
  96. } // namespace Internal
  97. } // namespace Tizen