Skip to content

Commit

Permalink
xdg: install icons from XDGData dir
Browse files Browse the repository at this point in the history
  • Loading branch information
eszlari committed Jan 4, 2021
1 parent 6805a31 commit 6d8aec2
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 282 deletions.
16 changes: 0 additions & 16 deletions src/Gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1387,22 +1387,6 @@ else(WIN32)
INSTALL(TARGETS FreeCADGui
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
#INSTALL(FILES Icons/freecad.xpm
# Icons/freecad-icon-16.png
# Icons/freecad-icon-32.png
# Icons/freecad-icon-48.png
# Icons/freecad-icon-64.png
# Icons/freecad.svg
# Icons/freecad-doc.png
# DESTINATION ${CMAKE_INSTALL_DATADIR}
#)
INSTALL(FILES Icons/freecad-icon-16.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/16x16/apps RENAME freecad.png)
INSTALL(FILES Icons/freecad-icon-32.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/32x32/apps RENAME freecad.png)
INSTALL(FILES Icons/freecad-icon-48.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/48x48/apps RENAME freecad.png)
INSTALL(FILES Icons/freecad-icon-64.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/64x64/apps RENAME freecad.png)
INSTALL(FILES Icons/freecad.svg DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/apps)
INSTALL(FILES Icons/freecad.xpm DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/pixmaps)
INSTALL(FILES Icons/freecad-doc.svg DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/mimetypes RENAME application-x-extension-fcstd.svg)
endif(WIN32)

set(FreeCADGui_Scripts
Expand Down
4 changes: 2 additions & 2 deletions src/Gui/FileDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -633,10 +633,10 @@ QIcon FileIconProvider::icon(const QFileInfo & info) const
{
if (info.suffix().toLower() == QLatin1String("fcstd")) {
// return QApplication::windowIcon();
return QIcon(QString::fromLatin1(":/icons/freecad-doc.png"));
return QIcon(QString::fromLatin1(":/icons/freecad-doc-64.png"));
}
else if (info.suffix().toLower().startsWith(QLatin1String("fcstd"))) {
QIcon icon(QString::fromLatin1(":/icons/freecad-doc.png"));
QIcon icon(QString::fromLatin1(":/icons/freecad-doc-64.png"));
QIcon darkIcon;
int w = QApplication::style()->pixelMetric(QStyle::PM_ListViewIconSize);
darkIcon.addPixmap(icon.pixmap(w, w, QIcon::Disabled, QIcon::Off), QIcon::Normal, QIcon::Off);
Expand Down
File renamed without changes
2 changes: 1 addition & 1 deletion src/Gui/Icons/resource.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<file>list-remove.svg</file>
<file>list-add.svg</file>
<file>freecad.svg</file>
<file>freecad-doc.png</file>
<file>freecad-doc-64.png</file>
<file>bulb.svg</file>
<file>TextDocument.svg</file>
<file>button_down.svg</file>
Expand Down
55 changes: 50 additions & 5 deletions src/XDGData/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
set(APPDATA_RELEASE_VERSION "${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}.${FREECAD_VERSION_PATCH}${PACKAGE_VERSION_SUFFIX}")

if(NOT DEFINED APPDATA_RELEASE_DATE)
if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
execute_process(COMMAND git log -1 --pretty=%cd --date=short
Expand Down Expand Up @@ -28,11 +30,6 @@ install(
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications
)

install(
FILES org.freecadweb.FreeCAD.svg
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/apps
)

install(
FILES org.freecadweb.FreeCAD.xml
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/mime/packages
Expand All @@ -42,3 +39,51 @@ install(
FILES FreeCAD.thumbnailer
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/thumbnailers
)

install(
FILES ../Gui/Icons/freecad-icon-16.png
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/16x16/apps
RENAME org.freecadweb.FreeCAD.png
)

install(
FILES ../Gui/Icons/freecad-icon-32.png
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/32x32/apps
RENAME org.freecadweb.FreeCAD.png
)

install(
FILES ../Gui/Icons/freecad-icon-48.png
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/48x48/apps
RENAME org.freecadweb.FreeCAD.png
)

install(
FILES ../Gui/Icons/freecad-icon-64.png
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/64x64/apps
RENAME org.freecadweb.FreeCAD.png
)

install(
FILES ../Gui/Icons/freecad.svg
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/apps
RENAME org.freecadweb.FreeCAD.svg
)

install(
FILES ../Gui/Icons/freecad.xpm
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/pixmaps
RENAME org.freecadweb.FreeCAD.xpm
)

install(
FILES ../Gui/Icons/freecad-doc.svg
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/mimetypes
RENAME org.freecadweb.FreeCAD-mimetype.svg
)

install(
FILES ../Gui/Icons/freecad-doc-64.png
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/64x64/mimetypes
RENAME org.freecadweb.FreeCAD-mimetype.png
)
2 changes: 1 addition & 1 deletion src/XDGData/org.freecadweb.FreeCAD.appdata.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@
<update_contact>yorik_AT_uncreated.net</update_contact>
<content_rating type="oars-1.1"/>
<releases>
<release version="@PACKAGE_VERSION@" date="@APPDATA_RELEASE_DATE@"/>
<release version="@APPDATA_RELEASE_VERSION@" date="@APPDATA_RELEASE_DATE@"/>
</releases>
</component>
256 changes: 0 additions & 256 deletions src/XDGData/org.freecadweb.FreeCAD.svg

This file was deleted.

2 changes: 1 addition & 1 deletion src/XDGData/org.freecadweb.FreeCAD.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
<!-- <sub-class-of type="application/zip"/> -->
<comment>FreeCAD document files</comment>
<glob pattern="*.fcstd"/>
<icon name="org.freecadweb.FreeCAD"/>
<generic-icon name="org.freecadweb.FreeCAD-mimetype"/>
</mime-type>
</mime-info>

0 comments on commit 6d8aec2

Please sign in to comment.