From: Laurent Montel Date: Fri, 23 Mar 2007 15:32:28 +0000 (+0000) Subject: Create shared lib as discussed with David and Peter X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/84ea1693dace41d500c0a61501d67508b83711da Create shared lib as discussed with David and Peter It will used to create kparts which will use theses class svn path=/trunk/KDE/kdebase/apps/; revision=645768 --- diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3c437e139..bf5679ef3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -6,6 +6,34 @@ include_directories( ${CMAKE_SOURCE_DIR}/libkonq ${KDE4_INCLUDE_DIR} ${QT_INCLUD ########### next target ############### +set(dolphinprivate_LIB_SRCS + dolphincontroller.cpp + dolphindetailsview.cpp + dolphiniconsview.cpp + dolphinsettings.cpp + viewproperties.cpp + dolphinsortfilterproxymodel.cpp + ) + +kde4_add_kcfg_files(dolphinprivate_LIB_SRCS + dolphin_directoryviewpropertysettings.kcfgc + dolphin_detailsmodesettings.kcfgc + dolphin_iconsmodesettings.kcfgc + dolphin_generalsettings.kcfgc) + + +kde4_automoc(${dolphinprivate_LIB_SRCS}) + +kde4_add_library(dolphinprivate SHARED ${dolphinprivate_LIB_SRCS}) + +target_link_libraries(dolphinprivate ${KDE4_KDEUI_LIBS} konq) + +set_target_properties(dolphinprivate PROPERTIES VERSION 1.0.0 SOVERSION 1 ) +install(TARGETS dolphinprivate DESTINATION ${LIB_INSTALL_DIR} ) + + +########################################## + set(dolphin_SRCS applyviewpropsjob.cpp bookmarkselector.cpp @@ -13,17 +41,12 @@ set(dolphin_SRCS bookmarkssidebarpage.cpp detailsviewsettingspage.cpp dolphinapplication.cpp - dolphincontroller.cpp dolphinmainwindow.cpp dolphinnewmenu.cpp dolphinview.cpp dolphinstatusbar.cpp dolphindirlister.cpp - dolphindetailsview.cpp - dolphiniconsview.cpp - dolphinsettings.cpp dolphincontextmenu.cpp - dolphinsortfilterproxymodel.cpp dolphinsettingsdialog.cpp editbookmarkdialog.cpp filterbar.cpp @@ -47,18 +70,11 @@ set(dolphin_SRCS urlnavigator.cpp urlnavigatorbutton.cpp viewpropertiesdialog.cpp - viewproperties.cpp viewsettingspage.cpp viewpropsprogressinfo.cpp ) kde4_automoc(${dolphin_SRCS}) -kde4_add_kcfg_files(dolphin_SRCS - dolphin_directoryviewpropertysettings.kcfgc - dolphin_generalsettings.kcfgc - dolphin_iconsmodesettings.kcfgc - dolphin_detailsmodesettings.kcfgc ) - qt4_add_dbus_adaptor(dolphin_SRCS org.kde.dolphin.Application.xml dolphinapplication.h DolphinApplication) @@ -77,7 +93,7 @@ else(KMETADATA_INCLUDE_DIR AND KMETADATA_LIBRARY) set(KDE4_KMETADATA "") endif(KMETADATA_INCLUDE_DIR AND KMETADATA_LIBRARY AND KMETADATA_TOOLS_LIBRARY) configure_file(config-kmetadata.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kmetadata.h ) -target_link_libraries(dolphin ${KDE4_KDECORE_LIBS} ${KDE4_KDEPRINT_LIBS} ${KDE4_KMETADATA} konq) +target_link_libraries(dolphin ${KDE4_KDECORE_LIBS} ${KDE4_KDEPRINT_LIBS} ${KDE4_KMETADATA} konq dolphinprivate) install(TARGETS dolphin DESTINATION ${BIN_INSTALL_DIR}) diff --git a/src/dolphincontroller.h b/src/dolphincontroller.h index 6edf6eba9..7bd7a4b08 100644 --- a/src/dolphincontroller.h +++ b/src/dolphincontroller.h @@ -23,6 +23,7 @@ #include #include #include +#include class KUrl; class QModelIndex; @@ -45,7 +46,7 @@ class QPoint; * when an item should be triggered and a lot more. The controller emits the corresponding signals * so that the receiver may react on those changes. */ -class DolphinController : public QObject +class LIBDOLPHIN_EXPORT DolphinController : public QObject { Q_OBJECT diff --git a/src/dolphindetailsview.h b/src/dolphindetailsview.h index b504d6853..cbeb861d1 100644 --- a/src/dolphindetailsview.h +++ b/src/dolphindetailsview.h @@ -24,6 +24,7 @@ #include #include #include +#include class DolphinController; @@ -35,7 +36,7 @@ class DolphinController; * that full available width of the view is used by stretching the width * of the name column. */ -class DolphinDetailsView : public QTreeView +class LIBDOLPHIN_EXPORT DolphinDetailsView : public QTreeView { Q_OBJECT diff --git a/src/dolphiniconsview.h b/src/dolphiniconsview.h index db3d5d6cd..cc3715c61 100644 --- a/src/dolphiniconsview.h +++ b/src/dolphiniconsview.h @@ -22,6 +22,7 @@ #include #include +#include class DolphinController; class DolphinView; @@ -32,7 +33,7 @@ class DolphinView; * It is also possible that instead of the icon a preview of the item * content is shown. */ -class DolphinIconsView : public QListView +class LIBDOLPHIN_EXPORT DolphinIconsView : public QListView { Q_OBJECT diff --git a/src/dolphinsettings.h b/src/dolphinsettings.h index b4aaa6371..296f943fc 100644 --- a/src/dolphinsettings.h +++ b/src/dolphinsettings.h @@ -21,6 +21,8 @@ #ifndef DOLPHINSETTINGS_H #define DOLPHINSETTINGS_H +#include + class KBookmark; class KBookmarkManager; class GeneralSettings; @@ -38,7 +40,7 @@ class DetailsModeSettings; * - bookmarks * - properties for icons and details view */ -class DolphinSettings { +class LIBDOLPHIN_EXPORT DolphinSettings { public: static DolphinSettings& instance(); diff --git a/src/dolphinsortfilterproxymodel.h b/src/dolphinsortfilterproxymodel.h index 87d074e07..a2e1324d8 100644 --- a/src/dolphinsortfilterproxymodel.h +++ b/src/dolphinsortfilterproxymodel.h @@ -22,6 +22,7 @@ #include #include +#include /** * @brief Acts as proxy model for KDirModel to sort and filter @@ -38,7 +39,7 @@ * * It is assured that directories are always sorted before files. */ -class DolphinSortFilterProxyModel : public QSortFilterProxyModel +class LIBDOLPHIN_EXPORT DolphinSortFilterProxyModel : public QSortFilterProxyModel { Q_OBJECT diff --git a/src/libdolphin_export.h b/src/libdolphin_export.h new file mode 100644 index 000000000..6603844f1 --- /dev/null +++ b/src/libdolphin_export.h @@ -0,0 +1,40 @@ +/* + This file is part of the KDE project + Copyright (C) 2007 Montel Laurent + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef LIBDOLPHIN_EXPORT_H +#define LIBDOLPHIN_EXPORT_H + +/* needed for KDE_EXPORT macros */ +#include + +/* needed, because e.g. Q_OS_UNIX is so frequently used */ +#include + +#ifdef MAKE_DOLPHIN_LIB +# define LIBDOLPHIN_EXPORT KDE_EXPORT +#else +# ifdef Q_OS_WIN +# define LIBDOLPHIN_EXPORT KDE_IMPORT +# else +# define LIBDOLPHIN_EXPORT KDE_EXPORT +# endif +#endif + +#endif + diff --git a/src/viewproperties.h b/src/viewproperties.h index 0eb575407..be64b989b 100644 --- a/src/viewproperties.h +++ b/src/viewproperties.h @@ -25,7 +25,7 @@ #include #include #include - +#include #include "dolphin_directoryviewpropertysettings.h" class QFile; @@ -51,7 +51,7 @@ class QFile; * (see GeneralSettings::globalViewMode()), the values from the global .directory file * are used for initialization. */ -class ViewProperties +class LIBDOLPHIN_EXPORT ViewProperties { public: explicit ViewProperties(const KUrl& url);