mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-24 10:52:49 +00:00
kio: remove fish slave leftovers
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
19797922e8
commit
7c265c3c1b
2 changed files with 0 additions and 76 deletions
|
@ -235,12 +235,6 @@ bool NetAccess::mkdir( const KUrl & url, QWidget* window, int permissions )
|
|||
return kioNet.mkdirInternal( url, permissions, window );
|
||||
}
|
||||
|
||||
QString NetAccess::fish_execute( const KUrl & url, const QString &command, QWidget* window )
|
||||
{
|
||||
NetAccess kioNet;
|
||||
return kioNet.fish_executeInternal( url, command, window );
|
||||
}
|
||||
|
||||
bool NetAccess::synchronousRun( Job* job, QWidget* window, QByteArray* data,
|
||||
KUrl* finalURL, QMap<QString, QString>* metaData )
|
||||
{
|
||||
|
@ -373,56 +367,6 @@ void NetAccess::slotMimetype( KIO::Job *, const QString & type )
|
|||
d->m_mimetype = type;
|
||||
}
|
||||
|
||||
QString NetAccess::fish_executeInternal(const KUrl & url, const QString &command, QWidget* window)
|
||||
{
|
||||
QString target, remoteTempFileName, resultData;
|
||||
KUrl tempPathUrl;
|
||||
KTemporaryFile tmpFile;
|
||||
tmpFile.open();
|
||||
|
||||
if( url.protocol() == "fish" )
|
||||
{
|
||||
// construct remote temp filename
|
||||
tempPathUrl = url;
|
||||
remoteTempFileName = tmpFile.fileName();
|
||||
// only need the filename KTempFile adds some KDE specific dirs
|
||||
// that probably does not exist on the remote side
|
||||
int pos = remoteTempFileName.lastIndexOf('/');
|
||||
remoteTempFileName = "/tmp/fishexec_" + remoteTempFileName.mid(pos + 1);
|
||||
tempPathUrl.setPath( remoteTempFileName );
|
||||
d->bJobOK = true; // success unless further error occurs
|
||||
QByteArray packedArgs;
|
||||
QDataStream stream( &packedArgs, QIODevice::WriteOnly );
|
||||
|
||||
stream << int('X') << tempPathUrl << command;
|
||||
|
||||
KIO::Job * job = KIO::special( tempPathUrl, packedArgs );
|
||||
job->ui()->setWindow( window );
|
||||
connect( job, SIGNAL(result(KJob*)),
|
||||
this, SLOT(slotResult(KJob*)) );
|
||||
enter_loop();
|
||||
|
||||
// since the KIO::special does not provide feedback we need to download the result
|
||||
if( NetAccess::download( tempPathUrl, target, window ) )
|
||||
{
|
||||
QFile resultFile( target );
|
||||
|
||||
if (resultFile.open( QIODevice::ReadOnly ))
|
||||
{
|
||||
QTextStream ts( &resultFile ); // default encoding is Locale
|
||||
resultData = ts.readAll();
|
||||
resultFile.close();
|
||||
NetAccess::del( tempPathUrl, window );
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
resultData = i18n( "ERROR: Unknown protocol '%1'", url.protocol() );
|
||||
}
|
||||
return resultData;
|
||||
}
|
||||
|
||||
bool NetAccess::synchronousRunInternal( Job* job, QWidget* window, QByteArray* data,
|
||||
KUrl* finalURL, QMap<QString,QString>* metaData )
|
||||
{
|
||||
|
|
|
@ -302,26 +302,6 @@ public:
|
|||
*/
|
||||
static bool mkdir( const KUrl & url, QWidget* window, int permissions = -1 );
|
||||
|
||||
/**
|
||||
* Executes a remote process via the fish ioslave in a synchronous way.
|
||||
*
|
||||
* @param url The remote machine where the command should be executed.
|
||||
* e.g. fish://someuser\@somehost:sshport/
|
||||
* some special cases exist.
|
||||
* fish://someuser\@localhost/
|
||||
* will use su instead of ssh to connect and execute the command.
|
||||
* fish://someuser\@localhost:port/
|
||||
* will use ssh to connect and execute the command.
|
||||
* @param command The command to be executed.
|
||||
* @param window main window associated with this job. This is used to
|
||||
* automatically cache and discard authentication information
|
||||
* as needed. If NULL, authentication information will be
|
||||
* cached only for a short duration after which the user will
|
||||
* again be prompted for passwords as needed.
|
||||
* @return The resulting output of the @p command that is executed.
|
||||
*/
|
||||
static QString fish_execute( const KUrl & url, const QString &command, QWidget* window );
|
||||
|
||||
/**
|
||||
* This function executes a job in a synchronous way.
|
||||
* If a job fetches some data, pass a QByteArray pointer as data parameter to this function
|
||||
|
|
Loading…
Add table
Reference in a new issue