Commit 163ed3db authored by Andrius Štikonas's avatar Andrius Štikonas
Browse files

Port away from KIO::NetAccess and stop linking to KDELibs4Support.

parent 98015bff
......@@ -12,6 +12,7 @@ set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDECompilerSettings)
include(GenerateExportHeader)
include(FeatureSummary)
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
......@@ -26,7 +27,7 @@ ecm_setup_version(${ARK_VERSION}
SOVERSION ${ARK_VERSION_MAJOR})
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED Core Widgets)
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS Archive Config Pty KHtml KDELibs4Support DBusAddons)
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS Archive Config DBusAddons I18n IconThemes KHtml KIO Service Pty WidgetsAddons KDELibs4Support)
find_package(Qt5Test ${QT_MIN_VERSION} CONFIG QUIET)
set_package_properties(Qt5Test PROPERTIES
......
......@@ -14,7 +14,7 @@ ecm_add_app_icon(ark_SRCS ICONS ${ICONS_SRCS})
add_executable( ark ${ark_SRCS} )
target_link_libraries( ark kerfuffle KF5::DBusAddons )
target_link_libraries( ark kerfuffle KF5::DBusAddons KF5::Parts )
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/org.kde.ark.desktop.cmake
......@@ -48,7 +48,7 @@ set_package_properties(LibKonq PROPERTIES DESCRIPTION "Provides high-level file
if (KF5Konq_FOUND)
set(extracthere_SRCS batchextract.cpp extractHereDndPlugin.cpp)
add_library(extracthere MODULE ${extracthere_SRCS})
target_link_libraries(extracthere kerfuffle KF5::KDELibs4Support KF5::Parts KF5::Konq )
target_link_libraries(extracthere kerfuffle KF5::Parts KF5::Konq )
install( TARGETS extracthere DESTINATION ${PLUGIN_INSTALL_DIR} )
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/ark_dndextract.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
......
......@@ -27,7 +27,6 @@
#include <KPluginFactory>
#include <KMessageBox>
#include <KApplication>
#include <KLocalizedString>
#include <KActionCollection>
#include <KStandardAction>
......@@ -36,6 +35,7 @@
#include <KEditToolBar>
#include <KShortcutsDialog>
#include <KService>
#include <KSharedConfig>
#include <KConfigGroup>
#include <KXMLGUIFactory>
......
......@@ -22,13 +22,14 @@ add_library(kerfuffle SHARED ${kerfuffle_SRCS})
generate_export_header(kerfuffle BASE_NAME kerfuffle)
target_link_libraries(kerfuffle
KF5::IconThemes
KF5::Pty
KF5::Service
KF5::KIOCore
KF5::KIOWidgets
KF5::KIOFileWidgets
KF5::I18n
KF5::WidgetsAddons
KF5::KDELibs4Support
)
if (NOT WIN32)
target_link_libraries(kerfuffle ${KDE4_KPTY_LIBS})
......
......@@ -14,7 +14,7 @@ ki18n_wrap_ui(arkpart_PART_SRCS jobtracker.ui )
add_library(arkpart MODULE ${arkpart_PART_SRCS})
target_link_libraries(arkpart kerfuffle KF5::KHtml )
target_link_libraries(arkpart kerfuffle KF5::KHtml)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/ark_part.desktop.cmake
......
......@@ -28,7 +28,7 @@
#include <QDebug>
#include <KIconLoader>
#include <KLocalizedString>
#include <KIO/NetAccess>
#include <kio/global.h>
#include <QDir>
#include <QFont>
......
......@@ -26,7 +26,6 @@
#include <KIconLoader>
#include <KMessageBox>
#include <KRun>
#include <KIO/NetAccess>
#include <KHtml/KHTMLPart>
#include <KSharedConfig>
#include <KWindowConfig>
......
......@@ -28,7 +28,7 @@
#include <KLocalizedString>
#include <KIconLoader>
#include <KIO/NetAccess>
#include <kio/global.h>
using namespace Kerfuffle;
......
......@@ -33,13 +33,13 @@
#include "kerfuffle/jobs.h"
#include "kerfuffle/settings.h"
#include <K4AboutData>
#include <KActionCollection>
#include <KConfigGroup>
#include <QDebug>
#include <KGuiItem>
#include <KIO/Job>
#include <KIO/NetAccess>
#include <KJobWidgets>
#include <KIO/StatJob>
#include <KMessageBox>
#include <KPluginFactory>
#include <KRun>
......@@ -894,7 +894,9 @@ void Part::slotSaveAs()
QUrl saveUrl = QFileDialog::getSaveFileUrl(widget(), i18nc("@title:window", "Save Archive As"), url().adjusted(QUrl::RemoveFilename));
if ((saveUrl.isValid()) && (!saveUrl.isEmpty())) {
if (KIO::NetAccess::exists(saveUrl, KIO::NetAccess::DestinationSide, widget())) {
auto statJob = KIO::stat(saveUrl, KIO::StatJob::DestinationSide, 0);
KJobWidgets::setWindow(statJob, widget());
if (statJob->exec()) {
int overwrite = KMessageBox::warningContinueCancel(widget(),
xi18nc("@info", "An archive named <filename>%1</filename> already exists. Are you sure you want to overwrite it?", saveUrl.fileName()),
QString(),
......@@ -920,7 +922,9 @@ void Part::slotSaveAs()
KIO::Job *copyJob = KIO::file_copy(srcUrl, saveUrl, -1, KIO::Overwrite);
if (!KIO::NetAccess::synchronousRun(copyJob, widget())) {
KJobWidgets::setWindow(copyJob, widget());
copyJob->exec();
if (copyJob->error()) {
KMessageBox::error(widget(),
xi18nc("@info", "The archive could not be saved as <filename>%1</filename>. Try saving it to another location.", saveUrl.path()));
}
......
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