From 0ff2c923c330d16ee6bc2c7a44541d856c9a6108 Mon Sep 17 00:00:00 2001 From: Chris Campbell Date: Wed, 18 Feb 2015 12:05:42 +0000 Subject: [PATCH] Split partitionmanagerprivate into kpmcore and kpmgui. Please enter the commit message for your changes. Lines starting --- CMakeLists.txt | 1 - src/CMakeLists.txt | 82 +++++++++++++++---------- src/backend/CMakeLists.txt | 7 +++ src/backend/corebackend.h | 2 +- src/backend/corebackenddevice.h | 2 +- src/backend/corebackendmanager.h | 2 +- src/backend/corebackendpartition.h | 2 +- src/backend/corebackendpartitiontable.h | 2 +- src/config.kcfgc | 2 +- src/config/CMakeLists.txt | 6 ++ src/config/configureoptionsdialog.h | 3 +- src/core/CMakeLists.txt | 21 +++++++ src/core/device.h | 2 +- src/core/devicescanner.h | 3 +- src/core/mountentry.h | 3 +- src/core/operationrunner.h | 10 +-- src/core/operationstack.h | 3 +- src/core/partition.h | 2 +- src/core/partitionalignment.h | 2 +- src/core/partitionnode.h | 3 +- src/core/partitionrole.h | 2 +- src/core/partitiontable.h | 4 +- src/core/smartattribute.h | 3 +- src/core/smartstatus.h | 3 +- src/fs/CMakeLists.txt | 29 +++++++++ src/fs/btrfs.h | 2 +- src/fs/exfat.h | 2 +- src/fs/ext2.h | 2 +- src/fs/ext3.h | 2 +- src/fs/ext4.h | 2 +- src/fs/extended.h | 2 +- src/fs/fat16.h | 2 +- src/fs/fat32.h | 2 +- src/fs/filesystem.h | 3 +- src/fs/filesystemfactory.h | 2 +- src/fs/hfs.h | 2 +- src/fs/hfsplus.h | 2 +- src/fs/hpfs.h | 2 +- src/fs/jfs.h | 2 +- src/fs/linuxswap.h | 2 +- src/fs/luks.cpp | 29 --------- src/fs/luks.h | 5 +- src/fs/lvm2_pv.h | 2 +- src/fs/nilfs2.h | 2 +- src/fs/ntfs.h | 2 +- src/fs/ocfs2.h | 2 +- src/fs/reiser4.h | 2 +- src/fs/reiserfs.h | 2 +- src/fs/ufs.h | 2 +- src/fs/unformatted.h | 2 +- src/fs/unknown.h | 2 +- src/fs/xfs.h | 2 +- src/fs/zfs.h | 2 +- src/gui/CMakeLists.txt | 36 +++++++++++ src/gui/decryptluksdialog.cpp | 48 --------------- src/gui/decryptluksdialog.h | 53 ---------------- src/gui/decryptluksdialogwidget.cpp | 24 -------- src/gui/decryptluksdialogwidget.h | 42 ------------- src/gui/decryptluksdialogwidgetbase.ui | 71 --------------------- src/gui/listdevices.h | 2 +- src/gui/listoperations.h | 2 +- src/gui/mainwindow.h | 2 +- src/gui/partitionmanagerwidget.h | 2 +- src/gui/treelog.h | 2 +- src/jobs/CMakeLists.txt | 18 ++++++ src/jobs/job.h | 2 +- src/ops/CMakeLists.txt | 14 +++++ src/ops/backupoperation.h | 3 +- src/ops/checkoperation.h | 3 +- src/ops/copyoperation.h | 3 +- src/ops/createfilesystemoperation.h | 3 +- src/ops/createpartitiontableoperation.h | 3 +- src/ops/deleteoperation.h | 3 +- src/ops/newoperation.h | 3 +- src/ops/operation.h | 4 +- src/ops/resizeoperation.h | 3 +- src/ops/restoreoperation.h | 3 +- src/ops/setfilesystemlabeloperation.h | 3 +- src/ops/setpartflagsoperation.h | 3 +- src/plugins/dummy/CMakeLists.txt | 2 +- src/plugins/libparted/CMakeLists.txt | 2 +- src/util/CMakeLists.txt | 8 +++ src/util/capacity.h | 3 +- src/util/externalcommand.h | 2 +- src/util/globallog.h | 4 +- src/util/helpers.h | 18 +++--- src/util/htmlreport.h | 3 +- src/util/libpartitionmanagerexport.h | 7 ++- src/util/report.cpp | 2 - src/util/report.h | 2 +- 90 files changed, 302 insertions(+), 394 deletions(-) create mode 100644 src/backend/CMakeLists.txt create mode 100644 src/config/CMakeLists.txt create mode 100644 src/core/CMakeLists.txt create mode 100644 src/fs/CMakeLists.txt create mode 100644 src/gui/CMakeLists.txt delete mode 100644 src/gui/decryptluksdialog.cpp delete mode 100644 src/gui/decryptluksdialog.h delete mode 100644 src/gui/decryptluksdialogwidget.cpp delete mode 100644 src/gui/decryptluksdialogwidget.h delete mode 100644 src/gui/decryptluksdialogwidgetbase.ui create mode 100644 src/jobs/CMakeLists.txt create mode 100644 src/ops/CMakeLists.txt create mode 100644 src/util/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index e47c3e9..9661608 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,7 +53,6 @@ find_package(KF5 REQUIRED IconThemes JobWidgets KIO - WindowSystem XmlGui WidgetsAddons ) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e1b9144..ed4f99f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -15,50 +15,67 @@ ############################################ -file(GLOB partitionmanagerprivate_SRCS - backend/*.cpp - core/*.cpp - util/*.cpp - ops/*.cpp - jobs/*.cpp - fs/*.cpp - gui/*.cpp - config/*.cpp +include(config/CMakeLists.txt) +include(backend/CMakeLists.txt) +include(core/CMakeLists.txt) +include(util/CMakeLists.txt) +include(ops/CMakeLists.txt) +include(jobs/CMakeLists.txt) +include(fs/CMakeLists.txt) +include(gui/CMakeLists.txt) + +set(kpmcore_SRCS + ${BACKEND_SRC} + ${FS_SRC} + ${CORE_SRC} + ${UTIL_SRC} + ${OPS_SRC} + ${JOBS_SRC} ) -file(GLOB partitionmanagerprivate_UIFILES config/*.ui gui/*.ui) +set(kpmgui_SRCS + ${CONFIG_SRC} + ${GUI_SRC} +) -ki18n_wrap_ui(partitionmanagerprivate_SRCS ${partitionmanagerprivate_UIFILES}) +file(GLOB kpmcore_UIFILES config/*.ui) +file(GLOB kpmgui_UIFILES gui/*.ui) -kconfig_add_kcfg_files(partitionmanagerprivate_SRCS config.kcfgc) +ki18n_wrap_ui(kpmcore_SRCS ${kpmcore_UIFILES}) +ki18n_wrap_ui(kpmgui_SRCS ${kpmgui_UIFILES}) + +kconfig_add_kcfg_files(kpmcore_SRCS config.kcfgc) +kconfig_add_kcfg_files(kpmgui_SRCS config.kcfgc) install(FILES config.kcfg DESTINATION ${KCFG_INSTALL_DIR}) -add_library(partitionmanagerprivate SHARED ${partitionmanagerprivate_SRCS}) -generate_export_header(partitionmanagerprivate EXPORT_FILE_NAME libpartitionmanager_export.h) -target_link_libraries( partitionmanagerprivate libfatlabel - ${UUID_LIBRARIES} ${BLKID_LIBRARIES} ${LIBATASMART_LIBRARIES} - KF5::ConfigCore - KF5::ConfigGui - KF5::Crash - KF5::I18n - KF5::IconThemes - KF5::JobWidgets - KF5::KIOCore - KF5::KIOWidgets - KF5::XmlGui - KF5::WidgetsAddons - KF5::WindowSystem +add_library(kpmcore SHARED ${kpmcore_SRCS}) +generate_export_header(kpmcore EXPORT_FILE_NAME libpartitionmanager_export.h) +target_link_libraries( kpmcore libfatlabel + ${UUID_LIBRARIES} ${BLKID_LIBRARIES} ${LIBATASMART_LIBRARIES} + KF5::ConfigCore + KF5::ConfigGui + KF5::Crash + KF5::I18n + KF5::IconThemes + KF5::KIOCore + KF5::WidgetsAddons ) -install(TARGETS partitionmanagerprivate ${INSTALL_TARGETS_DEFAULT_ARGS}) +add_library(kpmgui SHARED ${kpmgui_SRCS}) +target_link_libraries( kpmgui + kpmcore + KF5::JobWidgets + KF5::KIOWidgets + KF5::XmlGui +) + +install(TARGETS kpmcore kpmgui ${INSTALL_TARGETS_DEFAULT_ARGS}) ############################################ -file(GLOB partitionmanager_SRCS main.cpp) +add_executable(partitionmanager main.cpp) -add_executable(partitionmanager ${partitionmanager_SRCS}) - -target_link_libraries(partitionmanager partitionmanagerprivate) +target_link_libraries(partitionmanager kpmcore kpmgui) install(TARGETS partitionmanager ${INSTALL_TARGETS_DEFAULT_ARGS}) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/org.kde.PartitionManager.appdata.xml DESTINATION share/appdata) @@ -68,4 +85,3 @@ install(PROGRAMS org.kde.PartitionManager.desktop DESTINATION ${XDG_APPS_INSTALL ############################################ add_subdirectory(plugins) - diff --git a/src/backend/CMakeLists.txt b/src/backend/CMakeLists.txt new file mode 100644 index 0000000..49ef1a7 --- /dev/null +++ b/src/backend/CMakeLists.txt @@ -0,0 +1,7 @@ +set(BACKEND_SRC + backend/corebackendmanager.cpp + backend/corebackenddevice.cpp + backend/corebackend.cpp + backend/corebackendpartition.cpp + backend/corebackendpartitiontable.cpp +) diff --git a/src/backend/corebackend.h b/src/backend/corebackend.h index a756f0d..f605fa1 100644 --- a/src/backend/corebackend.h +++ b/src/backend/corebackend.h @@ -36,7 +36,7 @@ class QString; * @author Volker Lanz */ -class LIBPARTITIONMANAGERPRIVATE_EXPORT CoreBackend : public QObject +class LIBKPMCORE_EXPORT CoreBackend : public QObject { Q_OBJECT Q_DISABLE_COPY(CoreBackend) diff --git a/src/backend/corebackenddevice.h b/src/backend/corebackenddevice.h index 48265e4..87f12e3 100644 --- a/src/backend/corebackenddevice.h +++ b/src/backend/corebackenddevice.h @@ -33,7 +33,7 @@ class Report; * Interface class representing a device in the backend plugin. * @author Volker Lanz */ -class LIBPARTITIONMANAGERPRIVATE_EXPORT CoreBackendDevice +class LIBKPMCORE_EXPORT CoreBackendDevice { public: CoreBackendDevice(const QString& device_node); diff --git a/src/backend/corebackendmanager.h b/src/backend/corebackendmanager.h index 3825a35..42858b9 100644 --- a/src/backend/corebackendmanager.h +++ b/src/backend/corebackendmanager.h @@ -34,7 +34,7 @@ class CoreBackend; * selected backend and also to manage the available backend plugins. * @author Volker Lanz */ -class LIBPARTITIONMANAGERPRIVATE_EXPORT CoreBackendManager +class LIBKPMCORE_EXPORT CoreBackendManager { private: CoreBackendManager(); diff --git a/src/backend/corebackendpartition.h b/src/backend/corebackendpartition.h index 7ecd882..e675069 100644 --- a/src/backend/corebackendpartition.h +++ b/src/backend/corebackendpartition.h @@ -29,7 +29,7 @@ class Report; * Represents a partition in the backend plugin. * @author Volker Lanz */ -class LIBPARTITIONMANAGERPRIVATE_EXPORT CoreBackendPartition +class LIBKPMCORE_EXPORT CoreBackendPartition { public: CoreBackendPartition(); diff --git a/src/backend/corebackendpartitiontable.h b/src/backend/corebackendpartitiontable.h index 467d2e8..9a33fca 100644 --- a/src/backend/corebackendpartitiontable.h +++ b/src/backend/corebackendpartitiontable.h @@ -35,7 +35,7 @@ class Partition; * Interface class to represent a partition table in the backend. * @author Volker Lanz */ -class LIBPARTITIONMANAGERPRIVATE_EXPORT CoreBackendPartitionTable +class LIBKPMCORE_EXPORT CoreBackendPartitionTable { public: virtual ~CoreBackendPartitionTable() {} diff --git a/src/config.kcfgc b/src/config.kcfgc index 373d71c..e1cbe50 100644 --- a/src/config.kcfgc +++ b/src/config.kcfgc @@ -2,7 +2,7 @@ File=config.kcfg ClassName=Config Singleton=true Mutators=true -Visibility=LIBPARTITIONMANAGERPRIVATE_EXPORT +Visibility=LIBKPMCORE_EXPORT IncludeFiles=\"util/libpartitionmanagerexport.h\" ItemAccessors=true SetUserTexts=true diff --git a/src/config/CMakeLists.txt b/src/config/CMakeLists.txt new file mode 100644 index 0000000..e0f57ca --- /dev/null +++ b/src/config/CMakeLists.txt @@ -0,0 +1,6 @@ +set(CONFIG_SRC + config/advancedpagewidget.cpp + config/configureoptionsdialog.cpp + config/filesystemcolorspagewidget.cpp + config/generalpagewidget.cpp +) diff --git a/src/config/configureoptionsdialog.h b/src/config/configureoptionsdialog.h index c967cde..293283a 100644 --- a/src/config/configureoptionsdialog.h +++ b/src/config/configureoptionsdialog.h @@ -18,6 +18,7 @@ #if !defined(CONFIGUREOPTIONSDIALOG__H) #define CONFIGUREOPTIONSDIALOG__H +#include "util/libpartitionmanagerexport.h" #include @@ -26,7 +27,7 @@ class FileSystemColorsPageWidget; class AdvancedPageWidget; class OperationStack; -class ConfigureOptionsDialog : public KConfigDialog +class LIBKPMCORE_EXPORT ConfigureOptionsDialog : public KConfigDialog { Q_OBJECT diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt new file mode 100644 index 0000000..488e6c9 --- /dev/null +++ b/src/core/CMakeLists.txt @@ -0,0 +1,21 @@ +set(CORE_SRC + core/copysourceshred.cpp + core/copysource.cpp + core/partition.cpp + core/mountentry.cpp + core/copytargetdevice.cpp + core/copytarget.cpp + core/copysourcedevice.cpp + core/operationrunner.cpp + core/partitiontable.cpp + core/copytargetfile.cpp + core/smartstatus.cpp + core/copysourcefile.cpp + core/smartattribute.cpp + core/devicescanner.cpp + core/partitionnode.cpp + core/partitionalignment.cpp + core/device.cpp + core/operationstack.cpp + core/partitionrole.cpp +) diff --git a/src/core/device.h b/src/core/device.h index bfa815c..1250a37 100644 --- a/src/core/device.h +++ b/src/core/device.h @@ -39,7 +39,7 @@ class SmartStatus; @see PartitionTable, Partition @author Volker Lanz */ -class LIBPARTITIONMANAGERPRIVATE_EXPORT Device : public QObject +class LIBKPMCORE_EXPORT Device : public QObject { Q_OBJECT Q_DISABLE_COPY(Device) diff --git a/src/core/devicescanner.h b/src/core/devicescanner.h index b4ef95f..dcc67a7 100644 --- a/src/core/devicescanner.h +++ b/src/core/devicescanner.h @@ -17,6 +17,7 @@ #ifndef DEVICESCANNER_H #define DEVICESCANNER_H +#include "util/libpartitionmanagerexport.h" #include @@ -28,7 +29,7 @@ class OperationStack; @author Volker Lanz */ -class DeviceScanner : public QThread +class LIBKPMCORE_EXPORT DeviceScanner : public QThread { Q_OBJECT diff --git a/src/core/mountentry.h b/src/core/mountentry.h index c4dbbb3..483beed 100644 --- a/src/core/mountentry.h +++ b/src/core/mountentry.h @@ -18,6 +18,7 @@ #if !defined(MOUNTENTRY__H) #define MOUNTENTRY__H +#include "util/libpartitionmanagerexport.h" #include #include @@ -25,7 +26,7 @@ struct mntent; -class MountEntry +class LIBKPMCORE_EXPORT MountEntry { public: enum IdentifyType { deviceNode, uuid, label }; diff --git a/src/core/operationrunner.h b/src/core/operationrunner.h index 869c029..ae7acd6 100644 --- a/src/core/operationrunner.h +++ b/src/core/operationrunner.h @@ -19,6 +19,8 @@ #define OPERATIONRUNNER__H +#include "util/libpartitionmanagerexport.h" + #include #include #include @@ -33,7 +35,7 @@ class Report; @author Volker Lanz */ -class OperationRunner : public QThread +class LIBKPMCORE_EXPORT OperationRunner : public QThread { Q_OBJECT Q_DISABLE_COPY(OperationRunner) @@ -43,9 +45,9 @@ class OperationRunner : public QThread public: void run(); - qint32 numJobs() const; - qint32 numOperations() const; - qint32 numProgressSub() const; + LIBKPMCORE_EXPORT qint32 numJobs() const; + LIBKPMCORE_EXPORT qint32 numOperations() const; + LIBKPMCORE_EXPORT qint32 numProgressSub() const; bool isCancelling() const { return m_Cancelling; } /**< @return if the user has requested cancelling */ void cancel() const { m_Cancelling = true; } /**< Sets cancelling to true. */ QMutex& suspendMutex() const { return m_SuspendMutex; } /**< @return the QMutex used for syncing */ diff --git a/src/core/operationstack.h b/src/core/operationstack.h index 97ea057..db8f107 100644 --- a/src/core/operationstack.h +++ b/src/core/operationstack.h @@ -18,6 +18,7 @@ #if !defined(OPERATIONSTACK__H) #define OPERATIONSTACK__H +#include "util/libpartitionmanagerexport.h" #include #include @@ -37,7 +38,7 @@ class DeviceScanner; @author Volker Lanz */ -class OperationStack : public QObject +class LIBKPMCORE_EXPORT OperationStack : public QObject { Q_OBJECT Q_DISABLE_COPY(OperationStack) diff --git a/src/core/partition.h b/src/core/partition.h index c095fba..0d8f556 100644 --- a/src/core/partition.h +++ b/src/core/partition.h @@ -70,7 +70,7 @@ class QTextStream; @see PartitionTable, Device, FileSystem @author Volker Lanz */ -class LIBPARTITIONMANAGERPRIVATE_EXPORT Partition : public PartitionNode +class LIBKPMCORE_EXPORT Partition : public PartitionNode { friend class PartitionTable; friend class OperationStack; diff --git a/src/core/partitionalignment.h b/src/core/partitionalignment.h index c4f70d7..ba3f17c 100644 --- a/src/core/partitionalignment.h +++ b/src/core/partitionalignment.h @@ -26,7 +26,7 @@ class Device; class Partition; -class LIBPARTITIONMANAGERPRIVATE_EXPORT PartitionAlignment +class LIBKPMCORE_EXPORT PartitionAlignment { private: PartitionAlignment(); diff --git a/src/core/partitionnode.h b/src/core/partitionnode.h index 3c8a39f..a9bf8b4 100644 --- a/src/core/partitionnode.h +++ b/src/core/partitionnode.h @@ -18,6 +18,7 @@ #if !defined(PARTITIONNODE__H) #define PARTITIONNODE__H +#include "util/libpartitionmanagerexport.h" #include #include @@ -34,7 +35,7 @@ class PartitionRole; @see Device, PartitionTable, Partition @author Volker Lanz */ -class PartitionNode : public QObject +class LIBKPMCORE_EXPORT PartitionNode : public QObject { Q_OBJECT diff --git a/src/core/partitionrole.h b/src/core/partitionrole.h index 0fdc57d..fe411aa 100644 --- a/src/core/partitionrole.h +++ b/src/core/partitionrole.h @@ -31,7 +31,7 @@ class QString; @author Volker Lanz */ -class LIBPARTITIONMANAGERPRIVATE_EXPORT PartitionRole +class LIBKPMCORE_EXPORT PartitionRole { public: /** A Partition's role: What kind of Partition is it? */ diff --git a/src/core/partitiontable.h b/src/core/partitiontable.h index 61ab516..c630d5e 100644 --- a/src/core/partitiontable.h +++ b/src/core/partitiontable.h @@ -41,12 +41,12 @@ class QTextStream; @author Volker Lanz */ -class LIBPARTITIONMANAGERPRIVATE_EXPORT PartitionTable : public PartitionNode +class LIBKPMCORE_EXPORT PartitionTable : public PartitionNode { Q_DISABLE_COPY(PartitionTable) friend class CoreBackend; - friend QTextStream& operator<<(QTextStream& stream, const PartitionTable& ptable); + friend LIBKPMCORE_EXPORT QTextStream& operator<<(QTextStream& stream, const PartitionTable& ptable); public: enum TableType diff --git a/src/core/smartattribute.h b/src/core/smartattribute.h index 7efe369..09e9eba 100644 --- a/src/core/smartattribute.h +++ b/src/core/smartattribute.h @@ -18,12 +18,13 @@ #if !defined(SMARTATTRIBUTE__H) #define SMARTATTRIBUTE__H +#include "util/libpartitionmanagerexport.h" #include struct SkSmartAttributeParsedData; -class SmartAttribute +class LIBKPMCORE_EXPORT SmartAttribute { public: enum FailureType diff --git a/src/core/smartstatus.h b/src/core/smartstatus.h index 53c05d2..b665f1d 100644 --- a/src/core/smartstatus.h +++ b/src/core/smartstatus.h @@ -18,6 +18,7 @@ #if !defined(SMARTSTATUS__H) #define SMARTSTATUS__H +#include "util/libpartitionmanagerexport.h" #include #include @@ -28,7 +29,7 @@ class SmartAttribute; struct SkSmartAttributeParsedData; struct SkDisk; -class SmartStatus +class LIBKPMCORE_EXPORT SmartStatus { public: enum Overall diff --git a/src/fs/CMakeLists.txt b/src/fs/CMakeLists.txt new file mode 100644 index 0000000..33e0483 --- /dev/null +++ b/src/fs/CMakeLists.txt @@ -0,0 +1,29 @@ +set(FS_SRC + fs/fat32.cpp + fs/filesystem.cpp + fs/hfs.cpp + fs/nilfs2.cpp + fs/unknown.cpp + fs/linuxswap.cpp + fs/hfsplus.cpp + fs/ext3.cpp + fs/hpfs.cpp + fs/unformatted.cpp + fs/luks.cpp + fs/btrfs.cpp + fs/ufs.cpp + fs/reiserfs.cpp + fs/exfat.cpp + fs/filesystemfactory.cpp + fs/lvm2_pv.cpp + fs/reiser4.cpp + fs/ext2.cpp + fs/jfs.cpp + fs/ntfs.cpp + fs/fat16.cpp + fs/ext4.cpp + fs/xfs.cpp + fs/extended.cpp + fs/zfs.cpp + fs/ocfs2.cpp +) diff --git a/src/fs/btrfs.h b/src/fs/btrfs.h index bf30173..d0b64da 100644 --- a/src/fs/btrfs.h +++ b/src/fs/btrfs.h @@ -34,7 +34,7 @@ namespace FS /** A btrfs file system. @author Volker Lanz */ - class LIBPARTITIONMANAGERPRIVATE_EXPORT btrfs : public FileSystem + class LIBKPMCORE_EXPORT btrfs : public FileSystem { public: btrfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label); diff --git a/src/fs/exfat.h b/src/fs/exfat.h index c917d96..5190fc0 100644 --- a/src/fs/exfat.h +++ b/src/fs/exfat.h @@ -34,7 +34,7 @@ namespace FS /** An exfat file system. @author Volker Lanz */ - class LIBPARTITIONMANAGERPRIVATE_EXPORT exfat : public FileSystem + class LIBKPMCORE_EXPORT exfat : public FileSystem { public: exfat(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label); diff --git a/src/fs/ext2.h b/src/fs/ext2.h index c2f7017..90c7e6d 100644 --- a/src/fs/ext2.h +++ b/src/fs/ext2.h @@ -34,7 +34,7 @@ namespace FS /** An ext2 file system. @author Volker Lanz */ - class LIBPARTITIONMANAGERPRIVATE_EXPORT ext2 : public FileSystem + class LIBKPMCORE_EXPORT ext2 : public FileSystem { public: ext2(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, FileSystem::Type t = FileSystem::Ext2); diff --git a/src/fs/ext3.h b/src/fs/ext3.h index b90bd6d..f28989b 100644 --- a/src/fs/ext3.h +++ b/src/fs/ext3.h @@ -37,7 +37,7 @@ namespace FS @author Volker Lanz */ - class LIBPARTITIONMANAGERPRIVATE_EXPORT ext3 : public ext2 + class LIBKPMCORE_EXPORT ext3 : public ext2 { public: ext3(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label); diff --git a/src/fs/ext4.h b/src/fs/ext4.h index 2fa3d77..1ee2874 100644 --- a/src/fs/ext4.h +++ b/src/fs/ext4.h @@ -37,7 +37,7 @@ namespace FS @author Volker Lanz */ - class LIBPARTITIONMANAGERPRIVATE_EXPORT ext4 : public ext2 + class LIBKPMCORE_EXPORT ext4 : public ext2 { public: ext4(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label); diff --git a/src/fs/extended.h b/src/fs/extended.h index a824278..48369fb 100644 --- a/src/fs/extended.h +++ b/src/fs/extended.h @@ -37,7 +37,7 @@ namespace FS @author Volker Lanz */ - class LIBPARTITIONMANAGERPRIVATE_EXPORT extended : public FileSystem + class LIBKPMCORE_EXPORT extended : public FileSystem { public: extended(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label); diff --git a/src/fs/fat16.h b/src/fs/fat16.h index 86de597..7bb9d13 100644 --- a/src/fs/fat16.h +++ b/src/fs/fat16.h @@ -34,7 +34,7 @@ namespace FS /** A fat16 file system. @author Volker Lanz */ - class LIBPARTITIONMANAGERPRIVATE_EXPORT fat16 : public FileSystem + class LIBKPMCORE_EXPORT fat16 : public FileSystem { public: fat16(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, FileSystem::Type t = FileSystem::Fat16); diff --git a/src/fs/fat32.h b/src/fs/fat32.h index b611bc5..0eb1baa 100644 --- a/src/fs/fat32.h +++ b/src/fs/fat32.h @@ -37,7 +37,7 @@ namespace FS @author Volker Lanz */ - class LIBPARTITIONMANAGERPRIVATE_EXPORT fat32 : public fat16 + class LIBKPMCORE_EXPORT fat32 : public fat16 { public: fat32(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label); diff --git a/src/fs/filesystem.h b/src/fs/filesystem.h index e0e29b1..9b3b562 100644 --- a/src/fs/filesystem.h +++ b/src/fs/filesystem.h @@ -18,6 +18,7 @@ #if !defined(FILESYSTEM__H) #define FILESYSTEM__H +#include "util/libpartitionmanagerexport.h" #include #include @@ -35,7 +36,7 @@ class Report; @author Volker Lanz */ -class FileSystem +class LIBKPMCORE_EXPORT FileSystem { Q_DISABLE_COPY(FileSystem) diff --git a/src/fs/filesystemfactory.h b/src/fs/filesystemfactory.h index f5f04ba..46385b9 100644 --- a/src/fs/filesystemfactory.h +++ b/src/fs/filesystemfactory.h @@ -31,7 +31,7 @@ class QString; /** Factory to create instances of FileSystem. @author Volker Lanz */ -class LIBPARTITIONMANAGERPRIVATE_EXPORT FileSystemFactory +class LIBKPMCORE_EXPORT FileSystemFactory { public: /** map of FileSystem::Types to pointers of FileSystem */ diff --git a/src/fs/hfs.h b/src/fs/hfs.h index f78b965..affc0b3 100644 --- a/src/fs/hfs.h +++ b/src/fs/hfs.h @@ -34,7 +34,7 @@ namespace FS /** An hfs file system. @author Volker Lanz */ - class LIBPARTITIONMANAGERPRIVATE_EXPORT hfs : public FileSystem + class LIBKPMCORE_EXPORT hfs : public FileSystem { public: hfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label); diff --git a/src/fs/hfsplus.h b/src/fs/hfsplus.h index b1c5cfc..5706ca9 100644 --- a/src/fs/hfsplus.h +++ b/src/fs/hfsplus.h @@ -34,7 +34,7 @@ namespace FS /** An hfsplus file system. @author Volker Lanz */ - class LIBPARTITIONMANAGERPRIVATE_EXPORT hfsplus : public FileSystem + class LIBKPMCORE_EXPORT hfsplus : public FileSystem { public: hfsplus(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label); diff --git a/src/fs/hpfs.h b/src/fs/hpfs.h index 2b488d6..192b254 100644 --- a/src/fs/hpfs.h +++ b/src/fs/hpfs.h @@ -34,7 +34,7 @@ namespace FS /** A hpfs file system. @author Volker Lanz */ - class LIBPARTITIONMANAGERPRIVATE_EXPORT hpfs : public FileSystem + class LIBKPMCORE_EXPORT hpfs : public FileSystem { public: hpfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label); diff --git a/src/fs/jfs.h b/src/fs/jfs.h index 6b61bf3..8ccb63e 100644 --- a/src/fs/jfs.h +++ b/src/fs/jfs.h @@ -34,7 +34,7 @@ namespace FS /** A JFS file system. @author Volker Lanz */ - class LIBPARTITIONMANAGERPRIVATE_EXPORT jfs : public FileSystem + class LIBKPMCORE_EXPORT jfs : public FileSystem { public: jfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label); diff --git a/src/fs/linuxswap.h b/src/fs/linuxswap.h index c3e3d13..1ad8ce5 100644 --- a/src/fs/linuxswap.h +++ b/src/fs/linuxswap.h @@ -34,7 +34,7 @@ namespace FS /** A linux swap pseudo file system. @author Volker Lanz */ - class LIBPARTITIONMANAGERPRIVATE_EXPORT linuxswap : public FileSystem + class LIBKPMCORE_EXPORT linuxswap : public FileSystem { public: linuxswap(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label); diff --git a/src/fs/luks.cpp b/src/fs/luks.cpp index 22e5b3b..393227d 100644 --- a/src/fs/luks.cpp +++ b/src/fs/luks.cpp @@ -18,12 +18,9 @@ #include "fs/luks.h" -#include "gui/decryptluksdialog.h" - #include "util/capacity.h" #include "util/externalcommand.h" -#include #include #include #include @@ -86,37 +83,11 @@ namespace FS return 3 * Capacity::unitFactor(Capacity::Byte, Capacity::MiB); } - QString luks::mountTitle() const - { - return i18nc("@title:menu", "Decrypt"); - } - QString luks::unmountTitle() const { return i18nc("@title:menu", "Deactivate"); } - bool luks::mount(const QString& deviceNode) - { - QPointer dlg = new DecryptLuksDialog(0, deviceNode); //TODO: parent widget instead of 0 - - if (dlg->exec() == QDialog::Accepted) - { - std::vector commands; - commands.push_back(QStringLiteral("echo")); - commands.push_back(QStringLiteral("cryptsetup")); - std::vector args; - args.push_back(QStringList() << dlg->luksPassphrase().text()); - args.push_back(QStringList() << QStringLiteral("luksOpen") << deviceNode << dlg->luksName().text()); - ExternalCommand cmd(commands, args); - delete dlg; - return cmd.run(-1) && cmd.exitCode() == 0; - } - - delete dlg; - return false; - } - bool luks::unmount(const QString& deviceNode) { ExternalCommand cmd(QStringLiteral("cryptsetup"), QStringList() << QStringLiteral("luksClose") << mapperName(deviceNode)); diff --git a/src/fs/luks.h b/src/fs/luks.h index 01e0bc7..2769b94 100644 --- a/src/fs/luks.h +++ b/src/fs/luks.h @@ -34,7 +34,7 @@ namespace FS /** A LUKS crypto file system. @author Volker Lanz */ - class LIBPARTITIONMANAGERPRIVATE_EXPORT luks : public FileSystem + class LIBKPMCORE_EXPORT luks : public FileSystem { public: luks(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label); @@ -61,12 +61,9 @@ namespace FS virtual QString readUUID(const QString& deviceNode) const; virtual bool updateUUID(Report& report, const QString& deviceNode) const; - virtual bool canMount(const QString&) const { return true; }; virtual bool canUnmount(const QString&) const { return true; }; - virtual bool mount(const QString& deviceNode); virtual bool unmount(const QString& deviceNode); - virtual QString mountTitle() const; virtual QString unmountTitle() const; static QString mapperName (const QString& deviceNode); diff --git a/src/fs/lvm2_pv.h b/src/fs/lvm2_pv.h index 8b18926..f77a09e 100644 --- a/src/fs/lvm2_pv.h +++ b/src/fs/lvm2_pv.h @@ -34,7 +34,7 @@ namespace FS /** LVM2 physical volume. @author Andrius Štikonas */ - class LIBPARTITIONMANAGERPRIVATE_EXPORT lvm2_pv : public FileSystem + class LIBKPMCORE_EXPORT lvm2_pv : public FileSystem { public: lvm2_pv(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label); diff --git a/src/fs/nilfs2.h b/src/fs/nilfs2.h index adbe2c3..1c330d0 100644 --- a/src/fs/nilfs2.h +++ b/src/fs/nilfs2.h @@ -34,7 +34,7 @@ namespace FS /** A nilfs2 file system. @author Volker Lanz */ - class LIBPARTITIONMANAGERPRIVATE_EXPORT nilfs2 : public FileSystem + class LIBKPMCORE_EXPORT nilfs2 : public FileSystem { public: nilfs2(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label); diff --git a/src/fs/ntfs.h b/src/fs/ntfs.h index 4dfd811..9c775ff 100644 --- a/src/fs/ntfs.h +++ b/src/fs/ntfs.h @@ -34,7 +34,7 @@ namespace FS /** An NTFS file system. @author Volker Lanz */ - class LIBPARTITIONMANAGERPRIVATE_EXPORT ntfs : public FileSystem + class LIBKPMCORE_EXPORT ntfs : public FileSystem { public: ntfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label); diff --git a/src/fs/ocfs2.h b/src/fs/ocfs2.h index ed991b8..23c5c3a 100644 --- a/src/fs/ocfs2.h +++ b/src/fs/ocfs2.h @@ -34,7 +34,7 @@ namespace FS /** A ocfs2 file system. @author Volker Lanz */ - class LIBPARTITIONMANAGERPRIVATE_EXPORT ocfs2 : public FileSystem + class LIBKPMCORE_EXPORT ocfs2 : public FileSystem { public: ocfs2(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label); diff --git a/src/fs/reiser4.h b/src/fs/reiser4.h index 4f06bd7..dc15ce3 100644 --- a/src/fs/reiser4.h +++ b/src/fs/reiser4.h @@ -34,7 +34,7 @@ namespace FS /** A Reiser4 file system. @author Volker Lanz */ - class LIBPARTITIONMANAGERPRIVATE_EXPORT reiser4 : public FileSystem + class LIBKPMCORE_EXPORT reiser4 : public FileSystem { public: reiser4(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label); diff --git a/src/fs/reiserfs.h b/src/fs/reiserfs.h index 481c863..be30559 100644 --- a/src/fs/reiserfs.h +++ b/src/fs/reiserfs.h @@ -36,7 +36,7 @@ namespace FS /** A ReiserFS file system. @author Volker Lanz */ - class LIBPARTITIONMANAGERPRIVATE_EXPORT reiserfs : public FileSystem + class LIBKPMCORE_EXPORT reiserfs : public FileSystem { public: reiserfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label); diff --git a/src/fs/ufs.h b/src/fs/ufs.h index e2f17b6..412f790 100644 --- a/src/fs/ufs.h +++ b/src/fs/ufs.h @@ -32,7 +32,7 @@ namespace FS /** A UFS file system. @author Volker Lanz */ - class LIBPARTITIONMANAGERPRIVATE_EXPORT ufs : public FileSystem + class LIBKPMCORE_EXPORT ufs : public FileSystem { public: ufs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label); diff --git a/src/fs/unformatted.h b/src/fs/unformatted.h index bf21c9d..374dea4 100644 --- a/src/fs/unformatted.h +++ b/src/fs/unformatted.h @@ -34,7 +34,7 @@ namespace FS /** A pseudo file system for unformatted partitions. @author Volker Lanz */ - class LIBPARTITIONMANAGERPRIVATE_EXPORT unformatted : public FileSystem + class LIBKPMCORE_EXPORT unformatted : public FileSystem { public: unformatted(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label); diff --git a/src/fs/unknown.h b/src/fs/unknown.h index 857ff91..ecf1f5f 100644 --- a/src/fs/unknown.h +++ b/src/fs/unknown.h @@ -30,7 +30,7 @@ namespace FS /** A pseudo file system for partitions whose file system we cannot determine. @author Volker Lanz */ - class LIBPARTITIONMANAGERPRIVATE_EXPORT unknown : public FileSystem + class LIBKPMCORE_EXPORT unknown : public FileSystem { public: unknown(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label); diff --git a/src/fs/xfs.h b/src/fs/xfs.h index cc88ed4..92edc26 100644 --- a/src/fs/xfs.h +++ b/src/fs/xfs.h @@ -34,7 +34,7 @@ namespace FS /** An XFS file system. @author Volker Lanz */ - class LIBPARTITIONMANAGERPRIVATE_EXPORT xfs : public FileSystem + class LIBKPMCORE_EXPORT xfs : public FileSystem { public: xfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label); diff --git a/src/fs/zfs.h b/src/fs/zfs.h index 94b9297..d0310c9 100644 --- a/src/fs/zfs.h +++ b/src/fs/zfs.h @@ -34,7 +34,7 @@ namespace FS /** A zfs file system. @author Volker Lanz */ - class LIBPARTITIONMANAGERPRIVATE_EXPORT zfs : public FileSystem + class LIBKPMCORE_EXPORT zfs : public FileSystem { public: zfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label); diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt new file mode 100644 index 0000000..9d61731 --- /dev/null +++ b/src/gui/CMakeLists.txt @@ -0,0 +1,36 @@ +set(GUI_SRC + gui/applyprogressdetailswidget.cpp + gui/applyprogressdialog.cpp + gui/applyprogressdialogwidget.cpp + gui/createpartitiontabledialog.cpp + gui/createpartitiontablewidget.cpp + gui/devicepropsdialog.cpp + gui/devicepropswidget.cpp + gui/editmountpointdialog.cpp + gui/editmountpointdialogwidget.cpp + gui/editmountoptionsdialog.cpp + gui/editmountoptionsdialogwidget.cpp + gui/filesystemsupportdialog.cpp + gui/filesystemsupportdialogwidget.cpp + gui/formattedspinbox.cpp + gui/infopane.cpp + gui/insertdialog.cpp + gui/listdevices.cpp + gui/listoperations.cpp + gui/mainwindow.cpp + gui/newdialog.cpp + gui/partitionmanagerwidget.cpp + gui/partpropsdialog.cpp + gui/partresizerwidget.cpp + gui/partwidget.cpp + gui/partwidgetbase.cpp + gui/parttablewidget.cpp + gui/resizedialog.cpp + gui/scanprogressdialog.cpp + gui/sizedetailswidget.cpp + gui/sizedialogbase.cpp + gui/sizedialogwidget.cpp + gui/smartdialog.cpp + gui/smartdialogwidget.cpp + gui/treelog.cpp +) diff --git a/src/gui/decryptluksdialog.cpp b/src/gui/decryptluksdialog.cpp deleted file mode 100644 index 9f9c80e..0000000 --- a/src/gui/decryptluksdialog.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/************************************************************************* - * Copyright (C) 2013 by Andrius Štikonas * - * * - * This program is free software; you can redistribute it and/or * - * modify it under the terms of the GNU General Public License as * - * published by the Free Software Foundation; either version 3 of * - * the License, or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see .* - *************************************************************************/ - -#include "gui/decryptluksdialog.h" -#include "gui/decryptluksdialogwidget.h" - -#include "core/device.h" -#include "core/partitiontable.h" - -#include - -#include -#include - -#include - -DecryptLuksDialog::DecryptLuksDialog(QWidget* parent, const QString& deviceNode) : - QDialog(parent), - m_DialogWidget(new DecryptLuksDialogWidget(this)), - m_DeviceNode(deviceNode) -{ - QVBoxLayout *mainLayout = new QVBoxLayout(this); - setLayout(mainLayout); - mainLayout->addWidget(&widget()); - setWindowTitle(xi18nc("@title:window", "Decrypt LUKS partition on %1", this->deviceNode())); - - QDialogButtonBox* dialogButtonBox = new QDialogButtonBox; - QPushButton* decryptButton = new QPushButton; - decryptButton->setText(i18nc("@action:button", "&Decrypt")); - decryptButton->setIcon(QIcon::fromTheme(QStringLiteral("object-unlocked"))); - dialogButtonBox->addButton(decryptButton, QDialogButtonBox::AcceptRole); - mainLayout->addWidget(dialogButtonBox); - connect(dialogButtonBox, SIGNAL(accepted()), this, SLOT(accept())); -} diff --git a/src/gui/decryptluksdialog.h b/src/gui/decryptluksdialog.h deleted file mode 100644 index cab0da1..0000000 --- a/src/gui/decryptluksdialog.h +++ /dev/null @@ -1,53 +0,0 @@ -/************************************************************************* - * Copyright (C) 2013 by Andrius Štikonas * - * * - * This program is free software; you can redistribute it and/or * - * modify it under the terms of the GNU General Public License as * - * published by the Free Software Foundation; either version 3 of * - * the License, or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see .* - *************************************************************************/ - -#if !defined(DECRYPTLUKSDIALOG__H) - -#define DECRYPTLUKSDIALOG__H - -#include "gui/decryptluksdialogwidget.h" - -#include - -class Device; - -class DecryptLuksDialog : public QDialog -{ - Q_OBJECT - - public: - DecryptLuksDialog(QWidget* parent, const QString& deviceNode); - - protected: - DecryptLuksDialogWidget& widget() { return *m_DialogWidget; } - const DecryptLuksDialogWidget& widget() const { return *m_DialogWidget; } - const QString& deviceNode() const { return m_DeviceNode; } - - private: - DecryptLuksDialogWidget* m_DialogWidget; - const QString& m_DeviceNode; - - public: - QLineEdit& luksName() { return widget().luksName(); } - const QLineEdit& luksName() const { return widget().luksName(); } - - QLineEdit& luksPassphrase() { return widget().luksPassphrase(); } - const QLineEdit& luksPassphrase() const { return widget().luksPassphrase(); } -}; - - -#endif diff --git a/src/gui/decryptluksdialogwidget.cpp b/src/gui/decryptluksdialogwidget.cpp deleted file mode 100644 index df7fd65..0000000 --- a/src/gui/decryptluksdialogwidget.cpp +++ /dev/null @@ -1,24 +0,0 @@ -/************************************************************************* - * Copyright (C) 2013 by Andrius Štikonas * - * * - * This program is free software; you can redistribute it and/or * - * modify it under the terms of the GNU General Public License as * - * published by the Free Software Foundation; either version 3 of * - * the License, or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see .* - *************************************************************************/ - -#include "gui/decryptluksdialogwidget.h" - -DecryptLuksDialogWidget::DecryptLuksDialogWidget(QWidget* parent) : - QWidget(parent) -{ - setupUi(this); -} diff --git a/src/gui/decryptluksdialogwidget.h b/src/gui/decryptluksdialogwidget.h deleted file mode 100644 index 0f95895..0000000 --- a/src/gui/decryptluksdialogwidget.h +++ /dev/null @@ -1,42 +0,0 @@ -/************************************************************************* - * Copyright (C) 2013 by Andrius Štikonas * - * * - * This program is free software; you can redistribute it and/or * - * modify it under the terms of the GNU General Public License as * - * published by the Free Software Foundation; either version 3 of * - * the License, or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see .* - *************************************************************************/ - -#if !defined(DECRYPTLUKSDIALOGWIDGET__H) - -#define DECRYPTLUKSDIALOGWIDGET__H - -#include "ui_decryptluksdialogwidgetbase.h" - -#include -#include - -class DecryptLuksDialogWidget : public QWidget, public Ui::DecryptLuksDialogWidgetBase -{ - Q_OBJECT - - public: - DecryptLuksDialogWidget(QWidget* parent); - - public: - QLineEdit& luksName() { return *m_LineEditName; } - const QLineEdit& luksName() const { return *m_LineEditName; } - - QLineEdit& luksPassphrase() { return *m_LineEditPassphrase; } - const QLineEdit& luksPassphrase() const { return *m_LineEditPassphrase; } -}; - -#endif diff --git a/src/gui/decryptluksdialogwidgetbase.ui b/src/gui/decryptluksdialogwidgetbase.ui deleted file mode 100644 index a26346d..0000000 --- a/src/gui/decryptluksdialogwidgetbase.ui +++ /dev/null @@ -1,71 +0,0 @@ - - - DecryptLuksDialogWidgetBase - - - - 0 - 0 - 377 - 122 - - - - - 10 - - - - - - - &Name: - - - m_LineEditName - - - - - - - - - - &Passphrase: - - - m_LineEditPassphrase - - - - - - - QLineEdit::Password - - - - - - - - - Qt::Vertical - - - QSizePolicy::MinimumExpanding - - - - 20 - 20 - - - - - - - - - diff --git a/src/gui/listdevices.h b/src/gui/listdevices.h index d94f76f..f754b96 100644 --- a/src/gui/listdevices.h +++ b/src/gui/listdevices.h @@ -34,7 +34,7 @@ class KActionCollection; /** A list of devices. @author Volker Lanz */ -class LIBPARTITIONMANAGERPRIVATE_EXPORT ListDevices : public QWidget, public Ui::ListDevicesBase +class LIBKPMCORE_EXPORT ListDevices : public QWidget, public Ui::ListDevicesBase { Q_OBJECT Q_DISABLE_COPY(ListDevices) diff --git a/src/gui/listoperations.h b/src/gui/listoperations.h index df727a9..c4fa1e7 100644 --- a/src/gui/listoperations.h +++ b/src/gui/listoperations.h @@ -35,7 +35,7 @@ class KActionCollection; @author Volker Lanz */ -class LIBPARTITIONMANAGERPRIVATE_EXPORT ListOperations : public QWidget, public Ui::ListOperationsBase +class LIBKPMCORE_EXPORT ListOperations : public QWidget, public Ui::ListOperationsBase { Q_OBJECT Q_DISABLE_COPY(ListOperations) diff --git a/src/gui/mainwindow.h b/src/gui/mainwindow.h index 673c976..cf5b6f4 100644 --- a/src/gui/mainwindow.h +++ b/src/gui/mainwindow.h @@ -46,7 +46,7 @@ class QEvent; @author Volker Lanz */ -class LIBPARTITIONMANAGERPRIVATE_EXPORT MainWindow : public KXmlGuiWindow, public Ui::MainWindowBase +class LIBKPMCORE_EXPORT MainWindow : public KXmlGuiWindow, public Ui::MainWindowBase { Q_OBJECT Q_DISABLE_COPY(MainWindow) diff --git a/src/gui/partitionmanagerwidget.h b/src/gui/partitionmanagerwidget.h index 6113ac2..71a890b 100644 --- a/src/gui/partitionmanagerwidget.h +++ b/src/gui/partitionmanagerwidget.h @@ -40,7 +40,7 @@ class QPoint; @author Volker Lanz */ -class LIBPARTITIONMANAGERPRIVATE_EXPORT PartitionManagerWidget : public QWidget, Ui::PartitionManagerWidgetBase +class LIBKPMCORE_EXPORT PartitionManagerWidget : public QWidget, Ui::PartitionManagerWidgetBase { Q_OBJECT Q_DISABLE_COPY(PartitionManagerWidget) diff --git a/src/gui/treelog.h b/src/gui/treelog.h index a9d3b25..c777c58 100644 --- a/src/gui/treelog.h +++ b/src/gui/treelog.h @@ -32,7 +32,7 @@ class QTreeWidget; /** A tree for formatted log output. @author Volker Lanz */ -class LIBPARTITIONMANAGERPRIVATE_EXPORT TreeLog: public QWidget, public Ui::TreeLogBase +class LIBKPMCORE_EXPORT TreeLog: public QWidget, public Ui::TreeLogBase { Q_OBJECT Q_DISABLE_COPY(TreeLog) diff --git a/src/jobs/CMakeLists.txt b/src/jobs/CMakeLists.txt new file mode 100644 index 0000000..3adddc6 --- /dev/null +++ b/src/jobs/CMakeLists.txt @@ -0,0 +1,18 @@ +set(JOBS_SRC + jobs/resizefilesystemjob.cpp + jobs/createfilesystemjob.cpp + jobs/job.cpp + jobs/checkfilesystemjob.cpp + jobs/shredfilesystemjob.cpp + jobs/createpartitionjob.cpp + jobs/createpartitiontablejob.cpp + jobs/setfilesystemlabeljob.cpp + jobs/deletepartitionjob.cpp + jobs/restorefilesystemjob.cpp + jobs/setpartgeometryjob.cpp + jobs/deletefilesystemjob.cpp + jobs/backupfilesystemjob.cpp + jobs/setpartflagsjob.cpp + jobs/copyfilesystemjob.cpp + jobs/movefilesystemjob.cpp +) diff --git a/src/jobs/job.h b/src/jobs/job.h index 363fa37..e45f8bc 100644 --- a/src/jobs/job.h +++ b/src/jobs/job.h @@ -42,7 +42,7 @@ class Report; @author Volker Lanz */ -class LIBPARTITIONMANAGERPRIVATE_EXPORT Job : public QObject +class LIBKPMCORE_EXPORT Job : public QObject { Q_OBJECT Q_DISABLE_COPY(Job) diff --git a/src/ops/CMakeLists.txt b/src/ops/CMakeLists.txt new file mode 100644 index 0000000..972ed94 --- /dev/null +++ b/src/ops/CMakeLists.txt @@ -0,0 +1,14 @@ +set(OPS_SRC + ops/operation.cpp + ops/deleteoperation.cpp + ops/restoreoperation.cpp + ops/resizeoperation.cpp + ops/newoperation.cpp + ops/createfilesystemoperation.cpp + ops/createpartitiontableoperation.cpp + ops/setfilesystemlabeloperation.cpp + ops/setpartflagsoperation.cpp + ops/checkoperation.cpp + ops/backupoperation.cpp + ops/copyoperation.cpp +) diff --git a/src/ops/backupoperation.h b/src/ops/backupoperation.h index e619b9e..b153285 100644 --- a/src/ops/backupoperation.h +++ b/src/ops/backupoperation.h @@ -18,6 +18,7 @@ #if !defined(BACKUPOPERATION__H) #define BACKUPOPERATION__H +#include "util/libpartitionmanagerexport.h" #include "ops/operation.h" @@ -30,7 +31,7 @@ class BackupFileSystemJob; /** Back up a FileSystem. @author Volker Lanz */ -class BackupOperation : public Operation +class LIBKPMCORE_EXPORT BackupOperation : public Operation { Q_OBJECT Q_DISABLE_COPY(BackupOperation) diff --git a/src/ops/checkoperation.h b/src/ops/checkoperation.h index 2fb5be1..f3c66c4 100644 --- a/src/ops/checkoperation.h +++ b/src/ops/checkoperation.h @@ -18,6 +18,7 @@ #if !defined(CHECKOPERATION__H) #define CHECKOPERATION__H +#include "util/libpartitionmanagerexport.h" #include "ops/operation.h" @@ -31,7 +32,7 @@ class ResizeFileSystemJob; /** Check a Partition. @author Volker Lanz */ -class CheckOperation : public Operation +class LIBKPMCORE_EXPORT CheckOperation : public Operation { friend class OperationStack; diff --git a/src/ops/copyoperation.h b/src/ops/copyoperation.h index 215e2a5..0b5a4d0 100644 --- a/src/ops/copyoperation.h +++ b/src/ops/copyoperation.h @@ -18,6 +18,7 @@ #if !defined(COPYOPERATION__H) #define COPYOPERATION__H +#include "util/libpartitionmanagerexport.h" #include "ops/operation.h" @@ -40,7 +41,7 @@ class ResizeFileSystemJob; @author Volker Lanz */ -class CopyOperation : public Operation +class LIBKPMCORE_EXPORT CopyOperation : public Operation { friend class OperationStack; diff --git a/src/ops/createfilesystemoperation.h b/src/ops/createfilesystemoperation.h index 588aaab..bd885ba 100644 --- a/src/ops/createfilesystemoperation.h +++ b/src/ops/createfilesystemoperation.h @@ -18,6 +18,7 @@ #if !defined(CREATEFILESYSTEMOPERATION__H) #define CREATEFILESYSTEMOPERATION__H +#include "util/libpartitionmanagerexport.h" #include "ops/operation.h" @@ -38,7 +39,7 @@ class CheckFileSystemJob; @author Volker Lanz */ -class CreateFileSystemOperation : public Operation +class LIBKPMCORE_EXPORT CreateFileSystemOperation : public Operation { friend class OperationStack; diff --git a/src/ops/createpartitiontableoperation.h b/src/ops/createpartitiontableoperation.h index df9de5e..00faf0e 100644 --- a/src/ops/createpartitiontableoperation.h +++ b/src/ops/createpartitiontableoperation.h @@ -18,6 +18,7 @@ #if !defined(CREATEPARTITIONTABLEOPERATION__H) #define CREATEPARTITIONTABLEOPERATION__H +#include "util/libpartitionmanagerexport.h" #include "ops/operation.h" @@ -33,7 +34,7 @@ class OperationStack; /** Create a PartitionTable. @author Volker Lanz */ -class CreatePartitionTableOperation : public Operation +class LIBKPMCORE_EXPORT CreatePartitionTableOperation : public Operation { Q_OBJECT Q_DISABLE_COPY(CreatePartitionTableOperation) diff --git a/src/ops/deleteoperation.h b/src/ops/deleteoperation.h index fae65b3..d0f3752 100644 --- a/src/ops/deleteoperation.h +++ b/src/ops/deleteoperation.h @@ -18,6 +18,7 @@ #if !defined(DELETEOPERATION__H) #define DELETEOPERATION__H +#include "util/libpartitionmanagerexport.h" #include "ops/operation.h" @@ -33,7 +34,7 @@ class DeletePartitionJob; /** Delete a Partition. @author Volker Lanz */ -class DeleteOperation : public Operation +class LIBKPMCORE_EXPORT DeleteOperation : public Operation { friend class OperationStack; diff --git a/src/ops/newoperation.h b/src/ops/newoperation.h index 51e24a1..308369c 100644 --- a/src/ops/newoperation.h +++ b/src/ops/newoperation.h @@ -20,6 +20,7 @@ #define NEWOPERATION__H #include "ops/operation.h" +#include "util/libpartitionmanagerexport.h" #include @@ -38,7 +39,7 @@ class CheckFileSystemJob; @author Volker Lanz */ -class NewOperation : public Operation +class LIBKPMCORE_EXPORT NewOperation : public Operation { friend class OperationStack; diff --git a/src/ops/operation.h b/src/ops/operation.h index 68d6f1b..adf9a84 100644 --- a/src/ops/operation.h +++ b/src/ops/operation.h @@ -19,6 +19,8 @@ #define OPERATION__H +#include "util/libpartitionmanagerexport.h" + #include #include #include @@ -113,7 +115,7 @@ class Operation : public QObject virtual void setStatus(OperationStatus s) { m_Status = s; } /**< @param s the new status */ - qint32 totalProgress() const; + LIBKPMCORE_EXPORT qint32 totalProgress() const; protected Q_SLOTS: void onJobStarted(); diff --git a/src/ops/resizeoperation.h b/src/ops/resizeoperation.h index 521ca60..92db580 100644 --- a/src/ops/resizeoperation.h +++ b/src/ops/resizeoperation.h @@ -18,6 +18,7 @@ #if !defined(RESIZEOPERATION__H) #define RESIZEOPERATION__H +#include "util/libpartitionmanagerexport.h" #include "ops/operation.h" @@ -45,7 +46,7 @@ class CheckFileSystemJob; @author Volker Lanz */ -class ResizeOperation : public Operation +class LIBKPMCORE_EXPORT ResizeOperation : public Operation { friend class OperationStack; diff --git a/src/ops/restoreoperation.h b/src/ops/restoreoperation.h index d268fdd..b3098e4 100644 --- a/src/ops/restoreoperation.h +++ b/src/ops/restoreoperation.h @@ -18,6 +18,7 @@ #if !defined(RESTOREOPERATION__H) #define RESTOREOPERATION__H +#include "util/libpartitionmanagerexport.h" #include "ops/operation.h" @@ -41,7 +42,7 @@ class ResizeFileSystemJob; @author Volker Lanz */ -class RestoreOperation : public Operation +class LIBKPMCORE_EXPORT RestoreOperation : public Operation { friend class OperationStack; diff --git a/src/ops/setfilesystemlabeloperation.h b/src/ops/setfilesystemlabeloperation.h index a4dd817..3abdd1b 100644 --- a/src/ops/setfilesystemlabeloperation.h +++ b/src/ops/setfilesystemlabeloperation.h @@ -18,6 +18,7 @@ #if !defined(SETFILESYSTEMLABELOPERATION__H) #define SETFILESYSTEMLABELOPERATION__H +#include "util/libpartitionmanagerexport.h" #include "ops/operation.h" @@ -34,7 +35,7 @@ class SetFileSystemLabelJob; @author Volker Lanz */ -class SetFileSystemLabelOperation : public Operation +class LIBKPMCORE_EXPORT SetFileSystemLabelOperation : public Operation { friend class OperationStack; diff --git a/src/ops/setpartflagsoperation.h b/src/ops/setpartflagsoperation.h index 6bb309b..4531a43 100644 --- a/src/ops/setpartflagsoperation.h +++ b/src/ops/setpartflagsoperation.h @@ -18,6 +18,7 @@ #if !defined(SETPARTFLAGSOPERATION__H) #define SETPARTFLAGSOPERATION__H +#include "util/libpartitionmanagerexport.h" #include "ops/operation.h" @@ -37,7 +38,7 @@ class SetPartFlagsJob; @author Volker Lanz */ -class SetPartFlagsOperation : public Operation +class LIBKPMCORE_EXPORT SetPartFlagsOperation : public Operation { friend class OperationStack; diff --git a/src/plugins/dummy/CMakeLists.txt b/src/plugins/dummy/CMakeLists.txt index c733f91..6c707b6 100644 --- a/src/plugins/dummy/CMakeLists.txt +++ b/src/plugins/dummy/CMakeLists.txt @@ -17,7 +17,7 @@ file (GLOB pmdummybackendplugin_SRCS *.cpp) add_library(pmdummybackendplugin SHARED ${pmdummybackendplugin_SRCS}) -target_link_libraries(pmdummybackendplugin partitionmanagerprivate KF5::KIOCore ${LIBPARTED_LIBS} ${BLKID_LIBRARIES} KF5::Solid) +target_link_libraries(pmdummybackendplugin kpmgui KF5::KIOCore ${LIBPARTED_LIBS} ${BLKID_LIBRARIES} KF5::Solid) install(TARGETS pmdummybackendplugin DESTINATION ${PLUGIN_INSTALL_DIR}) kcoreaddons_desktop_to_json(pmdummybackendplugin pmdummybackendplugin.desktop) diff --git a/src/plugins/libparted/CMakeLists.txt b/src/plugins/libparted/CMakeLists.txt index 17eaf14..61958da 100644 --- a/src/plugins/libparted/CMakeLists.txt +++ b/src/plugins/libparted/CMakeLists.txt @@ -29,7 +29,7 @@ file (GLOB pmlibpartedbackendplugin_SRCS *.cpp) add_library(pmlibpartedbackendplugin SHARED ${pmlibpartedbackendplugin_SRCS}) -target_link_libraries(pmlibpartedbackendplugin partitionmanagerprivate ${LIBPARTED_LIBS} ${BLKID_LIBRARIES} KF5::KIOCore) +target_link_libraries(pmlibpartedbackendplugin kpmgui ${LIBPARTED_LIBS} ${BLKID_LIBRARIES} KF5::KIOCore) install(TARGETS pmlibpartedbackendplugin DESTINATION ${PLUGIN_INSTALL_DIR}) kcoreaddons_desktop_to_json(pmlibpartedbackendplugin pmlibpartedbackendplugin.desktop) diff --git a/src/util/CMakeLists.txt b/src/util/CMakeLists.txt new file mode 100644 index 0000000..2c8e697 --- /dev/null +++ b/src/util/CMakeLists.txt @@ -0,0 +1,8 @@ +set(UTIL_SRC + util/capacity.cpp + util/report.cpp + util/helpers.cpp + util/globallog.cpp + util/externalcommand.cpp + util/htmlreport.cpp +) diff --git a/src/util/capacity.h b/src/util/capacity.h index 5f2458f..12400a5 100644 --- a/src/util/capacity.h +++ b/src/util/capacity.h @@ -18,6 +18,7 @@ #if !defined(CAPACITY__H) #define CAPACITY__H +#include "util/libpartitionmanagerexport.h" class Partition; class Device; @@ -31,7 +32,7 @@ class Device; @author Volker Lanz */ -class Capacity +class LIBKPMCORE_EXPORT Capacity { public: /** Units we can deal with */ diff --git a/src/util/externalcommand.h b/src/util/externalcommand.h index 1d3cbf7..8769a3c 100644 --- a/src/util/externalcommand.h +++ b/src/util/externalcommand.h @@ -37,7 +37,7 @@ class Report; @author Volker Lanz @author Andrius Štikonas */ -class LIBPARTITIONMANAGERPRIVATE_EXPORT ExternalCommand : public QProcess +class LIBKPMCORE_EXPORT ExternalCommand : public QProcess { Q_OBJECT Q_DISABLE_COPY(ExternalCommand) diff --git a/src/util/globallog.h b/src/util/globallog.h index 6e4707c..42ef14f 100644 --- a/src/util/globallog.h +++ b/src/util/globallog.h @@ -25,7 +25,7 @@ #include #include -class LIBPARTITIONMANAGERPRIVATE_EXPORT Log +class LIBKPMCORE_EXPORT Log { public: enum Level @@ -49,7 +49,7 @@ class LIBPARTITIONMANAGERPRIVATE_EXPORT Log /** Global logging. @author Volker Lanz */ -class LIBPARTITIONMANAGERPRIVATE_EXPORT GlobalLog : public QObject +class LIBKPMCORE_EXPORT GlobalLog : public QObject { Q_OBJECT Q_DISABLE_COPY(GlobalLog) diff --git a/src/util/helpers.h b/src/util/helpers.h index 0ccff81..2f190a4 100644 --- a/src/util/helpers.h +++ b/src/util/helpers.h @@ -30,20 +30,20 @@ class QPoint; class QTreeWidget; -LIBPARTITIONMANAGERPRIVATE_EXPORT void registerMetaTypes(); -LIBPARTITIONMANAGERPRIVATE_EXPORT bool checkPermissions(); +LIBKPMCORE_EXPORT void registerMetaTypes(); +LIBKPMCORE_EXPORT bool checkPermissions(); -LIBPARTITIONMANAGERPRIVATE_EXPORT KAboutData* createPartitionManagerAboutData(); +LIBKPMCORE_EXPORT KAboutData* createPartitionManagerAboutData(); -LIBPARTITIONMANAGERPRIVATE_EXPORT bool caseInsensitiveLessThan(const QString& s1, const QString& s2); -LIBPARTITIONMANAGERPRIVATE_EXPORT bool naturalLessThan(const QString& s1, const QString& s2); +LIBKPMCORE_EXPORT bool caseInsensitiveLessThan(const QString& s1, const QString& s2); +LIBKPMCORE_EXPORT bool naturalLessThan(const QString& s1, const QString& s2); -LIBPARTITIONMANAGERPRIVATE_EXPORT QIcon createFileSystemColor(FileSystem::Type type, quint32 size); +LIBKPMCORE_EXPORT QIcon createFileSystemColor(FileSystem::Type type, quint32 size); -LIBPARTITIONMANAGERPRIVATE_EXPORT void showColumnsContextMenu(const QPoint& p, QTreeWidget& tree); +LIBKPMCORE_EXPORT void showColumnsContextMenu(const QPoint& p, QTreeWidget& tree); -LIBPARTITIONMANAGERPRIVATE_EXPORT bool loadBackend(); +LIBKPMCORE_EXPORT bool loadBackend(); -LIBPARTITIONMANAGERPRIVATE_EXPORT bool checkAccessibleDevices(); +LIBKPMCORE_EXPORT bool checkAccessibleDevices(); #endif diff --git a/src/util/htmlreport.h b/src/util/htmlreport.h index c82ed12..736070d 100644 --- a/src/util/htmlreport.h +++ b/src/util/htmlreport.h @@ -18,10 +18,11 @@ #if !defined(HTMLREPORT__H) #define HTMLREPORT__H +#include "util/libpartitionmanagerexport.h" class QString; -class HtmlReport +class LIBKPMCORE_EXPORT HtmlReport { public: HtmlReport() {} diff --git a/src/util/libpartitionmanagerexport.h b/src/util/libpartitionmanagerexport.h index cab9c09..0846223 100644 --- a/src/util/libpartitionmanagerexport.h +++ b/src/util/libpartitionmanagerexport.h @@ -17,12 +17,13 @@ #include "libpartitionmanager_export.h" - #if !defined(LIBPARTITIONMANAGEREXPORT__H) #define LIBPARTITIONMANAGEREXPORT__H -#if !defined(LIBPARTITIONMANAGERPRIVATE_EXPORT) - #define LIBPARTITIONMANAGERPRIVATE_EXPORT Q_DECL_EXPORT +#include + +#if !defined(LIBKPMCORE_EXPORT) + #define LIBKPMCORE_EXPORT Q_DECL_EXPORT #endif #endif diff --git a/src/util/report.cpp b/src/util/report.cpp index 601f2b2..5f2c174 100644 --- a/src/util/report.cpp +++ b/src/util/report.cpp @@ -21,8 +21,6 @@ #include "backend/corebackend.h" #include "backend/corebackendmanager.h" -#include - #include #include diff --git a/src/util/report.h b/src/util/report.h index 39a479c..30da163 100644 --- a/src/util/report.h +++ b/src/util/report.h @@ -34,7 +34,7 @@ class ReportLine; @author Volker Lanz */ -class LIBPARTITIONMANAGERPRIVATE_EXPORT Report : public QObject +class LIBKPMCORE_EXPORT Report : public QObject { Q_OBJECT Q_DISABLE_COPY(Report)