summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Čukić <ivan.cukic@kde.org>2015-04-03 20:29:38 (GMT)
committerIvan Čukić <ivan.cukic@kde.org>2015-05-04 22:19:28 (GMT)
commitc46b08c23f12f9819e93bd67b7147b1964cd7e8a (patch)
treebbba9242c06d57d9780437b83b2f15f7fa26abfa
parentdcf4d93abb79b3f8c38f32a4d1e32e672e2dff4c (diff)
Make KActivities a required dependency
Our goal is better integration with Plasma and other KDE components. We have made a conscious decision to reduce our code a bit by removing the legacy #ifdefs. That way we do not have to support a build configuration which is going to be used by just a tiny minority of our users, and one that we are not terribly interested in. Without KActivities, there is for example no support for recording and listing of recent documents, PDF sharing etc etc, and we honestly believe that the majority of our audience wants these features. REVIEW: 123249
-rw-r--r--autotests/CMakeLists.txt2
-rw-r--r--shell/CMakeLists.txt10
-rw-r--r--shell/shell.cpp16
-rw-r--r--shell/shell.h8
4 files changed, 9 insertions, 27 deletions
diff --git a/autotests/CMakeLists.txt b/autotests/CMakeLists.txt
index 0a0f546..274cbca 100644
--- a/autotests/CMakeLists.txt
+++ b/autotests/CMakeLists.txt
@@ -60,5 +60,5 @@ ecm_add_test(editformstest editformstest.cpp
ecm_add_test(mainshelltest mainshelltest.cpp ../shell/okular_main.cpp ../shell/shellutils.cpp ../shell/shell.cpp
TEST_NAME "mainshelltest"
- LINK_LIBRARIES Qt5::Test okularpart okularcore
+ LINK_LIBRARIES Qt5::Test KF5::Activities okularpart okularcore
)
diff --git a/shell/CMakeLists.txt b/shell/CMakeLists.txt
index ec36582..7a6af74 100644
--- a/shell/CMakeLists.txt
+++ b/shell/CMakeLists.txt
@@ -4,8 +4,6 @@ include_directories(
${CMAKE_CURRENT_BINARY_DIR}/../
)
-# checking whether we should enable activities support
-find_package(KF5Activities)
set_package_properties("KActivities" PROPERTIES
DESCRIPTION "Activities interface library"
URL "https://projects.kde.org/projects/kde/kdelibs/kactivities"
@@ -26,13 +24,7 @@ ecm_add_app_icon(okular_SRCS ICONS ${ICONS_SRCS})
add_executable(okular ${okular_SRCS})
-target_link_libraries(okular KF5::Parts KF5::WindowSystem KF5::KDELibs4Support)
-
-if(KActivities_FOUND)
- add_definitions(-DKActivities_FOUND)
- include_directories(${KACTIVITIES_INCLUDE_DIRS})
- target_link_libraries(okular KF5::KActivities)
-endif(KActivities_FOUND)
+target_link_libraries(okular KF5::Parts KF5::WindowSystem KF5::KDELibs4Support KF5::Activities)
install(TARGETS okular ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
diff --git a/shell/shell.cpp b/shell/shell.cpp
index 6bb89c5..6bf690d 100644
--- a/shell/shell.cpp
+++ b/shell/shell.cpp
@@ -45,9 +45,7 @@
#include <KUrlMimeData>
#include <KLocalizedString>
#include <KSharedConfig>
-#ifdef KActivities_FOUND
#include <KActivities/ResourceInstance>
-#endif
// local includes
#include "kdocumentviewer.h"
@@ -62,9 +60,7 @@ static const char* const SESSION_TAB_KEY = "ActiveTab";
Shell::Shell( const QString &serializedOptions )
: KParts::MainWindow(), m_menuBarWasShown(true), m_toolBarWasShown(true)
-#ifdef KActivities_FOUND
, m_activityResource(0)
-#endif
, m_isValid(true)
{
setObjectName( QLatin1String( "okular::Shell#" ) );
@@ -130,7 +126,7 @@ Shell::Shell( const QString &serializedOptions )
{
setAttribute(Qt::WA_ShowWithoutActivating);
}
-
+
QDBusConnection::sessionBus().registerObject("/okularshell", this, QDBusConnection::ExportScriptableSlots);
}
else
@@ -242,12 +238,10 @@ void Shell::openUrl( const QUrl & url, const QString &serializedOptions )
{
if ( openOk )
{
-#ifdef KActivities_FOUND
if ( !m_activityResource )
m_activityResource = new KActivities::ResourceInstance( window()->winId(), this );
m_activityResource->setUri( url );
-#endif
m_recent->addUrl( url );
}
else
@@ -270,7 +264,7 @@ void Shell::readSettings()
const KConfigGroup group = KSharedConfig::openConfig()->group( "Desktop Entry" );
bool fullScreen = group.readEntry( "FullScreen", false );
setFullScreen( fullScreen );
-
+
if (fullScreen)
{
m_menuBarWasShown = group.readEntry( shouldShowMenuBarComingFromFullScreen, true );
@@ -444,11 +438,11 @@ void Shell::slotUpdateFullScreen()
{
m_menuBarWasShown = !menuBar()->isHidden();
menuBar()->hide();
-
+
m_toolBarWasShown = !toolBar()->isHidden();
toolBar()->hide();
- KToggleFullScreenAction::setFullScreen(this, true);
+ KToggleFullScreenAction::setFullScreen(this, true);
}
else
{
@@ -460,7 +454,7 @@ void Shell::slotUpdateFullScreen()
{
toolBar()->show();
}
- KToggleFullScreenAction::setFullScreen(this, false);
+ KToggleFullScreenAction::setFullScreen(this, false);
}
}
diff --git a/shell/shell.h b/shell/shell.h
index f345cf3..43bd3e1 100644
--- a/shell/shell.h
+++ b/shell/shell.h
@@ -32,9 +32,7 @@ class KPluginFactory;
class KDocumentViewer;
class Part;
-#ifdef KActivities_FOUND
namespace KActivities { class ResourceInstance; }
-#endif
/**
* This is the application "Shell". It has a menubar and a toolbar
@@ -124,9 +122,9 @@ private slots:
void testTabDrop( const QDragMoveEvent* event, bool& accept );
void handleTabDrop( QDropEvent* event );
void moveTabData( int from, int to );
-
+
void slotFitWindowToPage( const QSize& pageViewSize, const QSize& pageSize );
-
+
signals:
void moveSplitter(int sideWidgetSize);
@@ -168,9 +166,7 @@ private:
QAction* m_nextTabAction;
QAction* m_prevTabAction;
-#ifdef KActivities_FOUND
KActivities::ResourceInstance* m_activityResource;
-#endif
bool m_isValid;
};