Commit 621a72f6 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Port some deprecated methods

parent 23f7fb59
......@@ -49,7 +49,7 @@ IntegrationPreferences::IntegrationPreferences(KConfigDialog *parent, Qt::Window
AutoPasteDelegate *delegate = new AutoPasteDelegate(ui.type->model(), ui.patternSyntax->model(), this);
ui.list->setItemDelegate(delegate);
QByteArray loadedState = QByteArray::fromBase64(Settings::autoPasteHeaderState().toAscii());
QByteArray loadedState = QByteArray::fromBase64(Settings::autoPasteHeaderState().toLatin1());
if (Settings::autoPasteHeaderState().isEmpty()) {
ui.list->resizeColumnToContents(AutoPasteModel::Type);
} else if (!loadedState.isNull()) {
......
......@@ -32,7 +32,7 @@ class IntegrationPreferences : public QWidget
Q_OBJECT
public:
explicit IntegrationPreferences(KConfigDialog *parent, Qt::WindowFlags f = 0);
explicit IntegrationPreferences(KConfigDialog *parent, Qt::WindowFlags f = Qt::Widget);
~IntegrationPreferences();
private slots:
......
......@@ -31,7 +31,7 @@ class VerificationPreferences : public QWidget
Q_OBJECT
public:
explicit VerificationPreferences(KConfigDialog *parent, Qt::WindowFlags f = 0);
explicit VerificationPreferences(KConfigDialog *parent, Qt::WindowFlags f = Qt::Widget);
signals:
/**
......
......@@ -1240,7 +1240,7 @@ Signature *DataSourceFactory::signature()
void DataSourceFactory::slotUpdateCapabilities()
{
const Transfer::Capabilities oldCaps = capabilities();
Transfer::Capabilities newCaps = 0;
Transfer::Capabilities newCaps = {};
if ((status() == Job::Finished) || (status() == Job::Stopped)) {
newCaps |= Transfer::Cap_Moving | Transfer::Cap_Renaming;
......
......@@ -412,7 +412,7 @@ Qt::ItemFlags FileModel::flags(const QModelIndex &index) const
{
if (!index.isValid())
{
return 0;
return Qt::NoItemFlags;
}
if (index.column() == FileItem::File)
......
......@@ -142,7 +142,7 @@ QByteArray Signature::signature()
void Signature::setAsciiDetatchedSignature(const QString &signature)
{
setSignature(signature.toAscii(), AsciiDetached);
setSignature(signature.toLatin1(), AsciiDetached);
}
void Signature::setSignature(const QByteArray &signature, SignatureType type)
......@@ -295,10 +295,10 @@ void Signature::load(const QDomElement &e)
switch (d->type) {
case NoType:
case AsciiDetached:
d->signature = verification.text().toAscii();
d->signature = verification.text().toLatin1();
break;
case BinaryDetached:
d->signature = QByteArray::fromBase64(verification.text().toAscii());
d->signature = QByteArray::fromBase64(verification.text().toLatin1());
}
}
......
......@@ -635,7 +635,7 @@ bool TransferTreeModel::dropMimeData(const QMimeData * mdata, Qt::DropAction act
if (transfers[i].isNull()) {
qWarning() << "The moved transfer has been deleted inbetween.";
} else {
moveTransfer(transfers[i].data()->m_transfer, destGroup, after);
moveTransfer(transfers[i].toStrongRef().data()->m_transfer, destGroup, after);
}
}
return true;
......
......@@ -81,7 +81,7 @@ QVariant VerificationModel::data(const QModelIndex &index, int role) const
Qt::ItemFlags VerificationModel::flags(const QModelIndex &index) const
{
if (!index.isValid()) {
return 0;
return Qt::NoItemFlags;
}
Qt::ItemFlags flags = Qt::ItemIsEnabled | Qt::ItemIsSelectable;
......
......@@ -56,7 +56,7 @@ namespace kt
Qt::ItemFlags TorrentFileModel::flags(const QModelIndex & index) const
{
if (!index.isValid())
return 0;
return Qt::NoItemFlags;
Qt::ItemFlags flags = Qt::ItemIsSelectable | Qt::ItemIsEnabled;
if (tc->getStats().multi_file_torrent)
......
......@@ -184,7 +184,7 @@ void ChecksumSearchTransferDataSource::gotBaseUrl(const QUrl &urlToFile)
for (int i = 0, k = 0; i < changes.size(); ++i) {
const ChecksumSearch::UrlChangeMode mode = static_cast<ChecksumSearch::UrlChangeMode>(modes.at(i));
const QUrl source = ChecksumSearch::createUrl(m_sourceUrl, changes.at(i), mode);
if (data.indexOf(source.fileName().toAscii()) != -1) {
if (data.indexOf(source.fileName().toLatin1()) != -1) {
urls.append(source);
++k;
} else {
......
......@@ -37,7 +37,7 @@ const QUrl ChecksumSearchAddDlg::URL = QUrl("http://www.example.com/file.zip");
K_PLUGIN_FACTORY( KGetFactory, registerPlugin<DlgChecksumSettingsWidget>(); )
ChecksumSearchAddDlg::ChecksumSearchAddDlg(QStringListModel *modesModel, QStringListModel *typesModel, QWidget *parent, Qt::WFlags flags)
ChecksumSearchAddDlg::ChecksumSearchAddDlg(QStringListModel *modesModel, QStringListModel *typesModel, QWidget *parent, Qt::WindowFlags flags)
: QDialog(parent, flags),
m_modesModel(modesModel),
m_typesModel(typesModel)
......
......@@ -39,7 +39,7 @@ class ChecksumSearchAddDlg : public QDialog
Q_OBJECT
public:
ChecksumSearchAddDlg(QStringListModel *modesModel, QStringListModel *typesModel, QWidget *parent = nullptr, Qt::WFlags flags = {});
ChecksumSearchAddDlg(QStringListModel *modesModel, QStringListModel *typesModel, QWidget *parent = nullptr, Qt::WindowFlags flags = {});
signals:
/**
......
......@@ -402,7 +402,7 @@ void AbstractMetalink::setAvailableMirrors(const QUrl &file, const QHash<QUrl, Q
void AbstractMetalink::slotUpdateCapabilities()
{
Capabilities oldCap = capabilities();
Capabilities newCap = 0;
Capabilities newCap = {};
foreach (DataSourceFactory *file, m_dataSourceFactory) {
if (file->doDownload()) {//FIXME when a download did not start yet it should be moveable!!//FIXME why not working, when only two connections?
if (newCap) {
......
......@@ -46,7 +46,7 @@
*/
QString base64ToHex(const QString& b64)
{
return QString(QByteArray::fromBase64(b64.toAscii()).toHex());
return QString(QByteArray::fromBase64(b64.toLatin1()).toHex());
}
MetalinkHttp::MetalinkHttp(TransferGroup * parent, TransferFactory * factory,
......
......@@ -63,7 +63,7 @@ void MmsDownload::run()
bool MmsDownload::isWorkingUrl()
{
/** Check if the URL is working, if it can't connect then not start the download.*/
m_mms = mmsx_connect(NULL, NULL, qstrdup(m_sourceUrl.toAscii()), 1e9);
m_mms = mmsx_connect(NULL, NULL, qstrdup(m_sourceUrl.toLatin1()), 1e9);
return m_mms;
}
......
......@@ -39,7 +39,7 @@ void MmsThread::run()
file.seek(m_begin);
/** Connecting to the url*/
mms = mmsx_connect(NULL, NULL, qstrdup(m_sourceUrl.toAscii()) , 1e6);
mms = mmsx_connect(NULL, NULL, qstrdup(m_sourceUrl.toLatin1()) , 1e6);
if (mms) {
m_locker.lock();
emit signIsConnected(true);
......
......@@ -501,7 +501,7 @@ void KGetMetalink::File::load(const QDomElement &e)
{
data.load(e);
name = QUrl::fromPercentEncoding(e.attribute("name").toAscii());
name = QUrl::fromPercentEncoding(e.attribute("name").toLatin1());
size = e.firstChildElement("size").text().toULongLong();
verification.load(e);
......@@ -741,7 +741,7 @@ void KGetMetalink::Metalink_v3::parseFiles(const QDomElement &e)
for (QDomElement elem = filesElem.firstChildElement("file"); !elem.isNull(); elem = elem.nextSiblingElement("file")) {
File file;
file.name = QUrl::fromPercentEncoding(elem.attribute("name").toAscii());
file.name = QUrl::fromPercentEncoding(elem.attribute("name").toLatin1());
file.size = elem.firstChildElement("size").text().toULongLong();
file.data = parseCommonData(elem);
......
......@@ -413,7 +413,7 @@ QVariant MirrorModel::data(const QModelIndex &index, int role) const
Qt::ItemFlags MirrorModel::flags(const QModelIndex &index) const
{
if (!index.isValid()) {
return 0;
return Qt::NoItemFlags;
}
return m_data.at(index.row())->flags(index.column());
......
......@@ -26,7 +26,7 @@
#include <KLocalizedString>
#include <KStandardGuiItem>
MirrorAddDlg::MirrorAddDlg(MirrorModel *model, QWidget *parent, Qt::WFlags flags)
MirrorAddDlg::MirrorAddDlg(MirrorModel *model, QWidget *parent, Qt::WindowFlags flags)
: QDialog(parent, flags),
m_model(model),
m_countryModel(nullptr)
......@@ -34,7 +34,7 @@ MirrorAddDlg::MirrorAddDlg(MirrorModel *model, QWidget *parent, Qt::WFlags flags
init();
}
MirrorAddDlg::MirrorAddDlg(MirrorModel *model, QSortFilterProxyModel *countryModel, QWidget *parent, Qt::WFlags flags)
MirrorAddDlg::MirrorAddDlg(MirrorModel *model, QSortFilterProxyModel *countryModel, QWidget *parent, Qt::WindowFlags flags)
: QDialog(parent, flags),
m_model(model),
m_countryModel(countryModel)
......
......@@ -35,8 +35,8 @@ class MirrorAddDlg : public QDialog
Q_OBJECT
public:
explicit MirrorAddDlg(MirrorModel *model, QWidget *parent = nullptr, Qt::WFlags flags = {});
explicit MirrorAddDlg(MirrorModel *model, QSortFilterProxyModel *countryModel, QWidget *parent = nullptr, Qt::WFlags flags = {});
explicit MirrorAddDlg(MirrorModel *model, QWidget *parent = nullptr, Qt::WindowFlags flags = {});
explicit MirrorAddDlg(MirrorModel *model, QSortFilterProxyModel *countryModel, QWidget *parent = nullptr, Qt::WindowFlags flags = {});
virtual QSize sizeHint() const override;
......
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