diff options
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | commands/CMakeLists.txt | 26 | ||||
-rw-r--r-- | commands/command.cpp (renamed from desktop-widgets/command.cpp) | 0 | ||||
-rw-r--r-- | commands/command.h (renamed from desktop-widgets/command.h) | 0 | ||||
-rw-r--r-- | commands/command_base.cpp (renamed from desktop-widgets/command_base.cpp) | 0 | ||||
-rw-r--r-- | commands/command_base.h (renamed from desktop-widgets/command_base.h) | 0 | ||||
-rw-r--r-- | commands/command_divelist.cpp (renamed from desktop-widgets/command_divelist.cpp) | 0 | ||||
-rw-r--r-- | commands/command_divelist.h (renamed from desktop-widgets/command_divelist.h) | 0 | ||||
-rw-r--r-- | commands/command_divesite.cpp (renamed from desktop-widgets/command_divesite.cpp) | 0 | ||||
-rw-r--r-- | commands/command_divesite.h (renamed from desktop-widgets/command_divesite.h) | 0 | ||||
-rw-r--r-- | commands/command_edit.cpp (renamed from desktop-widgets/command_edit.cpp) | 0 | ||||
-rw-r--r-- | commands/command_edit.h (renamed from desktop-widgets/command_edit.h) | 0 | ||||
-rw-r--r-- | commands/command_edit_trip.cpp (renamed from desktop-widgets/command_edit_trip.cpp) | 0 | ||||
-rw-r--r-- | commands/command_edit_trip.h (renamed from desktop-widgets/command_edit_trip.h) | 0 | ||||
-rw-r--r-- | commands/command_private.cpp (renamed from desktop-widgets/command_private.cpp) | 0 | ||||
-rw-r--r-- | commands/command_private.h (renamed from desktop-widgets/command_private.h) | 0 | ||||
-rw-r--r-- | desktop-widgets/CMakeLists.txt | 14 | ||||
-rw-r--r-- | desktop-widgets/divelistview.cpp | 2 | ||||
-rw-r--r-- | desktop-widgets/divelogimportdialog.cpp | 2 | ||||
-rw-r--r-- | desktop-widgets/divesiteimportdialog.cpp | 2 | ||||
-rw-r--r-- | desktop-widgets/downloadfromdivecomputer.cpp | 2 | ||||
-rw-r--r-- | desktop-widgets/locationinformation.cpp | 2 | ||||
-rw-r--r-- | desktop-widgets/mainwindow.cpp | 2 | ||||
-rw-r--r-- | desktop-widgets/mapwidget.cpp | 2 | ||||
-rw-r--r-- | desktop-widgets/simplewidgets.cpp | 2 | ||||
-rw-r--r-- | desktop-widgets/subsurfacewebservices.cpp | 2 | ||||
-rw-r--r-- | desktop-widgets/tab-widgets/TabDiveEquipment.cpp | 2 | ||||
-rw-r--r-- | desktop-widgets/tab-widgets/TabDiveInformation.cpp | 2 | ||||
-rw-r--r-- | desktop-widgets/tab-widgets/TabDiveSite.cpp | 2 | ||||
-rw-r--r-- | desktop-widgets/tab-widgets/maintab.cpp | 2 | ||||
-rw-r--r-- | profile-widget/profilewidget2.cpp | 2 | ||||
-rw-r--r-- | qt-models/divelocationmodel.cpp | 2 | ||||
-rw-r--r-- | qt-models/diveplannermodel.cpp | 2 | ||||
-rw-r--r-- | qt-models/divetripmodel.cpp | 2 |
34 files changed, 45 insertions, 31 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 2d6a33126..979ffc08d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -272,6 +272,7 @@ endif() add_subdirectory(translations) add_subdirectory(core) add_subdirectory(qt-models) +add_subdirectory(commands) add_subdirectory(profile-widget) if (SUBSURFACE_TARGET_EXECUTABLE MATCHES "DesktopExecutable") @@ -343,6 +344,7 @@ elseif (SUBSURFACE_TARGET_EXECUTABLE MATCHES "DesktopExecutable") subsurface_profile subsurface_statistics subsurface_models_desktop + subsurface_commands_desktop subsurface_corelib ${SUBSURFACE_LINK_LIBRARIES} ) diff --git a/commands/CMakeLists.txt b/commands/CMakeLists.txt new file mode 100644 index 000000000..76ad42603 --- /dev/null +++ b/commands/CMakeLists.txt @@ -0,0 +1,26 @@ +# the undo-commands that perform undoable actions. + +# models used both mobile and desktop builds +set(SUBSURFACE_GENERIC_COMMANDS_SRCS + command_base.cpp + command_base.h + command.cpp + command.h + command_divelist.cpp + command_divelist.h + command_divesite.cpp + command_divesite.h + command_edit.cpp + command_edit.h + command_edit_trip.cpp + command_edit_trip.h + command_private.cpp + command_private.h +) +if (SUBSURFACE_TARGET_EXECUTABLE MATCHES "DesktopExecutable") + add_library(subsurface_commands_desktop STATIC ${SUBSURFACE_GENERIC_COMMANDS_SRCS}) + target_link_libraries(subsurface_commands_desktop ${QT_LIBRARIES}) +#elseif (SUBSURFACE_TARGET_EXECUTABLE MATCHES "MobileExecutable") +# add_library(subsurface_commands_mobile STATIC ${SUBSURFACE_GENERIC_COMMANDS_SRCS}) +# target_link_libraries(subsurface_commands_mobile ${QT_LIBRARIES}) +endif() diff --git a/desktop-widgets/command.cpp b/commands/command.cpp index 4257324ec..4257324ec 100644 --- a/desktop-widgets/command.cpp +++ b/commands/command.cpp diff --git a/desktop-widgets/command.h b/commands/command.h index 8fbed5069..8fbed5069 100644 --- a/desktop-widgets/command.h +++ b/commands/command.h diff --git a/desktop-widgets/command_base.cpp b/commands/command_base.cpp index bef9da09c..bef9da09c 100644 --- a/desktop-widgets/command_base.cpp +++ b/commands/command_base.cpp diff --git a/desktop-widgets/command_base.h b/commands/command_base.h index 9a2f6cf34..9a2f6cf34 100644 --- a/desktop-widgets/command_base.h +++ b/commands/command_base.h diff --git a/desktop-widgets/command_divelist.cpp b/commands/command_divelist.cpp index 4b4ef4ab8..4b4ef4ab8 100644 --- a/desktop-widgets/command_divelist.cpp +++ b/commands/command_divelist.cpp diff --git a/desktop-widgets/command_divelist.h b/commands/command_divelist.h index 20d031f54..20d031f54 100644 --- a/desktop-widgets/command_divelist.h +++ b/commands/command_divelist.h diff --git a/desktop-widgets/command_divesite.cpp b/commands/command_divesite.cpp index b5fb46f91..b5fb46f91 100644 --- a/desktop-widgets/command_divesite.cpp +++ b/commands/command_divesite.cpp diff --git a/desktop-widgets/command_divesite.h b/commands/command_divesite.h index 3fcf085ae..3fcf085ae 100644 --- a/desktop-widgets/command_divesite.h +++ b/commands/command_divesite.h diff --git a/desktop-widgets/command_edit.cpp b/commands/command_edit.cpp index 638bfb792..638bfb792 100644 --- a/desktop-widgets/command_edit.cpp +++ b/commands/command_edit.cpp diff --git a/desktop-widgets/command_edit.h b/commands/command_edit.h index 8532523e2..8532523e2 100644 --- a/desktop-widgets/command_edit.h +++ b/commands/command_edit.h diff --git a/desktop-widgets/command_edit_trip.cpp b/commands/command_edit_trip.cpp index b25e3fcc5..b25e3fcc5 100644 --- a/desktop-widgets/command_edit_trip.cpp +++ b/commands/command_edit_trip.cpp diff --git a/desktop-widgets/command_edit_trip.h b/commands/command_edit_trip.h index ae41ca252..ae41ca252 100644 --- a/desktop-widgets/command_edit_trip.h +++ b/commands/command_edit_trip.h diff --git a/desktop-widgets/command_private.cpp b/commands/command_private.cpp index 714ffd9b6..714ffd9b6 100644 --- a/desktop-widgets/command_private.cpp +++ b/commands/command_private.cpp diff --git a/desktop-widgets/command_private.h b/commands/command_private.h index 280654a93..280654a93 100644 --- a/desktop-widgets/command_private.h +++ b/commands/command_private.h diff --git a/desktop-widgets/CMakeLists.txt b/desktop-widgets/CMakeLists.txt index 53aef5dbf..d798f8341 100644 --- a/desktop-widgets/CMakeLists.txt +++ b/desktop-widgets/CMakeLists.txt @@ -58,20 +58,6 @@ set(SUBSURFACE_INTERFACE ../map-widget/qmlmapwidgethelper.cpp about.cpp about.h - command.cpp - command.h - command_base.cpp - command_base.h - command_divelist.cpp - command_divelist.h - command_divesite.cpp - command_divesite.h - command_edit.cpp - command_edit.h - command_edit_trip.cpp - command_edit_trip.h - command_private.cpp - command_private.h configuredivecomputerdialog.cpp configuredivecomputerdialog.h divecomputermanagementdialog.cpp diff --git a/desktop-widgets/divelistview.cpp b/desktop-widgets/divelistview.cpp index c012b9832..aa2195434 100644 --- a/desktop-widgets/divelistview.cpp +++ b/desktop-widgets/divelistview.cpp @@ -19,10 +19,10 @@ #include <QStandardPaths> #include <QMessageBox> #include <QHeaderView> +#include "commands/command.h" #include "core/errorhelper.h" #include "core/qthelper.h" #include "core/trip.h" -#include "desktop-widgets/command.h" #include "desktop-widgets/divelistview.h" #include "qt-models/divepicturemodel.h" #include "core/metrics.h" diff --git a/desktop-widgets/divelogimportdialog.cpp b/desktop-widgets/divelogimportdialog.cpp index 0f08b1ec5..1d6557697 100644 --- a/desktop-widgets/divelogimportdialog.cpp +++ b/desktop-widgets/divelogimportdialog.cpp @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 #include "desktop-widgets/divelogimportdialog.h" #include "desktop-widgets/mainwindow.h" -#include "desktop-widgets/command.h" +#include "commands/command.h" #include "core/color.h" #include "ui_divelogimportdialog.h" #include <QShortcut> diff --git a/desktop-widgets/divesiteimportdialog.cpp b/desktop-widgets/divesiteimportdialog.cpp index ad45d97a5..defb90617 100644 --- a/desktop-widgets/divesiteimportdialog.cpp +++ b/desktop-widgets/divesiteimportdialog.cpp @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 #include "desktop-widgets/divesiteimportdialog.h" -#include "desktop-widgets/command.h" +#include "commands/command.h" #include "core/display.h" #include "core/qthelper.h" #include "core/metrics.h" diff --git a/desktop-widgets/downloadfromdivecomputer.cpp b/desktop-widgets/downloadfromdivecomputer.cpp index 484d15f83..a14a8a665 100644 --- a/desktop-widgets/downloadfromdivecomputer.cpp +++ b/desktop-widgets/downloadfromdivecomputer.cpp @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 #include "desktop-widgets/downloadfromdivecomputer.h" -#include "desktop-widgets/command.h" +#include "commands/command.h" #include "core/display.h" #include "core/qthelper.h" #include "core/divelist.h" diff --git a/desktop-widgets/locationinformation.cpp b/desktop-widgets/locationinformation.cpp index b9146a178..bbf43ec5a 100644 --- a/desktop-widgets/locationinformation.cpp +++ b/desktop-widgets/locationinformation.cpp @@ -9,9 +9,9 @@ #include "core/divesitehelpers.h" #include "desktop-widgets/modeldelegates.h" #include "core/subsurface-qt/DiveListNotifier.h" -#include "command.h" #include "core/taxonomy.h" #include "core/settings/qPrefUnit.h" +#include "commands/command.h" #include <QDebug> #include <QShowEvent> diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp index bed142ecc..47306bad9 100644 --- a/desktop-widgets/mainwindow.cpp +++ b/desktop-widgets/mainwindow.cpp @@ -41,7 +41,6 @@ #include "core/subsurface-qt/DiveListNotifier.h" #include "desktop-widgets/about.h" -#include "desktop-widgets/command.h" #include "desktop-widgets/divecomputermanagementdialog.h" #include "desktop-widgets/divelistview.h" #include "desktop-widgets/divelogexportdialog.h" @@ -57,6 +56,7 @@ #include "desktop-widgets/updatemanager.h" #include "desktop-widgets/usersurvey.h" #include "desktop-widgets/simplewidgets.h" +#include "commands/command.h" #include "profile-widget/profilewidget2.h" diff --git a/desktop-widgets/mapwidget.cpp b/desktop-widgets/mapwidget.cpp index f8f9b0b7b..07d440530 100644 --- a/desktop-widgets/mapwidget.cpp +++ b/desktop-widgets/mapwidget.cpp @@ -11,7 +11,7 @@ #include "qt-models/divelocationmodel.h" #include "mainwindow.h" #include "divelistview.h" -#include "command.h" +#include "commands/command.h" static const QUrl urlMapWidget = QUrl(QStringLiteral("qrc:/qml/MapWidget.qml")); static const QUrl urlMapWidgetError = QUrl(QStringLiteral("qrc:/qml/MapWidgetError.qml")); diff --git a/desktop-widgets/simplewidgets.cpp b/desktop-widgets/simplewidgets.cpp index 5edc66e80..1c1cb953c 100644 --- a/desktop-widgets/simplewidgets.cpp +++ b/desktop-widgets/simplewidgets.cpp @@ -20,7 +20,7 @@ #include "desktop-widgets/divelistview.h" #include "core/display.h" #include "profile-widget/profilewidget2.h" -#include "desktop-widgets/command.h" +#include "commands/command.h" #include "core/metadata.h" #include "core/tag.h" #include "core/divelist.h" // for mark_divelist_changed diff --git a/desktop-widgets/subsurfacewebservices.cpp b/desktop-widgets/subsurfacewebservices.cpp index 57f3c2876..f9e359226 100644 --- a/desktop-widgets/subsurfacewebservices.cpp +++ b/desktop-widgets/subsurfacewebservices.cpp @@ -4,8 +4,8 @@ #include "core/webservice.h" #include "core/settings/qPrefCloudStorage.h" #include "desktop-widgets/mainwindow.h" -#include "desktop-widgets/command.h" #include "desktop-widgets/usersurvey.h" +#include "commands/command.h" #include "core/trip.h" #include "core/errorhelper.h" #include "core/file.h" diff --git a/desktop-widgets/tab-widgets/TabDiveEquipment.cpp b/desktop-widgets/tab-widgets/TabDiveEquipment.cpp index 6f43fc5a2..f7e2d2667 100644 --- a/desktop-widgets/tab-widgets/TabDiveEquipment.cpp +++ b/desktop-widgets/tab-widgets/TabDiveEquipment.cpp @@ -4,7 +4,7 @@ #include "desktop-widgets/mainwindow.h" // TODO: Only used temporarilly for edit mode changes #include "desktop-widgets/simplewidgets.h" // For isGnome3Session() #include "desktop-widgets/modeldelegates.h" -#include "desktop-widgets/command.h" +#include "commands/command.h" #include "profile-widget/profilewidget2.h" #include "qt-models/cylindermodel.h" diff --git a/desktop-widgets/tab-widgets/TabDiveInformation.cpp b/desktop-widgets/tab-widgets/TabDiveInformation.cpp index d4c5ae1a6..071551584 100644 --- a/desktop-widgets/tab-widgets/TabDiveInformation.cpp +++ b/desktop-widgets/tab-widgets/TabDiveInformation.cpp @@ -4,9 +4,9 @@ #include "desktop-widgets/mainwindow.h" // TODO: Only used temporarilly for edit mode changes #include "profile-widget/profilewidget2.h" #include "../tagwidget.h" +#include "commands/command.h" #include "core/units.h" #include "core/dive.h" -#include "desktop-widgets/command.h" #include "core/qthelper.h" #include "core/statistics.h" #include "core/display.h" diff --git a/desktop-widgets/tab-widgets/TabDiveSite.cpp b/desktop-widgets/tab-widgets/TabDiveSite.cpp index e9eee0a88..d5591c152 100644 --- a/desktop-widgets/tab-widgets/TabDiveSite.cpp +++ b/desktop-widgets/tab-widgets/TabDiveSite.cpp @@ -4,7 +4,7 @@ #include "core/divesite.h" #include "qt-models/divelocationmodel.h" #include "qt-models/filtermodels.h" -#include "desktop-widgets/command.h" +#include "commands/command.h" #include <qt-models/divecomputerextradatamodel.h> diff --git a/desktop-widgets/tab-widgets/maintab.cpp b/desktop-widgets/tab-widgets/maintab.cpp index 417f9f91e..ec3957f47 100644 --- a/desktop-widgets/tab-widgets/maintab.cpp +++ b/desktop-widgets/tab-widgets/maintab.cpp @@ -24,8 +24,8 @@ #include "core/subsurface-string.h" #include "core/gettextfromc.h" #include "desktop-widgets/locationinformation.h" -#include "desktop-widgets/command.h" #include "desktop-widgets/simplewidgets.h" +#include "commands/command.h" #include "TabDiveEquipment.h" #include "TabDiveExtraInfo.h" diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp index ccbae7cc4..54225a0fc 100644 --- a/profile-widget/profilewidget2.cpp +++ b/profile-widget/profilewidget2.cpp @@ -24,8 +24,8 @@ #include "desktop-widgets/diveplanner.h" #include "desktop-widgets/simplewidgets.h" #include "desktop-widgets/divepicturewidget.h" -#include "desktop-widgets/command.h" #include "desktop-widgets/mainwindow.h" +#include "commands/command.h" #include "core/qthelper.h" #include "core/gettextfromc.h" #include "core/imagedownloader.h" diff --git a/qt-models/divelocationmodel.cpp b/qt-models/divelocationmodel.cpp index 224dc1bea..f68209a7e 100644 --- a/qt-models/divelocationmodel.cpp +++ b/qt-models/divelocationmodel.cpp @@ -8,7 +8,7 @@ #ifndef SUBSURFACE_MOBILE #include "cleanertablemodel.h" // for trashIcon() and editIcon() #include "desktop-widgets/mainwindow.h" // to place message box -#include "desktop-widgets/command.h" +#include "commands/command.h" #include <QMessageBox> #endif #include <QLineEdit> diff --git a/qt-models/diveplannermodel.cpp b/qt-models/diveplannermodel.cpp index dbac82681..eef8b99c3 100644 --- a/qt-models/diveplannermodel.cpp +++ b/qt-models/diveplannermodel.cpp @@ -7,7 +7,7 @@ #include "core/device.h" #include "core/qthelper.h" #include "core/settings/qPrefDivePlanner.h" -#include "desktop-widgets/command.h" +#include "commands/command.h" #include "core/gettextfromc.h" #include "core/deco.h" #include <QApplication> diff --git a/qt-models/divetripmodel.cpp b/qt-models/divetripmodel.cpp index 4e8478a33..bc64ef211 100644 --- a/qt-models/divetripmodel.cpp +++ b/qt-models/divetripmodel.cpp @@ -9,7 +9,7 @@ #include "core/subsurface-string.h" #include "core/tag.h" #include "qt-models/divelocationmodel.h" // For the dive-site field ids -#include "desktop-widgets/command.h" +#include "commands/command.h" #include <QIcon> #include <QDebug> #include <memory> |