diff --git a/CMakeLists.txt b/CMakeLists.txt index f7ceb31..cfe0609 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,57 +1,65 @@ cmake_minimum_required (VERSION 3.0) project(kcachegrind) # minimal requirements set (QT_MIN_VERSION "5.6.0") set (KF_MIN_VERSION "5.18.0") find_package(ECM ${KF_MIN_VERSION} REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH}) include(KDEInstallDirs) include(KDECMakeSettings) include(KDECompilerSettings NO_POLICY_SCOPE) include(ECMOptionalAddSubdirectory) include(ECMInstallIcons) include(ECMSetupVersion) include(ECMMarkNonGuiExecutable) include(ECMGenerateHeaders) include(GenerateExportHeader) include(FeatureSummary) include(ECMAddAppIcon) include(ECMPoQmTools) find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED Core DBus Gui Widgets) find_package(KF5 ${KF_MIN_VERSION} REQUIRED - Archive CoreAddons DocTools WidgetsAddons XmlGui I18n Config KIO + Archive + CoreAddons + DocTools + WidgetsAddons + XmlGui + I18n + Config + KIO + DBusAddons ) if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") add_definitions(-DQT_STRICT_ITERATORS) endif() add_definitions(-DQT_NO_URL_CAST_FROM_STRING) set(CMAKE_INCLUDE_CURRENT_DIR ON) set( KCACHEGRIND_VERSION "0.8.0kde") configure_file(${CMAKE_CURRENT_SOURCE_DIR}/version.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/version.h ) IF(NOT WIN32) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/kcachegrind.spec.cmake ${CMAKE_CURRENT_BINARY_DIR}/kcachegrind.spec ) ENDIF(NOT WIN32) ecm_create_qm_loader(kcachegrind_QM_LOADER kcachegrind_qt) add_subdirectory( doc ) add_subdirectory( libcore ) add_subdirectory( cgview ) add_subdirectory( libviews ) add_subdirectory( kcachegrind ) add_subdirectory( qcachegrind ) add_subdirectory( pics ) add_subdirectory( converters ) feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/kcachegrind/CMakeLists.txt b/kcachegrind/CMakeLists.txt index 7e95896..daa57fe 100644 --- a/kcachegrind/CMakeLists.txt +++ b/kcachegrind/CMakeLists.txt @@ -1,41 +1,42 @@ ########### next target ############### set(kcachegrind_SRCS main.cpp kdeconfig.cpp toplevel.cpp configdlg.cpp ${kcachegrind_QM_LOADER} ) ki18n_wrap_ui(kcachegrind_SRCS configdlgbase.ui dumpselectionbase.ui) file(GLOB ICONS_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/*-apps-kcachegrind.png") ecm_add_app_icon(kcachegrind_SRCS ICONS ${ICONS_SRCS}) add_executable(kcachegrind ${kcachegrind_SRCS}) set(kcachegrind_LIBS KF5::Archive KF5::CoreAddons KF5::I18n KF5::XmlGui KF5::ConfigCore KF5::ConfigGui KF5::KIOCore KF5::KIOFileWidgets KF5::KIOWidgets KF5::KIONTLM + KF5::DBusAddons ) target_link_libraries(kcachegrind core views ${kcachegrind_LIBS}) install(TARGETS kcachegrind ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} ) ########### install files ############### install( PROGRAMS org.kde.kcachegrind.desktop DESTINATION ${KDE_INSTALL_APPDIR} ) install( FILES org.kde.kcachegrind.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR} ) install( FILES tips DESTINATION ${KDE_INSTALL_DATADIR}/kcachegrind ) install( FILES kcachegrindui.rc DESTINATION ${KDE_INSTALL_KXMLGUI5DIR}/kcachegrind ) ecm_install_icons( ICONS 128-apps-kcachegrind.png 64-apps-kcachegrind.png 32-apps-kcachegrind.png 48-apps-kcachegrind.png DESTINATION ${KDE_INSTALL_ICONDIR} THEME hicolor ) diff --git a/kcachegrind/main.cpp b/kcachegrind/main.cpp index 2382b29..d4e39d9 100644 --- a/kcachegrind/main.cpp +++ b/kcachegrind/main.cpp @@ -1,104 +1,108 @@ /* This file is part of KCachegrind. Copyright (C) 2003-2016 Josef Weidendorfer KCachegrind is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. This program 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 General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* * KCachegrind startup */ // for KCACHEGRIND_VERSION #include "../version.h" #include #include #include #include #include +#include #include "kdeconfig.h" #include "toplevel.h" #include "tracedata.h" #include "loader.h" int main( int argc, char ** argv ) { QApplication a(argc, argv); KLocalizedString::setApplicationDomain("kcachegrind"); KAboutData aboutData(QStringLiteral("kcachegrind"), i18n("KCachegrind"), KCACHEGRIND_VERSION, i18n("KDE Frontend for Callgrind/Cachegrind"), KAboutLicense::GPL, i18n("(C) 2002 - 2016"), QString(), QStringLiteral("https://kcachegrind.github.io")); aboutData.addAuthor(i18n("Josef Weidendorfer"), i18n("Author/Maintainer"), QStringLiteral("Josef.Weidendorfer@gmx.de")); + aboutData.setOrganizationDomain("kde.org"); aboutData.setDesktopFileName(QStringLiteral("org.kde.kcachegrind")); KAboutData::setApplicationData(aboutData); QApplication::setWindowIcon(QIcon::fromTheme(QStringLiteral("kcachegrind"))); + KDBusService service(KDBusService::Multiple); + // KGlobal::locale()->insertCatalog("kcachegrind_qt"); Loader::initLoaders(); KConfig* kc = KSharedConfig::openConfig().data(); ConfigStorage::setStorage(new KDEConfigStorage(kc)); if (a.isSessionRestored()){ int n = 1; while (KMainWindow::canBeRestored(n)){ (new TopLevel())->restore(n); n++; } } else { TopLevel* t; QCommandLineParser parser; parser.addPositionalArgument(QStringLiteral("trace"), i18n("Show information of this trace"), i18n("[trace...]")); aboutData.setupCommandLine(&parser); parser.process(a); aboutData.processCommandLine(&parser); int nbArgs = parser.positionalArguments().count(); if (nbArgs>0) { t = new TopLevel(); t->show(); foreach(const QString &arg, parser.positionalArguments()) { t->loadDelayed(arg); } } else { // load trace in current dir t = new TopLevel(); t->show(); t->loadDelayed(QStringLiteral(".")); } } a.connect( &a, &QGuiApplication::lastWindowClosed, &a, &QCoreApplication::quit ); int res = a.exec(); // to make leak checking in valgrind happy... Loader::deleteLoaders(); ProfileContext::cleanup(); ConfigStorage::cleanup(); return res; }