diff options
author | Michele Calgaro <[email protected]> | 2025-03-10 20:36:49 +0900 |
---|---|---|
committer | Michele Calgaro <[email protected]> | 2025-03-21 14:10:54 +0900 |
commit | bf204e931c605c73d761ec84943bb0cc94d7e7e4 (patch) | |
tree | b11fccbf3b4846f07130d8626e3f40103dd4cbc4 | |
parent | 44ef0bd5fe47a43e47aec5f7981b6c1d728dd9a8 (diff) | |
download | ktorrent-master.tar.gz ktorrent-master.zip |
Signed-off-by: Michele Calgaro <[email protected]>
123 files changed, 1378 insertions, 123 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..97c15eb --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,93 @@ +############################################ +# # +# Improvements and feedbacks are welcome # +# # +# This file is released under GPL >= 3 # +# # +############################################ + + +##### set project version ######################## + +include( TDEVersion ) +cmake_minimum_required( VERSION ${TDE_CMAKE_MINIMUM_VERSION} ) +tde_set_project_version( ) + + +#### general package setup + +project( ktorrent ) + + +#### include essential cmake modules + +include( FindPkgConfig ) +include( CheckFunctionExists ) +include( CheckSymbolExists ) +include( CheckIncludeFile ) +include( CheckLibraryExists ) +include( CheckCSourceCompiles ) +include( CheckCXXSourceCompiles ) +enable_testing() + + +#### include our cmake modules + +include( TDEMacros ) + + +##### setup install paths + +include( TDESetupPaths ) +tde_setup_paths( ) + + +##### optional stuff + +option( WITH_ALL_OPTIONS "Enable all optional support" OFF ) +option( WITH_ZEROCONF "Enable zeroconf support" ${WITH_ALL_OPTIONS} ) +option( WITH_SYSTEM_GEOIP "Enable system-wide geoip support" ${WITH_ALL_OPTIONS} ) +option( WITH_BUILTIN_GEOIP "Enable built-in geoip support" OFF ) +option( WITH_BUILTIN_FLAGS "Install built-in flags" ${WITH_BUILTIN_GEOIP} ) +option( WITH_TORRENT_MIMETYPE "Install torrent mime type" OFF ) +option( WITH_MEMLEAK_TRACING "Enable memory leak tracing" OFF ) +option( WITH_PROFILING_SUPPORT "Enable profiling support" OFF ) + +option( WITH_GCC_VISIBILITY "Enable fvisibility and fvisibility-inlines-hidden" ${WITH_ALL_OPTIONS} ) + + +##### user requested modules + +option( BUILD_ALL "Build all" ON ) +option( BUILD_DOC "Build documentation" ${BUILD_ALL} ) +option( BUILD_TRANSLATIONS "Build translations" ${BUILD_ALL} ) + + +##### configure checks + +include( ConfigureChecks.cmake ) + + +###### global compiler settings + +add_definitions( -DHAVE_CONFIG_H ) + +set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS}" ) +set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined" ) +set( CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined" ) + + +##### directories + +add_subdirectory( src ) + + +##### other data ################################ + +tde_conditional_add_project_docs( BUILD_DOC ) +tde_conditional_add_project_translations( BUILD_TRANSLATIONS ) + + +##### write configure files + +configure_file( config.h.cmake config.h @ONLY ) diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake new file mode 100644 index 0000000..d5976b3 --- /dev/null +++ b/ConfigureChecks.cmake @@ -0,0 +1,103 @@ +########################################### +# # +# Improvements and feedback are welcome # +# # +# This file is released under GPL >= 3 # +# # +########################################### + + +# required stuff +find_package( TQt ) +find_package( TDE ) + +tde_setup_architecture_flags( ) + +include(TestBigEndian) +test_big_endian(WORDS_BIGENDIAN) + +tde_setup_largefiles( ) + +set( ENV{PKG_CONFIG_PATH} "${PKG_CONFIG_PATH}:$ENV{PKG_CONFIG_PATH}:${LIB_INSTALL_DIR}/pkgconfig" ) + + +##### check for gcc visibility support + +if( WITH_GCC_VISIBILITY ) + tde_setup_gcc_visibility( ) +endif( WITH_GCC_VISIBILITY ) + + +##### check for libgmp + +pkg_search_module( GMP gmp ) +if( NOT GMP_FOUND ) + find_library( GMP_LIBRARIES gmp ) + if( NOT GMP_LIBRARIES ) + tde_message_fatal( "libgmp is required but not found on your system" ) + endif() +endif( ) + + +##### check for avahi + +if( WITH_ZEROCONF ) + pkg_search_module( AVAHI_TQT avahi-tqt ) + pkg_search_module( AVAHI_CLIENT avahi-client ) + if( NOT AVAHI_TQT_FOUND OR NOT AVAHI_CLIENT_FOUND OR AVAHI_CLIENT_VERSION VERSION_LESS "0.6.10") + tde_message_fatal( "avahi >= 0.6.10 support is requested, but not found on your system" ) + endif( ) +endif( ) + + +##### check for geoip + +if( WITH_SYSTEM_GEOIP ) + pkg_search_module( GEOIP geoip ) + if( NOT GEOIP_FOUND ) + tde_message_fatal( "GeoIP is required but was not found on your system" ) + endif( ) + set( USE_SYSTEM_GEOIP 1 ) + # The use of the system-wide geoip database disables the use of the builtin one + set( WITH_BUILTIN_GEOIP OFF ) +endif( ) + + +##### check for various fuctions, headers and types + +check_function_exists( posix_fallocate HAVE_POSIX_FALLOCATE ) +check_function_exists( posix_fallocate64 HAVE_POSIX_FALLOCATE64 ) +check_function_exists( fopen64 HAVE_FOPEN64 ) +check_function_exists( ftruncate64 HAVE_FTRUNCATE64 ) +check_function_exists( lseek64 HAVE_LSEEK64 ) +check_function_exists( mmap64 HAVE_MMAP64 ) +check_function_exists( munmap64 HAVE_MUNMAP64 ) +check_function_exists( statvfs HAVE_STATVFS ) +check_function_exists( statvfs64 HAVE_STATVFS64 ) + +check_function_exists( fseeko64 _HAVE_FSEEKO64 ) +check_function_exists( ftello64 _HAVE_FTELLO64 ) +if( _HAVE_FSEEKO64 AND _HAVE_FTELLO64 ) + set( HAVE_FSEEKO64 1 ) +endif( ) + +check_function_exists( stat64 _HAVE_STAT64 ) +check_function_exists( fstat64 _HAVE_FSTAT64 ) +if( _HAVE_FSTAT64 AND _HAVE_STAT64 ) + set( HAVE_STAT64 1 ) +endif( ) + +check_include_file( "xfs/xfs.h" HAVE_XFS_XFS_H ) + +tde_save_and_set( CMAKE_REQUIRED_INCLUDES ) +check_cxx_source_compiles( " + #include <xfs/xfs.h> + int main() { __s64 u; return 0; } " + HAVE___S64 +) +check_cxx_source_compiles( " + #include <xfs/xfs.h> + int main() { __u64 u; return 0; } " + HAVE___U64 +) +tde_restore( CMAKE_REQUIRED_INCLUDES ) diff --git a/config.h.cmake b/config.h.cmake new file mode 100644 index 0000000..17f5660 --- /dev/null +++ b/config.h.cmake @@ -0,0 +1,53 @@ +#define VERSION "@VERSION@" + +// Defined if you have fvisibility and fvisibility-inlines-hidden support. +#cmakedefine __TDE_HAVE_GCC_VISIBILITY 1 + +// Define WORDS_BIGENDIAN to 1 if your processor stores words with the most +// significant byte first (like Motorola and SPARC, unlike Intel). +#cmakedefine WORDS_BIGENDIAN @WORDS_BIGENDIAN@ + +// Defined if we have system-wide geoip +#cmakedefine USE_SYSTEM_GEOIP 1 + +// Defined if we have posix fallocate +#cmakedefine HAVE_POSIX_FALLOCATE 1 + +// Defined if we have posix fallocate64 +#cmakedefine HAVE_POSIX_FALLOCATE64 1 + +// Defined if we have fopen64 +#cmakedefine HAVE_FOPEN64 1 + +// Defined if we have fseeko64 +#cmakedefine HAVE_FSEEKO64 1 + +// Defined if we have ftruncate64 +#cmakedefine HAVE_FTRUNCATE64 1 + +// Defined if we have lseek64 +#cmakedefine HAVE_LSEEK64 1 + +// Defined if we have mmap64 +#cmakedefine HAVE_MMAP64 1 + +// Defined if we have munmap64 +#cmakedefine HAVE_MUNMAP64 1 + +// Defined if we have stat64 +#cmakedefine HAVE_STAT64 1 + +// Defined if we have statvfs +#cmakedefine HAVE_STATVFS 1 + +// Defined if we have statvfs64 +#cmakedefine HAVE_STATVFS64 1 + +// Defined if we have xfs/xfs.h +#cmakedefine HAVE_XFS_XFS_H 1 + +// Defined if we have __s64 +#cmakedefine HAVE___S64 1 + +// Defined if we have __u64 +#cmakedefine HAVE___U64 1 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..a380326 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,19 @@ +include_directories( + ${CMAKE_BINARY_DIR} + ${TQT_INCLUDE_DIRS} + ${TDE_INCLUDE_DIR} +) + + +link_directories( + ${TQT_LIBRARY_DIRS} + ${TDE_LIB_DIR} +) + + +##### subfolders + +add_subdirectory( libktorrent ) +add_subdirectory( plugins ) +add_subdirectory( apps ) +add_subdirectory( scripts ) diff --git a/src/apps/CMakeLists.txt b/src/apps/CMakeLists.txt new file mode 100644 index 0000000..414640a --- /dev/null +++ b/src/apps/CMakeLists.txt @@ -0,0 +1,7 @@ + +##### subfolders + +add_subdirectory( ktcachecheck ) +add_subdirectory( ktorrent ) +add_subdirectory( kttorinfo ) +add_subdirectory( ktupnptest ) diff --git a/src/apps/ktcachecheck/CMakeLists.txt b/src/apps/ktcachecheck/CMakeLists.txt new file mode 100644 index 0000000..e1f5b13 --- /dev/null +++ b/src/apps/ktcachecheck/CMakeLists.txt @@ -0,0 +1,16 @@ +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/libktorrent + ${CMAKE_CURRENT_BINARY_DIR} +) + + +##### ktcachecheck (executable) + +tde_add_executable( ktcachecheck AUTOMOC + SOURCES + cachecheck.cpp cachechecker.cpp singlecachechecker.cpp multicachechecker.cpp + LINK + ktorrent-shared tdecore-shared tdeui-shared tdeio-shared DCOP-shared + DESTINATION ${BIN_INSTALL_DIR} +) diff --git a/src/apps/ktorrent/CMakeLists.txt b/src/apps/ktorrent/CMakeLists.txt new file mode 100644 index 0000000..0966c29 --- /dev/null +++ b/src/apps/ktorrent/CMakeLists.txt @@ -0,0 +1,73 @@ + +##### subfolders + +add_subdirectory( groups ) +add_subdirectory( newui ) + + +##### current folder + +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_SOURCE_DIR}/src/libktorrent + ${CMAKE_BINARY_DIR}/src/libktorrent +) + + +##### check for memory leakage tracing + +if( WITH_MEMLEAK_TRACING ) + add_definitions(-DKT_LEAKTRACE ) +endif( ) + + +##### ktorrent (executable) + +tde_add_executable( ktorrent AUTOMOC + SOURCES + addpeerwidget.cpp addpeerwidget.h addpeerwidgetbase.ui + advancedpref.ui dcopinterface.skel downloadpref.ui fileselectdlg.cpp + fileselectdlgbase.ui generalpref.ui ipfilterwidget.cpp ipfilterwidgetbase.ui ktorrent.cpp + ktorrentapp.cpp ktorrentcore.cpp ktorrentdcop.cpp ktorrentview.cpp ktorrentviewitem.cpp + ktorrentviewmenu.cpp leaktrace.cpp main.cpp pastedialog.cpp pastedlgbase.ui pref.cpp + queuedialog.cpp queuedialog.h queuedlg.ui scandialog.cpp scandlgbase.ui + speedlimitsdlg.cpp speedlimitsdlgbase.ui torrentcreatordlg.cpp torrentcreatordlg.h + torrentcreatordlgbase.ui trayhoverpopup.cpp trayicon.cpp viewmanager.cpp filterbar.cpp + LINK + groups-static newui-static + ktorrent-shared tdecore-shared tdeui-shared tdeio-shared DCOP-shared + DESTINATION ${BIN_INSTALL_DIR} +) + + +##### other files + +install( + FILES ktorrentui.rc + DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME} +) + +tde_create_translated_desktop( + SOURCE ktorrentplugin.desktop + DESTINATION ${SERVICETYPES_INSTALL_DIR} +) + +tde_create_translated_desktop( + SOURCE ktorrent.desktop + DESTINATION ${XDG_APPS_INSTALL_DIR} +) + +if( WITH_TORRENT_MIMETYPE ) + tde_create_translated_desktop( + SOURCE x-bittorrent.desktop + DESTINATION ${MIME_INSTALL_DIR}/application + ) +endif() + +tde_install_icons( ktorrent torrent DESTINATION ${SHARE_INSTALL_PREFIX}/icons ) +tde_install_icons( + ktencrypted ktinfowidget ktplugins ktprefdownloads ktqueuemanager + ktremove ktstart ktstart_all ktstop ktstop_all ktupnp + DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME}/icons +) diff --git a/src/apps/ktorrent/groups/CMakeLists.txt b/src/apps/ktorrent/groups/CMakeLists.txt new file mode 100644 index 0000000..9f7b273 --- /dev/null +++ b/src/apps/ktorrent/groups/CMakeLists.txt @@ -0,0 +1,16 @@ +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/libktorrent + ${CMAKE_CURRENT_BINARY_DIR} +) + + +##### groups library (static) + +tde_add_library( groups STATIC_PIC AUTOMOC + SOURCES + activedownloadsgroup.cpp activegroup.cpp groupview.cpp useruploadsgroup.cpp + activeuploadsgroup.cpp allgroup.cpp downloadgroup.cpp group.cpp groupmanager.cpp + inactivedownloadsgroup.cpp inactivegroup.cpp inactiveuploadsgroup.cpp queueddownloadsgroup.cpp + queueduploadsgroup.cpp torrentdrag.cpp torrentgroup.cpp uploadgroup.cpp userdownloadsgroup.cpp +) diff --git a/src/apps/ktorrent/groups/groupmanager.h b/src/apps/ktorrent/groups/groupmanager.h index 5c5491e..a2fa4fd 100644 --- a/src/apps/ktorrent/groups/groupmanager.h +++ b/src/apps/ktorrent/groups/groupmanager.h @@ -23,6 +23,7 @@ #include <tqstring.h> #include <tdelocale.h> #include <util/ptrmap.h> +#include <libktorrent_export.h> namespace kt @@ -35,7 +36,7 @@ namespace kt * * Manages all user created groups and the standard groups. */ - class GroupManager : public bt::PtrMap<TQString,Group> + class LIBKTORRENT_EXPORT GroupManager : public bt::PtrMap<TQString,Group> { bt::PtrMap<TQString,Group> default_groups; diff --git a/src/apps/ktorrent/groups/torrentgroup.h b/src/apps/ktorrent/groups/torrentgroup.h index 14f1b37..432cffb 100644 --- a/src/apps/ktorrent/groups/torrentgroup.h +++ b/src/apps/ktorrent/groups/torrentgroup.h @@ -23,6 +23,7 @@ #include <set> #include <group.h> #include <util/sha1hash.h> +#include <libktorrent_export.h> namespace kt @@ -32,7 +33,7 @@ namespace kt /** @author Joris Guisson <[email protected]> */ - class TorrentGroup : public Group + class LIBKTORRENT_EXPORT TorrentGroup : public Group { std::set<TorrentInterface*> torrents; std::set<bt::SHA1Hash> hashes; diff --git a/src/apps/ktorrent/newui/CMakeLists.txt b/src/apps/ktorrent/newui/CMakeLists.txt new file mode 100644 index 0000000..a9dc774 --- /dev/null +++ b/src/apps/ktorrent/newui/CMakeLists.txt @@ -0,0 +1,14 @@ +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/libktorrent + ${CMAKE_CURRENT_BINARY_DIR} +) + + +##### newui library (static) + +tde_add_library( newui STATIC_PIC AUTOMOC + SOURCES + button.cpp button.h buttonbar.cpp buttonbar.h comdefs.h ddockwindow.cpp ddockwindow.h + dmainwindow.cpp dmainwindow.h docksplitter.cpp docksplitter.h dtabwidget.cpp dtabwidget.h +) diff --git a/src/apps/kttorinfo/CMakeLists.txt b/src/apps/kttorinfo/CMakeLists.txt new file mode 100644 index 0000000..0dba8e0 --- /dev/null +++ b/src/apps/kttorinfo/CMakeLists.txt @@ -0,0 +1,13 @@ +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/libktorrent +) + + +##### kttorinfo (executable) + +tde_add_executable( kttorinfo + SOURCES main.cpp + LINK ktorrent-shared + DESTINATION ${BIN_INSTALL_DIR} +) diff --git a/src/apps/ktupnptest/CMakeLists.txt b/src/apps/ktupnptest/CMakeLists.txt new file mode 100644 index 0000000..674d951 --- /dev/null +++ b/src/apps/ktupnptest/CMakeLists.txt @@ -0,0 +1,15 @@ +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src + ${CMAKE_SOURCE_DIR}/src/libktorrent + ${CMAKE_CURRENT_BINARY_DIR} +) + + +##### ktupnptest (executable) + +tde_add_executable( ktupnptest AUTOMOC + SOURCES main.cpp upnptestapp.cpp mainwidget.ui + LINK ktupnp-static ktorrent-shared tdecore-shared tdeui-shared tdeio-shared DCOP-shared + DESTINATION ${BIN_INSTALL_DIR} +) diff --git a/src/libktorrent/CMakeLists.txt b/src/libktorrent/CMakeLists.txt new file mode 100644 index 0000000..4bcf0ba --- /dev/null +++ b/src/libktorrent/CMakeLists.txt @@ -0,0 +1,54 @@ +##### generate settings.h + +add_custom_command( + OUTPUT settings.cpp settings.h + COMMAND "${BIN_INSTALL_DIR}/tdeconfig_compiler" + ARGS "${CMAKE_CURRENT_SOURCE_DIR}/ktorrent.kcfg" + "${CMAKE_CURRENT_SOURCE_DIR}/settings.kcfgc" +) + +add_custom_target( SettingsH DEPENDS settings.h ) + + +##### subfolders + +add_subdirectory( datachecker ) +add_subdirectory( interfaces ) +add_subdirectory( kademlia ) +add_subdirectory( migrate ) +add_subdirectory( mse ) +add_subdirectory( net ) +add_subdirectory( torrent ) +add_subdirectory( util ) + + +##### current folder + +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_BINARY_DIR} +) + + +##### ktorrent library (static) + +tde_add_library( ktorrent SHARED AUTOMOC + SOURCES + expandablewidget.cpp functions.cpp labelview.cpp labelviewitembase.ui pluginmanager.cpp + pluginmanagerprefpage.cpp pluginmanagerwidget.ui settings.cpp + EMBED + torrent-static net-static datachecker-static mse-static migrate-static + kademlia-static interfaces-static util-static + LINK + tdecore-shared tdeio-shared tdeui-shared tdeparts-shared + VERSION 2.2.8 + DESTINATION ${LIB_INSTALL_DIR} +) + + +##### other files + +install( + FILES ktorrent.kcfg + DESTINATION ${KCFG_INSTALL_DIR} +) diff --git a/src/libktorrent/Makefile.am b/src/libktorrent/Makefile.am index d5537c5..6238869 100644 --- a/src/libktorrent/Makefile.am +++ b/src/libktorrent/Makefile.am @@ -11,7 +11,7 @@ kde_kcfg_DATA = ktorrent.kcfg BUILT_SOURCES=settings.h noinst_HEADERS = expandablewidget.h functions.h ktversion.h labelview.h \ - pluginmanager.h pluginmanagerprefpage.h + pluginmanager.h pluginmanagerprefpage.h libktorrent_export.h libktorrent_la_SOURCES = expandablewidget.cpp functions.cpp labelview.cpp \ labelviewitembase.ui pluginmanager.cpp pluginmanagerprefpage.cpp pluginmanagerwidget.ui \ settings.kcfgc diff --git a/src/libktorrent/datachecker/CMakeLists.txt b/src/libktorrent/datachecker/CMakeLists.txt new file mode 100644 index 0000000..f09dd85 --- /dev/null +++ b/src/libktorrent/datachecker/CMakeLists.txt @@ -0,0 +1,13 @@ +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/.. +) + + +##### datachecker library (static) + +tde_add_library( datachecker STATIC_PIC AUTOMOC + SOURCES + datachecker.cpp multidatachecker.cpp singledatachecker.cpp + datacheckerlistener.cpp datacheckerthread.cpp +) diff --git a/src/libktorrent/datachecker/datachecker.h b/src/libktorrent/datachecker/datachecker.h index e038152..edc53f5 100644 --- a/src/libktorrent/datachecker/datachecker.h +++ b/src/libktorrent/datachecker/datachecker.h @@ -22,6 +22,7 @@ #include <util/bitset.h> #include "datacheckerlistener.h" +#include <libktorrent_export.h> class TQString; @@ -37,7 +38,7 @@ namespace bt * Checks which data is downloaded, given a torrent and a file or directory containing * files of the torrent. */ - class DataChecker + class LIBKTORRENT_EXPORT DataChecker { public: DataChecker(); diff --git a/src/libktorrent/datachecker/datacheckerlistener.h b/src/libktorrent/datachecker/datacheckerlistener.h index a770bab..abadc21 100644 --- a/src/libktorrent/datachecker/datacheckerlistener.h +++ b/src/libktorrent/datachecker/datacheckerlistener.h @@ -21,6 +21,7 @@ #define BTDATACHECKERLISTENER_H #include <util/constants.h> +#include <libktorrent_export.h> namespace bt { @@ -28,7 +29,7 @@ namespace bt /** @author Joris Guisson <[email protected]> */ - class DataCheckerListener + class LIBKTORRENT_EXPORT DataCheckerListener { public: DataCheckerListener(bool auto_import); diff --git a/src/libktorrent/datachecker/multidatachecker.h b/src/libktorrent/datachecker/multidatachecker.h index bb68a06..f6271dd 100644 --- a/src/libktorrent/datachecker/multidatachecker.h +++ b/src/libktorrent/datachecker/multidatachecker.h @@ -28,7 +28,7 @@ namespace bt /** @author Joris Guisson */ - class MultiDataChecker : public DataChecker + class LIBKTORRENT_EXPORT MultiDataChecker : public DataChecker { public: MultiDataChecker(); diff --git a/src/libktorrent/datachecker/singledatachecker.h b/src/libktorrent/datachecker/singledatachecker.h index 3b86829..d0d15b4 100644 --- a/src/libktorrent/datachecker/singledatachecker.h +++ b/src/libktorrent/datachecker/singledatachecker.h @@ -30,7 +30,7 @@ namespace bt * * Data checker for single file torrents. */ - class SingleDataChecker : public DataChecker + class LIBKTORRENT_EXPORT SingleDataChecker : public DataChecker { public: SingleDataChecker(); diff --git a/src/libktorrent/functions.h b/src/libktorrent/functions.h index 4b2a9ee..4076d9e 100644 --- a/src/libktorrent/functions.h +++ b/src/libktorrent/functions.h @@ -22,6 +22,7 @@ #include <tqstring.h> #include <util/constants.h> +#include <libktorrent_export.h> namespace kt { @@ -29,7 +30,7 @@ namespace kt * Will return the data directory * @return ~/.trinity/share/apps/ktorrent/ */ - TQString DataDir(); + LIBKTORRENT_EXPORT TQString DataDir(); } #endif diff --git a/src/libktorrent/interfaces/CMakeLists.txt b/src/libktorrent/interfaces/CMakeLists.txt new file mode 100644 index 0000000..e2b6e12 --- /dev/null +++ b/src/libktorrent/interfaces/CMakeLists.txt @@ -0,0 +1,16 @@ +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/.. + ${CMAKE_CURRENT_BINARY_DIR} +) + + +##### interfaces library (static) + +tde_add_library( interfaces STATIC_PIC AUTOMOC + SOURCES + plugin.cpp coreinterface.cpp guiinterface.cpp prefpageinterface.cpp torrentinterface.cpp + monitorinterface.cpp chunkdownloadinterface.cpp peerinterface.cpp torrentfileinterface.cpp + filetreeitem.cpp filetreediritem.cpp functions.cpp logmonitorinterface.cpp + ipblockinginterface.cpp trackerslist.cpp peersource.cpp exitoperation.cpp +) diff --git a/src/libktorrent/interfaces/coreinterface.h b/src/libktorrent/interfaces/coreinterface.h index f42c966..6e779f9 100644 --- a/src/libktorrent/interfaces/coreinterface.h +++ b/src/libktorrent/interfaces/coreinterface.h @@ -24,6 +24,7 @@ #include <tqobject.h> #include <util/constants.h> #include <torrent/queuemanager.h> +#include <libktorrent_export.h> ///Stats struct struct CurrentStats @@ -50,7 +51,7 @@ namespace kt * the applications core, the core is responsible for managing all * TorrentControl objects. */ - class CoreInterface : public TQObject + class LIBKTORRENT_EXPORT CoreInterface : public TQObject { TQ_OBJECT diff --git a/src/libktorrent/interfaces/exitoperation.h b/src/libktorrent/interfaces/exitoperation.h index e9c0ae5..655b344 100644 --- a/src/libktorrent/interfaces/exitoperation.h +++ b/src/libktorrent/interfaces/exitoperation.h @@ -22,6 +22,7 @@ #include <tqobject.h> #include <tdeio/job.h> +#include <libktorrent_export.h> namespace kt { @@ -35,7 +36,7 @@ namespace kt * ExitOperation's can be used in combination with a WaitJob, to wait for a certain amount of time * to give serveral ExitOperation's the time time to finish up. */ - class ExitOperation : public TQObject + class LIBKTORRENT_EXPORT ExitOperation : public TQObject { TQ_OBJECT diff --git a/src/libktorrent/interfaces/filetreediritem.h b/src/libktorrent/interfaces/filetreediritem.h index 6b35031..6f60070 100644 --- a/src/libktorrent/interfaces/filetreediritem.h +++ b/src/libktorrent/interfaces/filetreediritem.h @@ -23,6 +23,7 @@ #include <tdelistview.h> #include <util/constants.h> #include <util/ptrmap.h> +#include <libktorrent_export.h> namespace kt { @@ -44,7 +45,7 @@ namespace kt * * Directory item the file tree showing the files in a multifile torrent */ - class FileTreeDirItem : public TQCheckListItem + class LIBKTORRENT_EXPORT FileTreeDirItem : public TQCheckListItem { protected: TQString name; diff --git a/src/libktorrent/interfaces/filetreeitem.h b/src/libktorrent/interfaces/filetreeitem.h index 5cc17f9..af7759e 100644 --- a/src/libktorrent/interfaces/filetreeitem.h +++ b/src/libktorrent/interfaces/filetreeitem.h @@ -22,6 +22,7 @@ #include <tdelistview.h> #include <util/constants.h> +#include <libktorrent_export.h> using namespace bt; @@ -40,7 +41,7 @@ namespace kt * This is derived from TQCheckListItem, if the user checks or unchecks the box, * wether or not to download a file will be changed. */ - class FileTreeItem : public TQCheckListItem + class LIBKTORRENT_EXPORT FileTreeItem : public TQCheckListItem { protected: TQString name; diff --git a/src/libktorrent/interfaces/functions.h b/src/libktorrent/interfaces/functions.h index 4ffe9a9..4836a6f 100644 --- a/src/libktorrent/interfaces/functions.h +++ b/src/libktorrent/interfaces/functions.h @@ -22,6 +22,7 @@ #include <tqstring.h> #include <util/constants.h> +#include <libktorrent_export.h> namespace kt { @@ -29,9 +30,9 @@ namespace kt const double TO_MEG = (1024.0 * 1024.0); const double TO_GIG = (1024.0 * 1024.0 * 1024.0); - TQString BytesToString(bt::Uint64 bytes,int precision = -1); - TQString KBytesPerSecToString(double speed,int precision = 1); - TQString DurationToString(bt::Uint32 nsecs); + LIBKTORRENT_EXPORT TQString BytesToString(bt::Uint64 bytes,int precision = -1); + LIBKTORRENT_EXPORT TQString KBytesPerSecToString(double speed,int precision = 1); + LIBKTORRENT_EXPORT TQString DurationToString(bt::Uint32 nsecs); template<class T> int CompareVal(T a,T b) { diff --git a/src/libktorrent/interfaces/guiinterface.h b/src/libktorrent/interfaces/guiinterface.h index 69d168b..d94559e 100644 --- a/src/libktorrent/interfaces/guiinterface.h +++ b/src/libktorrent/interfaces/guiinterface.h @@ -21,6 +21,7 @@ #define KTGUIINTERFACE_H #include <tqptrlist.h> +#include <libktorrent_export.h> class TQWidget; class TQIconSet; @@ -77,7 +78,7 @@ namespace kt * * This interface allows plugins and others to modify the GUI. */ - class GUIInterface + class LIBKTORRENT_EXPORT GUIInterface { TQPtrList<ViewListener> listeners; public: diff --git a/src/libktorrent/interfaces/ipblockinginterface.h b/src/libktorrent/interfaces/ipblockinginterface.h index 236a549..87a544c 100644 --- a/src/libktorrent/interfaces/ipblockinginterface.h +++ b/src/libktorrent/interfaces/ipblockinginterface.h @@ -22,6 +22,8 @@ #ifndef IPBLOCKINGINTERFACE_H #define IPBLOCKINGINTERFACE_H +#include <libktorrent_export.h> + class TQString; namespace kt @@ -30,7 +32,7 @@ namespace kt * @author Ivan Vasic * @brief Interface for IPBlocklist to communicate with IPBlockingPlugin */ - class IPBlockingInterface + class LIBKTORRENT_EXPORT IPBlockingInterface { public: IPBlockingInterface(); diff --git a/src/libktorrent/interfaces/logmonitorinterface.h b/src/libktorrent/interfaces/logmonitorinterface.h index 54e1a21..7ee6498 100644 --- a/src/libktorrent/interfaces/logmonitorinterface.h +++ b/src/libktorrent/interfaces/logmonitorinterface.h @@ -20,6 +20,8 @@ #ifndef KTLOGMONITORINTERFACE_H #define KTLOGMONITORINTERFACE_H +#include <libktorrent_export.h> + class TQString; namespace kt @@ -32,7 +34,7 @@ namespace kt * This class is an interface for all classes which want to know, * what is written to the log. */ - class LogMonitorInterface + class LIBKTORRENT_EXPORT LogMonitorInterface { public: LogMonitorInterface(); diff --git a/src/libktorrent/interfaces/monitorinterface.h b/src/libktorrent/interfaces/monitorinterface.h index a199800..0f864de 100644 --- a/src/libktorrent/interfaces/monitorinterface.h +++ b/src/libktorrent/interfaces/monitorinterface.h @@ -20,6 +20,7 @@ #ifndef KTMONITORINTERFACE_H #define KTMONITORINTERFACE_H +#include <libktorrent_export.h> namespace kt { @@ -33,7 +34,7 @@ namespace kt * Classes who want to keep track of all peers currently connected for a given * torrent and all chunks who are currently downloading can implement this interface. */ - class MonitorInterface + class LIBKTORRENT_EXPORT MonitorInterface { public: MonitorInterface(); diff --git a/src/libktorrent/interfaces/peersource.h b/src/libktorrent/interfaces/peersource.h index 0b8a852..a6f2e79 100644 --- a/src/libktorrent/interfaces/peersource.h +++ b/src/libktorrent/interfaces/peersource.h @@ -23,6 +23,7 @@ #include <tqobject.h> #include <tqvaluelist.h> #include <util/constants.h> +#include <libktorrent_export.h> namespace bt { @@ -47,7 +48,7 @@ namespace kt * for torrents. PeerSources should work independently and should emit a signal when they * have peers ready. */ - class PeerSource : public TQObject + class LIBKTORRENT_EXPORT PeerSource : public TQObject { TQ_OBJECT diff --git a/src/libktorrent/interfaces/plugin.h b/src/libktorrent/interfaces/plugin.h index c2446e9..1c185cc 100644 --- a/src/libktorrent/interfaces/plugin.h +++ b/src/libktorrent/interfaces/plugin.h @@ -21,6 +21,7 @@ #define KTPLUGIN_H #include <ktversion.h> +#include <libktorrent_export.h> #include <tdeparts/plugin.h> namespace bt @@ -45,7 +46,7 @@ namespace kt * (setting an int to 0 is ok, creating widgets isn't). * Only the name, author and description may be set in the constructor. */ - class Plugin : public KParts::Plugin + class LIBKTORRENT_EXPORT Plugin : public KParts::Plugin { TQ_OBJECT diff --git a/src/libktorrent/interfaces/prefpageinterface.h b/src/libktorrent/interfaces/prefpageinterface.h index 850a344..665cdac 100644 --- a/src/libktorrent/interfaces/prefpageinterface.h +++ b/src/libktorrent/interfaces/prefpageinterface.h @@ -21,6 +21,7 @@ #define PREFPAGEINTERFACE_H #include <tqpixmap.h> +#include <libktorrent_export.h> class TQWidget; @@ -32,7 +33,7 @@ namespace kt * * This interface allows plugins and others to add their own pages in Configuration dialog */ - class PrefPageInterface + class LIBKTORRENT_EXPORT PrefPageInterface { public: /** diff --git a/src/libktorrent/interfaces/torrentfileinterface.h b/src/libktorrent/interfaces/torrentfileinterface.h index c9381a9..2590fa7 100644 --- a/src/libktorrent/interfaces/torrentfileinterface.h +++ b/src/libktorrent/interfaces/torrentfileinterface.h @@ -23,6 +23,7 @@ #include <tqobject.h> #include <tqstring.h> #include <util/constants.h> +#include <libktorrent_export.h> namespace kt { @@ -41,7 +42,7 @@ namespace kt * * This class is the interface for a file in a multifile torrent. */ - class TorrentFileInterface : public TQObject + class LIBKTORRENT_EXPORT TorrentFileInterface : public TQObject { TQ_OBJECT diff --git a/src/libktorrent/interfaces/torrentinterface.h b/src/libktorrent/interfaces/torrentinterface.h index 92b5f2c..464a640 100644 --- a/src/libktorrent/interfaces/torrentinterface.h +++ b/src/libktorrent/interfaces/torrentinterface.h @@ -22,9 +22,9 @@ #include <tqobject.h> #include <util/constants.h> -#include <interfaces/trackerslist.h> - #include <kurl.h> +#include <interfaces/trackerslist.h> +#include <libktorrent_export.h> namespace bt { @@ -179,7 +179,7 @@ namespace kt * This class is the interface for an object which controls the * up- and download of one torrent. */ - class TorrentInterface : public TQObject + class LIBKTORRENT_EXPORT TorrentInterface : public TQObject { TQ_OBJECT @@ -503,7 +503,7 @@ namespace kt * @param stats The stats of the torrent * @return The share ratio */ - float ShareRatio(const TorrentStats & stats); + LIBKTORRENT_EXPORT float ShareRatio(const TorrentStats & stats); } diff --git a/src/libktorrent/kademlia/CMakeLists.txt b/src/libktorrent/kademlia/CMakeLists.txt new file mode 100644 index 0000000..83c1fd1 --- /dev/null +++ b/src/libktorrent/kademlia/CMakeLists.txt @@ -0,0 +1,15 @@ +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/.. + ${CMAKE_CURRENT_BINARY_DIR} +) + + +##### kademlia library (static) + +tde_add_library( kademlia STATIC_PIC AUTOMOC + SOURCES + key.cpp node.cpp kbucket.cpp rpccall.cpp rpcserver.cpp database.cpp dht.cpp rpcmsg.cpp + kclosestnodessearch.cpp nodelookup.cpp task.cpp pack.cpp taskmanager.cpp announcetask.cpp + dhttrackerbackend.cpp dhtbase.cpp +) diff --git a/src/libktorrent/libktorrent_export.h b/src/libktorrent/libktorrent_export.h new file mode 100644 index 0000000..fa80a7b --- /dev/null +++ b/src/libktorrent/libktorrent_export.h @@ -0,0 +1,12 @@ +#ifndef _LIBKTORRENT_EXPORT_H +#define _LIBKTORRENT_EXPORT_H + +#include <tdemacros.h> + +#ifdef __TDE_HAVE_GCC_VISIBILITY +#define LIBKTORRENT_EXPORT TDE_EXPORT +#else +#define LIBKTORRENT_EXPORT +#endif + +#endif diff --git a/src/libktorrent/migrate/CMakeLists.txt b/src/libktorrent/migrate/CMakeLists.txt new file mode 100644 index 0000000..9213efc --- /dev/null +++ b/src/libktorrent/migrate/CMakeLists.txt @@ -0,0 +1,11 @@ +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/.. +) + + +##### migrate library (static) + +tde_add_library( migrate STATIC_PIC AUTOMOC + SOURCES migrate.cpp ccmigrate.cpp cachemigrate.cpp +) diff --git a/src/libktorrent/mse/CMakeLists.txt b/src/libktorrent/mse/CMakeLists.txt new file mode 100644 index 0000000..2d0d01c --- /dev/null +++ b/src/libktorrent/mse/CMakeLists.txt @@ -0,0 +1,16 @@ +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/.. + ${CMAKE_CURRENT_BINARY_DIR} +) + + +##### mse library (static) + +tde_add_library( mse STATIC_PIC AUTOMOC + SOURCES + bigint.cpp rc4encryptor.cpp streamsocket.cpp encryptedauthenticate.cpp + encryptedserverauthenticate.cpp functions.cpp + LINK + ${GMP_LIBRARIES} +) diff --git a/src/libktorrent/mse/streamsocket.h b/src/libktorrent/mse/streamsocket.h index c653e5d..0b3c234 100644 --- a/src/libktorrent/mse/streamsocket.h +++ b/src/libktorrent/mse/streamsocket.h @@ -23,6 +23,7 @@ #include <tqobject.h> #include <util/constants.h> #include <net/bufferedsocket.h> +#include <libktorrent_export.h> class TQString; @@ -52,7 +53,7 @@ namespace mse * not be used anymore, a SocketReader and SocketWriter should be provided, * so that reading and writing is controlled from the monitor thread. */ - class StreamSocket : public TQObject,public net::SocketReader,public net::SocketWriter + class LIBKTORRENT_EXPORT StreamSocket : public TQObject,public net::SocketReader,public net::SocketWriter { TQ_OBJECT diff --git a/src/libktorrent/net/CMakeLists.txt b/src/libktorrent/net/CMakeLists.txt new file mode 100644 index 0000000..27f84f8 --- /dev/null +++ b/src/libktorrent/net/CMakeLists.txt @@ -0,0 +1,13 @@ +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/.. +) + + +##### net library (static) + +tde_add_library( net STATIC_PIC AUTOMOC + SOURCES + address.cpp bufferedsocket.cpp circularbuffer.cpp downloadthread.cpp networkthread.cpp + portlist.cpp socket.cpp socketgroup.cpp socketmonitor.cpp speed.cpp uploadthread.cpp +) diff --git a/src/libktorrent/net/portlist.h b/src/libktorrent/net/portlist.h index c1a6e99..e4a6976 100644 --- a/src/libktorrent/net/portlist.h +++ b/src/libktorrent/net/portlist.h @@ -22,6 +22,7 @@ #include <tqvaluelist.h> #include <util/constants.h> +#include <libktorrent_export.h> namespace net { @@ -31,7 +32,7 @@ namespace net UDP }; - struct Port + struct LIBKTORRENT_EXPORT Port { bt::Uint16 number; Protocol proto; @@ -69,7 +70,7 @@ namespace net * List of ports which are currently being used. * */ - class PortList : public TQValueList<Port> + class LIBKTORRENT_EXPORT PortList : public TQValueList<Port> { PortListener* lst; public: diff --git a/src/libktorrent/net/socketmonitor.h b/src/libktorrent/net/socketmonitor.h index 6fc63c1..aa2aa56 100644 --- a/src/libktorrent/net/socketmonitor.h +++ b/src/libktorrent/net/socketmonitor.h @@ -20,10 +20,10 @@ #ifndef NETSOCKETMONITOR_H #define NETSOCKETMONITOR_H - #include <tqmutex.h> #include <tqptrlist.h> #include <util/constants.h> +#include <libktorrent_export.h> namespace net @@ -40,7 +40,7 @@ namespace net * Monitors all sockets for upload and download traffic. * It uses two threads to do this. */ - class SocketMonitor + class LIBKTORRENT_EXPORT SocketMonitor { static SocketMonitor self; diff --git a/src/libktorrent/pluginmanager.h b/src/libktorrent/pluginmanager.h index b86e521..27511c5 100644 --- a/src/libktorrent/pluginmanager.h +++ b/src/libktorrent/pluginmanager.h @@ -24,6 +24,7 @@ #include <util/ptrmap.h> #include <interfaces/plugin.h> #include <tqstringlist.h> +#include <libktorrent_export.h> namespace kt @@ -38,7 +39,7 @@ namespace kt * * This class manages all plugins. Plugins are stored in a map */ - class PluginManager + class LIBKTORRENT_EXPORT PluginManager { bt::PtrMap<TQString,Plugin> plugins,unloaded; CoreInterface* core; diff --git a/src/libktorrent/pluginmanagerprefpage.cpp b/src/libktorrent/pluginmanagerprefpage.cpp index a426ca4..20651d5 100644 --- a/src/libktorrent/pluginmanagerprefpage.cpp +++ b/src/libktorrent/pluginmanagerprefpage.cpp @@ -211,3 +211,5 @@ namespace kt } } + +#include "pluginmanagerprefpage.moc" diff --git a/src/libktorrent/settings.kcfgc b/src/libktorrent/settings.kcfgc index f6817f5..b283270 100644 --- a/src/libktorrent/settings.kcfgc +++ b/src/libktorrent/settings.kcfgc @@ -4,3 +4,5 @@ ClassName=Settings Singleton=true Mutators=true # will create the necessary code for setting those variables +IncludeFiles=libktorrent_export.h +Visibility=LIBKTORRENT_EXPORT diff --git a/src/libktorrent/torrent/CMakeLists.txt b/src/libktorrent/torrent/CMakeLists.txt new file mode 100644 index 0000000..5760582 --- /dev/null +++ b/src/libktorrent/torrent/CMakeLists.txt @@ -0,0 +1,29 @@ +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/.. + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_BINARY_DIR}/.. +) + + +##### torrent library (static) + +tde_add_library( torrent STATIC_PIC AUTOMOC + SOURCES + advancedchokealgorithm.cpp announcelist.cpp + authenticate.cpp authenticatebase.cpp authenticationmonitor.cpp bdecoder.cpp + bencoder.cpp bnode.cpp cache.cpp cachefile.cpp cap.cpp choker.cpp chunk.cpp + chunkcounter.cpp chunkdownload.cpp chunkmanager.cpp chunkselector.cpp dndfile.cpp + downloadcap.cpp downloader.cpp globals.cpp httptracker.cpp ipblocklist.cpp + movedatafilesjob.cpp multifilecache.cpp newchokealgorithm.cpp packet.cpp packetreader.cpp + packetwriter.cpp peer.cpp peerdownloader.cpp peerid.cpp peermanager.cpp + peersourcemanager.cpp peeruploader.cpp piece.cpp preallocationthread.cpp queuemanager.cpp + request.cpp server.cpp serverauthenticate.cpp singlefilecache.cpp + speedestimater.cpp statsfile.cpp timeestimator.cpp torrent.cpp torrentcontrol.cpp + torrentcreator.cpp torrentfile.cpp tracker.cpp udptracker.cpp udptrackersocket.cpp + uploadcap.cpp uploader.cpp upspeedestimater.cpp utpex.cpp value.cpp + LINK + net-static datachecker-static mse-static migrate-static util-static + kademlia-static interfaces-static + DEPENDENCIES torrent-static +) diff --git a/src/libktorrent/torrent/authenticationmonitor.h b/src/libktorrent/torrent/authenticationmonitor.h index 43a4ebb..64d824d 100644 --- a/src/libktorrent/torrent/authenticationmonitor.h +++ b/src/libktorrent/torrent/authenticationmonitor.h @@ -22,6 +22,8 @@ #include <list> #include <vector> + +#include <libktorrent_export.h> struct pollfd; @@ -34,7 +36,7 @@ namespace bt Monitors ongoing authentication attempts. This class is a singleton. */ - class AuthenticationMonitor + class LIBKTORRENT_EXPORT AuthenticationMonitor { std::list<AuthenticateBase*> auths; std::vector<struct pollfd> fd_vec; diff --git a/src/libktorrent/torrent/bdecoder.h b/src/libktorrent/torrent/bdecoder.h index 438a656..57bcdf0 100644 --- a/src/libktorrent/torrent/bdecoder.h +++ b/src/libktorrent/torrent/bdecoder.h @@ -22,6 +22,7 @@ #include <tqstring.h> #include <util/constants.h> +#include <libktorrent_export.h> namespace bt { @@ -37,7 +38,7 @@ namespace bt * * Class to decode b-encoded data. */ - class BDecoder + class LIBKTORRENT_EXPORT BDecoder { const TQByteArray & data; Uint32 pos; diff --git a/src/libktorrent/torrent/bencoder.h b/src/libktorrent/torrent/bencoder.h index eb84c39..1338681 100644 --- a/src/libktorrent/torrent/bencoder.h +++ b/src/libktorrent/torrent/bencoder.h @@ -22,6 +22,7 @@ #include <util/file.h> +#include <libktorrent_export.h> namespace bt @@ -79,7 +80,7 @@ namespace bt * the BitTorrent protocol docs. The data gets written to a BEncoderOutput * thing. */ - class BEncoder + class LIBKTORRENT_EXPORT BEncoder { BEncoderOutput* out; bool del; diff --git a/src/libktorrent/torrent/bnode.h b/src/libktorrent/torrent/bnode.h index 84b306e..c8482cd 100644 --- a/src/libktorrent/torrent/bnode.h +++ b/src/libktorrent/torrent/bnode.h @@ -24,6 +24,7 @@ #include <tqvaluelist.h> #include <util/constants.h> #include "value.h" +#include <libktorrent_export.h> namespace bt @@ -37,7 +38,7 @@ namespace bt * There are 3 possible pieces of data in b-encoded piece of data. * This is the base class for all those 3 things. */ - class BNode + class LIBKTORRENT_EXPORT BNode { public: enum Type @@ -79,7 +80,7 @@ namespace bt * * @todo Use TQVariant */ - class BValueNode : public BNode + class LIBKTORRENT_EXPORT BValueNode : public BNode { Value v; public: @@ -95,7 +96,7 @@ namespace bt * @brief Represents a dictionary in bencoded data * */ - class BDictNode : public BNode + class LIBKTORRENT_EXPORT BDictNode : public BNode { struct DictEntry { @@ -157,7 +158,7 @@ namespace bt * @brief Represents a list in bencoded data * */ - class BListNode : public BNode + class LIBKTORRENT_EXPORT BListNode : public BNode { TQPtrList<BNode> children; public: diff --git a/src/libktorrent/torrent/choker.h b/src/libktorrent/torrent/choker.h index b44fc48..9dd4bba 100644 --- a/src/libktorrent/torrent/choker.h +++ b/src/libktorrent/torrent/choker.h @@ -23,6 +23,7 @@ #include <tqptrlist.h> #include <util/constants.h> #include "peer.h" +#include <libktorrent_export.h> namespace kt { @@ -91,7 +92,7 @@ namespace bt * This class handles the choking and unchoking of Peer's. * This class needs to be updated every 10 seconds. */ - class Choker + class LIBKTORRENT_EXPORT Choker { ChokeAlgorithm* choke; PeerManager & pman; diff --git a/src/libktorrent/torrent/chunkmanager.h b/src/libktorrent/torrent/chunkmanager.h index bbf81df..6cb320f 100644 --- a/src/libktorrent/torrent/chunkmanager.h +++ b/src/libktorrent/torrent/chunkmanager.h @@ -27,6 +27,7 @@ #include <util/bitset.h> #include "chunk.h" #include "globals.h" +#include <libktorrent_export.h> class TQStringList; @@ -58,7 +59,7 @@ namespace bt * The chunks are stored in the cache file in the correct order. Eliminating * the need for a file reconstruction algorithm for single files. */ - class ChunkManager : public TQObject + class LIBKTORRENT_EXPORT ChunkManager : public TQObject { TQ_OBJECT diff --git a/src/libktorrent/torrent/downloader.h b/src/libktorrent/torrent/downloader.h index 5cafc6f..9ad8910 100644 --- a/src/libktorrent/torrent/downloader.h +++ b/src/libktorrent/torrent/downloader.h @@ -64,7 +64,7 @@ namespace bt * This class manages the downloading of the file. It should * regurarly be updated. */ - class Downloader : public TQObject + class LIBKTORRENT_EXPORT Downloader : public TQObject { TQ_OBJECT diff --git a/src/libktorrent/torrent/globals.h b/src/libktorrent/torrent/globals.h index 16de41e..11eb051 100644 --- a/src/libktorrent/torrent/globals.h +++ b/src/libktorrent/torrent/globals.h @@ -20,6 +20,7 @@ #ifndef BTGLOBALS_H #define BTGLOBALS_H +#include <libktorrent_export.h> #include <util/constants.h> class TQString; @@ -39,9 +40,7 @@ namespace bt class Log; class Server; - - - class Globals + class LIBKTORRENT_EXPORT Globals { public: virtual ~Globals(); diff --git a/src/libktorrent/torrent/ipblocklist.h b/src/libktorrent/torrent/ipblocklist.h index 6439972..a6a0008 100644 --- a/src/libktorrent/torrent/ipblocklist.h +++ b/src/libktorrent/torrent/ipblocklist.h @@ -21,6 +21,7 @@ #ifndef IPBLOCKLIST_H #define IPBLOCKLIST_H +#include <libktorrent_export.h> #include <interfaces/ipblockinginterface.h> #include <tqmap.h> @@ -31,7 +32,7 @@ class TQString; namespace bt { - class IPKey + class LIBKTORRENT_EXPORT IPKey { public: IPKey(); @@ -60,7 +61,7 @@ namespace bt * * Peers that have sent >= 3 bad chunks are blocked. */ - class IPBlocklist + class LIBKTORRENT_EXPORT IPBlocklist { IPBlocklist(); IPBlocklist(const IPBlocklist & ); diff --git a/src/libktorrent/torrent/peer.h b/src/libktorrent/torrent/peer.h index 549ab5d..8e8b11a 100644 --- a/src/libktorrent/torrent/peer.h +++ b/src/libktorrent/torrent/peer.h @@ -27,6 +27,7 @@ #include <util/bitset.h> #include "globals.h" #include "peerid.h" +#include <libktorrent_export.h> namespace net { @@ -64,7 +65,7 @@ namespace bt * It provides functions for sending packets. Packets it receives * get relayed to the outside world using a bunch of signals. */ - class Peer : public TQObject, public kt::PeerInterface + class LIBKTORRENT_EXPORT Peer : public TQObject, public kt::PeerInterface //,public Object { TQ_OBJECT diff --git a/src/libktorrent/torrent/peerid.cpp b/src/libktorrent/torrent/peerid.cpp index f15d5f2..66e9533 100644 --- a/src/libktorrent/torrent/peerid.cpp +++ b/src/libktorrent/torrent/peerid.cpp @@ -74,7 +74,7 @@ namespace bt return *this; } - bool operator == (const PeerID & a,const PeerID & b) + LIBKTORRENT_EXPORT bool operator == (const PeerID & a,const PeerID & b) { for (int i = 0;i < 20;i++) if (a.id[i] != b.id[i]) @@ -83,12 +83,12 @@ namespace bt return true; } - bool operator != (const PeerID & a,const PeerID & b) + LIBKTORRENT_EXPORT bool operator != (const PeerID & a,const PeerID & b) { return ! operator == (a,b); } - bool operator < (const PeerID & a,const PeerID & b) + LIBKTORRENT_EXPORT bool operator < (const PeerID & a,const PeerID & b) { for (int i = 0;i < 20;i++) if (a.id[i] < b.id[i]) diff --git a/src/libktorrent/torrent/peerid.h b/src/libktorrent/torrent/peerid.h index 8ebea9a..e1bb479 100644 --- a/src/libktorrent/torrent/peerid.h +++ b/src/libktorrent/torrent/peerid.h @@ -21,6 +21,7 @@ #define BTPEERID_H #include <tqstring.h> +#include <libktorrent_export.h> namespace bt { @@ -28,7 +29,7 @@ namespace bt /** @author Joris Guisson */ - class PeerID + class LIBKTORRENT_EXPORT PeerID { char id[20]; TQString client_name; diff --git a/src/libktorrent/torrent/peermanager.h b/src/libktorrent/torrent/peermanager.h index 1a87dbb..5bc785d 100644 --- a/src/libktorrent/torrent/peermanager.h +++ b/src/libktorrent/torrent/peermanager.h @@ -53,7 +53,7 @@ namespace bt * This class manages all Peer objects. * It can also open connections to other peers. */ - class PeerManager : public TQObject + class LIBKTORRENT_EXPORT PeerManager : public TQObject { TQ_OBJECT diff --git a/src/libktorrent/torrent/queuemanager.h b/src/libktorrent/torrent/queuemanager.h index 96bc586..3618c7a 100644 --- a/src/libktorrent/torrent/queuemanager.h +++ b/src/libktorrent/torrent/queuemanager.h @@ -26,6 +26,7 @@ #include <tqptrlist.h> #include <interfaces/torrentinterface.h> +#include <libktorrent_export.h> namespace kt { @@ -53,7 +54,7 @@ namespace bt * @author Ivan Vasic * @brief This class contains list of all TorrentControls and is responsible for starting/stopping them */ - class QueueManager : public TQObject + class LIBKTORRENT_EXPORT QueueManager : public TQObject { TQ_OBJECT diff --git a/src/libktorrent/torrent/server.h b/src/libktorrent/torrent/server.h index 6d994a2..600685c 100644 --- a/src/libktorrent/torrent/server.h +++ b/src/libktorrent/torrent/server.h @@ -23,6 +23,7 @@ #include <tqptrlist.h> #include <tqobject.h> #include "globals.h" +#include <libktorrent_export.h> namespace bt { @@ -42,7 +43,7 @@ namespace bt * All PeerManager's should register with this class when they * are created and should unregister when they are destroyed. */ - class Server : public TQObject + class LIBKTORRENT_EXPORT Server : public TQObject { TQ_OBJECT diff --git a/src/libktorrent/torrent/serverauthenticate.h b/src/libktorrent/torrent/serverauthenticate.h index 63ebff8..bb82e39 100644 --- a/src/libktorrent/torrent/serverauthenticate.h +++ b/src/libktorrent/torrent/serverauthenticate.h @@ -21,6 +21,7 @@ #define BTSERVERAUTHENTICATE_H #include "authenticatebase.h" +#include <libktorrent_export.h> namespace bt { @@ -35,7 +36,7 @@ namespace bt * Once the authentication is finished, the socket gets handed over * to the right PeerManager. */ - class ServerAuthenticate : public AuthenticateBase + class LIBKTORRENT_EXPORT ServerAuthenticate : public AuthenticateBase { TQ_OBJECT diff --git a/src/libktorrent/torrent/torrent.h b/src/libktorrent/torrent/torrent.h index 05c28cc..5ed623c 100644 --- a/src/libktorrent/torrent/torrent.h +++ b/src/libktorrent/torrent/torrent.h @@ -29,6 +29,7 @@ #include "globals.h" #include "peerid.h" #include "torrentfile.h" +#include <libktorrent_export.h> @@ -62,7 +63,7 @@ namespace bt * Loads a torrent file and calculates some miscelanious other data, * like the info_hash and the peer_id. */ - class Torrent + class LIBKTORRENT_EXPORT Torrent { public: Torrent(); diff --git a/src/libktorrent/torrent/torrentcontrol.h b/src/libktorrent/torrent/torrentcontrol.h index 14fd6f6..def2361 100644 --- a/src/libktorrent/torrent/torrentcontrol.h +++ b/src/libktorrent/torrent/torrentcontrol.h @@ -30,6 +30,7 @@ #include <interfaces/torrentinterface.h> #include <interfaces/monitorinterface.h> #include <interfaces/trackerslist.h> +#include <libktorrent_export.h> class TQStringList; class TQString; @@ -65,7 +66,7 @@ namespace bt * This class controls the uploading, downloading, choking, * updating the tracker and chunk management. */ - class TorrentControl : public kt::TorrentInterface + class LIBKTORRENT_EXPORT TorrentControl : public kt::TorrentInterface { TQ_OBJECT diff --git a/src/libktorrent/torrent/torrentcreator.h b/src/libktorrent/torrent/torrentcreator.h index e1e2545..4f1599c 100644 --- a/src/libktorrent/torrent/torrentcreator.h +++ b/src/libktorrent/torrent/torrentcreator.h @@ -23,6 +23,7 @@ #include <tqstringlist.h> #include "torrent.h" #include <util/sha1hash.h> +#include <libktorrent_export.h> namespace bt { @@ -37,7 +38,7 @@ namespace bt * It also allows to create a TorrentControl object, so * that we immediately can start to share the torrent. */ - class TorrentCreator + class LIBKTORRENT_EXPORT TorrentCreator { // input values TQString target; diff --git a/src/libktorrent/torrent/tracker.h b/src/libktorrent/torrent/tracker.h index 72c9468..5f35b04 100644 --- a/src/libktorrent/torrent/tracker.h +++ b/src/libktorrent/torrent/tracker.h @@ -41,7 +41,7 @@ namespace bt /** * Base class for all tracker classes. */ - class Tracker : public kt::PeerSource + class LIBKTORRENT_EXPORT Tracker : public kt::PeerSource { TQ_OBJECT diff --git a/src/libktorrent/torrent/udptrackersocket.h b/src/libktorrent/torrent/udptrackersocket.h index 5b48f18..fadbc38 100644 --- a/src/libktorrent/torrent/udptrackersocket.h +++ b/src/libktorrent/torrent/udptrackersocket.h @@ -24,6 +24,7 @@ #include <tqmap.h> #include <tqcstring.h> #include <util/constants.h> +#include <libktorrent_export.h> namespace KNetwork @@ -51,7 +52,7 @@ namespace bt * * Class which handles communication with one or more UDP trackers. */ - class UDPTrackerSocket : public TQObject + class LIBKTORRENT_EXPORT UDPTrackerSocket : public TQObject { TQ_OBJECT diff --git a/src/libktorrent/util/CMakeLists.txt b/src/libktorrent/util/CMakeLists.txt new file mode 100644 index 0000000..fb8fa30 --- /dev/null +++ b/src/libktorrent/util/CMakeLists.txt @@ -0,0 +1,24 @@ +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/.. + ${CMAKE_CURRENT_BINARY_DIR} +) + + +##### check for profiling support + +if( WITH_PROFILING_SUPPORT ) + add_definitions(-DKT_PROFILE ) +endif( ) + + +##### util library (static) + +tde_add_library( util STATIC_PIC AUTOMOC + SOURCES + array.cpp autorotatelogjob.cpp bitset.cpp error.cpp file.cpp fileops.cpp functions.cpp + httprequest.cpp log.cpp mmapfile.cpp profiler.cpp ptrmap.cpp sha1hash.cpp sha1hashgen.cpp + timer.cpp urlencoder.cpp waitjob.cpp + LINK + torrent-static +) diff --git a/src/libktorrent/util/bitset.h b/src/libktorrent/util/bitset.h index 32e7e48..54910ec 100644 --- a/src/libktorrent/util/bitset.h +++ b/src/libktorrent/util/bitset.h @@ -21,6 +21,7 @@ #define BTBITSET_H #include "constants.h" +#include <libktorrent_export.h> namespace bt { @@ -32,7 +33,7 @@ namespace bt * Simple implementation of a BitSet, can only turn on and off bits. * BitSet's are used to indicate which chunks we have or not. */ - class BitSet + class LIBKTORRENT_EXPORT BitSet { Uint32 num_bits,num_bytes; Uint8* data; diff --git a/src/libktorrent/util/error.h b/src/libktorrent/util/error.h index 49aa95d..337c01a 100644 --- a/src/libktorrent/util/error.h +++ b/src/libktorrent/util/error.h @@ -21,6 +21,7 @@ #define BTERROR_H #include <tqstring.h> +#include <libktorrent_export.h> namespace bt { @@ -28,7 +29,7 @@ namespace bt /** @author Joris Guisson */ - class Error + class LIBKTORRENT_EXPORT Error { TQString msg; public: diff --git a/src/libktorrent/util/file.h b/src/libktorrent/util/file.h index c6567f8..40fd18b 100644 --- a/src/libktorrent/util/file.h +++ b/src/libktorrent/util/file.h @@ -23,6 +23,7 @@ #include <stdio.h> #include <tqstring.h> #include "constants.h" +#include <libktorrent_export.h> namespace bt { @@ -33,7 +34,7 @@ namespace bt * * Wrapper class for stdio's FILE. */ - class File + class LIBKTORRENT_EXPORT File { FILE* fptr; TQString file; diff --git a/src/libktorrent/util/fileops.h b/src/libktorrent/util/fileops.h index d1c3437..592ecd3 100644 --- a/src/libktorrent/util/fileops.h +++ b/src/libktorrent/util/fileops.h @@ -25,6 +25,8 @@ #endif #include <util/constants.h> +#include <libktorrent_export.h> + class TQString; namespace bt @@ -37,7 +39,7 @@ namespace bt * @param nothrow wether or not we shouldn't throw an Error upon failure * @throw Error upon error */ - void MakeDir(const TQString & dir,bool nothrow = false); + LIBKTORRENT_EXPORT void MakeDir(const TQString & dir,bool nothrow = false); /** * Create a symbolic link @a link_url which links to @a link_to @@ -45,7 +47,7 @@ namespace bt * @param link_url The link url * @param nothrow wether or not we shouldn't throw an Error upon failure */ - void SymLink(const TQString & link_to,const TQString & link_url,bool nothrow = false); + LIBKTORRENT_EXPORT void SymLink(const TQString & link_to,const TQString & link_url,bool nothrow = false); /** * Move a file/dir from one location to another @@ -53,7 +55,7 @@ namespace bt * @param dst The destination file / directory * @param nothrow wether or not we shouldn't throw an Error upon failure */ - void Move(const TQString & src,const TQString & dst,bool nothrow = false); + LIBKTORRENT_EXPORT void Move(const TQString & src,const TQString & dst,bool nothrow = false); /** * Copy a file. @@ -61,7 +63,7 @@ namespace bt * @param dst The destination dir/file * @param nothrow wether or not we shouldn't throw an Error upon failure */ - void CopyFile(const TQString & src,const TQString & dst,bool nothrow = false); + LIBKTORRENT_EXPORT void CopyFile(const TQString & src,const TQString & dst,bool nothrow = false); /** * Copy a file or directory @@ -69,21 +71,21 @@ namespace bt * @param dst The destination dir/file * @param nothrow wether or not we shouldn't throw an Error upon failure */ - void CopyDir(const TQString & src,const TQString & dst,bool nothrow = false); + LIBKTORRENT_EXPORT void CopyDir(const TQString & src,const TQString & dst,bool nothrow = false); /** * Check wether a file/dir exists * @param url The file/dir * @return true if it exits */ - bool Exists(const TQString & url); + LIBKTORRENT_EXPORT bool Exists(const TQString & url); /** * Delete a file or directory. * @param url The url of the file/dir * @param nothrow wether or not we shouldn't throw an Error upon failure */ - void Delete(const TQString & url,bool nothrow = false); + LIBKTORRENT_EXPORT void Delete(const TQString & url,bool nothrow = false); /** * Try to create a file. Doesn't do anything if the file @@ -91,7 +93,7 @@ namespace bt * @param url The url of the file * @param nothrow wether or not we shouldn't throw an Error upon failure */ - void Touch(const TQString & url,bool nothrow = false); + LIBKTORRENT_EXPORT void Touch(const TQString & url,bool nothrow = false); /** * Calculates the size of a file @@ -99,7 +101,7 @@ namespace bt * @return The size of the file * @throw Error if the file doesn't exist, or something else goes wrong */ - Uint64 FileSize(const TQString & url); + LIBKTORRENT_EXPORT Uint64 FileSize(const TQString & url); /** * Get the size of a file. @@ -107,7 +109,7 @@ namespace bt * @return The size * @throw Error if the file doesn't exist, or something else goes wrong */ - Uint64 FileSize(int fd); + LIBKTORRENT_EXPORT Uint64 FileSize(int fd); /** * Truncate a file (wrapper around ftruncate) @@ -115,7 +117,7 @@ namespace bt * @param size The size to truncate to * @throw Error if the file doesn't exist, or something else goes wrong */ - void TruncateFile(int fd,Uint64 size,bool quick); + LIBKTORRENT_EXPORT void TruncateFile(int fd,Uint64 size,bool quick); /** * Truncate a file (wrapper around ftruncate) @@ -124,28 +126,28 @@ namespace bt * @param quick Use the quick way (doesn't prevent fragmentationt) * @throw Error if the file doesn't exist, or something else goes wrong */ - void TruncateFile(const TQString & path,Uint64 size); + LIBKTORRENT_EXPORT void TruncateFile(const TQString & path,Uint64 size); /** * Special truncate for FAT file systems. */ - bool FatPreallocate(int fd,Uint64 size); + LIBKTORRENT_EXPORT bool FatPreallocate(int fd,Uint64 size); /** * Special truncate for FAT file systems. */ - bool FatPreallocate(const TQString & path,Uint64 size); + LIBKTORRENT_EXPORT bool FatPreallocate(const TQString & path,Uint64 size); #ifdef HAVE_XFS_XFS_H /** * Special truncate for XFS file systems. */ - bool XfsPreallocate(int fd,Uint64 size); + LIBKTORRENT_EXPORT bool XfsPreallocate(int fd,Uint64 size); /** * Special truncate for XFS file systems. */ - bool XfsPreallocate(const TQString & path,Uint64 size); + LIBKTORRENT_EXPORT bool XfsPreallocate(const TQString & path,Uint64 size); #endif @@ -156,10 +158,10 @@ namespace bt * @param whence Position to seek from * @throw Error if something else goes wrong */ - void SeekFile(int fd,Int64 off,int whence); + LIBKTORRENT_EXPORT void SeekFile(int fd,Int64 off,int whence); /// Calculate the number of bytes free on the filesystem path is located - bool FreeDiskSpace(const TQString & path,Uint64 & bytes_free); + LIBKTORRENT_EXPORT bool FreeDiskSpace(const TQString & path,Uint64 & bytes_free); } #endif diff --git a/src/libktorrent/util/functions.h b/src/libktorrent/util/functions.h index 9295b83..97bb3fe 100644 --- a/src/libktorrent/util/functions.h +++ b/src/libktorrent/util/functions.h @@ -21,6 +21,7 @@ #define BTFUNCTIONS_H #include "constants.h" +#include <libktorrent_export.h> class TQString; class TQHostAddress; @@ -29,44 +30,43 @@ class KURL; namespace bt { - void WriteUint64(Uint8* buf,Uint32 off,Uint64 val); - Uint64 ReadUint64(const Uint8* buf,Uint64 off); + LIBKTORRENT_EXPORT void WriteUint64(Uint8* buf,Uint32 off,Uint64 val); + LIBKTORRENT_EXPORT Uint64 ReadUint64(const Uint8* buf,Uint64 off); - void WriteUint32(Uint8* buf,Uint32 off,Uint32 val); - Uint32 ReadUint32(const Uint8* buf,Uint32 off); + LIBKTORRENT_EXPORT void WriteUint32(Uint8* buf,Uint32 off,Uint32 val); + LIBKTORRENT_EXPORT Uint32 ReadUint32(const Uint8* buf,Uint32 off); - void WriteUint16(Uint8* buf,Uint32 off,Uint16 val); - Uint16 ReadUint16(const Uint8* buf,Uint32 off); - + LIBKTORRENT_EXPORT void WriteUint16(Uint8* buf,Uint32 off,Uint16 val); + LIBKTORRENT_EXPORT Uint16 ReadUint16(const Uint8* buf,Uint32 off); - void WriteInt64(Uint8* buf,Uint32 off,Int64 val); - Int64 ReadInt64(const Uint8* buf,Uint32 off); + LIBKTORRENT_EXPORT void WriteInt64(Uint8* buf,Uint32 off,Int64 val); + LIBKTORRENT_EXPORT Int64 ReadInt64(const Uint8* buf,Uint32 off); - void WriteInt32(Uint8* buf,Uint32 off,Int32 val); - Int32 ReadInt32(const Uint8* buf,Uint32 off); + LIBKTORRENT_EXPORT void WriteInt32(Uint8* buf,Uint32 off,Int32 val); + LIBKTORRENT_EXPORT Int32 ReadInt32(const Uint8* buf,Uint32 off); - void WriteInt16(Uint8* buf,Uint32 off,Int16 val); - Int16 ReadInt16(const Uint8* buf,Uint32 off); + LIBKTORRENT_EXPORT void WriteInt16(Uint8* buf,Uint32 off,Int16 val); + LIBKTORRENT_EXPORT Int16 ReadInt16(const Uint8* buf,Uint32 off); - void UpdateCurrentTime(); + LIBKTORRENT_EXPORT void UpdateCurrentTime(); - extern TimeStamp global_time_stamp; + LIBKTORRENT_EXPORT extern TimeStamp global_time_stamp; inline TimeStamp GetCurrentTime() {return global_time_stamp;} - TimeStamp Now(); + LIBKTORRENT_EXPORT TimeStamp Now(); - TQHostAddress LookUpHost(const TQString & host); - TQString DirSeparator(); - bool IsMultimediaFile(const TQString & filename); + LIBKTORRENT_EXPORT TQHostAddress LookUpHost(const TQString & host); + LIBKTORRENT_EXPORT TQString DirSeparator(); + LIBKTORRENT_EXPORT bool IsMultimediaFile(const TQString & filename); /** * Maximize the file and memory limits using setrlimit. */ - bool MaximizeLimits(); + LIBKTORRENT_EXPORT bool MaximizeLimits(); /// Get the maximum number of open files - Uint32 MaxOpenFiles(); + LIBKTORRENT_EXPORT Uint32 MaxOpenFiles(); } #endif diff --git a/src/libktorrent/util/httprequest.h b/src/libktorrent/util/httprequest.h index fd9e7b7..0116e79 100644 --- a/src/libktorrent/util/httprequest.h +++ b/src/libktorrent/util/httprequest.h @@ -38,7 +38,7 @@ namespace bt * connect to the right signals and forget about it. After the reply has been received or * an error occurred, the appropriate signal will be emitted. */ - class HTTPRequest : public kt::ExitOperation + class LIBKTORRENT_EXPORT HTTPRequest : public kt::ExitOperation { TQ_OBJECT diff --git a/src/libktorrent/util/log.cpp b/src/libktorrent/util/log.cpp index 422effe..02fafe6 100644 --- a/src/libktorrent/util/log.cpp +++ b/src/libktorrent/util/log.cpp @@ -119,7 +119,7 @@ namespace bt *out << TQDateTime::currentDateTime().toString() << ": " << tmp << ::endl; fptr.flush(); if (to_cout) - std::cout << TQString(tmp.local8Bit()) << std::endl; + std::cout << tmp.local8Bit() << std::endl; if (monitors.count() > 0) { diff --git a/src/libktorrent/util/log.h b/src/libktorrent/util/log.h index 742b753..62260b7 100644 --- a/src/libktorrent/util/log.h +++ b/src/libktorrent/util/log.h @@ -23,6 +23,7 @@ #include "constants.h" +#include <libktorrent_export.h> #include <tqstring.h> // LOG MESSAGES CONSTANTS @@ -75,7 +76,7 @@ namespace bt * There is also the possibility to monitor what is written to the log using * the LogMonitorInterface class. */ - class Log + class LIBKTORRENT_EXPORT Log { class Private; @@ -195,10 +196,10 @@ namespace bt void logRotateDone(); }; - Log & endl(Log & lg); + LIBKTORRENT_EXPORT Log & endl(Log & lg); - Log & Out(unsigned int arg = 0x00); + LIBKTORRENT_EXPORT Log & Out(unsigned int arg = 0x00); inline Log & GenOut(unsigned int arg) {return Out(SYS_GEN|arg);} inline Log & DHTOut(unsigned int arg) {return Out(SYS_DHT|arg);} inline Log & ConOut(unsigned int arg) {return Out(SYS_CON|arg);} diff --git a/src/libktorrent/util/mmapfile.h b/src/libktorrent/util/mmapfile.h index 4d68fd2..78ccf4c 100644 --- a/src/libktorrent/util/mmapfile.h +++ b/src/libktorrent/util/mmapfile.h @@ -21,6 +21,7 @@ #define BTMMAPFILE_H +#include <libktorrent_export.h> #include <tqstring.h> #include <util/constants.h> @@ -35,11 +36,12 @@ namespace bt * File. * TODO: make sure large files work (not really needed for the blocklist) */ - class MMapFile + class LIBKTORRENT_EXPORT MMapFile { public: MMapFile(); - virtual ~MMapFile(); + //virtual + ~MMapFile(); enum Mode { diff --git a/src/libktorrent/util/sha1hash.cpp b/src/libktorrent/util/sha1hash.cpp index 6cdbbc4..00a1bb2 100644 --- a/src/libktorrent/util/sha1hash.cpp +++ b/src/libktorrent/util/sha1hash.cpp @@ -115,7 +115,7 @@ namespace bt return k; } - bool operator < (const SHA1Hash & a,const SHA1Hash & b) + LIBKTORRENT_EXPORT bool operator < (const SHA1Hash & a,const SHA1Hash & b) { for (int i = 0;i < 20;i++) { diff --git a/src/libktorrent/util/sha1hash.h b/src/libktorrent/util/sha1hash.h index dba66c9..5363555 100644 --- a/src/libktorrent/util/sha1hash.h +++ b/src/libktorrent/util/sha1hash.h @@ -22,6 +22,7 @@ #include <tqcstring.h> #include "constants.h" +#include <libktorrent_export.h> class TQString; @@ -36,7 +37,7 @@ namespace bt * This class keeps track of a SHA1 hash. A SHA1 hash is a 20 byte * array of bytes. */ - class SHA1Hash + class LIBKTORRENT_EXPORT SHA1Hash { protected: Uint8 hash[20]; diff --git a/src/libktorrent/util/waitjob.h b/src/libktorrent/util/waitjob.h index 6f9bdd5..04508f4 100644 --- a/src/libktorrent/util/waitjob.h +++ b/src/libktorrent/util/waitjob.h @@ -35,7 +35,7 @@ namespace bt * Job to wait for a certain amount of time or until one or more ExitOperation's have * finished. */ - class WaitJob : public TDEIO::Job + class LIBKTORRENT_EXPORT WaitJob : public TDEIO::Job { TQ_OBJECT diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt new file mode 100644 index 0000000..b42887c --- /dev/null +++ b/src/plugins/CMakeLists.txt @@ -0,0 +1,15 @@ + +##### subfolders + +add_subdirectory( infowidget ) +add_subdirectory( ipfilter ) +add_subdirectory( logviewer ) +add_subdirectory( partfileimport ) +add_subdirectory( rssfeed ) +add_subdirectory( scanfolder ) +add_subdirectory( scheduler ) +add_subdirectory( search ) +add_subdirectory( stats ) +add_subdirectory( upnp ) +add_subdirectory( webinterface ) +tde_conditional_add_subdirectory( WITH_ZEROCONF zeroconf ) diff --git a/src/plugins/infowidget/CMakeLists.txt b/src/plugins/infowidget/CMakeLists.txt new file mode 100644 index 0000000..23ffe8e --- /dev/null +++ b/src/plugins/infowidget/CMakeLists.txt @@ -0,0 +1,54 @@ + +##### subfolders + +add_subdirectory( geoip ) + + +##### current folder + +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/libktorrent + ${CMAKE_CURRENT_BINARY_DIR} +) + + +##### geoip library (system-wide or builtin) + +set( LIB_GEOIP "") +if( WITH_SYSTEM_GEOIP ) + set( LIB_GEOIP "${GEOIP_LIBRARIES}" ) +else( ) + if( WITH_BUILTIN_GEOIP ) + tde_add_library( geoip_builtin STATIC_PIC SOURCES GeoIP.c ) + set( LIB_GEOIP "geoip_builtin-static") + endif( ) +endif( ) + +##### ktinfowidgetplugin (kpart) + +tde_add_kpart( ktinfowidgetplugin AUTOMOC + SOURCES + infowidgetplugin.cpp availabilitychunkbar.cpp fileview.cpp floatspinbox.cpp + chunkbar.cpp chunkdownloadview.cpp downloadedchunkbar.cpp flagdb.cpp peerview.cpp + ktorrentmonitor.cpp iwfiletreediritem.cpp iwfiletreeitem.cpp infowidgetprefpage.cpp + infowidgetpluginsettings.kcfgc iwpref.ui trackerviewbase.ui trackerview.cpp + localefloatvalidator.cpp chunkdownloadviewbase.ui statustabbase.ui statustab.cpp + LINK + ${LIB_GEOIP} ktorrent-shared + tdecore-shared tdeui-shared tdeio-shared tdeparts-shared tdehtml-shared + DESTINATION ${PLUGIN_INSTALL_DIR} +) + + +##### other files + +install( + FILES ktinfowidgetplugin.kcfg + DESTINATION ${KCFG_INSTALL_DIR} +) + +tde_create_translated_desktop( + SOURCE ktinfowidgetplugin.desktop + DESTINATION ${SERVICES_INSTALL_DIR} +) diff --git a/src/plugins/infowidget/chunkbar.h b/src/plugins/infowidget/chunkbar.h index 593acfe..361f854 100644 --- a/src/plugins/infowidget/chunkbar.h +++ b/src/plugins/infowidget/chunkbar.h @@ -24,6 +24,7 @@ #include <tqlabel.h> #include <util/bitset.h> #include <tqpixmap.h> +#include <libktorrent_export.h> class TQPainter; @@ -47,7 +48,7 @@ namespace kt * BitSets can represent which chunks are downloaded, which chunks are available * and which chunks are excluded. */ - class ChunkBar : public TQFrame + class LIBKTORRENT_EXPORT ChunkBar : public TQFrame { TQ_OBJECT diff --git a/src/plugins/infowidget/geoip/CMakeLists.txt b/src/plugins/infowidget/geoip/CMakeLists.txt new file mode 100644 index 0000000..b11354d --- /dev/null +++ b/src/plugins/infowidget/geoip/CMakeLists.txt @@ -0,0 +1,17 @@ + +##### icon files + +if( WITH_BUILTIN_FLAGS ) + file(GLOB _pics "${CMAKE_CURRENT_SOURCE_DIR}/*.png" ) + install( + FILES ${_pics} + DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME}/geoip + ) +endif( ) + +if( WITH_BUILTIN_GEOIP ) + install( + FILES geoip.dat GeoIP-LICENSE.txt + DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME}/geoip + ) +endif( ) diff --git a/src/plugins/infowidget/statustab.h b/src/plugins/infowidget/statustab.h index d044011..1a7d7ac 100644 --- a/src/plugins/infowidget/statustab.h +++ b/src/plugins/infowidget/statustab.h @@ -22,12 +22,13 @@ #define STATUSTAB_H #include "statustabbase.h" +#include <libktorrent_export.h> namespace kt { class TorrentInterface; - class StatusTab : public StatusTabBase + class LIBKTORRENT_EXPORT StatusTab : public StatusTabBase { TQ_OBJECT diff --git a/src/plugins/ipfilter/CMakeLists.txt b/src/plugins/ipfilter/CMakeLists.txt new file mode 100644 index 0000000..4de7b52 --- /dev/null +++ b/src/plugins/ipfilter/CMakeLists.txt @@ -0,0 +1,30 @@ +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/libktorrent + ${CMAKE_CURRENT_BINARY_DIR} +) + + +##### ktipfilterplugin (kpart) + +tde_add_kpart( ktipfilterplugin AUTOMOC + SOURCES + ipfilterplugin.cpp ipblockingpref.ui ipblockingprefpage.cpp ipfilterpluginsettings.kcfgc + antip2p.cpp convert_dlg.ui convertdialog.cpp + LINK + ktorrent-shared tdecore-shared tdeui-shared tdeio-shared tdeparts-shared tdehtml-shared + DESTINATION ${PLUGIN_INSTALL_DIR} +) + + +##### other files + +install( + FILES ktipfilterplugin.kcfg + DESTINATION ${KCFG_INSTALL_DIR} +) + +tde_create_translated_desktop( + SOURCE ktipfilterplugin.desktop + DESTINATION ${SERVICES_INSTALL_DIR} +) diff --git a/src/plugins/ipfilter/ipfilterplugin.cpp b/src/plugins/ipfilter/ipfilterplugin.cpp index 96f71bf..b607b47 100644 --- a/src/plugins/ipfilter/ipfilterplugin.cpp +++ b/src/plugins/ipfilter/ipfilterplugin.cpp @@ -127,3 +127,5 @@ namespace kt return version == KT_VERSION_MACRO; } } + +#include "ipfilterplugin.moc" diff --git a/src/plugins/ipfilter/ipfilterplugin.h b/src/plugins/ipfilter/ipfilterplugin.h index 2ef114a..44098a1 100644 --- a/src/plugins/ipfilter/ipfilterplugin.h +++ b/src/plugins/ipfilter/ipfilterplugin.h @@ -39,7 +39,7 @@ namespace kt * * This plugin will load IP ranges from specific files into KT IPBlocklist. */ - class IPFilterPlugin : public Plugin, public kt::IPBlockingInterface + class LIBKTORRENT_EXPORT IPFilterPlugin : public Plugin, public kt::IPBlockingInterface { TQ_OBJECT diff --git a/src/plugins/logviewer/CMakeLists.txt b/src/plugins/logviewer/CMakeLists.txt new file mode 100644 index 0000000..93d2eb4 --- /dev/null +++ b/src/plugins/logviewer/CMakeLists.txt @@ -0,0 +1,30 @@ +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/libktorrent + ${CMAKE_CURRENT_BINARY_DIR} +) + + +##### ktlogviewerplugin (kpart) + +tde_add_kpart( ktlogviewerplugin AUTOMOC + SOURCES + logviewerplugin.cpp logviewer.cpp logprefpage.cpp logprefwidgetbase.ui + logprefwidget.cpp logviewerpluginsettings.kcfgc logflags.cpp + LINK + ktorrent-shared tdecore-shared tdeui-shared tdeio-shared tdeparts-shared tdehtml-shared + DESTINATION ${PLUGIN_INSTALL_DIR} +) + + +##### other files + +install( + FILES ktlogviewerplugin.kcfg + DESTINATION ${KCFG_INSTALL_DIR} +) + +tde_create_translated_desktop( + SOURCE ktlogviewerplugin.desktop + DESTINATION ${SERVICES_INSTALL_DIR} +) diff --git a/src/plugins/partfileimport/CMakeLists.txt b/src/plugins/partfileimport/CMakeLists.txt new file mode 100644 index 0000000..53e1691 --- /dev/null +++ b/src/plugins/partfileimport/CMakeLists.txt @@ -0,0 +1,29 @@ +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/libktorrent + ${CMAKE_CURRENT_BINARY_DIR} +) + + +##### ktpartfileimportplugin (kpart) + +tde_add_kpart( ktpartfileimportplugin AUTOMOC + SOURCES + partfileimportplugin.cpp importdlgbase.ui importdialog.cpp + LINK + ktorrent-shared tdecore-shared tdeui-shared tdeio-shared tdeparts-shared tdehtml-shared + DESTINATION ${PLUGIN_INSTALL_DIR} +) + + +##### other files + +install( + FILES ktpartfileimportpluginui.rc + DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME} +) + +tde_create_translated_desktop( + SOURCE ktpartfileimportplugin.desktop + DESTINATION ${SERVICES_INSTALL_DIR} +) diff --git a/src/plugins/partfileimport/Makefile.am b/src/plugins/partfileimport/Makefile.am index 263f8a0..45fb6ba 100644 --- a/src/plugins/partfileimport/Makefile.am +++ b/src/plugins/partfileimport/Makefile.am @@ -1,5 +1,4 @@ -INCLUDES = -I$(top_builddir)/apps/ktorrent -I$(srcdir)/../../libktorrent \ - $(all_includes) +INCLUDES = -I$(srcdir)/../../libktorrent $(all_includes) METASOURCES = AUTO kde_module_LTLIBRARIES = ktpartfileimportplugin.la noinst_HEADERS = partfileimportplugin.h importdialog.h diff --git a/src/plugins/partfileimport/importdialog.cpp b/src/plugins/partfileimport/importdialog.cpp index f570012..a3cb863 100644 --- a/src/plugins/partfileimport/importdialog.cpp +++ b/src/plugins/partfileimport/importdialog.cpp @@ -383,7 +383,5 @@ namespace kt } } - - #include "importdialog.moc" diff --git a/src/plugins/rssfeed/CMakeLists.txt b/src/plugins/rssfeed/CMakeLists.txt new file mode 100644 index 0000000..4a5a0a7 --- /dev/null +++ b/src/plugins/rssfeed/CMakeLists.txt @@ -0,0 +1,39 @@ + +##### subfolders + +add_subdirectory( rss ) + + +##### current folder + +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/libktorrent + ${CMAKE_CURRENT_BINARY_DIR} +) + + +##### ktrssfeedplugin (kpart) + +tde_add_kpart( ktrssfeedplugin AUTOMOC + SOURCES + rssfeedplugin.cpp rssfeedmanager.cpp rssfeedwidget.ui rssfeed.cpp + rssfilter.cpp rssarticle.cpp rsslinkdownloader.cpp + LINK + rsslocal-static + ktorrent-shared tdecore-shared tdeui-shared tdeio-shared tdeparts-shared tdehtml-shared + DESTINATION ${PLUGIN_INSTALL_DIR} +) + + +##### other files + +install( + FILES ktrssfeedplugin.kcfg + DESTINATION ${KCFG_INSTALL_DIR} +) + +tde_create_translated_desktop( + SOURCE ktrssfeedplugin.desktop + DESTINATION ${SERVICES_INSTALL_DIR} +) diff --git a/src/plugins/rssfeed/rss/CMakeLists.txt b/src/plugins/rssfeed/rss/CMakeLists.txt new file mode 100644 index 0000000..dd9af6e --- /dev/null +++ b/src/plugins/rssfeed/rss/CMakeLists.txt @@ -0,0 +1,24 @@ +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_BINARY_DIR} +) + + +##### rsslocal library (static) + +tde_add_library( rsslocal STATIC_PIC AUTOMOC + SOURCES + article.cpp document.cpp image.cpp textinput.cpp tools_p.cpp loader.cpp +) + + +##### testlibrss (executable) + +tde_add_check_executable( testlibrss AUTOMOC + SOURCES testlibrss.cpp + LINK + rsslocal-static + ktorrent-shared tdecore-shared tdeui-shared tdeio-shared tdeparts-shared + # uncomment the following line for a real test during building + # TEST https://floss.social/@tde.rss +) diff --git a/src/plugins/rssfeed/rssfeed.cpp b/src/plugins/rssfeed/rssfeed.cpp index b479849..2e2e908 100644 --- a/src/plugins/rssfeed/rssfeed.cpp +++ b/src/plugins/rssfeed/rssfeed.cpp @@ -364,3 +364,5 @@ namespace kt { } } + +#include "rssfeed.moc" diff --git a/src/plugins/rssfeed/rssfeedmanager.cpp b/src/plugins/rssfeed/rssfeedmanager.cpp index a8ffc31..5a4b719 100644 --- a/src/plugins/rssfeed/rssfeedmanager.cpp +++ b/src/plugins/rssfeed/rssfeedmanager.cpp @@ -1316,3 +1316,5 @@ namespace kt } } + +#include "rssfeedmanager.moc" diff --git a/src/plugins/rssfeed/rssfeedplugin.cpp b/src/plugins/rssfeed/rssfeedplugin.cpp index 4a60921..7899c70 100644 --- a/src/plugins/rssfeed/rssfeedplugin.cpp +++ b/src/plugins/rssfeed/rssfeedplugin.cpp @@ -84,3 +84,5 @@ namespace kt } + +#include "rssfeedplugin.moc" diff --git a/src/plugins/rssfeed/rssfilter.cpp b/src/plugins/rssfeed/rssfilter.cpp index 32d13d0..794a51f 100644 --- a/src/plugins/rssfeed/rssfilter.cpp +++ b/src/plugins/rssfeed/rssfilter.cpp @@ -421,3 +421,5 @@ namespace kt } } + +#include "rssfilter.moc" diff --git a/src/plugins/rssfeed/rsslinkdownloader.cpp b/src/plugins/rssfeed/rsslinkdownloader.cpp index 92bb90d..53a66de 100644 --- a/src/plugins/rssfeed/rsslinkdownloader.cpp +++ b/src/plugins/rssfeed/rsslinkdownloader.cpp @@ -200,3 +200,5 @@ namespace kt } } + +#include "rsslinkdownloader.moc" diff --git a/src/plugins/scanfolder/CMakeLists.txt b/src/plugins/scanfolder/CMakeLists.txt new file mode 100644 index 0000000..ed5b9f7 --- /dev/null +++ b/src/plugins/scanfolder/CMakeLists.txt @@ -0,0 +1,30 @@ +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/libktorrent + ${CMAKE_CURRENT_BINARY_DIR} +) + + +##### ktscanfolderplugin (kpart) + +tde_add_kpart( ktscanfolderplugin AUTOMOC + SOURCES + scanfolderplugin.cpp scanfolderpluginsettings.kcfgc scanfolderprefpage.cpp + sfprefwidgetbase.ui scanfolderprefpagewidget.cpp scanfolder.cpp + LINK + ktorrent-shared tdecore-shared tdeui-shared tdeio-shared tdeparts-shared tdehtml-shared + DESTINATION ${PLUGIN_INSTALL_DIR} +) + + +##### other files + +install( + FILES ktscanfolderplugin.kcfg + DESTINATION ${KCFG_INSTALL_DIR} +) + +tde_create_translated_desktop( + SOURCE ktscanfolderplugin.desktop + DESTINATION ${SERVICES_INSTALL_DIR} +) diff --git a/src/plugins/scanfolder/scanfolderplugin.cpp b/src/plugins/scanfolder/scanfolderplugin.cpp index 710d1d0..58e1bea 100644 --- a/src/plugins/scanfolder/scanfolderplugin.cpp +++ b/src/plugins/scanfolder/scanfolderplugin.cpp @@ -185,3 +185,5 @@ namespace kt return version == KT_VERSION_MACRO; } } + +#include "scanfolderplugin.moc" diff --git a/src/plugins/scheduler/CMakeLists.txt b/src/plugins/scheduler/CMakeLists.txt new file mode 100644 index 0000000..7ce787d --- /dev/null +++ b/src/plugins/scheduler/CMakeLists.txt @@ -0,0 +1,42 @@ +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/libktorrent + ${CMAKE_CURRENT_BINARY_DIR} +) + + +##### ktschedulerplugin (kpart) + +tde_add_kpart( ktschedulerplugin AUTOMOC + SOURCES + schedulerplugin.cpp schedulerpluginsettings.kcfgc bwscheduler.cpp schedulerprefpagewidget.cpp + schedulerpage.ui bwspage.ui bwsprefpagewidget.cpp bwswidget.cpp schedulerprefpage.cpp + LINK + ktorrent-shared tdecore-shared tdeui-shared tdeio-shared tdeparts-shared tdehtml-shared + DESTINATION ${PLUGIN_INSTALL_DIR} +) + + +##### other files + +install( + FILES ktschedulerpluginui.rc + DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME} +) + +install( + FILES + cell-a-0000.png cell-a-0001.png cell-a-0002.png cell-a-0003.png cell-a-0004.png + cell-b-0000.png cell-b-0001.png cell-b-0002.png cell-b-0003.png cell-b-0004.png + DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME}/icons +) + +install( + FILES ktschedulerplugin.kcfg + DESTINATION ${KCFG_INSTALL_DIR} +) + +tde_create_translated_desktop( + SOURCE ktschedulerplugin.desktop + DESTINATION ${SERVICES_INSTALL_DIR} +) diff --git a/src/plugins/scheduler/bwswidget.cpp b/src/plugins/scheduler/bwswidget.cpp index 8585e95..aa7b5e7 100644 --- a/src/plugins/scheduler/bwswidget.cpp +++ b/src/plugins/scheduler/bwswidget.cpp @@ -332,3 +332,5 @@ namespace kt clearSelect(); } } + +#include "bwswidget.moc" diff --git a/src/plugins/scheduler/schedulerplugin.cpp b/src/plugins/scheduler/schedulerplugin.cpp index e0a71e7..5950cfa 100644 --- a/src/plugins/scheduler/schedulerplugin.cpp +++ b/src/plugins/scheduler/schedulerplugin.cpp @@ -150,3 +150,5 @@ namespace kt return version == KT_VERSION_MACRO; } } + +#include "schedulerplugin.moc" diff --git a/src/plugins/scheduler/schedulerprefpagewidget.cpp b/src/plugins/scheduler/schedulerprefpagewidget.cpp index 156f46f..7aaf61e 100644 --- a/src/plugins/scheduler/schedulerprefpagewidget.cpp +++ b/src/plugins/scheduler/schedulerprefpagewidget.cpp @@ -79,5 +79,4 @@ namespace kt } - - +#include "schedulerprefpagewidget.moc" diff --git a/src/plugins/search/CMakeLists.txt b/src/plugins/search/CMakeLists.txt new file mode 100644 index 0000000..a1b9ba0 --- /dev/null +++ b/src/plugins/search/CMakeLists.txt @@ -0,0 +1,30 @@ +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/libktorrent + ${CMAKE_CURRENT_BINARY_DIR} +) + + +##### ktsearchplugin (kpart) + +tde_add_kpart( ktsearchplugin AUTOMOC + SOURCES + searchplugin.cpp htmlpart.cpp searchbar.ui searchpref.ui searchwidget.cpp + searchprefpage.cpp searchpluginsettings.kcfgc searchtab.cpp searchenginelist.cpp + LINK + ktorrent-shared tdecore-shared tdeui-shared tdeio-shared tdeparts-shared tdehtml-shared + DESTINATION ${PLUGIN_INSTALL_DIR} +) + + +##### other files + +install( + FILES ktsearchplugin.kcfg + DESTINATION ${KCFG_INSTALL_DIR} +) + +tde_create_translated_desktop( + SOURCE ktsearchplugin.desktop + DESTINATION ${SERVICES_INSTALL_DIR} +) diff --git a/src/plugins/stats/CMakeLists.txt b/src/plugins/stats/CMakeLists.txt new file mode 100644 index 0000000..3589eb6 --- /dev/null +++ b/src/plugins/stats/CMakeLists.txt @@ -0,0 +1,31 @@ +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/libktorrent + ${CMAKE_CURRENT_BINARY_DIR} +) + + +##### ktstatsplugin (kpart) + +tde_add_kpart( ktstatsplugin AUTOMOC + SOURCES + ChartDrawerData.cpp ChartDrawer.cpp statsspdwgt.ui statsconwgt.ui StatsSpd.cpp + StatsCon.cpp sprefwgt.ui statspluginsettings.kcfgc StatsPluginPrefsPage.cpp + StatsPluginPrefs.cpp statsplugin.cpp + LINK + ktorrent-shared tdecore-shared tdeui-shared tdeio-shared tdeparts-shared tdehtml-shared + DESTINATION ${PLUGIN_INSTALL_DIR} +) + + +##### other files + +install( + FILES ktstatsplugin.kcfg + DESTINATION ${KCFG_INSTALL_DIR} +) + +tde_create_translated_desktop( + SOURCE ktstatsplugin.desktop + DESTINATION ${SERVICES_INSTALL_DIR} +) diff --git a/src/plugins/upnp/CMakeLists.txt b/src/plugins/upnp/CMakeLists.txt new file mode 100644 index 0000000..c68b2e4 --- /dev/null +++ b/src/plugins/upnp/CMakeLists.txt @@ -0,0 +1,36 @@ +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/libktorrent + ${CMAKE_CURRENT_BINARY_DIR} +) + + +##### ktupnpplugin (kpart) + +tde_add_library( ktupnp STATIC_PIC AUTOMOC + SOURCES + soap.cpp upnpdescriptionparser.cpp upnpmcastsocket.cpp upnprouter.cpp +) + +tde_add_kpart( ktupnpplugin AUTOMOC + SOURCES + upnpplugin.cpp upnpprefpage.cpp upnpwidget.ui upnpprefwidget.cpp upnppluginsettings.kcfgc + EMBED + ktupnp-static + LINK + ktorrent-shared tdecore-shared tdeui-shared tdeio-shared tdeparts-shared tdehtml-shared + DESTINATION ${PLUGIN_INSTALL_DIR} +) + + +##### other files + +install( + FILES ktupnpplugin.kcfg + DESTINATION ${KCFG_INSTALL_DIR} +) + +tde_create_translated_desktop( + SOURCE ktupnpplugin.desktop + DESTINATION ${SERVICES_INSTALL_DIR} +) diff --git a/src/plugins/webinterface/CMakeLists.txt b/src/plugins/webinterface/CMakeLists.txt new file mode 100644 index 0000000..28925a4 --- /dev/null +++ b/src/plugins/webinterface/CMakeLists.txt @@ -0,0 +1,40 @@ + +##### subfolders + +add_subdirectory( www ) + + +##### current folder + +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_SOURCE_DIR}/src/libktorrent + ${CMAKE_BINARY_DIR}/src/libktorrent +) + + +##### ktwebinterfaceplugin (kpart) + +tde_add_kpart( ktwebinterfaceplugin AUTOMOC + SOURCES + webinterfaceplugin.cpp httpserver.cpp php_handler.cpp php_interface.cpp webinterfacepref.ui + webinterfacepluginsettings.kcfgc webinterfaceprefwidget.cpp webinterfaceprefpage.cpp + httpclienthandler.cpp httpresponseheader.cpp + LINK + ktorrent-shared tdecore-shared tdeui-shared tdeio-shared tdeparts-shared tdehtml-shared + DESTINATION ${PLUGIN_INSTALL_DIR} +) + + +##### other files + +install( + FILES ktwebinterfaceplugin.kcfg + DESTINATION ${KCFG_INSTALL_DIR} +) + +tde_create_translated_desktop( + SOURCE ktwebinterfaceplugin.desktop + DESTINATION ${SERVICES_INSTALL_DIR} +) diff --git a/src/plugins/webinterface/www/CMakeLists.txt b/src/plugins/webinterface/www/CMakeLists.txt new file mode 100644 index 0000000..42b186a --- /dev/null +++ b/src/plugins/webinterface/www/CMakeLists.txt @@ -0,0 +1 @@ +tde_auto_add_subdirectories() diff --git a/src/plugins/webinterface/www/coldmilk/CMakeLists.txt b/src/plugins/webinterface/www/coldmilk/CMakeLists.txt new file mode 100644 index 0000000..0e62c03 --- /dev/null +++ b/src/plugins/webinterface/www/coldmilk/CMakeLists.txt @@ -0,0 +1,14 @@ + +##### subfolders + +add_subdirectory( icons ) + + +##### other files + +install( + FILES + favicon.ico icon.png interface.js interface.php login.html + page_update.js rest.php shutdown.php style.css + DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME}/www/coldmilk +) diff --git a/src/plugins/webinterface/www/coldmilk/icons/16x16/CMakeLists.txt b/src/plugins/webinterface/www/coldmilk/icons/16x16/CMakeLists.txt new file mode 100644 index 0000000..890999c --- /dev/null +++ b/src/plugins/webinterface/www/coldmilk/icons/16x16/CMakeLists.txt @@ -0,0 +1,7 @@ + +##### icon files + +install( + FILES edit_user.png high_priority.png low_priority.png normal_priority.png only_seed.png + DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME}/www/coldmilk/icons/16x16 +) diff --git a/src/plugins/webinterface/www/coldmilk/icons/22x22/CMakeLists.txt b/src/plugins/webinterface/www/coldmilk/icons/22x22/CMakeLists.txt new file mode 100644 index 0000000..fc75d62 --- /dev/null +++ b/src/plugins/webinterface/www/coldmilk/icons/22x22/CMakeLists.txt @@ -0,0 +1,7 @@ + +##### icon files + +install( + FILES exit.png ktstart_all.png ktstop_all.png remove.png start.png stop.png + DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME}/www/coldmilk/icons/22x22 +) diff --git a/src/plugins/webinterface/www/coldmilk/icons/32x32/CMakeLists.txt b/src/plugins/webinterface/www/coldmilk/icons/32x32/CMakeLists.txt new file mode 100644 index 0000000..50cbc0f --- /dev/null +++ b/src/plugins/webinterface/www/coldmilk/icons/32x32/CMakeLists.txt @@ -0,0 +1,7 @@ + +##### icon files + +install( + FILES configure.png extender_opened.png fileopen.png folder1.png + DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME}/www/coldmilk/icons/32x32 +) diff --git a/src/plugins/webinterface/www/coldmilk/icons/48x48/CMakeLists.txt b/src/plugins/webinterface/www/coldmilk/icons/48x48/CMakeLists.txt new file mode 100644 index 0000000..24ecf55 --- /dev/null +++ b/src/plugins/webinterface/www/coldmilk/icons/48x48/CMakeLists.txt @@ -0,0 +1,7 @@ + +##### icon files + +install( + FILES exit.png switchuser.png + DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME}/www/coldmilk/icons/48x48 +) diff --git a/src/plugins/webinterface/www/coldmilk/icons/64x64/CMakeLists.txt b/src/plugins/webinterface/www/coldmilk/icons/64x64/CMakeLists.txt new file mode 100644 index 0000000..f5f01d8 --- /dev/null +++ b/src/plugins/webinterface/www/coldmilk/icons/64x64/CMakeLists.txt @@ -0,0 +1,7 @@ + +##### icon files + +install( + FILES down.png folder1_man.png looknfeel.png + DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME}/www/coldmilk/icons/64x64 +) diff --git a/src/plugins/webinterface/www/coldmilk/icons/CMakeLists.txt b/src/plugins/webinterface/www/coldmilk/icons/CMakeLists.txt new file mode 100644 index 0000000..9a574a7 --- /dev/null +++ b/src/plugins/webinterface/www/coldmilk/icons/CMakeLists.txt @@ -0,0 +1,13 @@ +##### install icons for each size + +file( GLOB icon_sizes RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*" ) + +foreach( icon_size IN LISTS icon_sizes ) + if( IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${icon_size} ) + file( GLOB icons RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "${icon_size}/*.png" ) + install( + FILES ${icons} + DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME}/www/coldmilk/icons/${icon_size} + ) + endif() +endforeach() diff --git a/src/plugins/webinterface/www/default/CMakeLists.txt b/src/plugins/webinterface/www/default/CMakeLists.txt new file mode 100644 index 0000000..671fda7 --- /dev/null +++ b/src/plugins/webinterface/www/default/CMakeLists.txt @@ -0,0 +1,11 @@ + +##### other files + +install( + FILES + details.php only_seed.png favicon.ico grad1.jpg grad2.jpg menu_bg.png + header_tile.png high_priority.png icon.png interface.php ktorrentwebinterfacelogo.png + login.html low_priority.png normal_priority.png remove.png shutdown.php start.png + stop.png style.css stylen.css wz_tooltip.js + DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME}/www/default +) diff --git a/src/plugins/webinterface/www/mobile/CMakeLists.txt b/src/plugins/webinterface/www/mobile/CMakeLists.txt new file mode 100644 index 0000000..920c4d8 --- /dev/null +++ b/src/plugins/webinterface/www/mobile/CMakeLists.txt @@ -0,0 +1,9 @@ + +##### other files + +install( + FILES + favicon.ico interface.php ktorrentwebinterfacelogo.png login.html + remove.png start.png stop.png settings.php torrent.php + DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME}/www/mobile +) diff --git a/src/plugins/zeroconf/CMakeLists.txt b/src/plugins/zeroconf/CMakeLists.txt new file mode 100644 index 0000000..c70392b --- /dev/null +++ b/src/plugins/zeroconf/CMakeLists.txt @@ -0,0 +1,25 @@ +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/libktorrent + ${CMAKE_CURRENT_BINARY_DIR} +) + + +##### ktzeroconfplugin (kpart) + +tde_add_kpart( ktzeroconfplugin AUTOMOC + SOURCES + localbrowser.cpp avahiservice.cpp zeroconfplugin.cpp + LINK + ktorrent-shared tdecore-shared tdeui-shared tdeio-shared tdeparts-shared tdehtml-shared + ${AVAHI_TQT_LIBRARIES} ${AVAHI_CLIENT_LIBRARIES} + DESTINATION ${PLUGIN_INSTALL_DIR} +) + + +##### other files + +tde_create_translated_desktop( + SOURCE ktzeroconfplugin.desktop + DESTINATION ${SERVICES_INSTALL_DIR} +) diff --git a/src/scripts/CMakeLists.txt b/src/scripts/CMakeLists.txt new file mode 100644 index 0000000..dad1ddf --- /dev/null +++ b/src/scripts/CMakeLists.txt @@ -0,0 +1,7 @@ + +##### other files + +install( + PROGRAMS ktshell + DESTINATION ${BIN_INSTALL_DIR} +) |