~bzoltan/kubuntu-packaging/decouple_cmake_plugin

« back to all changes in this revision

Viewing changes to src/plugins/madde/maddedevice.cpp

  • Committer: Timo Jyrinki
  • Date: 2013-11-15 12:25:23 UTC
  • mfrom: (1.1.28)
  • Revision ID: timo.jyrinki@canonical.com-20131115122523-i2kyamsu4gs2mu1m
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/****************************************************************************
2
 
**
3
 
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4
 
** Contact: http://www.qt-project.org/legal
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 "maddedevice.h"
30
 
 
31
 
#include "maddedevicetester.h"
32
 
#include "maemoconstants.h"
33
 
 
34
 
#include <remotelinux/linuxdevicetestdialog.h>
35
 
#include <remotelinux/publickeydeploymentdialog.h>
36
 
#include <remotelinux/remotelinux_constants.h>
37
 
#include <utils/qtcassert.h>
38
 
 
39
 
using namespace ProjectExplorer;
40
 
using namespace RemoteLinux;
41
 
 
42
 
namespace Madde {
43
 
namespace Internal {
44
 
 
45
 
MaddeDevice::Ptr MaddeDevice::create()
46
 
{
47
 
    return Ptr(new MaddeDevice);
48
 
}
49
 
 
50
 
MaddeDevice::Ptr MaddeDevice::create(const QString &name, Core::Id type,
51
 
        MachineType machineType, Origin origin, Core::Id id)
52
 
{
53
 
    return Ptr(new MaddeDevice(name, type, machineType, origin, id));
54
 
}
55
 
 
56
 
MaddeDevice::MaddeDevice()
57
 
{
58
 
}
59
 
 
60
 
MaddeDevice::MaddeDevice(const QString &name, Core::Id type, MachineType machineType,
61
 
        Origin origin, Core::Id id)
62
 
    : LinuxDevice(name, type, machineType, origin, id)
63
 
{
64
 
}
65
 
 
66
 
MaddeDevice::MaddeDevice(const MaddeDevice &other) : LinuxDevice(other)
67
 
{
68
 
}
69
 
 
70
 
ProjectExplorer::IDevice::Ptr MaddeDevice::clone() const
71
 
{
72
 
    return Ptr(new MaddeDevice(*this));
73
 
}
74
 
 
75
 
QString MaddeDevice::displayType() const
76
 
{
77
 
    return maddeDisplayType(type());
78
 
}
79
 
 
80
 
QString MaddeDevice::maddeDisplayType(Core::Id type)
81
 
{
82
 
    if (type == Maemo5OsType)
83
 
        return tr("Maemo5/Fremantle");
84
 
    if (type == HarmattanOsType)
85
 
        return tr("MeeGo 1.2 Harmattan");
86
 
    QTC_ASSERT(false, return QString());
87
 
    return QString(); // For crappy compilers.
88
 
}
89
 
 
90
 
bool MaddeDevice::allowsRemoteMounts(Core::Id type)
91
 
{
92
 
    return type == Maemo5OsType;
93
 
}
94
 
 
95
 
bool MaddeDevice::allowsPackagingDisabling(Core::Id type)
96
 
{
97
 
    return type == Maemo5OsType;
98
 
}
99
 
 
100
 
bool MaddeDevice::allowsQmlDebugging(Core::Id type)
101
 
{
102
 
    return type == HarmattanOsType;
103
 
}
104
 
 
105
 
QSize MaddeDevice::packageManagerIconSize(Core::Id type)
106
 
{
107
 
    if (type == Maemo5OsType)
108
 
        return QSize(48, 48);
109
 
    if (type == HarmattanOsType)
110
 
        return QSize(64, 64);
111
 
    return QSize();
112
 
}
113
 
 
114
 
AbstractLinuxDeviceTester *MaddeDevice::createDeviceTester() const
115
 
{
116
 
    return new MaddeDeviceTester;
117
 
}
118
 
 
119
 
} // namespace Internal
120
 
} // namespace Madde