This commit is contained in:
Martin Rotter 2024-03-15 13:45:08 +01:00 committed by martinrotter
parent f585398a64
commit df0f831c3c
6 changed files with 36 additions and 51 deletions

View File

@ -264,6 +264,16 @@ add_compile_definitions(
APP_LONG_NAME="${APP_NAME} ${CMAKE_PROJECT_VERSION}" APP_LONG_NAME="${APP_NAME} ${CMAKE_PROJECT_VERSION}"
APP_LOW_NAME="${APP_LOW_NAME}" APP_LOW_NAME="${APP_LOW_NAME}"
APP_REVERSE_NAME="${APP_REVERSE_NAME}" APP_REVERSE_NAME="${APP_REVERSE_NAME}"
APP_AUTHOR="${APP_AUTHOR}"
APP_DONATE_URL="${APP_DONATE_URL}"
APP_EMAIL="${APP_EMAIL}"
APP_LOW_H_NAME=".${CMAKE_PROJECT_NAME}"
APP_REVISION="${APP_REVISION}"
APP_SYSTEM_NAME="${CMAKE_SYSTEM_NAME}"
APP_SYSTEM_VERSION="${CMAKE_SYSTEM_PROCESSOR}"
APP_URL_DOCUMENTATION="${APP_URL_DOCUMENTATION}"
APP_URL_ISSUES_NEW="${APP_URL_ISSUES_NEW}"
APP_USERAGENT="${APP_NAME}/${CMAKE_PROJECT_VERSION}"
QT_USE_QSTRINGBUILDER QT_USE_QSTRINGBUILDER
QT_USE_FAST_CONCATENATION QT_USE_FAST_CONCATENATION

View File

@ -1,4 +1,5 @@
set(LIBRSSGUARD_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../librssguard") set(LIBRSSGUARD_SOURCE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../librssguard")
set(LIBRSSGUARD_BINARY_PATH "${CMAKE_BINARY_DIR}/src/librssguard")
set(SOURCES set(SOURCES
src/definitions.h src/definitions.h
@ -49,13 +50,13 @@ set(UI_FILES
# Add mimesis. # Add mimesis.
list(APPEND SOURCES list(APPEND SOURCES
${LIBRSSGUARD_PATH}/3rd-party/mimesis/mimesis.hpp ${LIBRSSGUARD_SOURCE_PATH}/3rd-party/mimesis/mimesis.hpp
${LIBRSSGUARD_PATH}/3rd-party/mimesis/quoted-printable.hpp ${LIBRSSGUARD_SOURCE_PATH}/3rd-party/mimesis/quoted-printable.hpp
) )
# Add boolinq. # Add boolinq.
list(APPEND SOURCES list(APPEND SOURCES
${LIBRSSGUARD_PATH}/3rd-party/boolinq/boolinq.h ${LIBRSSGUARD_SOURCE_PATH}/3rd-party/boolinq/boolinq.h
) )
# Deal with .ui files. # Deal with .ui files.
@ -74,33 +75,13 @@ target_compile_definitions(rssguard-standard
PRIVATE PRIVATE
RSSGUARD_DLLSPEC=Q_DECL_IMPORT RSSGUARD_DLLSPEC=Q_DECL_IMPORT
RSSGUARD_DLLSPEC_EXPORT=Q_DECL_EXPORT RSSGUARD_DLLSPEC_EXPORT=Q_DECL_EXPORT
)
APP_AUTHOR="${APP_AUTHOR}"
APP_DONATE_URL="${APP_DONATE_URL}"
APP_EMAIL="${APP_EMAIL}"
APP_LOW_H_NAME=".${CMAKE_PROJECT_NAME}"
APP_REVISION="${APP_REVISION}"
APP_SYSTEM_NAME="${CMAKE_SYSTEM_NAME}"
APP_SYSTEM_VERSION="${CMAKE_SYSTEM_PROCESSOR}"
APP_URL_DOCUMENTATION="${APP_URL_DOCUMENTATION}"
APP_URL_ISSUES_NEW="${APP_URL_ISSUES_NEW}"
APP_USERAGENT="${APP_NAME}/${CMAKE_PROJECT_VERSION}")
target_include_directories(rssguard-standard target_include_directories(rssguard-standard
PUBLIC PUBLIC
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_BINARY_DIR}/src/librssguard ${LIBRSSGUARD_SOURCE_PATH}
${LIBRSSGUARD_PATH} ${LIBRSSGUARD_BINARY_PATH}
${LIBRSSGUARD_PATH}/gui/dialogs
${LIBRSSGUARD_PATH}/gui/reusable
${LIBRSSGUARD_PATH}/services/abstract/gui
${LIBRSSGUARD_PATH}/dynamic-shortcuts
PRIVATE
${LIBRSSGUARD_PATH}/gui/notifications
${LIBRSSGUARD_PATH}/gui/toolbars
${LIBRSSGUARD_PATH}/gui/richtexteditor
) )
# Qt. # Qt.
@ -128,18 +109,18 @@ if(WIN32)
) )
endif() endif()
if(NO_LITE) #if(NO_LITE)
target_link_libraries(rssguard-standard PUBLIC # target_link_libraries(rssguard-standard PUBLIC
Qt${QT_VERSION_MAJOR}::WebEngineWidgets # Qt${QT_VERSION_MAJOR}::WebEngineWidgets
) # )
endif() #endif()
if(WIN32 OR OS2) if(WIN32 OR OS2)
install(TARGETS rssguard-standard DESTINATION .) install(TARGETS rssguard-standard DESTINATION plugins)
elseif(UNIX AND NOT APPLE AND NOT ANDROID) elseif(UNIX AND NOT APPLE AND NOT ANDROID)
include (GNUInstallDirs) include (GNUInstallDirs)
install(TARGETS rssguard-standard install(TARGETS rssguard-standard
DESTINATION ${CMAKE_INSTALL_LIBDIR} DESTINATION ${CMAKE_INSTALL_LIBDIR}/rssguard
) )
elseif(APPLE) elseif(APPLE)
install(TARGETS rssguard-standard install(TARGETS rssguard-standard

View File

@ -692,18 +692,7 @@ endif()
target_compile_definitions(rssguard target_compile_definitions(rssguard
PRIVATE PRIVATE
RSSGUARD_DLLSPEC=Q_DECL_EXPORT RSSGUARD_DLLSPEC=Q_DECL_EXPORT
)
APP_AUTHOR="${APP_AUTHOR}"
APP_DONATE_URL="${APP_DONATE_URL}"
APP_EMAIL="${APP_EMAIL}"
APP_LOW_H_NAME=".${CMAKE_PROJECT_NAME}"
APP_REVISION="${APP_REVISION}"
APP_SYSTEM_NAME="${CMAKE_SYSTEM_NAME}"
APP_SYSTEM_VERSION="${CMAKE_SYSTEM_PROCESSOR}"
APP_URL_DOCUMENTATION="${APP_URL_DOCUMENTATION}"
APP_URL_ISSUES_NEW="${APP_URL_ISSUES_NEW}"
APP_USERAGENT="${APP_NAME}/${CMAKE_PROJECT_VERSION}")
target_include_directories(rssguard target_include_directories(rssguard
PUBLIC PUBLIC

View File

@ -52,7 +52,9 @@ void FormAddAccount::showAccountDetails() {
} }
ServiceEntryPoint* FormAddAccount::selectedEntryPoint() const { ServiceEntryPoint* FormAddAccount::selectedEntryPoint() const {
return m_entryPoints.at(m_ui->m_listEntryPoints->currentRow()); return reinterpret_cast<ServiceEntryPoint*>(m_ui->m_listEntryPoints->currentItem()
->data(Qt::ItemDataRole::UserRole)
.value<intptr_t>());
} }
void FormAddAccount::loadEntryPoints() { void FormAddAccount::loadEntryPoints() {
@ -66,8 +68,10 @@ void FormAddAccount::loadEntryPoints() {
QListWidgetItem* item = new QListWidgetItem(entry_point->icon(), entry_point->name(), m_ui->m_listEntryPoints); QListWidgetItem* item = new QListWidgetItem(entry_point->icon(), entry_point->name(), m_ui->m_listEntryPoints);
item->setToolTip(entry_point->description()); item->setToolTip(entry_point->description());
item->setData(Qt::ItemDataRole::UserRole, QVariant::fromValue<intptr_t>(reinterpret_cast<intptr_t>(entry_point)));
i++; i++;
} }
m_ui->m_listEntryPoints->setCurrentRow(classic_row); m_ui->m_listEntryPoints->setCurrentRow(classic_row);
m_ui->m_listEntryPoints->sortItems(Qt::SortOrder::AscendingOrder);
} }

View File

@ -15,7 +15,7 @@ PluginFactory::PluginFactory() {}
QList<ServiceEntryPoint*> PluginFactory::loadPlugins() const { QList<ServiceEntryPoint*> PluginFactory::loadPlugins() const {
QList<ServiceEntryPoint*> plugins; QList<ServiceEntryPoint*> plugins;
const QString plugin_name_wildcard = pluginNameWildCard() + pluginSuffix(); const QString plugin_name_wildcard = pluginNameWildCard() + pluginNameSuffix();
const auto plugins_paths = pluginPaths(); const auto plugins_paths = pluginPaths();
const auto backup_current_dir = QDir::currentPath(); const auto backup_current_dir = QDir::currentPath();
@ -59,9 +59,10 @@ QStringList PluginFactory::pluginPaths() const {
QStringList paths; QStringList paths;
#if defined(Q_OS_LINUX) #if defined(Q_OS_LINUX)
paths << QCoreApplication::applicationDirPath() + QDir::separator() + QL1S("..") + QDir::separator() + QL1S("lib") + paths << QCoreApplication::applicationDirPath() + QDir::separator() + QL1S("..") + QDir::separator() + QL1S("lib") +
QDir::separator() + QL1S(APP_LOW_NAME) + QDir::separator() + QL1S("plugins"); QDir::separator() + QL1S(APP_LOW_NAME);
#else #else
paths << QCoreApplication::applicationDirPath() + QDir::separator() + QL1S("plugins"); paths << QCoreApplication::applicationDirPath() + QDir::separator() + QL1S("plugins");
paths << QCoreApplication::applicationDirPath();
#endif #endif
#if !defined(NDEBUG) #if !defined(NDEBUG)
@ -71,7 +72,7 @@ QStringList PluginFactory::pluginPaths() const {
return paths; return paths;
} }
QString PluginFactory::pluginSuffix() const { QString PluginFactory::pluginNameSuffix() const {
#if defined(Q_OS_LINUX) #if defined(Q_OS_LINUX)
return QSL(".so"); return QSL(".so");
#elif defined(Q_OS_WIN) #elif defined(Q_OS_WIN)

View File

@ -15,7 +15,7 @@ class PluginFactory {
private: private:
QStringList pluginPaths() const; QStringList pluginPaths() const;
QString pluginSuffix() const; QString pluginNameSuffix() const;
QString pluginNameWildCard() const; QString pluginNameWildCard() const;
}; };