Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 36a59ad7 authored by David Edmundson's avatar David Edmundson

Fix KIOClient non-interactive mode handling renamed prompts

Summary:
In the kdelibs to KF5 transition a factory class was added for loading
the rename prompts to make KIO gui-less.

In jobs "if (isInteractive)" was changed everywhere into "if
(uiDelegateExtension)".

The former was false if we called KJob::setUiDelegate(nullptr). The
latter is only false if the calling code explicitly calls the new
KIO::Job::setUiDelegateExtension(nullptr) as well.

This left kioclient5 in the very weird state of non-interactive mode
still having rename dialogs but not error messages.

Now non-interactive mode will simply error if it hits a conflict and
stop as before.

Test Plan:
Copied a conflict. Got a warning and an exit.
Interactive mode remains the same

Reviewers: #plasma, dfaure

Reviewed By: dfaure

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D17703
parent 72c87f10
......@@ -212,8 +212,10 @@ bool ClientApp::doCopy( const QStringList& urls )
QList<QUrl> srcLst(makeUrls(urls));
QUrl dest = srcLst.takeLast();
KIO::Job * job = KIO::copy( srcLst, dest, s_jobFlags );
if ( !s_interactive )
if ( !s_interactive ) {
job->setUiDelegate( nullptr );
job->setUiDelegateExtension( nullptr );
}
connect( job, SIGNAL( result( KJob * ) ), this, SLOT( slotResult( KJob * ) ) );
qApp->exec();
return m_ok;
......@@ -233,8 +235,10 @@ bool ClientApp::doList( const QStringList& urls )
{
QUrl dir = makeURL(urls.first());
KIO::Job * job = KIO::listDir(dir, KIO::HideProgressInfo);
if ( !s_interactive )
job->setUiDelegate(nullptr);
if ( !s_interactive ) {
job->setUiDelegate( nullptr );
job->setUiDelegateExtension( nullptr );
}
connect(job, SIGNAL(entries(KIO::Job*,KIO::UDSEntryList)),
SLOT(slotEntries(KIO::Job*,KIO::UDSEntryList)));
connect(job, SIGNAL(result(KJob *)), this, SLOT(slotResult(KJob *)));
......@@ -247,8 +251,10 @@ bool ClientApp::doMove( const QStringList& urls )
QList<QUrl> srcLst(makeUrls(urls));
QUrl dest = srcLst.takeLast();
KIO::Job * job = KIO::move( srcLst, dest, s_jobFlags );
if ( !s_interactive )
if ( !s_interactive ) {
job->setUiDelegate( nullptr );
job->setUiDelegateExtension( nullptr );
}
connect( job, SIGNAL( result( KJob * ) ), this, SLOT( slotResult( KJob * ) ) );
qApp->exec();
return m_ok;
......@@ -257,8 +263,10 @@ bool ClientApp::doMove( const QStringList& urls )
bool ClientApp::doRemove( const QStringList& urls )
{
KIO::Job * job = KIO::del( makeUrls(urls), s_jobFlags );
if ( !s_interactive )
if ( !s_interactive ) {
job->setUiDelegate( nullptr );
job->setUiDelegateExtension( nullptr );
}
connect( job, SIGNAL( result( KJob * ) ), this, SLOT( slotResult( KJob * ) ) );
qApp->exec();
return m_ok;
......@@ -309,8 +317,10 @@ bool ClientApp::doIt(const QCommandLineParser& parser)
checkArgumentCount(argc, 2, 2); // cat <url>
QUrl url = makeURL(parser.positionalArguments().last());
KIO::TransferJob* job = KIO::get(url, KIO::NoReload, s_jobFlags);
if ( !s_interactive )
if ( !s_interactive ) {
job->setUiDelegate( nullptr );
job->setUiDelegateExtension( nullptr );
}
connect(job, SIGNAL(data(KIO::Job*,QByteArray) ), this, SLOT(slotPrintData(KIO::Job*,QByteArray)));
connect(job, SIGNAL( result( KJob * ) ), this, SLOT( slotResult( KJob * ) ) );
qApp->exec();
......@@ -339,8 +349,10 @@ bool ClientApp::doIt(const QCommandLineParser& parser)
if (dsturl.isEmpty()) // canceled
return m_ok; // AK - really okay?
KIO::Job * job = KIO::copy( srcLst, dsturl, s_jobFlags );
if ( !s_interactive )
if ( !s_interactive ) {
job->setUiDelegate( nullptr );
job->setUiDelegateExtension( nullptr );
}
connect( job, SIGNAL( result( KJob * ) ), qApp, SLOT( slotResult( KJob * ) ) );
qApp->exec();
return m_ok;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment