mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-07 13:41:26 -07:00
Merge pull request #12718 from glassez/improve-cmake
Improve CMake project
This commit is contained in:
commit
4e7ff88cf4
36 changed files with 491 additions and 570 deletions
|
@ -97,7 +97,7 @@ before_install:
|
||||||
- |
|
- |
|
||||||
if [ "$gui" = "false" ]; then
|
if [ "$gui" = "false" ]; then
|
||||||
qmake_conf="$qmake_conf --disable-gui"
|
qmake_conf="$qmake_conf --disable-gui"
|
||||||
cmake_conf="$cmake_conf -DCMAKE_DISABLE_FIND_PACKAGE_Qt5Widgets=ON"
|
cmake_conf="$cmake_conf -DGUI=OFF"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# print settings
|
# print settings
|
||||||
|
|
|
@ -52,7 +52,7 @@ set(requiredLibtorrentVersion 1.1.10)
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
include(winconf)
|
include(winconf)
|
||||||
endif(WIN32)
|
endif()
|
||||||
|
|
||||||
|
|
||||||
# we need options here, at the top level, because they are used not only in "src" subdir, but in the "dist" dir too
|
# we need options here, at the top level, because they are used not only in "src" subdir, but in the "dist" dir too
|
||||||
|
@ -62,6 +62,8 @@ optional_compile_definitions(COUNTRIES_RESOLUTION FEATURE DESCRIPTION "Enable re
|
||||||
DEFAULT ON DISABLED DISABLE_COUNTRIES_RESOLUTION)
|
DEFAULT ON DISABLED DISABLE_COUNTRIES_RESOLUTION)
|
||||||
optional_compile_definitions(STACKTRACE FEATURE DESCRIPTION "Enable stacktraces"
|
optional_compile_definitions(STACKTRACE FEATURE DESCRIPTION "Enable stacktraces"
|
||||||
DEFAULT ON ENABLED STACKTRACE)
|
DEFAULT ON ENABLED STACKTRACE)
|
||||||
|
optional_compile_definitions(GUI FEATURE DESCRIPTION "Build GUI application"
|
||||||
|
DEFAULT ON DISABLED DISABLE_GUI)
|
||||||
optional_compile_definitions(WEBUI FEATURE DESCRIPTION "Enables built-in HTTP server for headless use"
|
optional_compile_definitions(WEBUI FEATURE DESCRIPTION "Enables built-in HTTP server for headless use"
|
||||||
DEFAULT ON DISABLED DISABLE_WEBUI)
|
DEFAULT ON DISABLED DISABLE_WEBUI)
|
||||||
|
|
||||||
|
|
9
dist/CMakeLists.txt
vendored
9
dist/CMakeLists.txt
vendored
|
@ -2,11 +2,8 @@ find_package(Qt5Widgets ${requiredQtVersion}) # to conditionally install desktop
|
||||||
|
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
add_subdirectory(mac)
|
add_subdirectory(mac)
|
||||||
else (APPLE)
|
elseif (UNIX)
|
||||||
if (UNIX)
|
|
||||||
add_subdirectory(unix)
|
add_subdirectory(unix)
|
||||||
endif (UNIX)
|
elseif (WIN32)
|
||||||
if (WIN32)
|
|
||||||
add_subdirectory(windows)
|
add_subdirectory(windows)
|
||||||
endif (WIN32)
|
endif()
|
||||||
endif (APPLE)
|
|
||||||
|
|
|
@ -12,19 +12,13 @@ if (Boost_VERSION VERSION_LESS 106000)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_package(Qt5 ${requiredQtVersion} REQUIRED COMPONENTS Core Network Xml LinguistTools)
|
find_package(Qt5 ${requiredQtVersion} REQUIRED COMPONENTS Core Network Xml LinguistTools)
|
||||||
find_package(Qt5Widgets ${requiredQtVersion})
|
if (NOT DISABLE_GUI)
|
||||||
if (Qt5Widgets_FOUND)
|
find_package(Qt5Widgets ${requiredQtVersion} REQUIRED)
|
||||||
find_package(Qt5DBus ${requiredQtVersion})
|
find_package(Qt5DBus ${requiredQtVersion})
|
||||||
else()
|
else()
|
||||||
add_definitions(-DDISABLE_GUI)
|
add_definitions(-DDISABLE_GUI)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set_package_properties(Qt5Widgets PROPERTIES
|
|
||||||
DESCRIPTION "Set of components for creating classic desktop-style UIs for the Qt5 framework"
|
|
||||||
PURPOSE "Enables qBittorrent GUI. Unneeded for headless configuration."
|
|
||||||
TYPE OPTIONAL
|
|
||||||
)
|
|
||||||
|
|
||||||
set_package_properties(Qt5DBus PROPERTIES
|
set_package_properties(Qt5DBus PROPERTIES
|
||||||
DESCRIPTION "Qt5 module for inter-process communication over the D-Bus protocol"
|
DESCRIPTION "Qt5 module for inter-process communication over the D-Bus protocol"
|
||||||
PURPOSE "Enables communication with other system components (e.g. notification service) via D-Bus. "
|
PURPOSE "Enables communication with other system components (e.g. notification service) via D-Bus. "
|
||||||
|
@ -60,7 +54,7 @@ configure_file(config.h.cmakein ${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
||||||
add_subdirectory(app)
|
add_subdirectory(app)
|
||||||
add_subdirectory(base)
|
add_subdirectory(base)
|
||||||
|
|
||||||
if (Qt5Widgets_FOUND)
|
if (NOT DISABLE_GUI)
|
||||||
add_subdirectory(gui)
|
add_subdirectory(gui)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
|
|
@ -18,16 +18,14 @@ upgrade.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(qBittorrent PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
|
target_include_directories(qBittorrent PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
|
||||||
target_link_libraries(qBittorrent
|
target_link_libraries(qBittorrent PRIVATE qbt_base)
|
||||||
PRIVATE
|
|
||||||
qbt_base
|
|
||||||
)
|
|
||||||
|
|
||||||
set_target_properties(qBittorrent
|
set_target_properties(qBittorrent
|
||||||
PROPERTIES
|
PROPERTIES
|
||||||
AUTOUIC True
|
AUTOUIC True
|
||||||
AUTORCC True
|
AUTORCC True
|
||||||
MACOSX_BUNDLE True
|
MACOSX_BUNDLE True
|
||||||
|
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
|
||||||
)
|
)
|
||||||
|
|
||||||
# translations
|
# translations
|
||||||
|
@ -53,49 +51,53 @@ qt5_add_resources(QBT_APP_RESOURCE_SOURCE ${QBT_APP_RESOURCES})
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
if (MINGW)
|
if (MINGW)
|
||||||
target_sources(qBittorrent PRIVATE ../qbittorrent_mingw.rc)
|
target_sources(qBittorrent PRIVATE ../qbittorrent_mingw.rc)
|
||||||
else (MINGW)
|
else()
|
||||||
target_sources(qBittorrent PRIVATE ../qbittorrent.rc)
|
target_sources(qBittorrent PRIVATE ../qbittorrent.rc)
|
||||||
endif (MINGW)
|
endif()
|
||||||
|
|
||||||
target_sources(qBittorrent PRIVATE ../qbittorrent.exe.manifest)
|
target_sources(qBittorrent PRIVATE ../qbittorrent.exe.manifest)
|
||||||
endif (WIN32)
|
endif()
|
||||||
|
|
||||||
if (STACKTRACE)
|
if (STACKTRACE)
|
||||||
if (UNIX)
|
if (UNIX)
|
||||||
target_sources(qBittorrent PRIVATE stacktrace.h)
|
target_sources(qBittorrent PRIVATE stacktrace.h)
|
||||||
else (UNIX)
|
else()
|
||||||
target_sources(qBittorrent PRIVATE stacktrace_win.h)
|
target_sources(qBittorrent PRIVATE stacktrace_win.h)
|
||||||
if (Qt5Widgets_FOUND)
|
if (NOT DISABLE_GUI)
|
||||||
target_sources(qBittorrent PRIVATE stacktracedialog.cpp stacktracedialog.h)
|
target_sources(qBittorrent PRIVATE stacktracedialog.cpp stacktracedialog.h)
|
||||||
endif (Qt5Widgets_FOUND)
|
endif()
|
||||||
|
|
||||||
if (MSVC)
|
if (MSVC)
|
||||||
if (NOT "${WINXXBITS}" STREQUAL "Win64")
|
if (NOT "${WINXXBITS}" STREQUAL "Win64")
|
||||||
# i686 arch requires frame pointer preservation
|
# i686 arch requires frame pointer preservation
|
||||||
add_compile_options(-Oy-)
|
add_compile_options(-Oy-)
|
||||||
endif (NOT "${WINXXBITS}" STREQUAL "Win64")
|
endif()
|
||||||
|
|
||||||
add_compile_options(-Zi)
|
add_compile_options(-Zi)
|
||||||
target_link_libraries(qBittorrent PUBLIC dbghelp -DEBUG)
|
target_link_libraries(qBittorrent PUBLIC dbghelp -DEBUG)
|
||||||
else (MSVC)
|
else()
|
||||||
if (NOT "${WINXXBITS}" STREQUAL "Win64")
|
if (NOT "${WINXXBITS}" STREQUAL "Win64")
|
||||||
add_compile_options(-fno-omit-frame-pointer)
|
add_compile_options(-fno-omit-frame-pointer)
|
||||||
endif (NOT "${WINXXBITS}" STREQUAL "Win64")
|
endif()
|
||||||
target_link_libraries(qBittorrent PUBLIC dbghelp -Wl,--export-all-symbols)
|
|
||||||
endif (MSVC)
|
|
||||||
endif (UNIX)
|
|
||||||
endif (STACKTRACE)
|
|
||||||
|
|
||||||
if (Qt5Widgets_FOUND)
|
target_link_libraries(qBittorrent PUBLIC dbghelp -Wl,--export-all-symbols)
|
||||||
target_link_libraries(qBittorrent PRIVATE qbt_searchengine qbt_gui)
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (NOT DISABLE_GUI)
|
||||||
|
target_link_libraries(qBittorrent PRIVATE qbt_gui)
|
||||||
set_target_properties(qBittorrent
|
set_target_properties(qBittorrent
|
||||||
PROPERTIES
|
PROPERTIES
|
||||||
OUTPUT_NAME qbittorrent
|
OUTPUT_NAME qbittorrent
|
||||||
WIN32_EXECUTABLE True
|
WIN32_EXECUTABLE True
|
||||||
)
|
)
|
||||||
else(Qt5Widgets_FOUND)
|
else()
|
||||||
set_target_properties(qBittorrent
|
set_target_properties(qBittorrent
|
||||||
PROPERTIES
|
PROPERTIES
|
||||||
OUTPUT_NAME qbittorrent-nox
|
OUTPUT_NAME qbittorrent-nox
|
||||||
)
|
)
|
||||||
endif (Qt5Widgets_FOUND)
|
endif()
|
||||||
|
|
||||||
if (NOT DISABLE_WEBUI)
|
if (NOT DISABLE_WEBUI)
|
||||||
target_link_libraries(qBittorrent PRIVATE qbt_webui)
|
target_link_libraries(qBittorrent PRIVATE qbt_webui)
|
||||||
|
@ -127,9 +129,8 @@ if (APPLE)
|
||||||
${QT_TR_DIR}/qt_zh_CN.qm
|
${QT_TR_DIR}/qt_zh_CN.qm
|
||||||
)
|
)
|
||||||
list(APPEND QBT_APP_RESOURCE_SOURCE ${QT_TRANSLATIONS})
|
list(APPEND QBT_APP_RESOURCE_SOURCE ${QT_TRANSLATIONS})
|
||||||
set_source_files_properties(${QT_TRANSLATIONS}
|
set_source_files_properties(${QT_TRANSLATIONS} PROPERTIES MACOSX_PACKAGE_LOCATION translations)
|
||||||
PROPERTIES MACOSX_PACKAGE_LOCATION translations)
|
endif()
|
||||||
endif (APPLE)
|
|
||||||
|
|
||||||
target_sources(qBittorrent PRIVATE ${QBT_QM_FILES} ${QBT_APP_RESOURCE_SOURCE})
|
target_sources(qBittorrent PRIVATE ${QBT_QM_FILES} ${QBT_APP_RESOURCE_SOURCE})
|
||||||
|
|
||||||
|
@ -146,15 +147,16 @@ if (APPLE)
|
||||||
MACOSX_BUNDLE_BUNDLE_NAME "${qbt_BUNDLE_NAME}"
|
MACOSX_BUNDLE_BUNDLE_NAME "${qbt_BUNDLE_NAME}"
|
||||||
MACOSX_BUNDLE_INFO_PLIST ${qBittorrent_BINARY_DIR}/dist/mac/Info.plist
|
MACOSX_BUNDLE_INFO_PLIST ${qBittorrent_BINARY_DIR}/dist/mac/Info.plist
|
||||||
)
|
)
|
||||||
endif (APPLE)
|
endif()
|
||||||
|
|
||||||
# installation
|
# installation
|
||||||
install(TARGETS qBittorrent
|
install(TARGETS qBittorrent
|
||||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||||
BUNDLE DESTINATION .
|
BUNDLE DESTINATION .
|
||||||
COMPONENT runtime)
|
COMPONENT runtime
|
||||||
|
)
|
||||||
|
|
||||||
if (Qt5Widgets_FOUND AND APPLE)
|
if (NOT DISABLE_GUI AND APPLE)
|
||||||
find_package(Qt5Svg REQUIRED)
|
find_package(Qt5Svg REQUIRED)
|
||||||
include(bundle)
|
include(bundle)
|
||||||
endif (Qt5Widgets_FOUND AND APPLE)
|
endif()
|
||||||
|
|
|
@ -85,11 +85,11 @@
|
||||||
#include "filelogger.h"
|
#include "filelogger.h"
|
||||||
|
|
||||||
#ifndef DISABLE_GUI
|
#ifndef DISABLE_GUI
|
||||||
#include "addnewtorrentdialog.h"
|
#include "gui/addnewtorrentdialog.h"
|
||||||
#include "gui/uithememanager.h"
|
#include "gui/uithememanager.h"
|
||||||
#include "gui/utils.h"
|
#include "gui/utils.h"
|
||||||
#include "mainwindow.h"
|
#include "gui/mainwindow.h"
|
||||||
#include "shutdownconfirmdialog.h"
|
#include "gui/shutdownconfirmdialog.h"
|
||||||
#endif // DISABLE_GUI
|
#endif // DISABLE_GUI
|
||||||
|
|
||||||
#ifndef DISABLE_WEBUI
|
#ifndef DISABLE_WEBUI
|
||||||
|
|
|
@ -164,10 +164,6 @@ target_link_libraries(qbt_base
|
||||||
Qt5::Core Qt5::Network Qt5::Xml
|
Qt5::Core Qt5::Network Qt5::Xml
|
||||||
)
|
)
|
||||||
|
|
||||||
if (Qt5Widgets_FOUND)
|
|
||||||
target_link_libraries(qbt_base PUBLIC Qt5::Gui Qt5::Widgets)
|
|
||||||
endif (Qt5Widgets_FOUND)
|
|
||||||
|
|
||||||
if (Qt5DBus_FOUND)
|
if (Qt5DBus_FOUND)
|
||||||
target_link_libraries(qbt_base PRIVATE Qt5::DBus)
|
target_link_libraries(qbt_base PRIVATE Qt5::DBus)
|
||||||
endif()
|
endif()
|
||||||
|
@ -177,4 +173,4 @@ if (APPLE)
|
||||||
find_library(Carbon_LIBRARY Carbon)
|
find_library(Carbon_LIBRARY Carbon)
|
||||||
find_library(AppKit_LIBRARY AppKit)
|
find_library(AppKit_LIBRARY AppKit)
|
||||||
target_link_libraries(qbt_base PRIVATE ${Carbon_LIBRARY} ${IOKit_LIBRARY} ${AppKit_LIBRARY})
|
target_link_libraries(qbt_base PRIVATE ${Carbon_LIBRARY} ${IOKit_LIBRARY} ${AppKit_LIBRARY})
|
||||||
endif (APPLE)
|
endif()
|
||||||
|
|
|
@ -38,6 +38,7 @@
|
||||||
#include <shlobj.h>
|
#include <shlobj.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <QCoreApplication>
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QLocale>
|
#include <QLocale>
|
||||||
|
@ -47,12 +48,6 @@
|
||||||
#include <QTime>
|
#include <QTime>
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
|
|
||||||
#ifndef DISABLE_GUI
|
|
||||||
#include <QApplication>
|
|
||||||
#else
|
|
||||||
#include <QCoreApplication>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
#include <QRegularExpression>
|
#include <QRegularExpression>
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,14 +1,6 @@
|
||||||
set(CMAKE_AUTORCC True)
|
set(CMAKE_AUTORCC True)
|
||||||
set(CMAKE_AUTOUIC True)
|
set(CMAKE_AUTOUIC True)
|
||||||
|
|
||||||
add_library(qbt_gui_headers INTERFACE)
|
|
||||||
target_include_directories(qbt_gui_headers INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
|
|
||||||
|
|
||||||
add_subdirectory(properties)
|
|
||||||
add_subdirectory(powermanagement)
|
|
||||||
add_subdirectory(rss)
|
|
||||||
add_subdirectory(search)
|
|
||||||
|
|
||||||
add_library(qbt_gui STATIC
|
add_library(qbt_gui STATIC
|
||||||
# headers
|
# headers
|
||||||
aboutdialog.h
|
aboutdialog.h
|
||||||
|
@ -28,9 +20,6 @@ fspathedit.h
|
||||||
hidabletabwidget.h
|
hidabletabwidget.h
|
||||||
ipsubnetwhitelistoptionsdialog.h
|
ipsubnetwhitelistoptionsdialog.h
|
||||||
lineedit.h
|
lineedit.h
|
||||||
log/logfiltermodel.h
|
|
||||||
log/loglistview.h
|
|
||||||
log/logmodel.h
|
|
||||||
mainwindow.h
|
mainwindow.h
|
||||||
optionsdialog.h
|
optionsdialog.h
|
||||||
previewlistdelegate.h
|
previewlistdelegate.h
|
||||||
|
@ -83,9 +72,6 @@ fspathedit.cpp
|
||||||
hidabletabwidget.cpp
|
hidabletabwidget.cpp
|
||||||
ipsubnetwhitelistoptionsdialog.cpp
|
ipsubnetwhitelistoptionsdialog.cpp
|
||||||
lineedit.cpp
|
lineedit.cpp
|
||||||
log/logfiltermodel.cpp
|
|
||||||
log/loglistview.cpp
|
|
||||||
log/logmodel.cpp
|
|
||||||
mainwindow.cpp
|
mainwindow.cpp
|
||||||
optionsdialog.cpp
|
optionsdialog.cpp
|
||||||
previewlistdelegate.cpp
|
previewlistdelegate.cpp
|
||||||
|
@ -140,37 +126,40 @@ torrentcategorydialog.ui
|
||||||
torrentcreatordialog.ui
|
torrentcreatordialog.ui
|
||||||
trackerentriesdialog.ui
|
trackerentriesdialog.ui
|
||||||
updownratiodialog.ui
|
updownratiodialog.ui
|
||||||
|
|
||||||
|
# resources
|
||||||
|
about.qrc
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(qbt_gui
|
if (WIN32 OR APPLE)
|
||||||
PRIVATE
|
target_sources(qbt_gui PRIVATE programupdater.h programupdater.cpp)
|
||||||
qbt_powermanagement qbt_rss qbt_properties qbt_searchengine
|
endif()
|
||||||
qbt_base
|
|
||||||
)
|
|
||||||
|
|
||||||
target_include_directories(qbt_gui
|
add_subdirectory(log)
|
||||||
PRIVATE ../app
|
add_subdirectory(properties)
|
||||||
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
|
add_subdirectory(powermanagement)
|
||||||
)
|
add_subdirectory(rss)
|
||||||
|
add_subdirectory(search)
|
||||||
|
|
||||||
if (UNIX AND Qt5DBus_FOUND)
|
if (UNIX AND Qt5DBus_FOUND)
|
||||||
add_subdirectory(qtnotify)
|
add_subdirectory(qtnotify)
|
||||||
target_link_libraries(qbt_gui PRIVATE qbt_qtnotify)
|
target_link_libraries(qbt_gui PRIVATE Qt5::DBus)
|
||||||
endif (UNIX AND Qt5DBus_FOUND)
|
endif()
|
||||||
|
|
||||||
|
target_link_libraries(qbt_gui
|
||||||
|
PRIVATE
|
||||||
|
qbt_base
|
||||||
|
PUBLIC
|
||||||
|
Qt5::Gui Qt5::Widgets
|
||||||
|
)
|
||||||
|
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
target_sources(qbt_gui PRIVATE macutilities.h macutilities.mm)
|
target_sources(qbt_gui PRIVATE macutilities.h macutilities.mm)
|
||||||
find_package(Qt5 ${requiredQtVersion} REQUIRED COMPONENTS MacExtras)
|
find_package(Qt5 ${requiredQtVersion} REQUIRED COMPONENTS MacExtras)
|
||||||
target_link_libraries(qbt_gui PRIVATE Qt5::MacExtras objc)
|
target_link_libraries(qbt_gui PRIVATE Qt5::MacExtras objc)
|
||||||
endif (APPLE)
|
endif()
|
||||||
|
|
||||||
if (WIN32 OR APPLE)
|
|
||||||
target_sources(qbt_gui PRIVATE programupdater.h programupdater.cpp)
|
|
||||||
endif (WIN32 OR APPLE)
|
|
||||||
|
|
||||||
qbt_target_sources(qBittorrent PRIVATE about.qrc)
|
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
find_package(Qt5 ${requiredQtVersion} REQUIRED COMPONENTS WinExtras)
|
find_package(Qt5 ${requiredQtVersion} REQUIRED COMPONENTS WinExtras)
|
||||||
target_link_libraries(qbt_gui PRIVATE Qt5::WinExtras)
|
target_link_libraries(qbt_gui PRIVATE Qt5::WinExtras PowrProf)
|
||||||
endif(WIN32)
|
endif()
|
||||||
|
|
|
@ -51,7 +51,7 @@
|
||||||
#include "base/utils/misc.h"
|
#include "base/utils/misc.h"
|
||||||
#include "base/utils/string.h"
|
#include "base/utils/string.h"
|
||||||
#include "autoexpandabledialog.h"
|
#include "autoexpandabledialog.h"
|
||||||
#include "proplistdelegate.h"
|
#include "properties/proplistdelegate.h"
|
||||||
#include "raisedmessagebox.h"
|
#include "raisedmessagebox.h"
|
||||||
#include "torrentcontentfiltermodel.h"
|
#include "torrentcontentfiltermodel.h"
|
||||||
#include "torrentcontentmodel.h"
|
#include "torrentcontentmodel.h"
|
||||||
|
|
11
src/gui/log/CMakeLists.txt
Normal file
11
src/gui/log/CMakeLists.txt
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
target_sources(qbt_gui PRIVATE
|
||||||
|
# headers
|
||||||
|
logfiltermodel.h
|
||||||
|
loglistview.h
|
||||||
|
logmodel.h
|
||||||
|
|
||||||
|
#sources
|
||||||
|
logfiltermodel.cpp
|
||||||
|
loglistview.cpp
|
||||||
|
logmodel.cpp
|
||||||
|
)
|
|
@ -37,8 +37,8 @@
|
||||||
#include <QStyle>
|
#include <QStyle>
|
||||||
#include <QStyledItemDelegate>
|
#include <QStyledItemDelegate>
|
||||||
|
|
||||||
|
#include "gui/uithememanager.h"
|
||||||
#include "logmodel.h"
|
#include "logmodel.h"
|
||||||
#include "uithememanager.h"
|
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
|
|
|
@ -51,7 +51,7 @@
|
||||||
#endif
|
#endif
|
||||||
#if (defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)) && defined(QT_DBUS_LIB)
|
#if (defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)) && defined(QT_DBUS_LIB)
|
||||||
#include <QDBusConnection>
|
#include <QDBusConnection>
|
||||||
#include "notifications.h"
|
#include "qtnotify/notifications.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "base/bittorrent/session.h"
|
#include "base/bittorrent/session.h"
|
||||||
|
@ -77,16 +77,17 @@
|
||||||
#include "hidabletabwidget.h"
|
#include "hidabletabwidget.h"
|
||||||
#include "lineedit.h"
|
#include "lineedit.h"
|
||||||
#include "optionsdialog.h"
|
#include "optionsdialog.h"
|
||||||
#include "peerlistwidget.h"
|
#include "powermanagement/powermanagement.h"
|
||||||
#include "powermanagement.h"
|
#include "properties/peerlistwidget.h"
|
||||||
#include "propertieswidget.h"
|
#include "properties/propertieswidget.h"
|
||||||
|
#include "properties/trackerlistwidget.h"
|
||||||
#include "rss/rsswidget.h"
|
#include "rss/rsswidget.h"
|
||||||
#include "search/searchwidget.h"
|
#include "search/searchwidget.h"
|
||||||
#include "speedlimitdialog.h"
|
#include "speedlimitdialog.h"
|
||||||
#include "statsdialog.h"
|
#include "statsdialog.h"
|
||||||
#include "statusbar.h"
|
#include "statusbar.h"
|
||||||
#include "torrentcreatordialog.h"
|
#include "torrentcreatordialog.h"
|
||||||
#include "trackerlistwidget.h"
|
|
||||||
#include "transferlistfilterswidget.h"
|
#include "transferlistfilterswidget.h"
|
||||||
#include "transferlistmodel.h"
|
#include "transferlistmodel.h"
|
||||||
#include "transferlistwidget.h"
|
#include "transferlistwidget.h"
|
||||||
|
|
|
@ -1,23 +1,8 @@
|
||||||
add_library(qbt_powermanagement STATIC
|
target_sources(qbt_gui PRIVATE powermanagement.h powermanagement.cpp)
|
||||||
# headers
|
|
||||||
powermanagement.h
|
|
||||||
|
|
||||||
# sources
|
|
||||||
powermanagement.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
target_link_libraries(qbt_powermanagement PUBLIC Qt5::Core)
|
|
||||||
set_target_properties(qbt_powermanagement PROPERTIES AUTOUIC False AUTORCC False)
|
|
||||||
target_include_directories(qbt_powermanagement PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
|
||||||
|
|
||||||
if (UNIX AND Qt5DBus_FOUND)
|
if (UNIX AND Qt5DBus_FOUND)
|
||||||
find_package(X11)
|
find_package(X11)
|
||||||
if (X11_FOUND)
|
if (X11_FOUND)
|
||||||
target_sources(qbt_powermanagement PRIVATE powermanagement_x11.h powermanagement_x11.cpp)
|
target_sources(qbt_gui PRIVATE powermanagement_x11.h powermanagement_x11.cpp)
|
||||||
target_link_libraries(qbt_powermanagement PRIVATE Qt5::DBus)
|
endif()
|
||||||
endif (X11_FOUND)
|
endif()
|
||||||
endif (UNIX AND Qt5DBus_FOUND)
|
|
||||||
|
|
||||||
if (WIN32)
|
|
||||||
target_link_libraries(qbt_powermanagement PRIVATE PowrProf)
|
|
||||||
endif (WIN32)
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
INCLUDEPATH += $$PWD
|
|
||||||
|
|
||||||
HEADERS += $$PWD/powermanagement.h
|
HEADERS += $$PWD/powermanagement.h
|
||||||
SOURCES += $$PWD/powermanagement.cpp
|
SOURCES += $$PWD/powermanagement.cpp
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
add_library(qbt_properties STATIC
|
target_sources(qbt_gui PRIVATE
|
||||||
# headers
|
# headers
|
||||||
downloadedpiecesbar.h
|
downloadedpiecesbar.h
|
||||||
peerlistdelegate.h
|
peerlistdelegate.h
|
||||||
|
@ -36,17 +36,3 @@ peersadditiondialog.ui
|
||||||
propertieswidget.ui
|
propertieswidget.ui
|
||||||
trackersadditiondialog.ui
|
trackersadditiondialog.ui
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(qbt_properties
|
|
||||||
PRIVATE
|
|
||||||
qbt_gui_headers
|
|
||||||
PUBLIC
|
|
||||||
qbt_base Qt5::Widgets
|
|
||||||
)
|
|
||||||
|
|
||||||
target_include_directories(qbt_properties
|
|
||||||
PRIVATE
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}
|
|
||||||
PUBLIC
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}
|
|
||||||
)
|
|
||||||
|
|
|
@ -52,11 +52,11 @@
|
||||||
#include "base/net/geoipmanager.h"
|
#include "base/net/geoipmanager.h"
|
||||||
#include "base/net/reverseresolution.h"
|
#include "base/net/reverseresolution.h"
|
||||||
#include "base/preferences.h"
|
#include "base/preferences.h"
|
||||||
|
#include "gui/uithememanager.h"
|
||||||
#include "peerlistdelegate.h"
|
#include "peerlistdelegate.h"
|
||||||
#include "peerlistsortmodel.h"
|
#include "peerlistsortmodel.h"
|
||||||
#include "peersadditiondialog.h"
|
#include "peersadditiondialog.h"
|
||||||
#include "propertieswidget.h"
|
#include "propertieswidget.h"
|
||||||
#include "uithememanager.h"
|
|
||||||
|
|
||||||
struct PeerEndpoint
|
struct PeerEndpoint
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
INCLUDEPATH += $$PWD
|
|
||||||
|
|
||||||
FORMS += \
|
FORMS += \
|
||||||
$$PWD/peersadditiondialog.ui \
|
$$PWD/peersadditiondialog.ui \
|
||||||
$$PWD/propertieswidget.ui \
|
$$PWD/propertieswidget.ui \
|
||||||
|
|
|
@ -51,21 +51,20 @@
|
||||||
#include "base/utils/fs.h"
|
#include "base/utils/fs.h"
|
||||||
#include "base/utils/misc.h"
|
#include "base/utils/misc.h"
|
||||||
#include "base/utils/string.h"
|
#include "base/utils/string.h"
|
||||||
#include "autoexpandabledialog.h"
|
#include "gui/autoexpandabledialog.h"
|
||||||
|
#include "gui/lineedit.h"
|
||||||
|
#include "gui/raisedmessagebox.h"
|
||||||
|
#include "gui/torrentcontentfiltermodel.h"
|
||||||
|
#include "gui/torrentcontentmodel.h"
|
||||||
|
#include "gui/uithememanager.h"
|
||||||
|
#include "gui/utils.h"
|
||||||
#include "downloadedpiecesbar.h"
|
#include "downloadedpiecesbar.h"
|
||||||
#include "lineedit.h"
|
|
||||||
#include "peerlistwidget.h"
|
#include "peerlistwidget.h"
|
||||||
#include "pieceavailabilitybar.h"
|
#include "pieceavailabilitybar.h"
|
||||||
#include "proplistdelegate.h"
|
#include "proplistdelegate.h"
|
||||||
#include "proptabbar.h"
|
#include "proptabbar.h"
|
||||||
#include "raisedmessagebox.h"
|
|
||||||
#include "speedwidget.h"
|
#include "speedwidget.h"
|
||||||
#include "torrentcontentfiltermodel.h"
|
|
||||||
#include "torrentcontentmodel.h"
|
|
||||||
#include "trackerlistwidget.h"
|
#include "trackerlistwidget.h"
|
||||||
#include "uithememanager.h"
|
|
||||||
#include "utils.h"
|
|
||||||
|
|
||||||
#include "ui_propertieswidget.h"
|
#include "ui_propertieswidget.h"
|
||||||
|
|
||||||
#ifdef Q_OS_MACOS
|
#ifdef Q_OS_MACOS
|
||||||
|
|
|
@ -1111,7 +1111,7 @@
|
||||||
<customwidget>
|
<customwidget>
|
||||||
<class>TorrentContentTreeView</class>
|
<class>TorrentContentTreeView</class>
|
||||||
<extends>QTreeView</extends>
|
<extends>QTreeView</extends>
|
||||||
<header location="global">torrentcontenttreeview.h</header>
|
<header location="global">gui/torrentcontenttreeview.h</header>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources/>
|
<resources/>
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
#include <QSpacerItem>
|
#include <QSpacerItem>
|
||||||
|
|
||||||
#include "base/global.h"
|
#include "base/global.h"
|
||||||
#include "uithememanager.h"
|
#include "gui/uithememanager.h"
|
||||||
|
|
||||||
PropTabBar::PropTabBar(QWidget *parent)
|
PropTabBar::PropTabBar(QWidget *parent)
|
||||||
: QHBoxLayout(parent)
|
: QHBoxLayout(parent)
|
||||||
|
|
|
@ -49,10 +49,10 @@
|
||||||
#include "base/bittorrent/trackerentry.h"
|
#include "base/bittorrent/trackerentry.h"
|
||||||
#include "base/global.h"
|
#include "base/global.h"
|
||||||
#include "base/preferences.h"
|
#include "base/preferences.h"
|
||||||
#include "autoexpandabledialog.h"
|
#include "gui/autoexpandabledialog.h"
|
||||||
|
#include "gui/uithememanager.h"
|
||||||
#include "propertieswidget.h"
|
#include "propertieswidget.h"
|
||||||
#include "trackersadditiondialog.h"
|
#include "trackersadditiondialog.h"
|
||||||
#include "uithememanager.h"
|
|
||||||
|
|
||||||
#define NB_STICKY_ITEM 3
|
#define NB_STICKY_ITEM 3
|
||||||
|
|
||||||
|
|
|
@ -36,8 +36,8 @@
|
||||||
#include "base/bittorrent/trackerentry.h"
|
#include "base/bittorrent/trackerentry.h"
|
||||||
#include "base/global.h"
|
#include "base/global.h"
|
||||||
#include "base/net/downloadmanager.h"
|
#include "base/net/downloadmanager.h"
|
||||||
|
#include "gui/uithememanager.h"
|
||||||
#include "ui_trackersadditiondialog.h"
|
#include "ui_trackersadditiondialog.h"
|
||||||
#include "uithememanager.h"
|
|
||||||
|
|
||||||
TrackersAdditionDialog::TrackersAdditionDialog(QWidget *parent, BitTorrent::TorrentHandle *const torrent)
|
TrackersAdditionDialog::TrackersAdditionDialog(QWidget *parent, BitTorrent::TorrentHandle *const torrent)
|
||||||
: QDialog(parent)
|
: QDialog(parent)
|
||||||
|
|
|
@ -1,11 +1 @@
|
||||||
add_library(qbt_qtnotify STATIC
|
target_sources(qbt_gui PRIVATE notifications.h notifications.cpp)
|
||||||
# headers
|
|
||||||
notifications.h
|
|
||||||
|
|
||||||
# sources
|
|
||||||
notifications.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
set_target_properties(qbt_qtnotify PROPERTIES AUTOUIC False AUTORCC False)
|
|
||||||
target_link_libraries(qbt_qtnotify PUBLIC Qt5::DBus)
|
|
||||||
target_include_directories(qbt_qtnotify PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
|
||||||
|
|
|
@ -1,5 +1,2 @@
|
||||||
INCLUDEPATH += $$PWD
|
|
||||||
|
|
||||||
HEADERS += $$PWD/notifications.h
|
HEADERS += $$PWD/notifications.h
|
||||||
|
|
||||||
SOURCES += $$PWD/notifications.cpp
|
SOURCES += $$PWD/notifications.cpp
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
add_library(qbt_rss STATIC
|
target_sources(qbt_gui PRIVATE
|
||||||
# headers
|
# headers
|
||||||
articlelistwidget.h
|
articlelistwidget.h
|
||||||
automatedrssdownloader.h
|
automatedrssdownloader.h
|
||||||
|
@ -17,11 +17,3 @@ rsswidget.cpp
|
||||||
automatedrssdownloader.ui
|
automatedrssdownloader.ui
|
||||||
rsswidget.ui
|
rsswidget.ui
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(qbt_rss PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
|
|
||||||
target_link_libraries(qbt_rss
|
|
||||||
PRIVATE
|
|
||||||
qbt_gui_headers
|
|
||||||
PUBLIC
|
|
||||||
qbt_base Qt5::Gui Qt5::Widgets Qt5::Network
|
|
||||||
)
|
|
||||||
|
|
|
@ -49,10 +49,10 @@
|
||||||
#include "base/rss/rss_session.h"
|
#include "base/rss/rss_session.h"
|
||||||
#include "base/utils/fs.h"
|
#include "base/utils/fs.h"
|
||||||
#include "base/utils/string.h"
|
#include "base/utils/string.h"
|
||||||
#include "autoexpandabledialog.h"
|
#include "gui/autoexpandabledialog.h"
|
||||||
|
#include "gui/uithememanager.h"
|
||||||
|
#include "gui/utils.h"
|
||||||
#include "ui_automatedrssdownloader.h"
|
#include "ui_automatedrssdownloader.h"
|
||||||
#include "uithememanager.h"
|
|
||||||
#include "utils.h"
|
|
||||||
|
|
||||||
const QString EXT_JSON {QStringLiteral(".json")};
|
const QString EXT_JSON {QStringLiteral(".json")};
|
||||||
const QString EXT_LEGACY {QStringLiteral(".rssrules")};
|
const QString EXT_LEGACY {QStringLiteral(".rssrules")};
|
||||||
|
|
|
@ -454,7 +454,7 @@ Supports the formats: S01E01, 1x1, 2017.01.01 and 01.01.2017 (Date formats also
|
||||||
<customwidget>
|
<customwidget>
|
||||||
<class>FileSystemPathLineEdit</class>
|
<class>FileSystemPathLineEdit</class>
|
||||||
<extends>QWidget</extends>
|
<extends>QWidget</extends>
|
||||||
<header>fspathedit.h</header>
|
<header>gui/fspathedit.h</header>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<tabstops>
|
<tabstops>
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
#include "base/rss/rss_feed.h"
|
#include "base/rss/rss_feed.h"
|
||||||
#include "base/rss/rss_folder.h"
|
#include "base/rss/rss_folder.h"
|
||||||
#include "base/rss/rss_session.h"
|
#include "base/rss/rss_session.h"
|
||||||
#include "uithememanager.h"
|
#include "gui/uithememanager.h"
|
||||||
|
|
||||||
FeedListWidget::FeedListWidget(QWidget *parent)
|
FeedListWidget::FeedListWidget(QWidget *parent)
|
||||||
: QTreeWidget(parent)
|
: QTreeWidget(parent)
|
||||||
|
|
|
@ -47,13 +47,13 @@
|
||||||
#include "base/rss/rss_feed.h"
|
#include "base/rss/rss_feed.h"
|
||||||
#include "base/rss/rss_folder.h"
|
#include "base/rss/rss_folder.h"
|
||||||
#include "base/rss/rss_session.h"
|
#include "base/rss/rss_session.h"
|
||||||
#include "addnewtorrentdialog.h"
|
#include "gui/addnewtorrentdialog.h"
|
||||||
|
#include "gui/autoexpandabledialog.h"
|
||||||
|
#include "gui/uithememanager.h"
|
||||||
#include "articlelistwidget.h"
|
#include "articlelistwidget.h"
|
||||||
#include "autoexpandabledialog.h"
|
|
||||||
#include "automatedrssdownloader.h"
|
#include "automatedrssdownloader.h"
|
||||||
#include "feedlistwidget.h"
|
#include "feedlistwidget.h"
|
||||||
#include "ui_rsswidget.h"
|
#include "ui_rsswidget.h"
|
||||||
#include "uithememanager.h"
|
|
||||||
|
|
||||||
RSSWidget::RSSWidget(QWidget *parent)
|
RSSWidget::RSSWidget(QWidget *parent)
|
||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
add_library(qbt_searchengine STATIC
|
target_sources(qbt_gui PRIVATE
|
||||||
# headers
|
# headers
|
||||||
pluginselectdialog.h
|
pluginselectdialog.h
|
||||||
pluginsourcedialog.h
|
pluginsourcedialog.h
|
||||||
|
@ -20,14 +20,3 @@ pluginselectdialog.ui
|
||||||
pluginsourcedialog.ui
|
pluginsourcedialog.ui
|
||||||
searchwidget.ui
|
searchwidget.ui
|
||||||
)
|
)
|
||||||
|
|
||||||
set(QBT_SEARCHENGINE_RESOURCES
|
|
||||||
# search.qrc
|
|
||||||
)
|
|
||||||
|
|
||||||
target_link_libraries(qbt_searchengine
|
|
||||||
PUBLIC
|
|
||||||
qbt_base
|
|
||||||
PRIVATE
|
|
||||||
qbt_gui_headers
|
|
||||||
)
|
|
||||||
|
|
|
@ -42,12 +42,12 @@
|
||||||
#include "base/global.h"
|
#include "base/global.h"
|
||||||
#include "base/net/downloadmanager.h"
|
#include "base/net/downloadmanager.h"
|
||||||
#include "base/utils/fs.h"
|
#include "base/utils/fs.h"
|
||||||
#include "autoexpandabledialog.h"
|
#include "gui/autoexpandabledialog.h"
|
||||||
|
#include "gui/uithememanager.h"
|
||||||
|
#include "gui/utils.h"
|
||||||
#include "pluginsourcedialog.h"
|
#include "pluginsourcedialog.h"
|
||||||
#include "searchwidget.h"
|
#include "searchwidget.h"
|
||||||
#include "ui_pluginselectdialog.h"
|
#include "ui_pluginselectdialog.h"
|
||||||
#include "uithememanager.h"
|
|
||||||
#include "utils.h"
|
|
||||||
|
|
||||||
enum PluginColumns
|
enum PluginColumns
|
||||||
{
|
{
|
||||||
|
|
|
@ -28,8 +28,8 @@
|
||||||
|
|
||||||
#include "pluginsourcedialog.h"
|
#include "pluginsourcedialog.h"
|
||||||
|
|
||||||
|
#include "gui/utils.h"
|
||||||
#include "ui_pluginsourcedialog.h"
|
#include "ui_pluginsourcedialog.h"
|
||||||
#include "utils.h"
|
|
||||||
|
|
||||||
PluginSourceDialog::PluginSourceDialog(QWidget *parent)
|
PluginSourceDialog::PluginSourceDialog(QWidget *parent)
|
||||||
: QDialog(parent)
|
: QDialog(parent)
|
||||||
|
|
|
@ -47,13 +47,13 @@
|
||||||
#include "base/search/searchpluginmanager.h"
|
#include "base/search/searchpluginmanager.h"
|
||||||
#include "base/settingvalue.h"
|
#include "base/settingvalue.h"
|
||||||
#include "base/utils/misc.h"
|
#include "base/utils/misc.h"
|
||||||
#include "addnewtorrentdialog.h"
|
#include "gui/addnewtorrentdialog.h"
|
||||||
#include "lineedit.h"
|
#include "gui/lineedit.h"
|
||||||
|
#include "gui/uithememanager.h"
|
||||||
|
#include "gui/utils.h"
|
||||||
#include "searchlistdelegate.h"
|
#include "searchlistdelegate.h"
|
||||||
#include "searchsortmodel.h"
|
#include "searchsortmodel.h"
|
||||||
#include "ui_searchjobwidget.h"
|
#include "ui_searchjobwidget.h"
|
||||||
#include "uithememanager.h"
|
|
||||||
#include "utils.h"
|
|
||||||
|
|
||||||
SearchJobWidget::SearchJobWidget(SearchHandler *searchHandler, QWidget *parent)
|
SearchJobWidget::SearchJobWidget(SearchHandler *searchHandler, QWidget *parent)
|
||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
|
|
|
@ -46,11 +46,11 @@
|
||||||
#include "base/search/searchhandler.h"
|
#include "base/search/searchhandler.h"
|
||||||
#include "base/search/searchpluginmanager.h"
|
#include "base/search/searchpluginmanager.h"
|
||||||
#include "base/utils/foreignapps.h"
|
#include "base/utils/foreignapps.h"
|
||||||
#include "mainwindow.h"
|
#include "gui/mainwindow.h"
|
||||||
|
#include "gui/uithememanager.h"
|
||||||
#include "pluginselectdialog.h"
|
#include "pluginselectdialog.h"
|
||||||
#include "searchjobwidget.h"
|
#include "searchjobwidget.h"
|
||||||
#include "ui_searchwidget.h"
|
#include "ui_searchwidget.h"
|
||||||
#include "uithememanager.h"
|
|
||||||
|
|
||||||
#define SEARCHHISTORY_MAXSIZE 50
|
#define SEARCHHISTORY_MAXSIZE 50
|
||||||
#define URL_COLUMN 5
|
#define URL_COLUMN 5
|
||||||
|
|
|
@ -141,7 +141,7 @@ Click the "Search plugins..." button at the bottom right of the window
|
||||||
<customwidget>
|
<customwidget>
|
||||||
<class>LineEdit</class>
|
<class>LineEdit</class>
|
||||||
<extends>QLineEdit</extends>
|
<extends>QLineEdit</extends>
|
||||||
<header>lineedit.h</header>
|
<header>gui/lineedit.h</header>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources/>
|
<resources/>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue