Commit 31dd81bb authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Make it compile against last kf5 version without deprecated methods

parent 69838a1c
......@@ -205,7 +205,7 @@ void DolphinContextMenu::addDirectoryItemContextMenu(KFileItemActions &fileItemA
const DolphinView* view = m_mainWindow->activeViewContainer()->view();
newFileMenu->setViewShowsHiddenFiles(view->hiddenFilesShown());
newFileMenu->checkUpToDate();
newFileMenu->setPopupFiles(m_fileInfo.url());
newFileMenu->setPopupFiles(QList<QUrl>() << m_fileInfo.url());
newFileMenu->setEnabled(selectedItemsProps.supportsWriting());
connect(newFileMenu, &DolphinNewFileMenu::fileCreated, newFileMenu, &DolphinNewFileMenu::deleteLater);
connect(newFileMenu, &DolphinNewFileMenu::directoryCreated, newFileMenu, &DolphinNewFileMenu::deleteLater);
......@@ -352,7 +352,7 @@ void DolphinContextMenu::openViewportContextMenu()
KNewFileMenu* newFileMenu = m_mainWindow->newFileMenu();
newFileMenu->setViewShowsHiddenFiles(view->hiddenFilesShown());
newFileMenu->checkUpToDate();
newFileMenu->setPopupFiles(m_baseUrl);
newFileMenu->setPopupFiles(QList<QUrl>() << m_baseUrl);
addMenu(newFileMenu->menu());
QAction* pasteAction = createPasteAction();
......
......@@ -595,13 +595,13 @@ void DolphinMainWindow::updateNewMenu()
{
m_newFileMenu->setViewShowsHiddenFiles(activeViewContainer()->view()->hiddenFilesShown());
m_newFileMenu->checkUpToDate();
m_newFileMenu->setPopupFiles(activeViewContainer()->url());
m_newFileMenu->setPopupFiles(QList<QUrl>() << activeViewContainer()->url());
}
void DolphinMainWindow::createDirectory()
{
m_newFileMenu->setViewShowsHiddenFiles(activeViewContainer()->view()->hiddenFilesShown());
m_newFileMenu->setPopupFiles(activeViewContainer()->url());
m_newFileMenu->setPopupFiles(QList<QUrl>() << activeViewContainer()->url());
m_newFileMenu->createDirectory();
}
......
......@@ -572,7 +572,7 @@ void DolphinPart::updateNewMenu()
m_newFileMenu->checkUpToDate();
m_newFileMenu->setViewShowsHiddenFiles(m_view->hiddenFilesShown());
// And set the files that the menu apply on :
m_newFileMenu->setPopupFiles(url());
m_newFileMenu->setPopupFiles(QList<QUrl>() << url());
}
void DolphinPart::updateStatusBar()
......@@ -589,7 +589,7 @@ void DolphinPart::updateProgress(int percent)
void DolphinPart::createDirectory()
{
m_newFileMenu->setViewShowsHiddenFiles(m_view->hiddenFilesShown());
m_newFileMenu->setPopupFiles(url());
m_newFileMenu->setPopupFiles(QList<QUrl>() << url());
m_newFileMenu->createDirectory();
}
......
......@@ -267,7 +267,7 @@ QMimeData* KFileItemModel::createMimeData(const KItemSet& indexes) const
urls << item.url();
bool isLocal;
mostLocalUrls << item.mostLocalUrl(isLocal);
mostLocalUrls << item.mostLocalUrl(&isLocal);
}
}
......
......@@ -173,7 +173,7 @@ void TreeViewContextMenu::populateMimeData(QMimeData* mimeData, bool cut)
kdeUrls.append(m_fileItem.url());
QList<QUrl> mostLocalUrls;
bool dummy;
mostLocalUrls.append(m_fileItem.mostLocalUrl(dummy));
mostLocalUrls.append(m_fileItem.mostLocalUrl(&dummy));
KIO::setClipboardDataCut(mimeData, cut);
KUrlMimeData::setUrls(kdeUrls, mostLocalUrls, mimeData);
}
......
......@@ -26,6 +26,7 @@
#include <KLocalizedString>
#include <KPluginFactory>
#include <KPluginLoader>
#include <kconfigwidgets_version.h>
#include <QTabWidget>
#include <QVBoxLayout>
......@@ -48,18 +49,29 @@ DolphinGeneralConfigModule::DolphinGeneralConfigModule(QWidget* parent, const QV
// initialize 'Behavior' tab
BehaviorSettingsPage* behaviorPage = new BehaviorSettingsPage(QUrl::fromLocalFile(QDir::homePath()), tabWidget);
tabWidget->addTab(behaviorPage, i18nc("@title:tab Behavior settings", "Behavior"));
#if KCONFIGWIDGETS_VERSION < QT_VERSION_CHECK(5, 64, 0)
connect(behaviorPage, &BehaviorSettingsPage::changed, this, QOverload<>::of(&DolphinGeneralConfigModule::changed));
#else
connect(behaviorPage, &BehaviorSettingsPage::changed, this, &DolphinGeneralConfigModule::markAsChanged);
#endif
// initialize 'Previews' tab
PreviewsSettingsPage* previewsPage = new PreviewsSettingsPage(tabWidget);
tabWidget->addTab(previewsPage, i18nc("@title:tab Previews settings", "Previews"));
#if KCONFIGWIDGETS_VERSION < QT_VERSION_CHECK(5, 64, 0)
connect(previewsPage, &PreviewsSettingsPage::changed, this, QOverload<>::of(&DolphinGeneralConfigModule::changed));
#else
connect(previewsPage, &PreviewsSettingsPage::changed, this, &DolphinGeneralConfigModule::markAsChanged);
#endif
// initialize 'Confirmations' tab
ConfirmationsSettingsPage* confirmationsPage = new ConfirmationsSettingsPage(tabWidget);
tabWidget->addTab(confirmationsPage, i18nc("@title:tab Confirmations settings", "Confirmations"));
#if KCONFIGWIDGETS_VERSION < QT_VERSION_CHECK(5, 64, 0)
connect(confirmationsPage, &ConfirmationsSettingsPage::changed, this, QOverload<>::of(&DolphinGeneralConfigModule::changed));
#else
connect(confirmationsPage, &ConfirmationsSettingsPage::changed, this, &DolphinGeneralConfigModule::markAsChanged);
#endif
m_pages.append(behaviorPage);
m_pages.append(previewsPage);
m_pages.append(confirmationsPage);
......
......@@ -20,6 +20,7 @@
#include "kcmdolphinnavigation.h"
#include "settings/navigation/navigationsettingspage.h"
#include <kconfigwidgets_version.h>
#include <KPluginFactory>
#include <KPluginLoader>
......@@ -40,7 +41,11 @@ DolphinNavigationConfigModule::DolphinNavigationConfigModule(QWidget* parent, co
topLayout->setContentsMargins(0, 0, 0, 0);
m_navigation = new NavigationSettingsPage(this);
#if KCONFIGWIDGETS_VERSION < QT_VERSION_CHECK(5, 64, 0)
connect(m_navigation, &NavigationSettingsPage::changed, this, QOverload<>::of(&DolphinNavigationConfigModule::changed));
#else
connect(m_navigation, &NavigationSettingsPage::changed, this, &DolphinNavigationConfigModule::markAsChanged);
#endif
topLayout->addWidget(m_navigation, 0, nullptr);
}
......
......@@ -21,6 +21,7 @@
#include "settings/services/servicessettingspage.h"
#include <kconfigwidgets_version.h>
#include <KPluginFactory>
#include <KPluginLoader>
......@@ -40,7 +41,11 @@ DolphinServicesConfigModule::DolphinServicesConfigModule(QWidget* parent, const
topLayout->setContentsMargins(0, 0, 0, 0);
m_services = new ServicesSettingsPage(this);
#if KCONFIGWIDGETS_VERSION < QT_VERSION_CHECK(5, 64, 0)
connect(m_services, &ServicesSettingsPage::changed, this, QOverload<>::of(&DolphinServicesConfigModule::changed));
#else
connect(m_services, &ServicesSettingsPage::changed, this, &DolphinServicesConfigModule::markAsChanged);
#endif
topLayout->addWidget(m_services, 0, nullptr);
}
......
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