Commit 1be27042 authored by Elvis Angelaccio's avatar Elvis Angelaccio

Port away from deprecated KIO::Job::ui()

It's equivalent to KJob::uiDelegate() from kcoreaddons.
parent 215bed08
......@@ -160,7 +160,7 @@ void DolphinContextMenu::openTrashContextMenu()
if (uiDelegate.askDeleteConfirmation(QList<QUrl>(), KIO::JobUiDelegate::EmptyTrash, KIO::JobUiDelegate::DefaultConfirmation)) {
KIO::Job* job = KIO::emptyTrash();
KJobWidgets::setWindow(job, m_mainWindow);
job->ui()->setAutoErrorHandlingEnabled(true);
job->uiDelegate()->setAutoErrorHandlingEnabled(true);
}
}
}
......
......@@ -723,7 +723,7 @@ void DolphinMainWindow::handleUrl(const QUrl& url)
} else if (KProtocolManager::supportsListing(url)) {
// stat the URL to see if it is a dir or not
m_lastHandleUrlStatJob = KIO::stat(url, KIO::HideProgressInfo);
if (m_lastHandleUrlStatJob->ui()) {
if (m_lastHandleUrlStatJob->uiDelegate()) {
KJobWidgets::setWindow(m_lastHandleUrlStatJob, this);
}
connect(m_lastHandleUrlStatJob, &KIO::Job::result,
......
......@@ -907,7 +907,7 @@ void KFileItemModelRolesUpdater::startPreviewJob()
KIO::PreviewJob* job = new KIO::PreviewJob(itemSubSet, cacheSize, &m_enabledPlugins);
job->setIgnoreMaximumSize(itemSubSet.first().isLocalFile());
if (job->ui()) {
if (job->uiDelegate()) {
KJobWidgets::setWindow(job, qApp->activeWindow());
}
......
......@@ -260,7 +260,7 @@ void FoldersPanel::slotRoleEditingFinished(int index, const QByteArray& role, co
KIO::Job* job = KIO::moveAs(oldUrl, newUrl);
KJobWidgets::setWindow(job, this);
KIO::FileUndoManager::self()->recordJob(KIO::FileUndoManager::Rename, {oldUrl}, newUrl, job);
job->ui()->setAutoErrorHandlingEnabled(true);
job->uiDelegate()->setAutoErrorHandlingEnabled(true);
}
}
}
......
......@@ -201,7 +201,7 @@ void TreeViewContextMenu::moveToTrash()
KIO::Job* job = KIO::trash(list);
KIO::FileUndoManager::self()->recordJob(KIO::FileUndoManager::Trash, list, QUrl(QStringLiteral("trash:/")), job);
KJobWidgets::setWindow(job, m_parent);
job->ui()->setAutoErrorHandlingEnabled(true);
job->uiDelegate()->setAutoErrorHandlingEnabled(true);
}
}
......@@ -213,7 +213,7 @@ void TreeViewContextMenu::deleteItem()
if (uiDelegate.askDeleteConfirmation(list, KIO::JobUiDelegate::Delete, KIO::JobUiDelegate::DefaultConfirmation)) {
KIO::Job* job = KIO::del(list);
KJobWidgets::setWindow(job, m_parent);
job->ui()->setAutoErrorHandlingEnabled(true);
job->uiDelegate()->setAutoErrorHandlingEnabled(true);
}
}
......
......@@ -185,7 +185,7 @@ void InformationPanel::showItemInfo()
// No item is hovered and no selection has been done: provide
// an item for the currently shown directory.
m_folderStatJob = KIO::stat(url(), KIO::HideProgressInfo);
if (m_folderStatJob->ui()) {
if (m_folderStatJob->uiDelegate()) {
KJobWidgets::setWindow(m_folderStatJob, this);
}
connect(m_folderStatJob, &KIO::Job::result,
......
......@@ -195,7 +195,7 @@ void InformationPanelContent::showItem(const KFileItem& item)
m_previewJob = new KIO::PreviewJob(KFileItemList() << item, QSize(m_preview->width(), m_preview->height()));
m_previewJob->setScaleType(KIO::PreviewJob::Unscaled);
m_previewJob->setIgnoreMaximumSize(item.isLocalFile());
if (m_previewJob->ui()) {
if (m_previewJob->uiDelegate()) {
KJobWidgets::setWindow(m_previewJob, this);
}
......
......@@ -137,7 +137,7 @@ void TerminalPanel::changeDir(const QUrl& url)
sendCdToTerminal(url.toLocalFile());
} else {
m_mostLocalUrlJob = KIO::mostLocalUrl(url, KIO::HideProgressInfo);
if (m_mostLocalUrlJob->ui()) {
if (m_mostLocalUrlJob->uiDelegate()) {
KJobWidgets::setWindow(m_mostLocalUrlJob, this);
}
connect(m_mostLocalUrlJob, &KIO::StatJob::result, this, &TerminalPanel::slotMostLocalUrlResult);
......
......@@ -1534,7 +1534,7 @@ void DolphinView::slotRoleEditingFinished(int index, const QByteArray& role, con
KIO::Job * job = KIO::moveAs(oldUrl, newUrl);
KJobWidgets::setWindow(job, this);
KIO::FileUndoManager::self()->recordJob(KIO::FileUndoManager::Rename, {oldUrl}, newUrl, job);
job->ui()->setAutoErrorHandlingEnabled(true);
job->uiDelegate()->setAutoErrorHandlingEnabled(true);
if (!newNameExistsAlready) {
// Only connect the result signal if there is no item with the new name
......
......@@ -162,7 +162,7 @@ void RenameDialog::renameItem(const KFileItem &item, const QString& newName)
KIO::Job * job = KIO::moveAs(oldUrl, newUrl);
KJobWidgets::setWindow(job, widget);
KIO::FileUndoManager::self()->recordJob(KIO::FileUndoManager::Rename, {oldUrl}, newUrl, job);
job->ui()->setAutoErrorHandlingEnabled(true);
job->uiDelegate()->setAutoErrorHandlingEnabled(true);
}
void RenameDialog::slotAccepted()
......
......@@ -130,7 +130,7 @@ void ToolTipManager::startContentRetrieval()
KIO::PreviewJob* job = new KIO::PreviewJob(KFileItemList() << m_item, QSize(256, 256));
job->setIgnoreMaximumSize(m_item.isLocalFile());
if (job->ui()) {
if (job->uiDelegate()) {
KJobWidgets::setWindow(job, qApp->activeWindow());
}
......
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