Commit a9d1bfcf authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

make it compile without deprecated methods

parent 405d1294
......@@ -41,6 +41,7 @@ include(FeatureSummary)
include(KDEClangFormat)
if (EXISTS "${CMAKE_SOURCE_DIR}/.git")
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000)
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x060000)
endif()
include_directories(${CMAKE_CURRENT_BINARY_DIR})
......
......@@ -117,26 +117,26 @@ void KioBluetooth::listRemoteDeviceServices()
Q_FOREACH (const Service &service, services) {
KIO::UDSEntry entry;
entry.insert(KIO::UDSEntry::UDS_NAME, service.uuid);
entry.insert(KIO::UDSEntry::UDS_DISPLAY_NAME, service.name);
entry.insert(KIO::UDSEntry::UDS_ICON_NAME, service.icon);
entry.insert(KIO::UDSEntry::UDS_ACCESS, S_IRUSR | S_IRGRP | S_IROTH);
entry.fastInsert(KIO::UDSEntry::UDS_NAME, service.uuid);
entry.fastInsert(KIO::UDSEntry::UDS_DISPLAY_NAME, service.name);
entry.fastInsert(KIO::UDSEntry::UDS_ICON_NAME, service.icon);
entry.fastInsert(KIO::UDSEntry::UDS_ACCESS, S_IRUSR | S_IRGRP | S_IROTH);
// If it is browse files, act as a folder
if (service.uuid == BluezQt::Services::ObexFileTransfer) {
QUrl obexUrl;
obexUrl.setScheme(QStringLiteral("obexftp"));
obexUrl.setHost(m_currentHostname.replace(QLatin1Char(':'), QLatin1Char('-')).toUpper());
entry.insert(KIO::UDSEntry::UDS_FILE_TYPE, S_IFDIR);
entry.insert(KIO::UDSEntry::UDS_URL, obexUrl.toString());
entry.fastInsert(KIO::UDSEntry::UDS_FILE_TYPE, S_IFDIR);
entry.fastInsert(KIO::UDSEntry::UDS_URL, obexUrl.toString());
} else {
entry.insert(KIO::UDSEntry::UDS_FILE_TYPE, S_IFREG);
entry.fastInsert(KIO::UDSEntry::UDS_FILE_TYPE, S_IFREG);
}
if (service.mimetype.isEmpty()) {
entry.insert(KIO::UDSEntry::UDS_MIME_TYPE, QStringLiteral("inode/vnd.kde.bluedevil.service"));
entry.fastInsert(KIO::UDSEntry::UDS_MIME_TYPE, QStringLiteral("inode/vnd.kde.bluedevil.service"));
} else {
entry.insert(KIO::UDSEntry::UDS_MIME_TYPE, service.mimetype);
entry.fastInsert(KIO::UDSEntry::UDS_MIME_TYPE, service.mimetype);
}
listEntry(entry);
......@@ -151,12 +151,12 @@ void KioBluetooth::listDownload()
{
KIO::UDSEntry entry;
entry.clear();
entry.insert(KIO::UDSEntry::UDS_URL, FileReceiverSettings::saveUrl().toDisplayString());
entry.insert(KIO::UDSEntry::UDS_NAME, i18n("Received Files"));
entry.insert(KIO::UDSEntry::UDS_ICON_NAME, QStringLiteral("folder-downloads"));
entry.insert(KIO::UDSEntry::UDS_FILE_TYPE, S_IFDIR);
entry.insert(KIO::UDSEntry::UDS_ACCESS, S_IRUSR | S_IRGRP | S_IROTH);
entry.insert(KIO::UDSEntry::UDS_MIME_TYPE, QStringLiteral("inode/directory"));
entry.fastInsert(KIO::UDSEntry::UDS_URL, FileReceiverSettings::saveUrl().toDisplayString());
entry.fastInsert(KIO::UDSEntry::UDS_NAME, i18n("Received Files"));
entry.fastInsert(KIO::UDSEntry::UDS_ICON_NAME, QStringLiteral("folder-downloads"));
entry.fastInsert(KIO::UDSEntry::UDS_FILE_TYPE, S_IFDIR);
entry.fastInsert(KIO::UDSEntry::UDS_ACCESS, S_IRUSR | S_IRGRP | S_IROTH);
entry.fastInsert(KIO::UDSEntry::UDS_MIME_TYPE, QStringLiteral("inode/directory"));
listEntry(entry);
}
......@@ -186,12 +186,12 @@ void KioBluetooth::listDevice(const DeviceInfo device)
target.append(QString(device[QStringLiteral("address")]).replace(QLatin1Char(':'), QLatin1Char('-')));
KIO::UDSEntry entry;
entry.insert(KIO::UDSEntry::UDS_URL, target);
entry.insert(KIO::UDSEntry::UDS_NAME, device[QStringLiteral("name")]);
entry.insert(KIO::UDSEntry::UDS_ICON_NAME, device[QStringLiteral("icon")]);
entry.insert(KIO::UDSEntry::UDS_FILE_TYPE, S_IFDIR);
entry.insert(KIO::UDSEntry::UDS_ACCESS, S_IRUSR | S_IRGRP | S_IROTH);
entry.insert(KIO::UDSEntry::UDS_MIME_TYPE, QStringLiteral("inode/vnd.kde.bluedevil.device"));
entry.fastInsert(KIO::UDSEntry::UDS_URL, target);
entry.fastInsert(KIO::UDSEntry::UDS_NAME, device[QStringLiteral("name")]);
entry.fastInsert(KIO::UDSEntry::UDS_ICON_NAME, device[QStringLiteral("icon")]);
entry.fastInsert(KIO::UDSEntry::UDS_FILE_TYPE, S_IFDIR);
entry.fastInsert(KIO::UDSEntry::UDS_ACCESS, S_IRUSR | S_IRGRP | S_IROTH);
entry.fastInsert(KIO::UDSEntry::UDS_MIME_TYPE, QStringLiteral("inode/vnd.kde.bluedevil.device"));
listEntry(entry);
}
......
......@@ -390,9 +390,9 @@ void KioFtp::statHelper(const QUrl &url)
if (urlIsRoot(url)) {
qCDebug(OBEXFTP) << "Url is root";
KIO::UDSEntry entry;
entry.insert(KIO::UDSEntry::UDS_NAME, QStringLiteral("/"));
entry.insert(KIO::UDSEntry::UDS_FILE_TYPE, S_IFDIR);
entry.insert(KIO::UDSEntry::UDS_ACCESS, 0700);
entry.fastInsert(KIO::UDSEntry::UDS_NAME, QStringLiteral("/"));
entry.fastInsert(KIO::UDSEntry::UDS_FILE_TYPE, S_IFDIR);
entry.fastInsert(KIO::UDSEntry::UDS_ACCESS, 0700);
qCDebug(OBEXFTP) << "Adding stat cache" << url.toDisplayString();
m_statMap.insert(url.toDisplayString(), entry);
......@@ -441,16 +441,16 @@ QList<KIO::UDSEntry> KioFtp::listFolder(const QUrl &url, bool *ok)
}
KIO::UDSEntry entry;
entry.insert(KIO::UDSEntry::UDS_NAME, item.name());
entry.insert(KIO::UDSEntry::UDS_DISPLAY_NAME, item.label());
entry.insert(KIO::UDSEntry::UDS_ACCESS, 0700);
entry.insert(KIO::UDSEntry::UDS_MODIFICATION_TIME, item.modificationTime().toSecsSinceEpoch());
entry.insert(KIO::UDSEntry::UDS_SIZE, item.size());
entry.fastInsert(KIO::UDSEntry::UDS_NAME, item.name());
entry.fastInsert(KIO::UDSEntry::UDS_DISPLAY_NAME, item.label());
entry.fastInsert(KIO::UDSEntry::UDS_ACCESS, 0700);
entry.fastInsert(KIO::UDSEntry::UDS_MODIFICATION_TIME, item.modificationTime().toSecsSinceEpoch());
entry.fastInsert(KIO::UDSEntry::UDS_SIZE, item.size());
if (item.type() == BluezQt::ObexFileTransferEntry::Folder) {
entry.insert(KIO::UDSEntry::UDS_FILE_TYPE, S_IFDIR);
entry.fastInsert(KIO::UDSEntry::UDS_FILE_TYPE, S_IFDIR);
} else if (item.type() == BluezQt::ObexFileTransferEntry::File) {
entry.insert(KIO::UDSEntry::UDS_FILE_TYPE, S_IFREG);
entry.fastInsert(KIO::UDSEntry::UDS_FILE_TYPE, S_IFREG);
}
if (urlIsRoot(url)) {
......@@ -526,18 +526,18 @@ void KioFtp::updateRootEntryIcon(KIO::UDSEntry &entry, const QString &memoryType
// Nokia (mount-points are C: D: E: ...)
if (path.size() == 2 && path.at(1) == QLatin1Char(':')) {
if (memoryType.startsWith(QLatin1String("DEV"))) {
entry.insert(KIO::UDSEntry::UDS_ICON_NAME, QStringLiteral("drive-removable-media"));
entry.fastInsert(KIO::UDSEntry::UDS_ICON_NAME, QStringLiteral("drive-removable-media"));
} else if (memoryType == QLatin1String("MMC")) {
entry.insert(KIO::UDSEntry::UDS_ICON_NAME, QStringLiteral("media-flash-sd-mmc"));
entry.fastInsert(KIO::UDSEntry::UDS_ICON_NAME, QStringLiteral("media-flash-sd-mmc"));
}
}
// Android
if (entry.stringValue(KIO::UDSEntry::UDS_NAME) == QLatin1String("PHONE_MEMORY")) {
entry.insert(KIO::UDSEntry::UDS_DISPLAY_NAME, i18n("Phone memory"));
entry.insert(KIO::UDSEntry::UDS_ICON_NAME, QStringLiteral("drive-removable-media"));
entry.fastInsert(KIO::UDSEntry::UDS_DISPLAY_NAME, i18n("Phone memory"));
entry.fastInsert(KIO::UDSEntry::UDS_ICON_NAME, QStringLiteral("drive-removable-media"));
} else if (entry.stringValue(KIO::UDSEntry::UDS_NAME) == QLatin1String("EXTERNAL_MEMORY")) {
entry.insert(KIO::UDSEntry::UDS_DISPLAY_NAME, i18n("External memory"));
entry.insert(KIO::UDSEntry::UDS_ICON_NAME, QStringLiteral("media-flash-sd-mmc"));
entry.fastInsert(KIO::UDSEntry::UDS_DISPLAY_NAME, i18n("External memory"));
entry.fastInsert(KIO::UDSEntry::UDS_ICON_NAME, QStringLiteral("media-flash-sd-mmc"));
}
}
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