Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
0ee99ff2
Commit
0ee99ff2
authored
Apr 21, 2011
by
Christian Kandeler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Maemo: Move OsVersion type from MaemoGlobal to MaemoDeviceConfig.
Also move freePorts() method from AbstractMaemoDeployStep to MaemoGlobal.
parent
5294db3d
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
136 additions
and
127 deletions
+136
-127
src/plugins/qt4projectmanager/qt-maemo/abstractmaemodeploystep.cpp
...ns/qt4projectmanager/qt-maemo/abstractmaemodeploystep.cpp
+2
-13
src/plugins/qt4projectmanager/qt-maemo/abstractmaemodeploystep.h
...gins/qt4projectmanager/qt-maemo/abstractmaemodeploystep.h
+0
-1
src/plugins/qt4projectmanager/qt-maemo/maemoanalyzersupport.cpp
...ugins/qt4projectmanager/qt-maemo/maemoanalyzersupport.cpp
+1
-0
src/plugins/qt4projectmanager/qt-maemo/maemoconfigtestdialog.cpp
...gins/qt4projectmanager/qt-maemo/maemoconfigtestdialog.cpp
+4
-4
src/plugins/qt4projectmanager/qt-maemo/maemodeployablelistmodel.cpp
...s/qt4projectmanager/qt-maemo/maemodeployablelistmodel.cpp
+2
-2
src/plugins/qt4projectmanager/qt-maemo/maemodeviceconfigurations.cpp
.../qt4projectmanager/qt-maemo/maemodeviceconfigurations.cpp
+30
-29
src/plugins/qt4projectmanager/qt-maemo/maemodeviceconfigurations.h
...ns/qt4projectmanager/qt-maemo/maemodeviceconfigurations.h
+15
-17
src/plugins/qt4projectmanager/qt-maemo/maemodeviceconfigurationssettingswidget.cpp
...ager/qt-maemo/maemodeviceconfigurationssettingswidget.cpp
+1
-0
src/plugins/qt4projectmanager/qt-maemo/maemodeviceconfigwizard.cpp
...ns/qt4projectmanager/qt-maemo/maemodeviceconfigwizard.cpp
+14
-13
src/plugins/qt4projectmanager/qt-maemo/maemoglobal.cpp
src/plugins/qt4projectmanager/qt-maemo/maemoglobal.cpp
+37
-23
src/plugins/qt4projectmanager/qt-maemo/maemoglobal.h
src/plugins/qt4projectmanager/qt-maemo/maemoglobal.h
+10
-8
src/plugins/qt4projectmanager/qt-maemo/maemopackagecreationstep.cpp
...s/qt4projectmanager/qt-maemo/maemopackagecreationstep.cpp
+3
-3
src/plugins/qt4projectmanager/qt-maemo/maemopertargetdeviceconfigurationlistmodel.cpp
...r/qt-maemo/maemopertargetdeviceconfigurationlistmodel.cpp
+7
-7
src/plugins/qt4projectmanager/qt-maemo/maemopertargetdeviceconfigurationlistmodel.h
...ger/qt-maemo/maemopertargetdeviceconfigurationlistmodel.h
+1
-1
src/plugins/qt4projectmanager/qt-maemo/maemopublishingbuildsettingspagefremantlefree.cpp
...t-maemo/maemopublishingbuildsettingspagefremantlefree.cpp
+1
-1
src/plugins/qt4projectmanager/qt-maemo/maemopublishingwizardfactories.cpp
...rojectmanager/qt-maemo/maemopublishingwizardfactories.cpp
+1
-1
src/plugins/qt4projectmanager/qt-maemo/maemoremoteprocessesdialog.cpp
...qt4projectmanager/qt-maemo/maemoremoteprocessesdialog.cpp
+1
-1
src/plugins/qt4projectmanager/qt-maemo/maemoremoteprocesslist.cpp
...ins/qt4projectmanager/qt-maemo/maemoremoteprocesslist.cpp
+2
-2
src/plugins/qt4projectmanager/qt-maemo/maemorunconfiguration.cpp
...gins/qt4projectmanager/qt-maemo/maemorunconfiguration.cpp
+4
-1
No files found.
src/plugins/qt4projectmanager/qt-maemo/abstractmaemodeploystep.cpp
View file @
0ee99ff2
...
...
@@ -394,23 +394,12 @@ void AbstractMaemoDeployStep::handleRemoteStderr(const QString &output)
}
}
MaemoPortList
AbstractMaemoDeployStep
::
freePorts
()
const
{
return
freePorts
(
m_deviceConfig
);
}
MaemoPortList
AbstractMaemoDeployStep
::
freePorts
(
const
MaemoDeviceConfig
::
ConstPtr
&
devConf
)
const
{
const
Qt4BuildConfiguration
*
const
qt4bc
=
qt4BuildConfiguration
();
if
(
!
devConf
)
if
(
!
qt4bc
)
return
MaemoPortList
();
if
(
devConf
->
type
()
==
MaemoDeviceConfig
::
Emulator
&&
qt4bc
)
{
MaemoQemuRuntime
rt
;
const
int
id
=
qt4bc
->
qtVersion
()
->
uniqueId
();
if
(
MaemoQemuManager
::
instance
().
runtimeForQtVersion
(
id
,
&
rt
))
return
rt
.
m_freePorts
;
}
return
devConf
->
freePorts
();
return
MaemoGlobal
::
freePorts
(
devConf
,
qt4bc
->
qtVersion
());
}
const
Qt4BuildConfiguration
*
AbstractMaemoDeployStep
::
qt4BuildConfiguration
()
const
...
...
src/plugins/qt4projectmanager/qt-maemo/abstractmaemodeploystep.h
View file @
0ee99ff2
...
...
@@ -68,7 +68,6 @@ public:
bool
currentlyNeedsDeployment
(
const
QString
&
host
,
const
MaemoDeployable
&
deployable
)
const
;
void
setDeployed
(
const
QString
&
host
,
const
MaemoDeployable
&
deployable
);
MaemoPortList
freePorts
()
const
;
Qt4MaemoDeployConfiguration
*
maemoDeployConfig
()
const
;
bool
isDeploymentPossible
(
QString
&
whyNot
)
const
;
...
...
src/plugins/qt4projectmanager/qt-maemo/maemoanalyzersupport.cpp
View file @
0ee99ff2
...
...
@@ -32,6 +32,7 @@
**************************************************************************/
#include "maemoanalyzersupport.h"
#include "maemoglobal.h"
#include <analyzerbase/analyzermanager.h>
#include <analyzerbase/analyzerstartparameters.h>
...
...
src/plugins/qt4projectmanager/qt-maemo/maemoconfigtestdialog.cpp
View file @
0ee99ff2
...
...
@@ -98,7 +98,7 @@ void MaemoConfigTestDialog::startConfigTest()
SLOT
(
processSshOutput
(
QByteArray
)));
const
QLatin1String
sysInfoCmd
(
"uname -rsm"
);
QString
command
=
sysInfoCmd
;
if
(
m_config
->
osVersion
()
!=
Maemo
Global
::
GenericLinux
)
{
if
(
m_config
->
osVersion
()
!=
Maemo
DeviceConfig
::
GenericLinux
)
{
const
bool
osUsesRpm
=
MaemoGlobal
::
packagingSystem
(
m_config
->
osVersion
())
==
MaemoGlobal
::
Rpm
;
const
QLatin1String
qtInfoCmd
(
osUsesRpm
?
"rpm -qa 'libqt*' --queryformat '%{NAME} %{VERSION}
\\
n'"
...
...
@@ -151,7 +151,7 @@ void MaemoConfigTestDialog::handleGeneralTestResult(int exitStatus)
m_ui
->
testResultEdit
->
setPlainText
(
output
);
}
if
(
m_config
->
osVersion
()
==
Maemo
Global
::
GenericLinux
)
{
if
(
m_config
->
osVersion
()
==
Maemo
DeviceConfig
::
GenericLinux
)
{
testPorts
();
return
;
}
...
...
@@ -174,7 +174,7 @@ void MaemoConfigTestDialog::handleMadDeveloperTestResult(int exitStatus)
+
tr
(
"%1 is not installed.<br>You will not be able to deploy "
"to this device."
)
.
arg
(
MaemoGlobal
::
madDeveloperUiName
(
m_config
->
osVersion
()));
if
(
m_config
->
osVersion
()
==
Maemo
Global
::
Maemo6
)
{
if
(
m_config
->
osVersion
()
==
Maemo
DeviceConfig
::
Maemo6
)
{
errorMsg
+=
QLatin1String
(
"<br>"
)
+
tr
(
"Please switch the device to developer mode via Settings -> Security."
);
}
...
...
@@ -256,7 +256,7 @@ QString MaemoConfigTestDialog::parseTestOutput()
output
=
tr
(
"Hardware architecture: %1
\n
"
).
arg
(
unamePattern
.
cap
(
2
));
output
.
append
(
tr
(
"Kernel version: %1
\n
"
).
arg
(
unamePattern
.
cap
(
1
)));
if
(
m_config
->
osVersion
()
==
Maemo
Global
::
GenericLinux
)
{
if
(
m_config
->
osVersion
()
==
Maemo
DeviceConfig
::
GenericLinux
)
{
m_qtVersionOk
=
true
;
return
output
;
}
...
...
src/plugins/qt4projectmanager/qt-maemo/maemodeployablelistmodel.cpp
View file @
0ee99ff2
...
...
@@ -248,7 +248,7 @@ bool MaemoDeployableListModel::addDesktopFile()
const
QtVersion
*
const
version
=
qtVersion
();
QTC_ASSERT
(
version
,
return
false
);
QString
remoteDir
=
QLatin1String
(
"/usr/share/applications"
);
if
(
MaemoGlobal
::
version
(
version
)
==
Maemo
Global
::
Maemo5
)
if
(
MaemoGlobal
::
version
(
version
)
==
Maemo
DeviceConfig
::
Maemo5
)
remoteDir
+=
QLatin1String
(
"/hildon"
);
const
QLatin1String
filesLine
(
"desktopfile.files = $${TARGET}.desktop"
);
const
QString
pathLine
=
QLatin1String
(
"desktopfile.path = "
)
+
remoteDir
;
...
...
@@ -330,7 +330,7 @@ QString MaemoDeployableListModel::proFileScope() const
{
const
QtVersion
*
const
qv
=
qtVersion
();
QTC_ASSERT
(
qv
,
return
QString
());
return
QLatin1String
(
MaemoGlobal
::
version
(
qv
)
==
Maemo
Global
::
Maemo5
return
QLatin1String
(
MaemoGlobal
::
version
(
qv
)
==
Maemo
DeviceConfig
::
Maemo5
?
"maemo5"
:
"unix:!symbian:!maemo5"
);
}
...
...
src/plugins/qt4projectmanager/qt-maemo/maemodeviceconfigurations.cpp
View file @
0ee99ff2
...
...
@@ -31,6 +31,7 @@
**************************************************************************/
#include "maemodeviceconfigurations.h"
#include "maemoglobal.h"
#include <coreplugin/icore.h>
...
...
@@ -224,7 +225,7 @@ MaemoDeviceConfig::Ptr MaemoDeviceConfig::create(const ConstPtr &other)
}
MaemoDeviceConfig
::
Ptr
MaemoDeviceConfig
::
createHardwareConfig
(
const
QString
&
name
,
Maemo
Global
::
OsVersion
osVersion
,
const
QString
&
hostName
,
Maemo
DeviceConfig
::
OsVersion
osVersion
,
const
QString
&
hostName
,
const
QString
&
privateKeyFilePath
,
Id
&
nextId
)
{
Utils
::
SshConnectionParameters
sshParams
(
Utils
::
SshConnectionParameters
::
NoProxy
);
...
...
@@ -245,7 +246,7 @@ MaemoDeviceConfig::Ptr MaemoDeviceConfig::createGenericLinuxConfigUsingPassword(
sshParams
.
host
=
hostName
;
sshParams
.
userName
=
userName
;
sshParams
.
password
=
password
;
return
Ptr
(
new
MaemoDeviceConfig
(
name
,
Maemo
Global
::
GenericLinux
,
Physical
,
return
Ptr
(
new
MaemoDeviceConfig
(
name
,
Maemo
DeviceConfig
::
GenericLinux
,
Physical
,
sshParams
,
nextId
));
}
...
...
@@ -259,12 +260,12 @@ MaemoDeviceConfig::Ptr MaemoDeviceConfig::createGenericLinuxConfigUsingKey(const
sshParams
.
host
=
hostName
;
sshParams
.
userName
=
userName
;
sshParams
.
privateKeyFile
=
privateKeyFile
;
return
Ptr
(
new
MaemoDeviceConfig
(
name
,
Maemo
Global
::
GenericLinux
,
Physical
,
return
Ptr
(
new
MaemoDeviceConfig
(
name
,
Maemo
DeviceConfig
::
GenericLinux
,
Physical
,
sshParams
,
nextId
));
}
MaemoDeviceConfig
::
Ptr
MaemoDeviceConfig
::
createEmulatorConfig
(
const
QString
&
name
,
Maemo
Global
::
OsVersion
osVersion
,
Id
&
nextId
)
Maemo
DeviceConfig
::
OsVersion
osVersion
,
Id
&
nextId
)
{
Utils
::
SshConnectionParameters
sshParams
(
Utils
::
SshConnectionParameters
::
NoProxy
);
sshParams
.
authenticationType
=
Utils
::
SshConnectionParameters
::
AuthenticationByPassword
;
...
...
@@ -275,7 +276,7 @@ MaemoDeviceConfig::Ptr MaemoDeviceConfig::createEmulatorConfig(const QString &na
}
MaemoDeviceConfig
::
MaemoDeviceConfig
(
const
QString
&
name
,
Maemo
Global
::
OsVersion
osVersion
,
DeviceType
devType
,
Maemo
DeviceConfig
::
OsVersion
osVersion
,
DeviceType
devType
,
const
Utils
::
SshConnectionParameters
&
sshParams
,
Id
&
nextId
)
:
m_sshParameters
(
sshParams
),
m_name
(
name
),
...
...
@@ -293,7 +294,7 @@ MaemoDeviceConfig::MaemoDeviceConfig(const QSettings &settings,
Id
&
nextId
)
:
m_sshParameters
(
Utils
::
SshConnectionParameters
::
NoProxy
),
m_name
(
settings
.
value
(
NameKey
).
toString
()),
m_osVersion
(
static_cast
<
Maemo
Global
::
OsVersion
>
(
settings
.
value
(
OsVersionKey
,
Maemo
Global
::
Maemo5
).
toInt
())),
m_osVersion
(
static_cast
<
Maemo
DeviceConfig
::
OsVersion
>
(
settings
.
value
(
OsVersionKey
,
Maemo
DeviceConfig
::
Maemo5
).
toInt
())),
m_type
(
static_cast
<
DeviceType
>
(
settings
.
value
(
TypeKey
,
DefaultDeviceType
).
toInt
())),
m_portsSpec
(
settings
.
value
(
PortsSpecKey
,
defaultPortsSpec
(
m_type
)).
toString
()),
m_isDefault
(
settings
.
value
(
IsDefaultKey
,
false
).
toBool
()),
...
...
@@ -340,14 +341,14 @@ QString MaemoDeviceConfig::defaultPortsSpec(DeviceType type) const
return
QLatin1String
(
type
==
Physical
?
"10000-10100"
:
"13219,14168"
);
}
QString
MaemoDeviceConfig
::
defaultHost
(
DeviceType
type
,
Maemo
Global
::
OsVersion
osVersion
)
QString
MaemoDeviceConfig
::
defaultHost
(
DeviceType
type
,
Maemo
DeviceConfig
::
OsVersion
osVersion
)
{
switch
(
osVersion
)
{
case
Maemo
Global
::
Maemo5
:
case
Maemo
Global
::
Maemo6
:
case
Maemo
Global
::
Meego
:
case
Maemo
DeviceConfig
::
Maemo5
:
case
Maemo
DeviceConfig
::
Maemo6
:
case
Maemo
DeviceConfig
::
Meego
:
return
QLatin1String
(
type
==
Physical
?
"192.168.2.15"
:
"localhost"
);
case
Maemo
Global
::
GenericLinux
:
case
Maemo
DeviceConfig
::
GenericLinux
:
return
QString
();
default:
qFatal
(
"%s: Missing case in switch"
,
Q_FUNC_INFO
);
...
...
@@ -366,15 +367,15 @@ QString MaemoDeviceConfig::defaultPublicKeyFilePath()
return
defaultPrivateKeyFilePath
()
+
QLatin1String
(
".pub"
);
}
QString
MaemoDeviceConfig
::
defaultUser
(
Maemo
Global
::
OsVersion
osVersion
)
QString
MaemoDeviceConfig
::
defaultUser
(
Maemo
DeviceConfig
::
OsVersion
osVersion
)
{
switch
(
osVersion
)
{
case
Maemo
Global
::
Maemo5
:
case
Maemo
Global
::
Maemo6
:
case
Maemo
DeviceConfig
::
Maemo5
:
case
Maemo
DeviceConfig
::
Maemo6
:
return
QLatin1String
(
"developer"
);
case
Maemo
Global
::
Meego
:
case
Maemo
DeviceConfig
::
Meego
:
return
QLatin1String
(
"meego"
);
case
Maemo
Global
::
GenericLinux
:
case
Maemo
DeviceConfig
::
GenericLinux
:
return
QString
();
default:
qDebug
(
"%s: Unknown OS Version %d."
,
Q_FUNC_INFO
,
osVersion
);
...
...
@@ -382,13 +383,13 @@ QString MaemoDeviceConfig::defaultUser(MaemoGlobal::OsVersion osVersion)
}
}
QString
MaemoDeviceConfig
::
defaultQemuPassword
(
Maemo
Global
::
OsVersion
osVersion
)
QString
MaemoDeviceConfig
::
defaultQemuPassword
(
Maemo
DeviceConfig
::
OsVersion
osVersion
)
{
switch
(
osVersion
)
{
case
Maemo
Global
::
Maemo5
:
case
Maemo
Global
::
Maemo6
:
case
Maemo
DeviceConfig
::
Maemo5
:
case
Maemo
DeviceConfig
::
Maemo6
:
return
QString
();
case
Maemo
Global
::
Meego
:
case
Maemo
DeviceConfig
::
Meego
:
return
QLatin1String
(
"meego"
);
default:
qDebug
(
"%s: Unknown OS Version %d."
,
Q_FUNC_INFO
,
osVersion
);
...
...
@@ -476,7 +477,7 @@ void MaemoDeviceConfigurations::save()
}
void
MaemoDeviceConfigurations
::
addHardwareDeviceConfiguration
(
const
QString
&
name
,
Maemo
Global
::
OsVersion
osVersion
,
const
QString
&
hostName
,
Maemo
DeviceConfig
::
OsVersion
osVersion
,
const
QString
&
hostName
,
const
QString
&
privateKeyFilePath
)
{
const
MaemoDeviceConfig
::
Ptr
&
devConf
=
MaemoDeviceConfig
::
createHardwareConfig
(
name
,
...
...
@@ -502,7 +503,7 @@ void MaemoDeviceConfigurations::addGenericLinuxConfigurationUsingKey(const QStri
}
void
MaemoDeviceConfigurations
::
addEmulatorDeviceConfiguration
(
const
QString
&
name
,
Maemo
Global
::
OsVersion
osVersion
)
Maemo
DeviceConfig
::
OsVersion
osVersion
)
{
const
MaemoDeviceConfig
::
Ptr
&
devConf
=
MaemoDeviceConfig
::
createEmulatorConfig
(
name
,
osVersion
,
m_nextId
);
...
...
@@ -523,7 +524,7 @@ void MaemoDeviceConfigurations::removeConfiguration(int idx)
Q_ASSERT
(
idx
>=
0
&&
idx
<
rowCount
());
beginRemoveRows
(
QModelIndex
(),
idx
,
idx
);
const
bool
wasDefault
=
deviceAt
(
idx
)
->
m_isDefault
;
const
Maemo
Global
::
OsVersion
osVersion
=
deviceAt
(
idx
)
->
osVersion
();
const
Maemo
DeviceConfig
::
OsVersion
osVersion
=
deviceAt
(
idx
)
->
osVersion
();
m_devConfigs
.
removeAt
(
idx
);
endRemoveRows
();
if
(
wasDefault
)
{
...
...
@@ -603,10 +604,10 @@ void MaemoDeviceConfigurations::load()
}
settings
->
endArray
();
settings
->
endGroup
();
ensureDefaultExists
(
Maemo
Global
::
Maemo5
);
ensureDefaultExists
(
Maemo
Global
::
Maemo6
);
ensureDefaultExists
(
Maemo
Global
::
Meego
);
ensureDefaultExists
(
Maemo
Global
::
GenericLinux
);
ensureDefaultExists
(
Maemo
DeviceConfig
::
Maemo5
);
ensureDefaultExists
(
Maemo
DeviceConfig
::
Maemo6
);
ensureDefaultExists
(
Maemo
DeviceConfig
::
Meego
);
ensureDefaultExists
(
Maemo
DeviceConfig
::
GenericLinux
);
}
MaemoDeviceConfig
::
ConstPtr
MaemoDeviceConfigurations
::
deviceAt
(
int
idx
)
const
...
...
@@ -629,7 +630,7 @@ MaemoDeviceConfig::ConstPtr MaemoDeviceConfigurations::find(MaemoDeviceConfig::I
return
index
==
-
1
?
MaemoDeviceConfig
::
ConstPtr
()
:
deviceAt
(
index
);
}
MaemoDeviceConfig
::
ConstPtr
MaemoDeviceConfigurations
::
defaultDeviceConfig
(
const
Maemo
Global
::
OsVersion
osVersion
)
const
MaemoDeviceConfig
::
ConstPtr
MaemoDeviceConfigurations
::
defaultDeviceConfig
(
const
Maemo
DeviceConfig
::
OsVersion
osVersion
)
const
{
foreach
(
const
MaemoDeviceConfig
::
ConstPtr
&
devConf
,
m_devConfigs
)
{
if
(
devConf
->
m_isDefault
&&
devConf
->
osVersion
()
==
osVersion
)
...
...
@@ -652,7 +653,7 @@ MaemoDeviceConfig::Id MaemoDeviceConfigurations::internalId(MaemoDeviceConfig::C
return
devConf
?
devConf
->
m_internalId
:
MaemoDeviceConfig
::
InvalidId
;
}
void
MaemoDeviceConfigurations
::
ensureDefaultExists
(
Maemo
Global
::
OsVersion
osVersion
)
void
MaemoDeviceConfigurations
::
ensureDefaultExists
(
Maemo
DeviceConfig
::
OsVersion
osVersion
)
{
if
(
!
defaultDeviceConfig
(
osVersion
))
{
foreach
(
const
MaemoDeviceConfig
::
Ptr
&
devConf
,
m_devConfigs
)
{
...
...
src/plugins/qt4projectmanager/qt-maemo/maemodeviceconfigurations.h
View file @
0ee99ff2
...
...
@@ -33,8 +33,6 @@
#ifndef MAEMODEVICECONFIGURATIONS_H
#define MAEMODEVICECONFIGURATIONS_H
#include "maemoglobal.h"
#include <utils/ssh/sshconnection.h>
#include <QtCore/QAbstractListModel>
...
...
@@ -72,30 +70,31 @@ class MaemoDeviceConfig
public:
typedef
QSharedPointer
<
const
MaemoDeviceConfig
>
ConstPtr
;
typedef
quint64
Id
;
enum
OsVersion
{
Maemo5
,
Maemo6
,
Meego
,
GenericLinux
};
enum
DeviceType
{
Physical
,
Emulator
};
MaemoPortList
freePorts
()
const
;
Utils
::
SshConnectionParameters
sshParameters
()
const
{
return
m_sshParameters
;
}
QString
name
()
const
{
return
m_name
;
}
MaemoGlobal
::
OsVersion
osVersion
()
const
{
return
m_osVersion
;
}
OsVersion
osVersion
()
const
{
return
m_osVersion
;
}
DeviceType
type
()
const
{
return
m_type
;
}
QString
portsSpec
()
const
{
return
m_portsSpec
;
}
Id
internalId
()
const
{
return
m_internalId
;
}
bool
isDefault
()
const
{
return
m_isDefault
;
}
static
QString
portsRegExpr
();
static
QString
defaultHost
(
DeviceType
type
,
MaemoGlobal
::
OsVersion
osVersion
);
static
QString
defaultHost
(
DeviceType
type
,
OsVersion
osVersion
);
static
QString
defaultPrivateKeyFilePath
();
static
QString
defaultPublicKeyFilePath
();
static
QString
defaultUser
(
MaemoGlobal
::
OsVersion
osVersion
);
static
QString
defaultUser
(
OsVersion
osVersion
);
static
int
defaultSshPort
(
DeviceType
type
);
static
QString
defaultQemuPassword
(
MaemoGlobal
::
OsVersion
osVersion
);
static
QString
defaultQemuPassword
(
OsVersion
osVersion
);
static
const
Id
InvalidId
;
private:
typedef
QSharedPointer
<
MaemoDeviceConfig
>
Ptr
;
MaemoDeviceConfig
(
const
QString
&
name
,
MaemoGlobal
::
OsVersion
osVersion
,
MaemoDeviceConfig
(
const
QString
&
name
,
OsVersion
osVersion
,
DeviceType
type
,
const
Utils
::
SshConnectionParameters
&
sshParams
,
Id
&
nextId
);
MaemoDeviceConfig
(
const
QSettings
&
settings
,
Id
&
nextId
);
...
...
@@ -104,17 +103,16 @@ private:
MaemoDeviceConfig
(
const
MaemoDeviceConfig
&
);
MaemoDeviceConfig
&
operator
=
(
const
MaemoDeviceConfig
&
);
static
Ptr
createHardwareConfig
(
const
QString
&
name
,
MaemoGlobal
::
OsVersion
osVersion
,
const
QString
&
hostName
,
const
QString
&
privateKeyFilePath
,
Id
&
nextId
);
static
Ptr
createHardwareConfig
(
const
QString
&
name
,
OsVersion
osVersion
,
const
QString
&
hostName
,
const
QString
&
privateKeyFilePath
,
Id
&
nextId
);
static
Ptr
createGenericLinuxConfigUsingPassword
(
const
QString
&
name
,
const
QString
&
hostName
,
const
QString
&
userName
,
const
QString
&
password
,
Id
&
nextId
);
static
Ptr
createGenericLinuxConfigUsingKey
(
const
QString
&
name
,
const
QString
&
hostName
,
const
QString
&
userName
,
const
QString
&
privateKeyFilePath
,
Id
&
nextId
);
static
Ptr
createEmulatorConfig
(
const
QString
&
name
,
MaemoGlobal
::
OsVersion
osVersion
,
Id
&
nextId
);
static
Ptr
createEmulatorConfig
(
const
QString
&
name
,
OsVersion
osVersion
,
Id
&
nextId
);
static
Ptr
create
(
const
QSettings
&
settings
,
Id
&
nextId
);
static
Ptr
create
(
const
ConstPtr
&
other
);
...
...
@@ -123,7 +121,7 @@ private:
Utils
::
SshConnectionParameters
m_sshParameters
;
QString
m_name
;
MaemoGlobal
::
OsVersion
m_osVersion
;
OsVersion
m_osVersion
;
DeviceType
m_type
;
QString
m_portsSpec
;
bool
m_isDefault
;
...
...
@@ -143,7 +141,7 @@ public:
MaemoDeviceConfig
::
ConstPtr
deviceAt
(
int
index
)
const
;
MaemoDeviceConfig
::
ConstPtr
find
(
MaemoDeviceConfig
::
Id
id
)
const
;
MaemoDeviceConfig
::
ConstPtr
defaultDeviceConfig
(
const
Maemo
Global
::
OsVersion
osVersion
)
const
;
MaemoDeviceConfig
::
ConstPtr
defaultDeviceConfig
(
const
Maemo
DeviceConfig
::
OsVersion
osVersion
)
const
;
bool
hasConfig
(
const
QString
&
name
)
const
;
int
indexForInternalId
(
MaemoDeviceConfig
::
Id
internalId
)
const
;
MaemoDeviceConfig
::
Id
internalId
(
MaemoDeviceConfig
::
ConstPtr
devConf
)
const
;
...
...
@@ -152,7 +150,7 @@ public:
QString
defaultSshKeyFilePath
()
const
{
return
m_defaultSshKeyFilePath
;
}
void
addHardwareDeviceConfiguration
(
const
QString
&
name
,
Maemo
Global
::
OsVersion
osVersion
,
const
QString
&
hostName
,
Maemo
DeviceConfig
::
OsVersion
osVersion
,
const
QString
&
hostName
,
const
QString
&
privateKeyFilePath
);
void
addGenericLinuxConfigurationUsingPassword
(
const
QString
&
name
,
const
QString
&
hostName
,
const
QString
&
userName
,
...
...
@@ -161,7 +159,7 @@ public:
const
QString
&
hostName
,
const
QString
&
userName
,
const
QString
&
privateKeyFilePath
);
void
addEmulatorDeviceConfiguration
(
const
QString
&
name
,
Maemo
Global
::
OsVersion
osVersion
);
Maemo
DeviceConfig
::
OsVersion
osVersion
);
void
removeConfiguration
(
int
index
);
void
setConfigurationName
(
int
i
,
const
QString
&
name
);
void
setSshParameters
(
int
i
,
const
Utils
::
SshConnectionParameters
&
params
);
...
...
@@ -182,7 +180,7 @@ private:
static
void
copy
(
const
MaemoDeviceConfigurations
*
source
,
MaemoDeviceConfigurations
*
target
,
bool
deep
);
void
addConfiguration
(
const
MaemoDeviceConfig
::
Ptr
&
devConfig
);
void
ensureDefaultExists
(
Maemo
Global
::
OsVersion
osVersion
);
void
ensureDefaultExists
(
Maemo
DeviceConfig
::
OsVersion
osVersion
);
static
MaemoDeviceConfigurations
*
m_instance
;
MaemoDeviceConfig
::
Id
m_nextId
;
...
...
src/plugins/qt4projectmanager/qt-maemo/maemodeviceconfigurationssettingswidget.cpp
View file @
0ee99ff2
...
...
@@ -36,6 +36,7 @@
#include "maemoconfigtestdialog.h"
#include "maemodeviceconfigwizard.h"
#include "maemodeviceconfigurations.h"
#include "maemoglobal.h"
#include "maemokeydeployer.h"
#include "maemoremoteprocessesdialog.h"
#include "maemosshconfigdialog.h"
...
...
src/plugins/qt4projectmanager/qt-maemo/maemodeviceconfigwizard.cpp
View file @
0ee99ff2
...
...
@@ -38,6 +38,7 @@
#include "ui_maemodeviceconfigwizardstartpage.h"
#include "maemodeviceconfigurations.h"
#include "maemoglobal.h"
#include "maemokeydeployer.h"
#include <utils/fileutils.h>
...
...
@@ -60,7 +61,7 @@ struct WizardData
{
QString
configName
;
QString
hostName
;
Maemo
Global
::
OsVersion
osVersion
;
Maemo
DeviceConfig
::
OsVersion
osVersion
;
SshConnectionParameters
::
AuthenticationType
authType
;
MaemoDeviceConfig
::
DeviceType
deviceType
;
QString
privateKeyFilePath
;
...
...
@@ -84,10 +85,10 @@ public:
m_ui
->
setupUi
(
this
);
setTitle
(
tr
(
"General Information"
));
setSubTitle
(
QLatin1String
(
" "
));
// For Qt bug (background color)
m_ui
->
fremantleButton
->
setText
(
MaemoGlobal
::
osVersionToString
(
Maemo
Global
::
Maemo5
));
m_ui
->
harmattanButton
->
setText
(
MaemoGlobal
::
osVersionToString
(
Maemo
Global
::
Maemo6
));
m_ui
->
meegoButton
->
setText
(
MaemoGlobal
::
osVersionToString
(
Maemo
Global
::
Meego
));
m_ui
->
genericLinuxButton
->
setText
(
MaemoGlobal
::
osVersionToString
(
Maemo
Global
::
GenericLinux
));
m_ui
->
fremantleButton
->
setText
(
MaemoGlobal
::
osVersionToString
(
Maemo
DeviceConfig
::
Maemo5
));
m_ui
->
harmattanButton
->
setText
(
MaemoGlobal
::
osVersionToString
(
Maemo
DeviceConfig
::
Maemo6
));
m_ui
->
meegoButton
->
setText
(
MaemoGlobal
::
osVersionToString
(
Maemo
DeviceConfig
::
Meego
));
m_ui
->
genericLinuxButton
->
setText
(
MaemoGlobal
::
osVersionToString
(
Maemo
DeviceConfig
::
GenericLinux
));
QButtonGroup
*
buttonGroup
=
new
QButtonGroup
(
this
);
buttonGroup
->
setExclusive
(
true
);
...
...
@@ -131,12 +132,12 @@ public:
:
m_ui
->
hostNameLineEdit
->
text
().
trimmed
();
}
Maemo
Global
::
OsVersion
osVersion
()
const
Maemo
DeviceConfig
::
OsVersion
osVersion
()
const
{
return
m_ui
->
fremantleButton
->
isChecked
()
?
Maemo
Global
::
Maemo5
:
m_ui
->
harmattanButton
->
isChecked
()
?
Maemo
Global
::
Maemo6
:
m_ui
->
meegoButton
->
isChecked
()
?
Maemo
Global
::
Meego
:
Maemo
Global
::
GenericLinux
;
return
m_ui
->
fremantleButton
->
isChecked
()
?
Maemo
DeviceConfig
::
Maemo5
:
m_ui
->
harmattanButton
->
isChecked
()
?
Maemo
DeviceConfig
::
Maemo6
:
m_ui
->
meegoButton
->
isChecked
()
?
Maemo
DeviceConfig
::
Meego
:
Maemo
DeviceConfig
::
GenericLinux
;
}
MaemoDeviceConfig
::
DeviceType
deviceType
()
const
...
...
@@ -155,7 +156,7 @@ private slots:
void
handleOsTypeChanged
()
{
if
(
osVersion
()
==
Maemo
Global
::
GenericLinux
)
{
if
(
osVersion
()
==
Maemo
DeviceConfig
::
GenericLinux
)
{
m_ui
->
hwButton
->
setChecked
(
true
);
m_ui
->
hwButton
->
setEnabled
(
false
);
m_ui
->
qemuButton
->
setEnabled
(
false
);
...
...
@@ -640,7 +641,7 @@ void MaemoDeviceConfigWizard::createDeviceConfig()
while
(
d
->
devConfigs
->
hasConfig
(
name
));
}
if
(
d
->
wizardData
.
osVersion
==
Maemo
Global
::
GenericLinux
)
{
if
(
d
->
wizardData
.
osVersion
==
Maemo
DeviceConfig
::
GenericLinux
)
{
if
(
d
->
wizardData
.
authType
==
SshConnectionParameters
::
AuthenticationByPassword
)
{
d
->
devConfigs
->
addGenericLinuxConfigurationUsingPassword
(
name
,
d
->
wizardData
.
hostName
,
d
->
wizardData
.
userName
,
...
...
@@ -671,7 +672,7 @@ int MaemoDeviceConfigWizard::nextId() const
if
(
d
->
wizardData
.
deviceType
==
MaemoDeviceConfig
::
Emulator
)
{
return
FinalPageId
;
}
else
if
(
d
->
wizardData
.
osVersion
==
Maemo
Global
::
GenericLinux
)
{
}
else
if
(
d
->
wizardData
.
osVersion
==
Maemo
DeviceConfig
::
GenericLinux
)
{
return
LoginDataPageId
;
}
else
{
return
PreviousKeySetupCheckPageId
;
...
...
src/plugins/qt4projectmanager/qt-maemo/maemoglobal.cpp
View file @
0ee99ff2
...
...
@@ -32,7 +32,7 @@
#include "maemoglobal.h"
#include "maemoconstants.h"
#include "maemo
deviceconfigurations
.h"
#include "maemo
qemumanager
.h"
#include <projectexplorer/projectexplorerconstants.h>
...
...
@@ -78,21 +78,21 @@ bool MaemoGlobal::isMeegoTargetId(const QString &id)
bool
MaemoGlobal
::
isValidMaemo5QtVersion
(
const
QtVersion
*
version
)
{
return
isValidMaemoQtVersion
(
version
,
Maemo5
);
return
isValidMaemoQtVersion
(
version
,
MaemoDeviceConfig
::
Maemo5
);
}
bool
MaemoGlobal
::
isValidHarmattanQtVersion
(
const
QtVersion
*
version
)
{
return
isValidMaemoQtVersion
(
version
,
Maemo6
);
return
isValidMaemoQtVersion
(
version
,
MaemoDeviceConfig
::
Maemo6
);
}
bool
MaemoGlobal
::
isValidMeegoQtVersion
(
const
Qt4ProjectManager
::
QtVersion
*
version
)
{
return
isValidMaemoQtVersion
(
version
,
Meego
);
return
isValidMaemoQtVersion
(
version
,
MaemoDeviceConfig
::
Meego
);
}
bool
MaemoGlobal
::
isValidMaemoQtVersion
(
const
QtVersion
*
qtVersion
,
OsVersion
maemoVersion
)
MaemoDeviceConfig
::
OsVersion
maemoVersion
)
{
if
(
version
(
qtVersion
)
!=
maemoVersion
)
return
false
;
...
...
@@ -132,12 +132,12 @@ QString MaemoGlobal::remoteSudo(const QString &uname)
return
uname
==
QLatin1String
(
"root"
)
?
QString
()
:
devrootshPath
();
}
QString
MaemoGlobal
::
remoteCommandPrefix
(
OsVersion
osVersion
,
QString
MaemoGlobal
::
remoteCommandPrefix
(
MaemoDeviceConfig
::
OsVersion
osVersion
,
const
QString
&
userName
,
const
QString
&
commandFilePath
)
{
QString
prefix
=
QString
::
fromLocal8Bit
(
"%1 chmod a+x %2; %3; "
)
.
arg
(
remoteSudo
(
userName
),
commandFilePath
,
remoteSourceProfilesCommand
());
if
(
osVersion
!=
Maemo
5
&&
osVersion
!=
Maemo6
)
if
(
osVersion
!=
Maemo
DeviceConfig
::
Maemo5
&&
osVersion
!=
MaemoDeviceConfig
::
Maemo6
)
prefix
+=
QLatin1String
(
"DISPLAY=:0.0 "
);
return
prefix
;
}
...
...
@@ -183,6 +183,20 @@ QString MaemoGlobal::deviceConfigurationName(const MaemoDeviceConfig::ConstPtr &
return
devConf
?
devConf
->
name
()
:
tr
(
"(No device)"
);
}
MaemoPortList
MaemoGlobal
::
freePorts
(
const
MaemoDeviceConfig
::
ConstPtr
&
devConf
,
const
QtVersion
*
qtVersion
)
{
if
(
!
devConf
)
return
MaemoPortList
();
if
(
devConf
->
type
()
==
MaemoDeviceConfig
::
Emulator
)
{
MaemoQemuRuntime
rt
;
const
int
id
=
qtVersion
->
uniqueId
();
if
(
MaemoQemuManager
::
instance
().
runtimeForQtVersion
(
id
,
&
rt
))
return
rt
.
m_freePorts
;
}
return
devConf
->
freePorts
();
}
QString
MaemoGlobal
::
maddeRoot
(
const
QtVersion
*
qtVersion
)
{
QDir
dir
(
targetRoot
(
qtVersion
));
...
...
@@ -210,22 +224,22 @@ QString MaemoGlobal::madCommand(const QtVersion *qtVersion)
return
maddeRoot
(
qtVersion
)
+
QLatin1String
(
"/bin/mad"
);
}
QString
MaemoGlobal
::
madDeveloperUiName
(
OsVersion
osVersion
)
QString
MaemoGlobal
::
madDeveloperUiName
(
MaemoDeviceConfig
::
OsVersion
osVersion
)
{
return
osVersion
==
Maemo6
return
osVersion
==
MaemoDeviceConfig
::
Maemo6
?
tr
(
"SDK Connectivity"
)
:
tr
(
"Mad Developer"
);
}
Maemo
Global
::
OsVersion
MaemoGlobal
::
version
(
const
QtVersion
*
qtVersion
)
Maemo
DeviceConfig
::
MaemoDeviceConfig
::
OsVersion
MaemoGlobal
::
version
(
const
QtVersion
*
qtVersion
)
{
const
QString
&
name
=
targetName
(
qtVersion
);
if
(
name
.
startsWith
(
QLatin1String
(
"fremantle"
)))
return
Maemo5
;
return
MaemoDeviceConfig
::
Maemo5
;
if
(
name
.
startsWith
(
QLatin1String
(
"harmattan"
)))
return
Maemo6
;
return
MaemoDeviceConfig
::
Maemo6
;
if
(
name
.
startsWith
(
QLatin1String
(
"meego"
)))
return
Meego
;
return
static_cast
<
OsVersion
>
(
-
1
);
return
MaemoDeviceConfig
::
Meego
;
return
static_cast
<
MaemoDeviceConfig
::
OsVersion
>
(
-
1
);
}
QString
MaemoGlobal
::
architecture
(
const
QtVersion
*
qtVersion
)
...
...
@@ -374,24 +388,24 @@ QStringList MaemoGlobal::targetArgs(const QtVersion *qtVersion, bool useTarget)
return
args
;
}
QString
MaemoGlobal
::
osVersionToString
(
OsVersion
version
)
QString
MaemoGlobal
::
osVersionToString
(
MaemoDeviceConfig
::
OsVersion
version
)
{
switch
(
version
)
{
case
Maemo5
:
return
QLatin1String
(
"Maemo5/Fremantle"
);
case
Maemo6
:
return
QLatin1String
(
"Harmattan"
);
case
Meego
:
return
QLatin1String
(
"Meego"
);
case
GenericLinux
:
return
QLatin1String
(
"Other Linux"
);