Commit 888ee925 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Port deprecated methods

parent 75da0e37
......@@ -1129,7 +1129,7 @@ QUrl KGet::getValidDestUrl(const QUrl& destDir, const QUrl &srcUrl)
if (dlg) {
int result = dlg->exec();
if (result == KIO::R_RENAME || result == KIO::R_OVERWRITE)
if (result == KIO::Result_Rename || result == KIO::Result_Overwrite)
destUrl = dlg->newDestUrl();
else {
delete(dlg);
......
......@@ -31,12 +31,12 @@ struct StatusStrings
const StatusStrings STATUSTEXTS[] = {
{"", I18N_NOOP("Downloading....")},
{I18N_NOOP2_NOSTRIP("transfer state: delayed", "Delayed")},
{I18N_NOOP2_NOSTRIP("transfer state: stopped", "Stopped")},
{I18N_NOOP2_NOSTRIP("transfer state: aborted", "Aborted")},
{I18N_NOOP2_NOSTRIP("transfer state: finished", "Finished")},
{I18NC_NOOP("transfer state: delayed", "Delayed")},
{I18NC_NOOP("transfer state: stopped", "Stopped")},
{I18NC_NOOP("transfer state: aborted", "Aborted")},
{I18NC_NOOP("transfer state: finished", "Finished")},
{"", ""},//TODO: Add FinishedKeepAlive status
{I18N_NOOP2_NOSTRIP("changing the destination of the file", "Changing destination")}
{I18NC_NOOP("changing the destination of the file", "Changing destination")}
};
const QStringList STATUSICONS = QStringList() << "media-playback-start" << "view-history" << "process-stop" << "dialog-error" << "dialog-ok" << "media-playback-start" << "media-playback-pause";
......
......@@ -749,31 +749,31 @@ QUrl UrlChecker::checkExistingFile(const QUrl &source, const QUrl &destination)
///now show the dialog and look at the result
const int result = dlg->exec();
switch (result) {
case KIO::R_OVERWRITE: {
case KIO::Result_Overwrite: {
//delete the file, that way it won't show up in future calls of this method
FileDeleter::deleteFile(newDestination);
return newDestination;
}
case KIO::R_OVERWRITE_ALL: {
case KIO::Result_OverwriteAll: {
//delete the file, that way it won't show up in future calls of this method
FileDeleter::deleteFile(newDestination);
m_overwriteAll = true;
return newDestination;
}
case KIO::R_RENAME:
case KIO::Result_Rename:
//call it again, as there is no check on the user input
return checkExistingFile(source, dlg->newDestUrl());
case KIO::R_AUTO_RENAME:
case KIO::Result_AutoRename:
newDestination = dlg->autoDestUrl();
m_autoRenameAll = true;
return newDestination;
case KIO::R_SKIP:
case KIO::Result_Skip:
return QUrl();
case KIO::R_AUTO_SKIP:
case KIO::Result_AutoSkip:
m_skipAll = true;
return QUrl();
case KIO::R_CANCEL:
case KIO::Result_Cancel:
m_cancel = true;
return QUrl();
default:
......
......@@ -481,7 +481,7 @@ void AbstractMetalink::filesSelected()
KIO::RenameDialog dlg(0, i18n("File already exists"), index.data().toString(), dest, KIO::RenameDialog_Options(KIO::RenameDialog_MultipleItems | KIO::RenameDialog_Overwrite | KIO::RenameDialog_Skip));
const int result = dlg.exec();
if (result == KIO::R_RENAME) {
if (result == KIO::Result_Rename) {
//no reason to use FileModel::rename() since the file does not exist yet, so simply skip it
//avoids having to deal with signals
const QUrl newDest = dlg.newDestUrl();
......@@ -493,17 +493,17 @@ void AbstractMetalink::filesSelected()
m_dataSourceFactory.remove(dest);
m_dataSourceFactory[newDest] = factory;
continue;
} else if (result == KIO::R_SKIP) {
} else if (result == KIO::Result_Skip) {
fileModel()->setData(index, Qt::Unchecked, Qt::CheckStateRole);
doDownload = false;
} else if (result == KIO::R_CANCEL) {
} else if (result == KIO::Result_Cancel) {
cancel = true;
break;
} else if (result == KIO::R_AUTO_SKIP) {
} else if (result == KIO::Result_AutoSkip) {
autoSkip = true;
fileModel()->setData(index, Qt::Unchecked, Qt::CheckStateRole);
doDownload = false;
} else if (result == KIO::R_OVERWRITE_ALL) {
} else if (result == KIO::Result_OverwriteAll) {
overwriteAll = true;
}
}
......
......@@ -717,7 +717,7 @@ void Metalink::filesSelected()
KIO::RenameDialog dlg(nullptr, i18n("File already exists"), index.data().toString(), dest, KIO::RenameDialog_Options(KIO::RenameDialog_MultipleItems | KIO::RenameDialog_Overwrite | KIO::RenameDialog_Skip));
const int result = dlg.exec();
if (result == KIO::R_RENAME) {
if (result == KIO::Result_Rename) {
//no reason to use FileModel::rename() since the file does not exist yet, so simply skip it
//avoids having to deal with signals
const QUrl newDest = dlg.newDestUrl();
......@@ -729,17 +729,17 @@ void Metalink::filesSelected()
m_dataSourceFactory.remove(dest);
m_dataSourceFactory[newDest] = factory;
continue;
} else if (result == KIO::R_SKIP) {
} else if (result == KIO::Result_Skip) {
fileModel()->setData(index, Qt::Unchecked, Qt::CheckStateRole);
doDownload = false;
} else if (result == KIO::R_CANCEL) {
} else if (result == KIO::Result_Cancel) {
cancel = true;
break;
} else if (result == KIO::R_AUTO_SKIP) {
} else if (result == KIO:Result_AutoSkip:) {
autoSkip = true;
fileModel()->setData(index, Qt::Unchecked, Qt::CheckStateRole);
doDownload = false;
} else if (result == KIO::R_OVERWRITE_ALL) {
} else if (result == KIO::Result_OverwriteAll) {
overwriteAll = true;
}
}
......
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