Commit ee5bfea2 authored by Boudewijn Rempt's avatar Boudewijn Rempt

Make KIO optional

parent 91f66549
......@@ -203,10 +203,11 @@ find_package(KF5 5.7.0 REQUIRED COMPONENTS
ItemViews
WidgetsAddons
XmlGui
KIO
OPTIONAL_COMPONENTS
KIO
)
find_package(Qt5 5.3.0 REQUIRED COMPONENTS Core Gui Widgets Xml Network PrintSupport
Script Svg Test Concurrent)
find_package(Qt5 5.3.0 COMPONENTS UiTools Qml Quick X11Extras)
......@@ -220,7 +221,6 @@ if (USEOPENGL)
set(QT_QTOPENGL_FOUND ${Qt5OpenGL_FOUND})
endif ()
include (MacroLibrary)
include (MacroAdditionalCleanFiles)
include (MacroAddFileDependencies)
......@@ -228,6 +228,8 @@ include (ECMInstallIcons)
macro_ensure_out_of_source_build("Compiling Calligra inside the source directory is not possible. Please refer to the build instruction http://community.kde.org/Calligra/Building/Building_Calligra")
macro_bool_to_01(KF5KIO_FOUND HAVE_KIO)
find_package(X11)
if(X11_FOUND)
find_package(Qt5 ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE COMPONENTS
......
......@@ -51,6 +51,9 @@
/* Defines if we use lcms2.4 */
#cmakedefine HAVE_LCMS24 1
/* Defines if KIO is present */
#cmakedefine HAVE_KIO 1
/* This file contains all the paths that change when changing the installation prefix */
#define CALLIGRAPREFIX "${CMAKE_INSTALL_PREFIX}"
add_subdirectory( thumbnail )
if(KF5KIO_FOUND)
add_subdirectory( thumbnail )
endif()
add_subdirectory( kimgio )
......@@ -444,7 +444,12 @@ QT5_WRAP_CPP(kritaui_HEADERS_MOC KisDocumentSectionPropertyAction_p.h)
add_library(kritaui SHARED ${kritaui_HEADERS_MOC} ${kritaui_LIB_SRCS} )
generate_export_header(kritaui BASE_NAME kritaui)
target_link_libraries(kritaui KF5::CoreAddons KF5::Completion KF5::I18n KF5::ItemViews KF5::KIOCore KF5::KIOFileWidgets KF5::KIOWidgets)
target_link_libraries(kritaui KF5::CoreAddons KF5::Completion KF5::I18n KF5::ItemViews)
if (HAVE_KIO)
target_link_libraries(kritaui KF5::KIOCore)
endif()
if (NOT WIN32)
target_link_libraries(kritaui ${X11_X11_LIB} ${X11_Xinput_LIB})
endif()
......@@ -470,7 +475,7 @@ if(X11_FOUND)
target_link_libraries(kritaui Qt5::X11Extras ${X11_LIBRARIES})
endif()
target_link_libraries(kritaui LINK_INTERFACE_LIBRARIES kritaimage kritalibbrush kritapigment KF5::Completion KF5::I18n KF5::KIOCore KF5::KIOFileWidgets KF5::KIOWidgets ${GL_INTERFACE_LIBRARIES})
target_link_libraries(kritaui LINK_INTERFACE_LIBRARIES kritaimage kritalibbrush kritapigment KF5::Completion KF5::I18n ${GL_INTERFACE_LIBRARIES})
set_target_properties(kritaui
PROPERTIES VERSION ${GENERIC_CALLIGRA_LIB_VERSION} SOVERSION ${GENERIC_CALLIGRA_LIB_SOVERSION}
......
......@@ -47,7 +47,6 @@
#include <kiconloader.h>
#include <kconfig.h>
#include <kconfiggroup.h>
#include <krecentdirs.h>
#include <KoPluginLoader.h>
#include <KoShapeRegistry.h>
......
......@@ -22,6 +22,8 @@
#include "KisMainWindow.h"
#include <KoConfig.h>
// qt includes
#include <QApplication>
#include <QByteArray>
......@@ -51,30 +53,28 @@
#include <QMenu>
#include <QMenuBar>
#include <krecentdirs.h>
#include <kactioncollection.h>
#include <QAction>
#include <kactionmenu.h>
#include <kis_debug.h>
#include <kdiroperator.h>
#include <kedittoolbar.h>
#include <kfileitem.h>
#include <khelpmenu.h>
#include <klocalizedstring.h>
#ifdef HAVE_KIO
#include <krecentdocument.h>
#endif
#include <krecentfilesaction.h>
#include <KoResourcePaths.h>
#include <ktoggleaction.h>
#include <ktoolbar.h>
#include <kurlcombobox.h>
#include <kmainwindow.h>
#include <kxmlguiwindow.h>
#include <kxmlguifactory.h>
#include <kxmlguiclient.h>
#include <kguiitem.h>
#include <KoConfig.h>
#include "KoDockFactoryBase.h"
#include "KoDockWidgetTitleBar.h"
#include "KoDocumentInfoDlg.h"
......@@ -607,13 +607,17 @@ void KisMainWindow::addRecentURL(const QUrl &url)
for (QStringList::ConstIterator it = tmpDirs.begin() ; ok && it != tmpDirs.end() ; ++it)
if (path.contains(*it))
ok = false; // it's in the tmp resource
#ifdef HAVE_KIO
if (ok) {
KRecentDocument::add(path);
KRecentDirs::add(":OpenDialog", QFileInfo(path).dir().canonicalPath());
}
} else {
#endif
}
#ifdef HAVE_KIO
else {
KRecentDocument::add(url.url(QUrl::StripTrailingSlash), true);
}
#endif
if (ok) {
d->recentFiles->addUrl(url);
}
......
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