diff --git a/icons/ico.png b/icons/ico.png deleted file mode 100644 index 42702c5..0000000 Binary files a/icons/ico.png and /dev/null differ diff --git a/src/analyze/gui/128-apps-heaptrack.png b/src/analyze/gui/128-apps-heaptrack.png index c2ceb80..0597042 100644 Binary files a/src/analyze/gui/128-apps-heaptrack.png and b/src/analyze/gui/128-apps-heaptrack.png differ diff --git a/src/analyze/gui/128-heaptrack_app_icon.png b/src/analyze/gui/128-heaptrack_app_icon.png new file mode 100644 index 0000000..de2e90c Binary files /dev/null and b/src/analyze/gui/128-heaptrack_app_icon.png differ diff --git a/src/analyze/gui/16-apps-heaptrack.png b/src/analyze/gui/16-apps-heaptrack.png index 75eadde..2a10873 100644 Binary files a/src/analyze/gui/16-apps-heaptrack.png and b/src/analyze/gui/16-apps-heaptrack.png differ diff --git a/src/analyze/gui/22-apps-heaptrack.png b/src/analyze/gui/22-apps-heaptrack.png index c973fce..df3e930 100644 Binary files a/src/analyze/gui/22-apps-heaptrack.png and b/src/analyze/gui/22-apps-heaptrack.png differ diff --git a/src/analyze/gui/32-apps-heaptrack.png b/src/analyze/gui/32-apps-heaptrack.png index 704ed0c..3607270 100644 Binary files a/src/analyze/gui/32-apps-heaptrack.png and b/src/analyze/gui/32-apps-heaptrack.png differ diff --git a/src/analyze/gui/48-apps-heaptrack.png b/src/analyze/gui/48-apps-heaptrack.png index 05ee2d6..4a2f457 100644 Binary files a/src/analyze/gui/48-apps-heaptrack.png and b/src/analyze/gui/48-apps-heaptrack.png differ diff --git a/icons/heaptrack-512icon.png b/src/analyze/gui/512-heaptrack_app_icon.png similarity index 100% rename from icons/heaptrack-512icon.png rename to src/analyze/gui/512-heaptrack_app_icon.png diff --git a/src/analyze/gui/64-apps-heaptrack.png b/src/analyze/gui/64-apps-heaptrack.png index d58fb8e..3d9ce6a 100644 Binary files a/src/analyze/gui/64-apps-heaptrack.png and b/src/analyze/gui/64-apps-heaptrack.png differ diff --git a/src/analyze/gui/CMakeLists.txt b/src/analyze/gui/CMakeLists.txt index 00df0ad..b152c05 100644 --- a/src/analyze/gui/CMakeLists.txt +++ b/src/analyze/gui/CMakeLists.txt @@ -1,115 +1,120 @@ set(CMAKE_AUTOMOC 1) ki18n_wrap_ui(UIFILES mainwindow.ui ) unset(BIN_INSTALL_DIR) unset(LIB_INSTALL_DIR) unset(LIBEXEC_INSTALL_DIR) include(KDEInstallDirs) include(KDECMakeSettings) include(KDECompilerSettings NO_POLICY_SCOPE) include(ECMAddTests) +include(ECMInstallIcons) +include(ECMAddAppIcon) include_directories(${CMAKE_CURRENT_BINARY_DIR}) option(APPIMAGE_BUILD "configure build for bundling in an appimage" OFF) configure_file(gui_config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/gui_config.h) add_definitions(-Wall -DQT_NO_URL_CAST_FROM_STRING -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_BYTEARRAY -DQT_USE_QSTRINGBUILDER ) add_library(heaptrack_gui_private STATIC util.cpp parser.cpp ) target_link_libraries(heaptrack_gui_private PUBLIC KF5::I18n KF5::CoreAddons # KFormat KF5::ThreadWeaver Qt5::Core sharedprint pthread ${CMAKE_THREAD_LIBS_INIT} ) set(SRCFILES gui.cpp mainwindow.cpp treemodel.cpp treeproxy.cpp costdelegate.cpp flamegraph.cpp stacksmodel.cpp topproxy.cpp callercalleemodel.cpp + resources.qrc +) + +ecm_add_app_icon(SRCFILES ICONS + ${CMAKE_CURRENT_SOURCE_DIR}/128-heaptrack_app_icon.png + ${CMAKE_CURRENT_SOURCE_DIR}/512-heaptrack_app_icon.png ) set(LIBRARIES Qt5::Widgets KF5::ItemModels KF5::ConfigWidgets KF5::I18n KF5::KIOWidgets sharedprint heaptrack_gui_private ) - if (KChart_FOUND) list(APPEND SRCFILES chartwidget.cpp chartmodel.cpp chartproxy.cpp histogramwidget.cpp histogrammodel.cpp ) list(APPEND LIBRARIES KChart ) endif() add_executable(heaptrack_gui ${SRCFILES} ${UIFILES} ) target_link_libraries(heaptrack_gui ${LIBRARIES} ) install(TARGETS heaptrack_gui ${INSTALL_TARGETS_DEFAULT_ARGS} ) set_target_properties(heaptrack_gui PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${BIN_INSTALL_DIR}" ) install(PROGRAMS org.kde.heaptrack.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} ) install(FILES org.kde.heaptrack.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR} ) -include(ECMInstallIcons) ecm_install_icons(ICONS 16-apps-heaptrack.png 22-apps-heaptrack.png 32-apps-heaptrack.png 48-apps-heaptrack.png 64-apps-heaptrack.png 128-apps-heaptrack.png - sc-apps-heaptrack.svg DESTINATION ${KDE_INSTALL_ICONDIR} THEME hicolor ) diff --git a/src/analyze/gui/gui.cpp b/src/analyze/gui/gui.cpp index ac06632..e8cd0bb 100644 --- a/src/analyze/gui/gui.cpp +++ b/src/analyze/gui/gui.cpp @@ -1,92 +1,92 @@ /* * Copyright 2015-2017 Milian Wolff * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include "mainwindow.h" #include "gui_config.h" int main(int argc, char** argv) { QApplication app(argc, argv); #if APPIMAGE_BUILD QIcon::setThemeSearchPaths({app.applicationDirPath() + QLatin1String("/../share/icons/")}); QIcon::setThemeName(QStringLiteral("breeze")); #endif KLocalizedString::setApplicationDomain("heaptrack"); KAboutData aboutData(QStringLiteral("heaptrack_gui"), i18n("Heaptrack GUI"), QStringLiteral("0.1"), i18n("A visualizer for heaptrack data files."), KAboutLicense::LGPL, i18n("Copyright 2015, Milian Wolff "), QString(), QStringLiteral("mail@milianw.de")); aboutData.addAuthor(i18n("Milian Wolff"), i18n("Original author, maintainer"), QStringLiteral("mail@milianw.de"), QStringLiteral("http://milianw.de")); aboutData.setOrganizationDomain("kde.org"); #if KCOREADDONS_VERSION >= QT_VERSION_CHECK(5, 16, 0) aboutData.setDesktopFileName(QStringLiteral("org.kde.heaptrack")); #endif KAboutData::setApplicationData(aboutData); - app.setWindowIcon(QIcon::fromTheme(QStringLiteral("heaptrack"))); + app.setWindowIcon(QIcon(QStringLiteral(":/512-heaptrack_app_icon.png"))); QCommandLineParser parser; aboutData.setupCommandLine(&parser); QCommandLineOption diffOption{{QStringLiteral("d"), QStringLiteral("diff")}, i18n("Base profile data to compare other files to."), QStringLiteral("")}; parser.addOption(diffOption); parser.addPositionalArgument(QStringLiteral("files"), i18n("Files to load"), i18n("[FILE...]")); parser.process(app); aboutData.processCommandLine(&parser); auto createWindow = []() -> MainWindow* { auto window = new MainWindow; window->setAttribute(Qt::WA_DeleteOnClose); window->show(); return window; }; foreach (const QString& file, parser.positionalArguments()) { createWindow()->loadFile(file, parser.value(diffOption)); } if (parser.positionalArguments().isEmpty()) { createWindow(); } #if APPIMAGE_BUILD // cleanup the environment when we are running from within the AppImage // to allow launching system applications using Qt without them loading // the bundled Qt we ship in the AppImage auto LD_LIBRARY_PATH = qgetenv("LD_LIBRARY_PATH"); LD_LIBRARY_PATH.remove(0, LD_LIBRARY_PATH.indexOf(':') + 1); qputenv("LD_LIBRARY_PATH", LD_LIBRARY_PATH); #endif return app.exec(); } diff --git a/src/analyze/gui/resources.qrc b/src/analyze/gui/resources.qrc new file mode 100644 index 0000000..2087c57 --- /dev/null +++ b/src/analyze/gui/resources.qrc @@ -0,0 +1,5 @@ + + + 512-heaptrack_app_icon.png + + diff --git a/src/analyze/gui/sc-apps-heaptrack.svg b/src/analyze/gui/sc-apps-heaptrack.svg deleted file mode 100644 index 08737c8..0000000 --- a/src/analyze/gui/sc-apps-heaptrack.svg +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - -