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
Tobias Hunger
qt-creator
Commits
1c746014
Commit
1c746014
authored
Aug 10, 2010
by
ck
Browse files
Maemo: Better reporting of mount errors.
parent
0b5e36d6
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/plugins/qt4projectmanager/qt-maemo/maemoremotemounter.cpp
View file @
1c746014
...
...
@@ -27,8 +27,9 @@
**
**************************************************************************/
#include
"maemoglobal.h"
#include
"maemoremotemounter.h"
#include
"maemoglobal.h"
#include
"maemotoolchain.h"
#include
<coreplugin/ssh/sftpchannel.h>
...
...
@@ -89,11 +90,12 @@ void MaemoRemoteMounter::unmount()
m_mountSpecs
.
at
(
i
).
remoteMountPoint
);
}
m_umountStderr
.
clear
();
m_unmountProcess
=
m_connection
->
createRemoteProcess
(
remoteCall
.
toUtf8
());
connect
(
m_unmountProcess
.
data
(),
SIGNAL
(
closed
(
int
)),
this
,
SLOT
(
handleUnmountProcessFinished
(
int
)));
connect
(
m_unmountProcess
.
data
(),
SIGNAL
(
errorOutputAvailable
(
QByteArray
)),
this
,
S
IGNAL
(
remoteErrorOutput
(
QByteArray
)));
this
,
S
LOT
(
handleUmountStderr
(
QByteArray
)));
m_unmountProcess
->
start
();
}
...
...
@@ -125,10 +127,15 @@ void MaemoRemoteMounter::handleUnmountProcessFinished(int exitStatus)
}
m_mountSpecs
.
clear
();
if
(
errorMsg
.
isEmpty
())
if
(
errorMsg
.
isEmpty
())
{
emit
unmounted
();
else
}
else
{
if
(
!
m_umountStderr
.
isEmpty
())
{
errorMsg
+=
tr
(
"
\n
stderr was: '%1'"
)
.
arg
(
QString
::
fromUtf8
(
m_umountStderr
));
}
emit
error
(
errorMsg
);
}
}
void
MaemoRemoteMounter
::
stop
()
...
...
@@ -224,13 +231,14 @@ void MaemoRemoteMounter::startUtfsClients()
remoteCall
+=
andOp
+
mkdir
+
andOp
+
chmod
+
andOp
+
utfsClient
;
}
m_utfsClientStderr
.
clear
();
m_mountProcess
=
m_connection
->
createRemoteProcess
(
remoteCall
.
toUtf8
());
connect
(
m_mountProcess
.
data
(),
SIGNAL
(
started
()),
this
,
SLOT
(
handleUtfsClientsStarted
()));
connect
(
m_mountProcess
.
data
(),
SIGNAL
(
closed
(
int
)),
this
,
SLOT
(
handleUtfsClientsFinished
(
int
)));
connect
(
m_mountProcess
.
data
(),
SIGNAL
(
errorOutputAvailable
(
QByteArray
)),
this
,
S
IGNAL
(
remoteErrorOutput
(
QByteArray
)));
this
,
S
LOT
(
handleUtfsClientStderr
(
QByteArray
)));
m_mountProcess
->
start
();
}
...
...
@@ -245,22 +253,30 @@ void MaemoRemoteMounter::handleUtfsClientsFinished(int exitStatus)
if
(
m_stop
)
return
;
QString
errMsg
;
switch
(
exitStatus
)
{
case
SshRemoteProcess
::
FailedToStart
:
e
mit
error
(
tr
(
"Could not execute mount request."
)
)
;
e
rrMsg
=
tr
(
"Could not execute mount request."
);
break
;
case
SshRemoteProcess
::
KilledBySignal
:
e
mit
error
(
tr
(
"Failure running UTFS client: %1"
)
.
arg
(
m_mountProcess
->
errorString
())
)
;
e
rrMsg
=
tr
(
"Failure running UTFS client: %1"
)
.
arg
(
m_mountProcess
->
errorString
());
break
;
case
SshRemoteProcess
::
ExitedNormally
:
if
(
m_mountProcess
->
exitCode
()
!=
0
)
e
mit
error
(
tr
(
"Could not execute mount request."
)
)
;
e
rrMsg
=
tr
(
"Could not execute mount request."
);
break
;
default:
Q_ASSERT_X
(
false
,
Q_FUNC_INFO
,
"Impossible SshRemoteProcess exit status."
);
}
if
(
!
errMsg
.
isEmpty
())
{
if
(
!
m_utfsClientStderr
.
isEmpty
())
errMsg
+=
tr
(
"
\n
stderr was: '%1'"
)
.
arg
(
QString
::
fromUtf8
(
m_utfsClientStderr
));
emit
error
(
errMsg
);
}
}
void
MaemoRemoteMounter
::
startUtfsServers
()
...
...
@@ -268,8 +284,6 @@ void MaemoRemoteMounter::startUtfsServers()
for
(
int
i
=
0
;
i
<
m_mountSpecs
.
count
();
++
i
)
{
const
MaemoMountSpecification
&
mountSpec
=
m_mountSpecs
.
at
(
i
);
const
ProcPtr
utfsServerProc
(
new
QProcess
);
connect
(
utfsServerProc
.
data
(),
SIGNAL
(
readyReadStandardError
()),
this
,
SLOT
(
handleUtfsServerErrorOutput
()));
const
QString
port
=
QString
::
number
(
mountSpec
.
remotePort
);
const
QString
localSecretOpt
=
QLatin1String
(
"-l"
);
const
QString
remoteSecretOpt
=
QLatin1String
(
"-r"
);
...
...
@@ -279,8 +293,15 @@ void MaemoRemoteMounter::startUtfsServers()
<<
mountSpec
.
localDir
;
utfsServerProc
->
start
(
utfsServer
(),
utfsServerArgs
);
if
(
!
utfsServerProc
->
waitForStarted
())
{
emit
error
(
tr
(
"Could not start UTFS server: %1"
)
.
arg
(
utfsServerProc
->
errorString
()));
const
QByteArray
&
errorOutput
=
utfsServerProc
->
readAllStandardError
();
QString
errorMsg
=
tr
(
"Could not start UTFS server: %1"
)
.
arg
(
utfsServerProc
->
errorString
());
if
(
!
errorOutput
.
isEmpty
())
{
errorMsg
+=
tr
(
"
\n
stderr output was: '%1'"
)
.
arg
(
QString
::
fromLocal8Bit
(
errorOutput
));
}
emit
error
(
errorMsg
);
return
;
}
m_utfsServers
<<
utfsServerProc
;
...
...
@@ -289,9 +310,14 @@ void MaemoRemoteMounter::startUtfsServers()
emit
mounted
();
}
void
MaemoRemoteMounter
::
handleUtfsServerErrorOutput
()
void
MaemoRemoteMounter
::
handleUtfsClientStderr
(
const
QByteArray
&
output
)
{
m_utfsClientStderr
+=
output
;
}
void
MaemoRemoteMounter
::
handleUmountStderr
(
const
QByteArray
&
output
)
{
emit
remoteErrorOutput
(
qobject_cast
<
QProcess
*>
(
sender
())
->
readAllStandardError
())
;
m_umountStderr
+=
output
;
}
QString
MaemoRemoteMounter
::
utfsClientOnDevice
()
const
...
...
src/plugins/qt4projectmanager/qt-maemo/maemoremotemounter.h
View file @
1c746014
...
...
@@ -70,7 +70,6 @@ signals:
void
mounted
();
void
unmounted
();
void
error
(
const
QString
&
reason
);
void
remoteErrorOutput
(
const
QByteArray
&
output
);
private
slots
:
void
handleUploaderInitialized
();
...
...
@@ -78,8 +77,9 @@ private slots:
void
handleUploadFinished
(
Core
::
SftpJobId
jobId
,
const
QString
&
error
);
void
handleUtfsClientsStarted
();
void
handleUtfsClientsFinished
(
int
exitStatus
);
void
handleUtfsServerErrorOutput
();
void
handleUnmountProcessFinished
(
int
exitStatus
);
void
handleUtfsClientStderr
(
const
QByteArray
&
output
);
void
handleUmountStderr
(
const
QByteArray
&
output
);
private:
void
deployUtfsClient
();
...
...
@@ -101,6 +101,8 @@ private:
typedef
QSharedPointer
<
QProcess
>
ProcPtr
;
QList
<
ProcPtr
>
m_utfsServers
;
bool
m_stop
;
QByteArray
m_utfsClientStderr
;
QByteArray
m_umountStderr
;
};
}
// namespace Internal
...
...
src/plugins/qt4projectmanager/qt-maemo/maemosshrunner.cpp
View file @
1c746014
...
...
@@ -66,8 +66,6 @@ MaemoSshRunner::MaemoSshRunner(QObject *parent,
connect
(
m_mounter
,
SIGNAL
(
unmounted
()),
this
,
SLOT
(
handleUnmounted
()));
connect
(
m_mounter
,
SIGNAL
(
error
(
QString
)),
this
,
SLOT
(
handleMounterError
(
QString
)));
connect
(
m_mounter
,
SIGNAL
(
remoteErrorOutput
(
QByteArray
)),
this
,
SIGNAL
(
remoteErrorOutput
(
QByteArray
)));
}
MaemoSshRunner
::~
MaemoSshRunner
()
{}
...
...
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