~fboucault/qtcreator-plugin-ubuntu/newarch_arm64

« back to all changes in this revision

Viewing changes to src/ubuntu/ubuntuqtversion.cpp

  • Committer: CI bot
  • Author(s): Zoltán Balogh
  • Date: 2014-09-30 11:39:10 UTC
  • mfrom: (273.1.16 support_named_chroots)
  • Revision ID: ps-jenkins@lists.canonical.com-20140930113910-8cz1g7fmgh38bmk7
Support named click chroots.

In sync with the fix of the https://bugs.launchpad.net/bugs/1364327 

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
namespace Ubuntu {
10
10
namespace Internal {
11
11
 
 
12
const char SCRIPT_VERSION_KEY[] = "UbuntuQtVersion.ScriptVersion";
 
13
 
 
14
/*!
 
15
 * \brief MIN_SCRIPT_VERSION
 
16
 * Increment this version if all qmake scripts in ~/.config/ubuntu-sdk
 
17
 * need to be recreated
 
18
 */
 
19
const int  MIN_SCRIPT_VERSION   = 1;
 
20
 
12
21
UbuntuQtVersion::UbuntuQtVersion()
13
 
    : BaseQtVersion()
 
22
    : BaseQtVersion(),
 
23
      m_scriptVersion(MIN_SCRIPT_VERSION)
14
24
{ }
15
25
 
16
26
UbuntuQtVersion::UbuntuQtVersion(const Utils::FileName &path, bool isAutodetected, const QString &autodetectionSource)
17
 
    : BaseQtVersion(path, isAutodetected, autodetectionSource)
 
27
    : BaseQtVersion(path, isAutodetected, autodetectionSource),
 
28
      m_scriptVersion(MIN_SCRIPT_VERSION)
18
29
{
19
30
    setDisplayName(defaultDisplayName(qtVersionString(), path, false));
20
31
}
22
33
UbuntuQtVersion::~UbuntuQtVersion()
23
34
{ }
24
35
 
 
36
void UbuntuQtVersion::fromMap(const QVariantMap &map)
 
37
{
 
38
    BaseQtVersion::fromMap(map);
 
39
    m_scriptVersion = map.value(QLatin1String(SCRIPT_VERSION_KEY),0).toInt();
 
40
}
 
41
 
 
42
QVariantMap UbuntuQtVersion::toMap() const
 
43
{
 
44
    QVariantMap map = BaseQtVersion::toMap();
 
45
    map.insert(QLatin1String(SCRIPT_VERSION_KEY),m_scriptVersion);
 
46
    return map;
 
47
}
 
48
 
25
49
UbuntuQtVersion *UbuntuQtVersion::clone() const
26
50
{
27
51
    return new UbuntuQtVersion(*this);
51
75
{
52
76
    return QLatin1String(Constants::UBUNTU_PLATFORM_NAME_TR);
53
77
}
 
78
int UbuntuQtVersion::scriptVersion() const
 
79
{
 
80
    return m_scriptVersion;
 
81
}
 
82
 
 
83
void UbuntuQtVersion::setScriptVersion(int scriptVersion)
 
84
{
 
85
    m_scriptVersion = scriptVersion;
 
86
}
 
87
 
 
88
int UbuntuQtVersion::minimalScriptVersion()
 
89
{
 
90
    return MIN_SCRIPT_VERSION;
 
91
}
 
92
 
54
93
 
55
94
bool UbuntuQtVersionFactory::canRestore(const QString &type)
56
95
{