Skip to content

Commit

Permalink
New part/ directory for okularpart sources from /, ui/, conf/
Browse files Browse the repository at this point in the history
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
  • Loading branch information
David Hurka committed Nov 18, 2020
1 parent 1327fdd commit 19d5dd8
Show file tree
Hide file tree
Showing 247 changed files with 160 additions and 166 deletions.
154 changes: 75 additions & 79 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -230,7 +230,7 @@ qt5_add_resources(okularcore_SRCS
)

ki18n_wrap_ui(okularcore_SRCS
conf/textdocumentsettings.ui
part/textdocumentsettings.ui
)

install( FILES
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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})
Expand Down
6 changes: 3 additions & 3 deletions Messages.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/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
18 changes: 18 additions & 0 deletions autotests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions autotests/annotationtoolbartest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion autotests/closedialoghelper.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#ifndef CLOSEDIALOGHELPER_H
#define CLOSEDIALOGHELPER_H

#include <../part.h>
#include <QDialogButtonBox>
#include <QObject>

#include "../part/part.h"

namespace TestingUtils
{
/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
***************************************************************************/

#include "editdrawingtooldialogtest.h"
#include "../editdrawingtooldialog.h"
#include "../part/editdrawingtooldialog.h"

#include <KColorButton>
#include <KLineEdit>
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions autotests/mainshelltest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
12 changes: 6 additions & 6 deletions autotests/parttest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion autotests/urldetecttest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include <QtTest>

#include "../ui/url_utils.h"
#include "../part/url_utils.h"

namespace Okular
{
Expand Down
18 changes: 0 additions & 18 deletions conf/autotests/CMakeLists.txt

This file was deleted.

2 changes: 1 addition & 1 deletion generators/kimgio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion generators/kimgio/tests/kimgiotest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

#include <core/observer.h>
#include <core/page.h>
#include <ui/pagepainter.h>
#include <part/pagepainter.h>

#include <QtTest>

Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion metainfo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 4 additions & 4 deletions mobile/components/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion mobile/components/documentitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions mobile/components/pageitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 19d5dd8

Please sign in to comment.