Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
aa2ab949
Commit
aa2ab949
authored
Feb 04, 2011
by
Christian Kandeler
Browse files
Maemo: Use rpm for listing packages on Meego devices.
parent
0d9da49d
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/plugins/qt4projectmanager/qt-maemo/maemoconfigtestdialog.cpp
View file @
aa2ab949
...
...
@@ -81,7 +81,10 @@ void MaemoConfigTestDialog::startConfigTest()
return
;
m_currentTest
=
GeneralTest
;
m_ui
->
testResultEdit
->
setPlainText
(
tr
(
"Testing configuration..."
));
const
QString
testingText
=
m_config
->
type
()
==
MaemoDeviceConfig
::
Simulator
?
tr
(
"Testing configuration. This may take a while."
)
:
tr
(
"Testing configuration..."
);
m_ui
->
testResultEdit
->
setPlainText
(
testingText
);
m_closeButton
->
setText
(
tr
(
"Stop Test"
));
m_testProcessRunner
=
SshRemoteProcessRunner
::
create
(
m_config
->
sshParameters
());
connect
(
m_testProcessRunner
.
data
(),
SIGNAL
(
connectionError
(
Core
::
SshError
)),
...
...
@@ -91,9 +94,12 @@ void MaemoConfigTestDialog::startConfigTest()
connect
(
m_testProcessRunner
.
data
(),
SIGNAL
(
processOutputAvailable
(
QByteArray
)),
this
,
SLOT
(
processSshOutput
(
QByteArray
)));
QLatin1String
sysInfoCmd
(
"uname -rsm"
);
QLatin1String
qtInfoCmd
(
"dpkg-query -W -f '${Package} ${Version} ${Status}
\n
' 'libqt*' "
"|grep ' installed$'"
);
const
QLatin1String
sysInfoCmd
(
"uname -rsm"
);
const
bool
osUsesRpm
=
MaemoGlobal
::
packagingSystem
(
m_config
->
osVersion
())
==
MaemoGlobal
::
Rpm
;
const
QLatin1String
qtInfoCmd
(
osUsesRpm
?
"rpm -qa 'libqt*' --queryformat '%{NAME} %{VERSION}
\\
n'"
:
"dpkg-query -W -f '${Package} ${Version} ${Status}
\n
' 'libqt*' "
"|grep ' installed$'"
);
QString
command
(
sysInfoCmd
+
" && "
+
qtInfoCmd
);
m_testProcessRunner
->
run
(
command
.
toUtf8
());
}
...
...
@@ -229,8 +235,11 @@ QString MaemoConfigTestDialog::parseTestOutput()
output
=
tr
(
"Hardware architecture: %1
\n
"
).
arg
(
unamePattern
.
cap
(
2
));
output
.
append
(
tr
(
"Kernel version: %1
\n
"
).
arg
(
unamePattern
.
cap
(
1
)));
const
QRegExp
dkpgPattern
(
QLatin1String
(
"(
\\
S+) (
\\
S*(
\\
d+)
\\
.(
\\
d+)
\\
.(
\\
d+)
\\
S*)
\\
S+
\\
S+
\\
S+"
));
index
=
dkpgPattern
.
indexIn
(
m_deviceTestOutput
);
const
bool
osUsesRpm
=
MaemoGlobal
::
packagingSystem
(
m_config
->
osVersion
())
==
MaemoGlobal
::
Rpm
;
const
QRegExp
packagePattern
(
QLatin1String
(
osUsesRpm
?
"(libqt
\\
S+) ((
\\
d+)
\\
.(
\\
d+)
\\
.(
\\
d+))"
:
"(
\\
S+) (
\\
S*(
\\
d+)
\\
.(
\\
d+)
\\
.(
\\
d+)
\\
S*)
\\
S+
\\
S+
\\
S+"
));
index
=
packagePattern
.
indexIn
(
m_deviceTestOutput
);
if
(
index
==
-
1
)
{
output
.
append
(
tr
(
"No Qt packages installed."
));
return
output
;
...
...
@@ -238,12 +247,12 @@ QString MaemoConfigTestDialog::parseTestOutput()
output
.
append
(
tr
(
"List of installed Qt packages:"
)
+
QLatin1Char
(
'\n'
));
do
{
output
.
append
(
QLatin1Char
(
'\t'
)
+
dkpg
Pattern
.
cap
(
1
)
+
QLatin1Char
(
' '
)
+
dkpg
Pattern
.
cap
(
2
)
+
QLatin1Char
(
'\n'
));
index
=
dkpg
Pattern
.
indexIn
(
m_deviceTestOutput
,
index
+
dkpg
Pattern
.
cap
(
0
).
length
());
if
(
!
m_qtVersionOk
&&
QT_VERSION_CHECK
(
dkpg
Pattern
.
cap
(
3
).
toInt
(),
dkpg
Pattern
.
cap
(
4
).
toInt
(),
dkpg
Pattern
.
cap
(
5
).
toInt
())
>=
0x040602
)
{
output
.
append
(
QLatin1Char
(
'\t'
)
+
package
Pattern
.
cap
(
1
)
+
QLatin1Char
(
' '
)
+
package
Pattern
.
cap
(
2
)
+
QLatin1Char
(
'\n'
));
index
=
package
Pattern
.
indexIn
(
m_deviceTestOutput
,
index
+
package
Pattern
.
cap
(
0
).
length
());
if
(
!
m_qtVersionOk
&&
QT_VERSION_CHECK
(
package
Pattern
.
cap
(
3
).
toInt
(),
package
Pattern
.
cap
(
4
).
toInt
(),
package
Pattern
.
cap
(
5
).
toInt
())
>=
0x040602
)
{
m_qtVersionOk
=
true
;
}
}
while
(
index
!=
-
1
);
...
...
src/plugins/qt4projectmanager/qt-maemo/maemodeviceconfigwizard.cpp
View file @
aa2ab949
...
...
@@ -456,20 +456,36 @@ class MaemoDeviceConfigWizardFinalPage : public QWizardPage
{
Q_OBJECT
public:
MaemoDeviceConfigWizardFinalPage
(
QWidget
*
parent
)
:
QWizardPage
(
parent
)
MaemoDeviceConfigWizardFinalPage
(
const
WizardData
&
wizardData
,
QWidget
*
parent
)
:
QWizardPage
(
parent
),
m_infoLabel
(
new
QLabel
(
this
)),
m_wizardData
(
wizardData
)
{
setTitle
(
tr
(
"Setup Finished"
));
setSubTitle
(
QLatin1String
(
" "
));
// For Qt bug (background color)
const
QString
infoText
=
tr
(
"Setup is complete.
\n
"
"The new device configuration will now be created and a test "
"procedure will be run to check whether Qt Creator can "
"connect to the device and to provide some information "
"about its features."
);
QLabel
*
const
infoLabel
=
new
QLabel
(
infoText
,
this
);
infoLabel
->
setWordWrap
(
true
);
m_infoLabel
->
setWordWrap
(
true
);
QVBoxLayout
*
const
layout
=
new
QVBoxLayout
(
this
);
layout
->
addWidget
(
infoLabel
);
layout
->
addWidget
(
m_
infoLabel
);
}
virtual
void
initializePage
()
{
QString
infoText
=
tr
(
"The new device configuration will now be "
"created and a test procedure will be run to check whether "
"Qt Creator can connect to the device and to provide some "
"information about its features."
);
if
(
m_wizardData
.
deviceType
==
MaemoDeviceConfig
::
Simulator
)
{
infoText
+=
QLatin1Char
(
'\n'
)
+
tr
(
"Please make sure that Qemu is running, otherwise "
"the test will fail."
);
}
m_infoLabel
->
setText
(
infoText
);
}
private:
QLabel
*
const
m_infoLabel
;
const
WizardData
&
m_wizardData
;
};
}
// anonymous namespace
...
...
@@ -484,7 +500,7 @@ struct MaemoDeviceConfigWizardPrivate
reuseKeysCheckPage
(
parent
),
keyCreationPage
(
parent
),
keyDeploymentPage
(
wizardData
,
parent
),
finalPage
(
parent
)
finalPage
(
wizardData
,
parent
)
{
}
...
...
src/plugins/qt4projectmanager/qt-maemo/maemodeviceconfigwizardstartpage.ui
View file @
aa2ab949
...
...
@@ -6,7 +6,7 @@
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
68
0
</width>
<width>
6
1
8
</width>
<height>
122
</height>
</rect>
</property>
...
...
@@ -68,7 +68,7 @@
<item>
<widget
class=
"QRadioButton"
name=
"qemuButton"
>
<property
name=
"text"
>
<string>
Emulator (Qemu
, should be currently running
)
</string>
<string>
Emulator (Qemu)
</string>
</property>
</widget>
</item>
...
...
src/plugins/qt4projectmanager/qt-maemo/maemoglobal.cpp
View file @
aa2ab949
...
...
@@ -300,6 +300,10 @@ QString MaemoGlobal::maemoVersionToString(MaemoVersion version)
return
QString
();
}
MaemoGlobal
::
PackagingSystem
MaemoGlobal
::
packagingSystem
(
MaemoVersion
maemoVersion
)
{
return
maemoVersion
==
Meego
?
Rpm
:
Dpkg
;
}
MaemoGlobal
::
FileUpdate
::
FileUpdate
(
const
QString
&
fileName
)
:
m_fileName
(
fileName
)
...
...
src/plugins/qt4projectmanager/qt-maemo/maemoglobal.h
View file @
aa2ab949
...
...
@@ -62,6 +62,7 @@ class MaemoGlobal
Q_DECLARE_TR_FUNCTIONS
(
Qt4ProjectManager
::
Internal
::
MaemoGlobal
)
public:
enum
MaemoVersion
{
Maemo5
,
Maemo6
,
Meego
};
enum
PackagingSystem
{
Dpkg
,
Rpm
};
class
FileUpdate
{
public:
...
...
@@ -99,6 +100,8 @@ public:
static
QString
maemoVersionToString
(
MaemoVersion
version
);
static
PackagingSystem
packagingSystem
(
MaemoVersion
maemoVersion
);
static
bool
removeRecursively
(
const
QString
&
filePath
,
QString
&
error
);
template
<
class
T
>
static
T
*
buildStep
(
const
ProjectExplorer
::
DeployConfiguration
*
dc
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment