Commit 3859fba0 authored by Oliver Sander's avatar Oliver Sander Committed by Albert Vaca Cintora

Remove dependency on KActivities on Windows.

REVIEW: 130022
REVIEW: 126378
parent fa315eb5
......@@ -41,7 +41,6 @@ else()
endif()
find_package(KF5 ${KF5_REQUIRED_VERSION} REQUIRED COMPONENTS
Activities
Archive
Bookmarks
Completion
......@@ -58,6 +57,11 @@ find_package(KF5 ${KF5_REQUIRED_VERSION} REQUIRED COMPONENTS
Wallet
WindowSystem
)
if(NOT WIN32)
find_package(KF5 ${KF5_REQUIRED_VERSION} REQUIRED COMPONENTS
Activities
)
endif()
find_package(Phonon4Qt5 CONFIG REQUIRED)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake/modules)
......
......@@ -57,11 +57,13 @@ ecm_add_test(editformstest.cpp
LINK_LIBRARIES Qt5::Widgets Qt5::Test okularcore
)
ecm_add_test(mainshelltest.cpp ../shell/okular_main.cpp ../shell/shellutils.cpp ../shell/shell.cpp
TEST_NAME "mainshelltest"
LINK_LIBRARIES Qt5::Test KF5::Activities okularpart okularcore
)
target_compile_definitions(mainshelltest PRIVATE OKULAR_BINARY="$<TARGET_FILE:okular>")
if(NOT WIN32)
ecm_add_test(mainshelltest.cpp ../shell/okular_main.cpp ../shell/shellutils.cpp ../shell/shell.cpp
TEST_NAME "mainshelltest"
LINK_LIBRARIES Qt5::Test KF5::Activities okularpart okularcore
)
target_compile_definitions(mainshelltest PRIVATE OKULAR_BINARY="$<TARGET_FILE:okular>")
endif()
ecm_add_test(generatorstest.cpp
TEST_NAME "generatorstest"
......
......@@ -4,11 +4,14 @@ include_directories(
${CMAKE_CURRENT_BINARY_DIR}/../
)
if(NOT WIN32)
set_package_properties("KActivities" PROPERTIES
DESCRIPTION "Activities interface library"
URL "https://projects.kde.org/projects/kde/kdelibs/kactivities"
TYPE RECOMMENDED
PURPOSE "Required for Activities integration.")
endif()
# okular
......@@ -24,7 +27,11 @@ ecm_add_app_icon(okular_SRCS ICONS ${ICONS_SRCS})
add_executable(okular ${okular_SRCS})
target_link_libraries(okular KF5::Parts KF5::WindowSystem KF5::Activities)
target_link_libraries(okular KF5::Parts KF5::WindowSystem)
if(NOT WIN32)
target_link_libraries(okular KF5::Activities)
endif()
install(TARGETS okular ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
......
......@@ -46,7 +46,9 @@
#include <KLocalizedString>
#include <KSharedConfig>
#include <KIO/Global>
#ifndef Q_OS_WIN
#include <KActivities/ResourceInstance>
#endif
// local includes
#include "kdocumentviewer.h"
......@@ -61,7 +63,9 @@ static const char* const SESSION_TAB_KEY = "ActiveTab";
Shell::Shell( const QString &serializedOptions )
: KParts::MainWindow(), m_menuBarWasShown(true), m_toolBarWasShown(true)
#ifndef Q_OS_WIN
, m_activityResource(0)
#endif
, m_isValid(true)
{
setObjectName( QStringLiteral( "okular::Shell#" ) );
......@@ -276,10 +280,12 @@ void Shell::openUrl( const QUrl & url, const QString &serializedOptions )
{
if ( openOk )
{
#ifndef Q_OS_WIN
if ( !m_activityResource )
m_activityResource = new KActivities::ResourceInstance( window()->winId(), this );
m_activityResource->setUri( url );
#endif
m_recent->addUrl( url );
}
else
......
......@@ -32,7 +32,9 @@ class KPluginFactory;
class KDocumentViewer;
class Part;
#ifndef Q_OS_WIN
namespace KActivities { class ResourceInstance; }
#endif
/**
* This is the application "Shell". It has a menubar and a toolbar
......@@ -168,7 +170,9 @@ private:
QAction* m_nextTabAction;
QAction* m_prevTabAction;
#ifndef Q_OS_WIN
KActivities::ResourceInstance* m_activityResource;
#endif
bool m_isValid;
};
......
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