Commit 19d5dd8e authored by David Hurka's avatar David Hurka 🐬

New part/ directory for okularpart sources from /, ui/, conf/

Source files are no longer separated by UI and non-UI and similar,
but only by their build target.

* ui/ -> part/
* Move all source files from conf/ to part/
* Keep config skeleton definitions in conf/, needed for the mobile target too
* Move editdrawingtooldialogtest.h from conf/autotests/ to autotests/
* ui/data/icons/ -> icons/
* Move /part.cpp, /part.rc and similar files to part/
* Adapt include paths in source files
* Adapt CMakeLists.txt files (in / and in subdirectories)
* Adapt /Messages.sh
parent 1327fdd8
......@@ -163,14 +163,14 @@ if(BUILD_COVERAGE)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lgcov")
endif()
add_subdirectory( ui )
add_subdirectory( icons ) # an own directory for multi-size icons retrieved by KIconThemeLoader
add_subdirectory( part )
if(BUILD_DESKTOP)
add_subdirectory( shell )
endif()
add_subdirectory( generators )
if(BUILD_TESTING)
add_subdirectory( autotests )
add_subdirectory( conf/autotests )
endif()
if(KF5DocTools_FOUND)
......@@ -230,7 +230,7 @@ qt5_add_resources(okularcore_SRCS
)
ki18n_wrap_ui(okularcore_SRCS
conf/textdocumentsettings.ui
part/textdocumentsettings.ui
)
install( FILES
......@@ -351,90 +351,86 @@ install(FILES core/okularGenerator.desktop DESTINATION ${KDE_INSTALL_KSERVICETYP
if(BUILD_DESKTOP)
# okularpart
set(okularpart_conf_SRCS
conf/preferencesdialog.cpp
conf/dlgaccessibility.cpp
conf/dlgdebug.cpp
conf/dlgeditor.cpp
conf/dlggeneral.cpp
conf/dlgannotations.cpp
conf/dlgperformance.cpp
conf/dlgpresentation.cpp
conf/editannottooldialog.cpp
conf/editdrawingtooldialog.cpp
conf/widgetannottools.cpp
conf/widgetconfigurationtoolsbase.cpp
conf/widgetdrawingtools.cpp
)
set(okularpart_SRCS
${okularpart_conf_SRCS}
part.cpp
xmlgui_helper.cpp
extensions.cpp
ui/embeddedfilesdialog.cpp
ui/annotationactionhandler.cpp
ui/annotwindow.cpp
ui/annotationmodel.cpp
ui/annotationpopup.cpp
ui/annotationpropertiesdialog.cpp
ui/annotationproxymodels.cpp
ui/annotationtools.cpp
ui/annotationwidgets.cpp
ui/bookmarklist.cpp
ui/certificateviewer.cpp
ui/debug_ui.cpp
ui/drawingtoolactions.cpp
ui/fileprinterpreview.cpp
ui/findbar.cpp
ui/formwidgets.cpp
ui/guiutils.cpp
ui/ktreeviewsearchline.cpp
ui/latexrenderer.cpp
ui/minibar.cpp
ui/okmenutitle.cpp
ui/pageitemdelegate.cpp
ui/pagepainter.cpp
ui/pagesizelabel.cpp
ui/pageviewannotator.cpp
ui/pageviewmouseannotation.cpp
ui/pageview.cpp
ui/magnifierview.cpp
ui/pageviewutils.cpp
ui/presentationsearchbar.cpp
ui/presentationwidget.cpp
ui/propertiesdialog.cpp
ui/revisionviewer.cpp
ui/searchlineedit.cpp
ui/searchwidget.cpp
ui/sidebar.cpp
ui/side_reviews.cpp
ui/snapshottaker.cpp
ui/thumbnaillist.cpp
ui/toc.cpp
ui/tocmodel.cpp
ui/toggleactionmenu.cpp
ui/videowidget.cpp
ui/layers.cpp
ui/signatureguiutils.cpp
ui/signaturepropertiesdialog.cpp
ui/signaturemodel.cpp
ui/signaturepanel.cpp
part/preferencesdialog.cpp
part/dlgaccessibility.cpp
part/dlgdebug.cpp
part/dlgeditor.cpp
part/dlggeneral.cpp
part/dlgannotations.cpp
part/dlgperformance.cpp
part/dlgpresentation.cpp
part/editannottooldialog.cpp
part/editdrawingtooldialog.cpp
part/widgetannottools.cpp
part/widgetconfigurationtoolsbase.cpp
part/widgetdrawingtools.cpp
part/part.cpp
part/xmlgui_helper.cpp
part/extensions.cpp
part/embeddedfilesdialog.cpp
part/annotationactionhandler.cpp
part/annotwindow.cpp
part/annotationmodel.cpp
part/annotationpopup.cpp
part/annotationpropertiesdialog.cpp
part/annotationproxymodels.cpp
part/annotationtools.cpp
part/annotationwidgets.cpp
part/bookmarklist.cpp
part/certificateviewer.cpp
part/debug_ui.cpp
part/drawingtoolactions.cpp
part/fileprinterpreview.cpp
part/findbar.cpp
part/formwidgets.cpp
part/guiutils.cpp
part/ktreeviewsearchline.cpp
part/latexrenderer.cpp
part/minibar.cpp
part/okmenutitle.cpp
part/pageitemdelegate.cpp
part/pagepainter.cpp
part/pagesizelabel.cpp
part/pageviewannotator.cpp
part/pageviewmouseannotation.cpp
part/pageview.cpp
part/magnifierview.cpp
part/pageviewutils.cpp
part/presentationsearchbar.cpp
part/presentationwidget.cpp
part/propertiesdialog.cpp
part/revisionviewer.cpp
part/searchlineedit.cpp
part/searchwidget.cpp
part/sidebar.cpp
part/side_reviews.cpp
part/snapshottaker.cpp
part/thumbnaillist.cpp
part/toc.cpp
part/tocmodel.cpp
part/toggleactionmenu.cpp
part/videowidget.cpp
part/layers.cpp
part/signatureguiutils.cpp
part/signaturepropertiesdialog.cpp
part/signaturemodel.cpp
part/signaturepanel.cpp
)
endif()
if (Qt5TextToSpeech_FOUND)
set(okularpart_SRCS ${okularpart_SRCS}
ui/tts.cpp)
part/tts.cpp)
endif()
ki18n_wrap_ui(okularpart_SRCS
conf/dlgaccessibilitybase.ui
conf/dlgeditorbase.ui
conf/dlggeneralbase.ui
conf/dlgannotationsbase.ui
conf/dlgperformancebase.ui
conf/dlgpresentationbase.ui
part/dlgaccessibilitybase.ui
part/dlgeditorbase.ui
part/dlggeneralbase.ui
part/dlgannotationsbase.ui
part/dlgperformancebase.ui
part/dlgpresentationbase.ui
)
kconfig_add_kcfg_files(okularpart_SRCS GENERATE_MOC conf/settings.kcfgc)
......@@ -480,7 +476,7 @@ install(TARGETS okularpart DESTINATION ${KDE_INSTALL_PLUGINDIR})
install(FILES okular.upd DESTINATION ${KDE_INSTALL_KCONFUPDATEDIR})
install( FILES okular_part.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR} )
install( FILES part.rc part-viewermode.rc DESTINATION ${KDE_INSTALL_KXMLGUI5DIR}/okular )
install( FILES part/part.rc part/part-viewermode.rc DESTINATION ${KDE_INSTALL_KXMLGUI5DIR}/okular )
if (${ECM_VERSION} STRGREATER "5.58.0")
install(FILES okular.categories DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR})
......
#!/bin/sh
$EXTRACTRC *.rc */*.rc >> rc.cpp || exit 11
$EXTRACTRC $(find conf/ -name "*.ui") $(find core/ -name "*.ui") $(find ui/ -name "*.ui") $(ls . | grep -E '\.ui') >> rc.cpp || exit 12
$EXTRACTATTR --attr=tool,name ui/data/drawingtools.xml >> rc.cpp || exit 13
$XGETTEXT $(find conf/ -name "*.cpp" -o -name "*.h") $(find core/ -name "*.cpp" -o -name "*.h") $(find ui/ -name "*.cpp" -o -name "*.h") $(find shell/ -name "*.cpp" -o -name "*.h") $(ls . | grep -E '\.cpp$') $(ls . | grep -E '\.h$') -o $podir/okular.pot
$EXTRACTRC $(find conf/ -name "*.ui") $(find core/ -name "*.ui") $(find part/ -name "*.ui") $(ls . | grep -E '\.ui') >> rc.cpp || exit 12
$EXTRACTATTR --attr=tool,name part/data/drawingtools.xml >> rc.cpp || exit 13
$XGETTEXT $(find conf/ -name "*.cpp" -o -name "*.h") $(find core/ -name "*.cpp" -o -name "*.h") $(find part/ -name "*.cpp" -o -name "*.h") $(find shell/ -name "*.cpp" -o -name "*.h") $(ls . | grep -E '\.cpp$') $(ls . | grep -E '\.h$') -o $podir/okular.pot
......@@ -2,6 +2,24 @@ add_definitions( -DKDESRCDIR="${CMAKE_CURRENT_SOURCE_DIR}/" )
include_directories(${CMAKE_CURRENT_BINARY_DIR}/..)
macro(add_conf_unittest _source)
set(_test ${_source} ../part/editdrawingtooldialog.cpp)
get_filename_component(_name ${_source} NAME_WE)
add_executable( ${_name} ${_test} )
add_test( NAME ${_name} COMMAND ${_name} )
ecm_mark_as_test(${_name})
target_link_libraries( ${_name}
Qt5::Test
Qt5::Widgets
Qt5::Xml
KF5::I18n
KF5::Completion
KF5::WidgetsAddons
)
endmacro ()
add_conf_unittest(editdrawingtooldialogtest.cpp)
ecm_add_test(shelltest.cpp ../shell/shellutils.cpp
TEST_NAME "shelltest"
LINK_LIBRARIES Qt5::Test okularcore
......
......@@ -20,12 +20,12 @@
#include <KSelectAction>
#include "../core/page.h"
#include "../part.h"
#include "../part/pageview.h"
#include "../part/part.h"
#include "../settings.h"
#include "../shell/okular_main.h"
#include "../shell/shell.h"
#include "../shell/shellutils.h"
#include "../ui/pageview.h"
#include "closedialoghelper.h"
namespace Okular
......
#ifndef CLOSEDIALOGHELPER_H
#define CLOSEDIALOGHELPER_H
#include <../part.h>
#include <QDialogButtonBox>
#include <QObject>
#include "../part/part.h"
namespace TestingUtils
{
/*
......
......@@ -8,7 +8,7 @@
***************************************************************************/
#include "editdrawingtooldialogtest.h"
#include "../editdrawingtooldialog.h"
#include "../part/editdrawingtooldialog.h"
#include <KColorButton>
#include <KLineEdit>
......
......@@ -21,13 +21,13 @@
#include <qwidget.h>
#include "../core/document_p.h"
#include "../part.h"
#include "../part/findbar.h"
#include "../part/part.h"
#include "../part/presentationwidget.h"
#include "../settings.h"
#include "../shell/okular_main.h"
#include "../shell/shell.h"
#include "../shell/shellutils.h"
#include "../ui/findbar.h"
#include "../ui/presentationwidget.h"
#include "closedialoghelper.h"
#include <sys/types.h>
......
......@@ -17,13 +17,13 @@
#include "../core/annotations.h"
#include "../core/form.h"
#include "../core/page.h"
#include "../part.h"
#include "../part/pageview.h"
#include "../part/part.h"
#include "../part/presentationwidget.h"
#include "../part/sidebar.h"
#include "../part/toc.h"
#include "../part/toggleactionmenu.h"
#include "../settings.h"
#include "../ui/pageview.h"
#include "../ui/presentationwidget.h"
#include "../ui/sidebar.h"
#include "../ui/toc.h"
#include "../ui/toggleactionmenu.h"
#include "closedialoghelper.h"
#include "../generators/poppler/config-okular-poppler.h"
......
......@@ -9,7 +9,7 @@
#include <QtTest>
#include "../ui/url_utils.h"
#include "../part/url_utils.h"
namespace Okular
{
......
macro(add_conf_unittest _source)
set(_test ${_source} ../editdrawingtooldialog.cpp)
get_filename_component(_name ${_source} NAME_WE)
add_executable( ${_name} ${_test} )
add_test( NAME ${_name} COMMAND ${_name} )
ecm_mark_as_test(${_name})
target_link_libraries( ${_name}
Qt5::Test
Qt5::Widgets
Qt5::Xml
KF5::I18n
KF5::Completion
KF5::WidgetsAddons
)
endmacro ()
add_conf_unittest(editdrawingtooldialogtest.cpp)
......@@ -14,7 +14,7 @@ target_link_libraries(okularGenerator_kimgio okularcore KF5::KExiv2 KF5::I18n)
if(BUILD_TESTING)
add_definitions( -DKDESRCDIR="${CMAKE_CURRENT_SOURCE_DIR}/" )
set( kimgiotest_SRCS tests/kimgiotest.cpp ${CMAKE_SOURCE_DIR}/ui/pagepainter.cpp ${CMAKE_SOURCE_DIR}/ui/guiutils.cpp ${CMAKE_SOURCE_DIR}/ui/debug_ui.cpp )
set( kimgiotest_SRCS tests/kimgiotest.cpp ${CMAKE_SOURCE_DIR}/part/pagepainter.cpp ${CMAKE_SOURCE_DIR}/part/guiutils.cpp ${CMAKE_SOURCE_DIR}/part/debug_ui.cpp )
ecm_add_test(${kimgiotest_SRCS} TEST_NAME "kimgiotest" LINK_LIBRARIES okularcore okularpart Qt5::Svg Qt5::Test)
target_compile_definitions(kimgiotest PRIVATE -DGENERATOR_PATH="$<TARGET_FILE:okularGenerator_kimgio>")
endif()
......
......@@ -12,7 +12,7 @@
#include <core/observer.h>
#include <core/page.h>
#include <ui/pagepainter.h>
#include <part/pagepainter.h>
#include <QtTest>
......
......@@ -11,6 +11,6 @@ public_source_dirs:
- core
- interfaces
- Mainpage.dox
logo: ui/data/icons/128-apps-okular.png
logo: icons/128-apps-okular.png
irc: okular
mailinglist: okular-devel
......@@ -10,10 +10,10 @@ include_directories(
set(okular_SRCS
okularplugin.cpp
${CMAKE_SOURCE_DIR}/ui/guiutils.cpp
${CMAKE_SOURCE_DIR}/ui/tocmodel.cpp
${CMAKE_SOURCE_DIR}/ui/pagepainter.cpp
${CMAKE_SOURCE_DIR}/ui/debug_ui.cpp
${CMAKE_SOURCE_DIR}/part/guiutils.cpp
${CMAKE_SOURCE_DIR}/part/tocmodel.cpp
${CMAKE_SOURCE_DIR}/part/pagepainter.cpp
${CMAKE_SOURCE_DIR}/part/debug_ui.cpp
pageitem.cpp
documentitem.cpp
thumbnailitem.cpp
......
......@@ -31,7 +31,7 @@
#include <core/document_p.h>
#include <core/page.h>
#include "ui/tocmodel.h"
#include "part/tocmodel.h"
DocumentItem::DocumentItem(QObject *parent)
: QObject(parent)
......
......@@ -30,9 +30,9 @@
#include <core/generator.h>
#include <core/page.h>
#include "part/pagepainter.h"
#include "part/priorities.h"
#include "settings.h"
#include "ui/pagepainter.h"
#include "ui/priorities.h"
#define REDRAW_TIMEOUT 250
......
......@@ -23,7 +23,7 @@
#include "core/document.h"
#include "core/observer.h"
#include "core/page.h"
#include "ui/guiutils.h"
#include "guiutils.h"
struct AnnItem {
AnnItem();
......
# an own directory for multi-size icons retrieved by KIconThemeLoader
add_subdirectory(icons)
# install annotator xml tools description
install(FILES
tools.xml
......