diff --git a/CMakeLists.txt b/CMakeLists.txt index cc994c8..4341eb5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,29 +1,32 @@ project(user-manager) cmake_minimum_required(VERSION 2.8.12) set(PROJECT_VERSION "5.14.80") set(QT_MIN_VERSION "5.11.0") set(KF5_MIN_VERSION "5.50.0") find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" ${CMAKE_MODULE_PATH}) find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Core Widgets DBus) find_package(KF5 ${KF5_MIN_VERSION} REQUIRED WidgetsAddons CoreAddons I18n Config ConfigWidgets KCMUtils KIO IconThemes Auth) find_package(PWQuality REQUIRED) include(FeatureSummary) include(KDEInstallDirs) include(KDECMakeSettings) include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) +include(ECMQtDeclareLoggingCategory) include_directories(${PWQUALITY_INCLUDE_DIR}) # Set KI18n translation domain add_definitions(-DTRANSLATION_DOMAIN=\"user_manager\") add_definitions(-DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT) add_subdirectory(src) +install( FILES user-manager.categories DESTINATION ${KDE_INSTALL_CONFDIR} ) + feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a23584e..6b8d391 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,65 +1,66 @@ set(user_manager_SRCS lib/accountmodel.cpp lib/modeltest.cpp lib/usersessions.cpp usermanager.cpp accountinfo.cpp createavatarjob.cpp passworddialog.cpp passwordedit.cpp avatargallery.cpp - user_manager_debug.cpp ) set_source_files_properties(lib/org.freedesktop.Accounts.xml PROPERTIES NO_NAMESPACE TRUE) set_source_files_properties(lib/org.freedesktop.Accounts.User.xml PROPERTIES NO_NAMESPACE TRUE) qt5_add_dbus_interface(user_manager_SRCS lib/org.freedesktop.Accounts.xml accounts_interface ) qt5_add_dbus_interface(user_manager_SRCS lib/org.freedesktop.Accounts.User.xml user_interface ) set(login1_manager_xml lib/org.freedesktop.login1.Manager.xml) set_source_files_properties(${login1_manager_xml} PROPERTIES INCLUDE "lib/usersessions.h") qt5_add_dbus_interface(user_manager_SRCS ${login1_manager_xml} login1_interface ) ki18n_wrap_ui(user_manager_SRCS kcm.ui account.ui password.ui avatargallery.ui) +ecm_qt_declare_logging_category(user_manager_SRCS HEADER user_manager_debug.h IDENTIFIER USER_MANAGER_LOG CATEGORY_NAME log_user_manager) + add_library(user_manager MODULE ${user_manager_SRCS}) target_link_libraries(user_manager Qt5::Core Qt5::Widgets Qt5::DBus KF5::Auth KF5::WidgetsAddons KF5::CoreAddons KF5::I18n KF5::ConfigCore KF5::ConfigWidgets KF5::KCMUtils KF5::KIOCore KF5::IconThemes ${PWQUALITY_LIBRARY} ) if (NOT APPLE) target_link_libraries(user_manager crypt) endif() install(TARGETS user_manager DESTINATION ${PLUGIN_INSTALL_DIR}) install(FILES user_manager.desktop DESTINATION ${SERVICES_INSTALL_DIR}) install(DIRECTORY pics/ DESTINATION ${DATA_INSTALL_DIR}/user-manager/avatars) diff --git a/src/user_manager_debug.cpp b/src/user_manager_debug.cpp deleted file mode 100644 index 7276939..0000000 --- a/src/user_manager_debug.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2014 Laurent Montel - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include "user_manager_debug.h" -Q_LOGGING_CATEGORY(USER_MANAGER_LOG, "log_user_manager") - - diff --git a/src/user_manager_debug.h b/src/user_manager_debug.h deleted file mode 100644 index 2fa3dad..0000000 --- a/src/user_manager_debug.h +++ /dev/null @@ -1,27 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2014 Laurent Montel - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef USER_MANAGER_DEBUG_H -#define USER_MANAGER_DEBUG_H - -#include -Q_DECLARE_LOGGING_CATEGORY(USER_MANAGER_LOG) - -#endif - diff --git a/user-manager.categories b/user-manager.categories new file mode 100644 index 0000000..b2f7c02 --- /dev/null +++ b/user-manager.categories @@ -0,0 +1 @@ +log_user_manager user-manager IDENTIFIER [USER_MANAGER_LOG]