From bdc59a51dc1d4a8f77b13820beebe184072b21fb Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Tue, 27 Sep 2016 13:36:08 +0800 Subject: [PATCH 1/4] Add .desktop file --- gui/CMakeLists.txt | 10 ++++++++-- gui/cppcheck-gui.desktop | 8 ++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 gui/cppcheck-gui.desktop diff --git a/gui/CMakeLists.txt b/gui/CMakeLists.txt index 774f42267..7ceb9c60f 100644 --- a/gui/CMakeLists.txt +++ b/gui/CMakeLists.txt @@ -9,7 +9,7 @@ if (BUILD_GUI) else() add_definitions(-DQT_DEBUG) endif() - + include_directories(${PROJECT_SOURCE_DIR}/lib/) include_directories(SYSTEM ${PROJECT_SOURCE_DIR}/externals/tinyxml/) @@ -20,7 +20,7 @@ if (BUILD_GUI) QT4_WRAP_UI(uis_hdrs ${uis}) QT4_ADD_RESOURCES(resources "gui.qrc") QT4_ADD_TRANSLATION(qms ${tss}) - + add_executable(cppcheck-gui ${hdrs} ${srcs} ${uis_hdrs} ${resources} ${qms} $ $ $) target_link_libraries(cppcheck-gui ${QT_LIBRARIES}) if (HAVE_RULES) @@ -31,6 +31,12 @@ if (BUILD_GUI) install(TARGETS cppcheck-gui RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} COMPONENT applications) install(FILES ${qms} DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} COMPONENT applications) + install(FILES cppcheck-gui.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications) + + # icons + install(FILES icon.svg DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps) + install(FILES icon.png DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/64x64/apps) + set(CMAKE_AUTOMOC OFF) endif() diff --git a/gui/cppcheck-gui.desktop b/gui/cppcheck-gui.desktop new file mode 100644 index 000000000..844d5153f --- /dev/null +++ b/gui/cppcheck-gui.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Version=1.0 +Type=Application +Name=Cppcheck +Comment=A tool for static C/C++ code analysis +Exec=cppcheck-gui +Icon=icon +Categories=Development;Debugger;Qt; From 4e11c0004d614204c74d4c19bd751f5daa081d95 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Tue, 27 Sep 2016 16:10:09 +0800 Subject: [PATCH 2/4] Rename icon.png to cppcheck-gui.png --- gui/CMakeLists.txt | 2 +- gui/about.ui | 2 +- gui/cppcheck-gui.desktop | 2 +- gui/{icon.png => cppcheck-gui.png} | Bin gui/gui.qrc | 2 +- gui/main.cpp | 2 +- gui/main.ui | 2 +- 7 files changed, 6 insertions(+), 6 deletions(-) rename gui/{icon.png => cppcheck-gui.png} (100%) diff --git a/gui/CMakeLists.txt b/gui/CMakeLists.txt index 7ceb9c60f..acf7e026c 100644 --- a/gui/CMakeLists.txt +++ b/gui/CMakeLists.txt @@ -35,7 +35,7 @@ if (BUILD_GUI) # icons install(FILES icon.svg DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps) - install(FILES icon.png DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/64x64/apps) + install(FILES cppcheck-gui.png DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/64x64/apps) set(CMAKE_AUTOMOC OFF) diff --git a/gui/about.ui b/gui/about.ui index 03b2d390a..13cd19bf6 100644 --- a/gui/about.ui +++ b/gui/about.ui @@ -24,7 +24,7 @@ - :/icon.png + :/cppcheck-gui.png diff --git a/gui/cppcheck-gui.desktop b/gui/cppcheck-gui.desktop index 844d5153f..21e611f40 100644 --- a/gui/cppcheck-gui.desktop +++ b/gui/cppcheck-gui.desktop @@ -4,5 +4,5 @@ Type=Application Name=Cppcheck Comment=A tool for static C/C++ code analysis Exec=cppcheck-gui -Icon=icon +Icon=cppcheck-gui Categories=Development;Debugger;Qt; diff --git a/gui/icon.png b/gui/cppcheck-gui.png similarity index 100% rename from gui/icon.png rename to gui/cppcheck-gui.png diff --git a/gui/gui.qrc b/gui/gui.qrc index 12eb6312b..076b12f6a 100644 --- a/gui/gui.qrc +++ b/gui/gui.qrc @@ -1,6 +1,6 @@ - icon.png + cppcheck-gui.png images/dialog-error.png images/dialog-information.png images/dialog-warning.png diff --git a/gui/main.cpp b/gui/main.cpp index a02cfb13c..254bdd1c9 100644 --- a/gui/main.cpp +++ b/gui/main.cpp @@ -70,7 +70,7 @@ int main(int argc, char *argv[]) if (!CheckArgs(app.arguments())) return 0; - app.setWindowIcon(QIcon(":icon.png")); + app.setWindowIcon(QIcon(":cppcheck-gui.png")); // Register this metatype that is used to transfer error info qRegisterMetaType("ErrorItem"); diff --git a/gui/main.ui b/gui/main.ui index a6daa7f0a..09c4ecc97 100644 --- a/gui/main.ui +++ b/gui/main.ui @@ -260,7 +260,7 @@ - :/icon.png:/icon.png + :/cppcheck-gui.png:/cppcheck-gui.png &Directory... From 0972de14f186c24e3c3da448de4b66b9441b6a5a Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Tue, 27 Sep 2016 16:13:24 +0800 Subject: [PATCH 3/4] Rename icon.svg to cppcheck-gui.svg --- gui/CMakeLists.txt | 2 +- gui/{icon.svg => cppcheck-gui.svg} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename gui/{icon.svg => cppcheck-gui.svg} (100%) diff --git a/gui/CMakeLists.txt b/gui/CMakeLists.txt index acf7e026c..3a5f4edab 100644 --- a/gui/CMakeLists.txt +++ b/gui/CMakeLists.txt @@ -34,7 +34,7 @@ if (BUILD_GUI) install(FILES cppcheck-gui.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications) # icons - install(FILES icon.svg DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps) + install(FILES cppcheck-gui.svg DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps) install(FILES cppcheck-gui.png DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/64x64/apps) set(CMAKE_AUTOMOC OFF) diff --git a/gui/icon.svg b/gui/cppcheck-gui.svg similarity index 100% rename from gui/icon.svg rename to gui/cppcheck-gui.svg From 54ac95223eaeba4be84940329838590a9c0ccb2e Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Tue, 27 Sep 2016 17:06:26 +0800 Subject: [PATCH 4/4] Resize page to content. Results in better menu icon --- gui/cppcheck-gui.svg | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/gui/cppcheck-gui.svg b/gui/cppcheck-gui.svg index 7f565752d..5c31942df 100644 --- a/gui/cppcheck-gui.svg +++ b/gui/cppcheck-gui.svg @@ -9,12 +9,12 @@ xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="744.09448819" - height="1052.3622047" + width="573.00116" + height="505.54184" id="svg2" sodipodi:version="0.32" - inkscape:version="0.48.5 r10040" - sodipodi:docname="icon.svg" + inkscape:version="0.91 r13725" + sodipodi:docname="cppcheck-gui.svg" inkscape:output_extension="org.inkscape.output.svg.inkscape" inkscape:export-filename="/home/daniel/cppcheck/logo.png" inkscape:export-xdpi="12.045081" @@ -33,16 +33,20 @@ inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="0.59676231" - inkscape:cx="409.21617" - inkscape:cy="560.6768" + inkscape:cx="320.1211" + inkscape:cy="296.99526" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="false" inkscape:window-width="1440" - inkscape:window-height="900" + inkscape:window-height="891" inkscape:window-x="0" inkscape:window-y="0" - inkscape:window-maximized="0" /> + inkscape:window-maximized="0" + fit-margin-top="0" + fit-margin-left="0" + fit-margin-right="0" + fit-margin-bottom="0" /> @@ -51,15 +55,17 @@ image/svg+xml + + id="layer1" + transform="translate(-92.44649,-283.13881)"> c + style="fill:#9797ff;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:15;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1">c ++ + style="fill:#9797ff;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:15;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1">++