diff --git a/COPYING b/COPYING index fbca3c12c..174848e46 100644 --- a/COPYING +++ b/COPYING @@ -58,85 +58,95 @@ Files: share/icons/application/scalable/apps/keepassxc.svg Copyright: 2016, Lorenzo Stella License: LGPL-2 -Files: share/icons/database/C00_Password.png - share/icons/database/C01_Package_Network.png - share/icons/database/C02_MessageBox_Warning.png - share/icons/database/C03_Server.png - share/icons/database/C04_Klipper.png - share/icons/database/C05_Edu_Languages.png - share/icons/database/C06_KCMDF.png - share/icons/database/C07_Kate.png - share/icons/database/C08_Socket.png - share/icons/database/C09_Identity.png - share/icons/database/C10_Kontact.png - share/icons/database/C11_Camera.png - share/icons/database/C12_IRKickFlash.png - share/icons/database/C13_KGPG_Key3.png - share/icons/database/C14_Laptop_Power.png - share/icons/database/C15_Scanner.png - share/icons/database/C16_Mozilla_Firebird.png - share/icons/database/C17_CDROM_Unmount.png - share/icons/database/C18_Display.png - share/icons/database/C19_Mail_Generic.png - share/icons/database/C20_Misc.png - share/icons/database/C21_KOrganizer.png - share/icons/database/C22_ASCII.png - share/icons/database/C23_Icons.png - share/icons/database/C24_Connect_Established.png - share/icons/database/C25_Folder_Mail.png - share/icons/database/C26_FileSave.png - share/icons/database/C27_NFS_Unmount.png - share/icons/database/C28_QuickTime.png - share/icons/database/C29_KGPG_Term.png - share/icons/database/C30_Konsole.png - share/icons/database/C31_FilePrint.png - share/icons/database/C32_FSView.png - share/icons/database/C33_Run.png - share/icons/database/C34_Configure.png - share/icons/database/C35_KRFB.png - share/icons/database/C36_Ark.png - share/icons/database/C37_KPercentage.png - share/icons/database/C38_Samba_Unmount.png - share/icons/database/C39_History.png - share/icons/database/C40_Mail_Find.png - share/icons/database/C41_VectorGfx.png - share/icons/database/C42_KCMMemory.png - share/icons/database/C43_EditTrash.png - share/icons/database/C44_KNotes.png - share/icons/database/C45_Cancel.png - share/icons/database/C46_Help.png - share/icons/database/C47_KPackage.png - share/icons/database/C48_Folder.png - share/icons/database/C49_Folder_Blue_Open.png - share/icons/database/C50_Folder_Tar.png - share/icons/database/C51_Decrypted.png - share/icons/database/C52_Encrypted.png - share/icons/database/C53_Apply.png - share/icons/database/C54_Signature.png - share/icons/database/C55_Thumbnail.png - share/icons/database/C56_KAddressBook.png - share/icons/database/C57_View_Text.png - share/icons/database/C58_KGPG.png - share/icons/database/C59_Package_Development.png - share/icons/database/C60_KFM_Home.png - share/icons/database/C61_Services.png -Copyright: 2003-2004, David Vignoni -License: LGPL-2.1 -Comment: from Nuvola icon theme +Files: share/icons/database/C00_Password.svg + share/icons/database/C01_Package_Network.svg + share/icons/database/C02_MessageBox_Warning.svg + share/icons/database/C03_Server.svg + share/icons/database/C04_Klipper.svg + share/icons/database/C05_Edu_Languages.svg + share/icons/database/C06_KCMDF.svg + share/icons/database/C08_Socket.svg + share/icons/database/C09_Identity.svg + share/icons/database/C10_Kontact.svg + share/icons/database/C11_Camera.svg + share/icons/database/C12_IRKickFlash.svg + share/icons/database/C13_KGPG_Key3.svg + share/icons/database/C14_Laptop_Power.svg + share/icons/database/C15_Scanner.svg + share/icons/database/C16_Mozilla_Firebird.svg + share/icons/database/C19_Mail_Generic.svg + share/icons/database/C20_Misc.svg + share/icons/database/C21_KOrganizer.svg + share/icons/database/C22_ASCII.svg + share/icons/database/C23_Icons.svg + share/icons/database/C24_Connect_Established.svg + share/icons/database/C25_Folder_Mail.svg + share/icons/database/C28_QuickTime.svg + share/icons/database/C29_KGPG_Term.svg + share/icons/database/C30_Konsole.svg + share/icons/database/C31_FilePrint.svg + share/icons/database/C32_FSView.svg + share/icons/database/C33_Run.svg + share/icons/database/C34_Configure.svg + share/icons/database/C36_Ark.svg + share/icons/database/C39_History.svg + share/icons/database/C40_Mail_Find.svg + share/icons/database/C41_VectorGfx.svg + share/icons/database/C42_KCMMemory.svg + share/icons/database/C43_EditTrash.svg + share/icons/database/C47_KPackage.svg + share/icons/database/C48_Folder.svg + share/icons/database/C49_Folder_Blue_Open.svg + share/icons/database/C50_Folder_Tar.svg + share/icons/database/C55_Thumbnail.svg + share/icons/database/C56_KAddressBook.svg + share/icons/database/C57_View_Text.svg + share/icons/database/C58_KGPG.svg + share/icons/database/C59_Package_Development.svg + share/icons/database/C60_KFM_Home.svg + share/icons/database/C62_Tux.svg + share/icons/database/C63_Feather.svg + share/icons/database/C65_W.svg + share/icons/database/C67_Certificate.svg + share/icons/database/C68_BlackBerry.svg +Copyright: none +License: MIT +Comment: Taken from https://github.com/icons8/flat-color-icons -Files: share/icons/application/scalable/actions/application-exit.svg - share/icons/application/scalable/actions/auto-type.svg - share/icons/application/scalable/actions/chronometer.svg - share/icons/application/scalable/actions/clipboard-text.svg - share/icons/application/scalable/actions/configure.svg - share/icons/application/scalable/actions/database-change-key.svg - share/icons/application/scalable/actions/database-lock.svg - share/icons/application/scalable/actions/dialog-close.svg - share/icons/application/scalable/actions/dialog-ok.svg - share/icons/application/scalable/actions/document-close.svg +Files: share/icons/badges/0_ShareActive.svg + share/icons/badges/1_ShareInactive.svg + share/icons/database/C07_Kate.svg + share/icons/database/C17_CDROM_Unmount.svg + share/icons/database/C18_Display.svg + share/icons/database/C26_FileSave.svg + share/icons/database/C27_NFS_Unmount.svg + share/icons/database/C35_KRFB.svg + share/icons/database/C38_Samba_Unmount.svg + share/icons/database/C44_KNotes.svg + share/icons/database/C51_Decrypted.svg + share/icons/database/C52_Encrypted.svg + share/icons/database/C54_Signature.svg + share/icons/database/C66_Money.svg +Copyright: none +License: CC0 +Comment: Taken from https://github.com/paomedia/small-n-flat + +Files: share/icons/badges/2_Expired.svg + share/icons/database/C37_KPercentage.svg + share/icons/database/C45_Cancel.svg + share/icons/database/C46_Help.svg + share/icons/database/C53_Apply.svg + share/icons/database/C61_Services.svg +Copyright: 2020 KeePassXC Team +License: MIT + +Files: share/icons/application/scalable/actions/document-close.svg share/icons/application/scalable/actions/document-edit.svg + share/icons/application/scalable/actions/document-export.svg + share/icons/application/scalable/actions/document-import.svg share/icons/application/scalable/actions/document-new.svg share/icons/application/scalable/actions/document-open.svg + share/icons/application/scalable/actions/document-open-recent.svg share/icons/application/scalable/actions/document-properties.svg share/icons/application/scalable/actions/document-save.svg share/icons/application/scalable/actions/document-save-as.svg @@ -172,7 +182,6 @@ Files: share/icons/application/scalable/actions/application-exit.svg share/icons/application/scalable/actions/url-copy.svg share/icons/application/scalable/actions/username-copy.svg share/icons/application/scalable/actions/view-history.svg - share/icons/application/scalable/apps/freedesktop.svg share/icons/application/scalable/apps/internet-web-browser.svg share/icons/application/scalable/apps/keepassxc.svg share/icons/application/scalable/apps/keepassxc-dark.svg @@ -191,27 +200,6 @@ Copyright: 2019 Austin Andrews License: SIL OPEN FONT LICENSE Version 1.1 Comment: Taken from Material Design icon set (https://github.com/templarian/MaterialDesign/) -Files: share/icons/database/C62_Tux.png - share/icons/database/C63_Feather.png - share/icons/database/C64_Apple.png - share/icons/database/C67_Certificate.png - share/icons/database/C68_BlackBerry.png -Copyright: Mairin Duffy - Sarah Owens - James Birkett - Dominik Reichl -License: CC0 -Comment: C62_Tux.png from https://openclipart.org/detail/103855 - C63_Feather.png from http://openclipart.org/detail/122017 - C64_Apple.png based on http://openclipart.org/detail/24319 - C67_Certificate.png based on https://openclipart.org/detail/16729 - C68_BlackBerry.png from https://openclipart.org/detail/4465 - -Files: share/icons/database/C65_W.png - share/icons/database/C66_Money.png -Copyright: none -License: public-domain - Files: src/streams/qtiocompressor.* src/streams/QtIOCompressor tests/modeltest.* @@ -237,5 +225,6 @@ Copyright: GPL-2+ Comment: from Freedesktop.org website Files: share/icons/application/scalable/actions/hibp.svg + share/icons/database/C64_Apple.svg Copyright: GPL-2+ Comment: from the Simple Icons repo (https://github.com/simple-icons/simple-icons/) diff --git a/share/CMakeLists.txt b/share/CMakeLists.txt index e07e6f082..0dde0fecf 100644 --- a/share/CMakeLists.txt +++ b/share/CMakeLists.txt @@ -39,97 +39,19 @@ install(FILES icons/application/256x256/apps/keepassxc.png DESTINATION ${DATA_IN install(DIRECTORY docs/ DESTINATION ${DATA_INSTALL_DIR}/docs FILES_MATCHING PATTERN "*.pdf") -add_custom_target(icons - # SVG to PNGs for KeePassXC - COMMAND inkscape -z -w 16 -h 16 - icons/application/scalable/apps/keepassxc.svg -e icons/application/16x16/apps/keepassxc.png - COMMAND inkscape -z -w 24 -h 24 - icons/application/scalable/apps/keepassxc.svg -e icons/application/24x24/apps/keepassxc.png - COMMAND inkscape -z -w 32 -h 32 - icons/application/scalable/apps/keepassxc.svg -e icons/application/32x32/apps/keepassxc.png - COMMAND inkscape -z -w 48 -h 48 - icons/application/scalable/apps/keepassxc.svg -e icons/application/48x48/apps/keepassxc.png - COMMAND inkscape -z -w 64 -h 64 - icons/application/scalable/apps/keepassxc.svg -e icons/application/64x64/apps/keepassxc.png - COMMAND inkscape -z -w 128 -h 128 - icons/application/scalable/apps/keepassxc.svg -e icons/application/128x128/apps/keepassxc.png - COMMAND inkscape -z -w 256 -h 256 - icons/application/scalable/apps/keepassxc.svg -e icons/application/256x256/apps/keepassxc.png - # SVG to PNGs for KeePassXC - COMMAND inkscape -z -w 16 -h 16 - icons/application/scalable/apps/keepassxc-dark.svg -e icons/application/16x16/apps/keepassxc-dark.png - COMMAND inkscape -z -w 24 -h 24 - icons/application/scalable/apps/keepassxc-dark.svg -e icons/application/24x24/apps/keepassxc-dark.png - COMMAND inkscape -z -w 32 -h 32 - icons/application/scalable/apps/keepassxc-dark.svg -e icons/application/32x32/apps/keepassxc-dark.png - COMMAND inkscape -z -w 48 -h 48 - icons/application/scalable/apps/keepassxc-dark.svg -e icons/application/48x48/apps/keepassxc-dark.png - COMMAND inkscape -z -w 64 -h 64 - icons/application/scalable/apps/keepassxc-dark.svg -e icons/application/64x64/apps/keepassxc-dark.png - COMMAND inkscape -z -w 128 -h 128 - icons/application/scalable/apps/keepassxc-dark.svg -e icons/application/128x128/apps/keepassxc-dark.png - COMMAND inkscape -z -w 256 -h 256 - icons/application/scalable/apps/keepassxc-dark.svg -e icons/application/256x256/apps/keepassxc-dark.png +add_custom_target(icons) +add_custom_command(TARGET icons + COMMAND bash ./icons/minify.sh + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) +if(APPLE) + add_custom_command(TARGET icons + COMMAND png2icns macosx/keepassxc.icns icons/application/256x256/apps/keepassxc.png + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) +endif() - # SVG to PNGs for KeePassXC - COMMAND inkscape -z -w 16 -h 16 - icons/application/scalable/apps/keepassxc-locked.svg -e icons/application/16x16/apps/keepassxc-locked.png - COMMAND inkscape -z -w 24 -h 24 - icons/application/scalable/apps/keepassxc-locked.svg -e icons/application/24x24/apps/keepassxc-locked.png - COMMAND inkscape -z -w 32 -h 32 - icons/application/scalable/apps/keepassxc-locked.svg -e icons/application/32x32/apps/keepassxc-locked.png - COMMAND inkscape -z -w 48 -h 48 - icons/application/scalable/apps/keepassxc-locked.svg -e icons/application/48x48/apps/keepassxc-locked.png - COMMAND inkscape -z -w 64 -h 64 - icons/application/scalable/apps/keepassxc-locked.svg -e icons/application/64x64/apps/keepassxc-locked.png - COMMAND inkscape -z -w 128 -h 128 - icons/application/scalable/apps/keepassxc-locked.svg -e icons/application/128x128/apps/keepassxc-locked.png - COMMAND inkscape -z -w 256 -h 256 - icons/application/scalable/apps/keepassxc-locked.svg -e icons/application/256x256/apps/keepassxc-locked.png - - # SVG to PNGs for KeePassXC - COMMAND inkscape -z -w 16 -h 16 - icons/application/scalable/apps/keepassxc-unlocked.svg -e icons/application/16x16/apps/keepassxc-unlocked.png - COMMAND inkscape -z -w 24 -h 24 - icons/application/scalable/apps/keepassxc-unlocked.svg -e icons/application/24x24/apps/keepassxc-unlocked.png - COMMAND inkscape -z -w 32 -h 32 - icons/application/scalable/apps/keepassxc-unlocked.svg -e icons/application/32x32/apps/keepassxc-unlocked.png - COMMAND inkscape -z -w 48 -h 48 - icons/application/scalable/apps/keepassxc-unlocked.svg -e icons/application/48x48/apps/keepassxc-unlocked.png - COMMAND inkscape -z -w 64 -h 64 - icons/application/scalable/apps/keepassxc-unlocked.svg -e icons/application/64x64/apps/keepassxc-unlocked.png - COMMAND inkscape -z -w 128 -h 128 - icons/application/scalable/apps/keepassxc-unlocked.svg -e icons/application/128x128/apps/keepassxc-unlocked.png - COMMAND inkscape -z -w 256 -h 256 - icons/application/scalable/apps/keepassxc-unlocked.svg -e icons/application/256x256/apps/keepassxc-unlocked.png - - # SVG to PNGs for KeePassXC MIME-Type - COMMAND inkscape -z -w 16 -h 16 - icons/application/scalable/mimetypes/application-x-keepassxc.svg -e icons/application/16x16/mimetypes/application-x-keepassxc.png - COMMAND inkscape -z -w 22 -h 22 - icons/application/scalable/mimetypes/application-x-keepassxc.svg -e icons/application/22x22/mimetypes/application-x-keepassxc.png - COMMAND inkscape -z -w 32 -h 32 - icons/application/scalable/mimetypes/application-x-keepassxc.svg -e icons/application/32x32/mimetypes/application-x-keepassxc.png - COMMAND inkscape -z -w 64 -h 64 - icons/application/scalable/mimetypes/application-x-keepassxc.svg -e icons/application/64x64/mimetypes/application-x-keepassxc.png - COMMAND inkscape -z -w 128 -h 128 - icons/application/scalable/mimetypes/application-x-keepassxc.svg -e icons/application/128x128/mimetypes/application-x-keepassxc.png - - # Shrink PNGs using pngcrush - COMMAND bash ./crushpng.sh icons - - # ICNS for MacOS - COMMAND png2icns macosx/keepassxc.icns - icons/application/16x16/apps/keepassxc.png - icons/application/32x32/apps/keepassxc.png - icons/application/48x48/apps/keepassxc.png - icons/application/128x128/apps/keepassxc.png - icons/application/256x256/apps/keepassxc.png - - # ICO for Windows +# ICO for Windows +add_custom_command(TARGET icons COMMAND bash ./windows/create-ico.sh icons/application/scalable/apps/keepassxc.svg windows/keepassxc.ico COMMAND bash ./windows/create-ico.sh icons/application/scalable/mimetypes/application-x-keepassxc.svg windows/keepassxc-kdbx.ico - - VERBATIM WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/share/crushpng.sh b/share/crushpng.sh deleted file mode 100644 index f36176d3c..000000000 --- a/share/crushpng.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash - -if [[ -z $1 ]]; then - echo "You must supply a root folder!" - exit 1 -fi - -find "$1" -iname '*png' -exec pngcrush -ow -brute {} \; \ No newline at end of file diff --git a/share/demo.kdbx b/share/demo.kdbx index 736fe7544..5195cd19d 100644 Binary files a/share/demo.kdbx and b/share/demo.kdbx differ diff --git a/share/icons/application/scalable/actions/application-exit.svg b/share/icons/application/scalable/actions/application-exit.svg index aea8b16ad..0c820cf06 100644 --- a/share/icons/application/scalable/actions/application-exit.svg +++ b/share/icons/application/scalable/actions/application-exit.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/share/icons/application/scalable/actions/clipboard-text.svg b/share/icons/application/scalable/actions/clipboard-text.svg index 88e025e02..a6ad04e2e 100644 --- a/share/icons/application/scalable/actions/clipboard-text.svg +++ b/share/icons/application/scalable/actions/clipboard-text.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/share/icons/application/scalable/actions/configure.svg b/share/icons/application/scalable/actions/configure.svg index 6ab8c5e7c..5cacc6ff7 100644 --- a/share/icons/application/scalable/actions/configure.svg +++ b/share/icons/application/scalable/actions/configure.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/share/icons/application/scalable/actions/document-export.svg b/share/icons/application/scalable/actions/document-export.svg new file mode 100644 index 000000000..8b7a6504e --- /dev/null +++ b/share/icons/application/scalable/actions/document-export.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/application/scalable/actions/document-import.svg b/share/icons/application/scalable/actions/document-import.svg new file mode 100644 index 000000000..6cbea2f72 --- /dev/null +++ b/share/icons/application/scalable/actions/document-import.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/application/scalable/actions/document-open-recent.svg b/share/icons/application/scalable/actions/document-open-recent.svg new file mode 100644 index 000000000..c1f209520 --- /dev/null +++ b/share/icons/application/scalable/actions/document-open-recent.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/application/scalable/actions/entry-clone.svg b/share/icons/application/scalable/actions/entry-clone.svg index 001d98242..5cac2bbec 100644 --- a/share/icons/application/scalable/actions/entry-clone.svg +++ b/share/icons/application/scalable/actions/entry-clone.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/share/icons/application/scalable/actions/entry-delete.svg b/share/icons/application/scalable/actions/entry-delete.svg index dad58cf89..66ae96f1b 100644 --- a/share/icons/application/scalable/actions/entry-delete.svg +++ b/share/icons/application/scalable/actions/entry-delete.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/share/icons/application/scalable/actions/entry-edit.svg b/share/icons/application/scalable/actions/entry-edit.svg index 6e0b0afa8..174a1abce 100644 --- a/share/icons/application/scalable/actions/entry-edit.svg +++ b/share/icons/application/scalable/actions/entry-edit.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/share/icons/application/scalable/actions/entry-new.svg b/share/icons/application/scalable/actions/entry-new.svg index 3fe6bec7e..eec7f0724 100644 --- a/share/icons/application/scalable/actions/entry-new.svg +++ b/share/icons/application/scalable/actions/entry-new.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/share/icons/application/scalable/actions/move-down.svg b/share/icons/application/scalable/actions/move-down.svg index edcf11814..bc5edfb07 100644 --- a/share/icons/application/scalable/actions/move-down.svg +++ b/share/icons/application/scalable/actions/move-down.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/share/icons/application/scalable/actions/move-up.svg b/share/icons/application/scalable/actions/move-up.svg index 7ba0a9f13..ac6f52c17 100644 --- a/share/icons/application/scalable/actions/move-up.svg +++ b/share/icons/application/scalable/actions/move-up.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/share/icons/application/scalable/actions/refresh.svg b/share/icons/application/scalable/actions/refresh.svg index ebe3f16e7..767162cb6 100644 --- a/share/icons/application/scalable/actions/refresh.svg +++ b/share/icons/application/scalable/actions/refresh.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/share/icons/application/scalable/actions/sort-alphabetical-ascending.svg b/share/icons/application/scalable/actions/sort-alphabetical-ascending.svg index 50d98a418..754e90a28 100644 --- a/share/icons/application/scalable/actions/sort-alphabetical-ascending.svg +++ b/share/icons/application/scalable/actions/sort-alphabetical-ascending.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/share/icons/application/scalable/actions/sort-alphabetical-descending.svg b/share/icons/application/scalable/actions/sort-alphabetical-descending.svg index 602ea069d..4dbaadbe2 100644 --- a/share/icons/application/scalable/actions/sort-alphabetical-descending.svg +++ b/share/icons/application/scalable/actions/sort-alphabetical-descending.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/share/icons/application/scalable/status/dialog-error.svg b/share/icons/application/scalable/status/dialog-error.svg index 4cec1e30d..0a6c3e674 100644 --- a/share/icons/application/scalable/status/dialog-error.svg +++ b/share/icons/application/scalable/status/dialog-error.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/share/icons/badges/0_ShareActive.svg b/share/icons/badges/0_ShareActive.svg new file mode 100644 index 000000000..c9232eb62 --- /dev/null +++ b/share/icons/badges/0_ShareActive.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/badges/1_ShareInactive.svg b/share/icons/badges/1_ShareInactive.svg new file mode 100644 index 000000000..c458b211a --- /dev/null +++ b/share/icons/badges/1_ShareInactive.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/badges/2_Expired.svg b/share/icons/badges/2_Expired.svg new file mode 100644 index 000000000..7adda1bf9 --- /dev/null +++ b/share/icons/badges/2_Expired.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C00_Password.png b/share/icons/database/C00_Password.png deleted file mode 100644 index 86fa47f04..000000000 Binary files a/share/icons/database/C00_Password.png and /dev/null differ diff --git a/share/icons/database/C00_Password.svg b/share/icons/database/C00_Password.svg new file mode 100644 index 000000000..b9b987e96 --- /dev/null +++ b/share/icons/database/C00_Password.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C01_Package_Network.png b/share/icons/database/C01_Package_Network.png deleted file mode 100644 index dceb0a528..000000000 Binary files a/share/icons/database/C01_Package_Network.png and /dev/null differ diff --git a/share/icons/database/C01_Package_Network.svg b/share/icons/database/C01_Package_Network.svg new file mode 100644 index 000000000..bc6273932 --- /dev/null +++ b/share/icons/database/C01_Package_Network.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C02_MessageBox_Warning.png b/share/icons/database/C02_MessageBox_Warning.png deleted file mode 100644 index 0b8a56f47..000000000 Binary files a/share/icons/database/C02_MessageBox_Warning.png and /dev/null differ diff --git a/share/icons/database/C02_MessageBox_Warning.svg b/share/icons/database/C02_MessageBox_Warning.svg new file mode 100644 index 000000000..f982f76ee --- /dev/null +++ b/share/icons/database/C02_MessageBox_Warning.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C03_Server.png b/share/icons/database/C03_Server.png deleted file mode 100644 index 00ed93316..000000000 Binary files a/share/icons/database/C03_Server.png and /dev/null differ diff --git a/share/icons/database/C03_Server.svg b/share/icons/database/C03_Server.svg new file mode 100644 index 000000000..0d572e96d --- /dev/null +++ b/share/icons/database/C03_Server.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C04_Klipper.png b/share/icons/database/C04_Klipper.png deleted file mode 100644 index a451fe1d2..000000000 Binary files a/share/icons/database/C04_Klipper.png and /dev/null differ diff --git a/share/icons/database/C04_Klipper.svg b/share/icons/database/C04_Klipper.svg new file mode 100644 index 000000000..88ac1c50c --- /dev/null +++ b/share/icons/database/C04_Klipper.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C05_Edu_Languages.png b/share/icons/database/C05_Edu_Languages.png deleted file mode 100644 index d36534f59..000000000 Binary files a/share/icons/database/C05_Edu_Languages.png and /dev/null differ diff --git a/share/icons/database/C05_Edu_Languages.svg b/share/icons/database/C05_Edu_Languages.svg new file mode 100644 index 000000000..bf1ff0826 --- /dev/null +++ b/share/icons/database/C05_Edu_Languages.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C06_KCMDF.png b/share/icons/database/C06_KCMDF.png deleted file mode 100644 index 331895758..000000000 Binary files a/share/icons/database/C06_KCMDF.png and /dev/null differ diff --git a/share/icons/database/C06_KCMDF.svg b/share/icons/database/C06_KCMDF.svg new file mode 100644 index 000000000..0077b792e --- /dev/null +++ b/share/icons/database/C06_KCMDF.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C07_Kate.png b/share/icons/database/C07_Kate.png deleted file mode 100644 index 8427b9054..000000000 Binary files a/share/icons/database/C07_Kate.png and /dev/null differ diff --git a/share/icons/database/C07_Kate.svg b/share/icons/database/C07_Kate.svg new file mode 100644 index 000000000..694fd7e4d --- /dev/null +++ b/share/icons/database/C07_Kate.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C08_Socket.png b/share/icons/database/C08_Socket.png deleted file mode 100644 index 6baa73335..000000000 Binary files a/share/icons/database/C08_Socket.png and /dev/null differ diff --git a/share/icons/database/C08_Socket.svg b/share/icons/database/C08_Socket.svg new file mode 100644 index 000000000..dc701bdf4 --- /dev/null +++ b/share/icons/database/C08_Socket.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C09_Identity.png b/share/icons/database/C09_Identity.png deleted file mode 100644 index 0bf21df91..000000000 Binary files a/share/icons/database/C09_Identity.png and /dev/null differ diff --git a/share/icons/database/C09_Identity.svg b/share/icons/database/C09_Identity.svg new file mode 100644 index 000000000..d2154bce8 --- /dev/null +++ b/share/icons/database/C09_Identity.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C10_Kontact.png b/share/icons/database/C10_Kontact.png deleted file mode 100644 index 08d441315..000000000 Binary files a/share/icons/database/C10_Kontact.png and /dev/null differ diff --git a/share/icons/database/C10_Kontact.svg b/share/icons/database/C10_Kontact.svg new file mode 100644 index 000000000..4eea35988 --- /dev/null +++ b/share/icons/database/C10_Kontact.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C11_Camera.png b/share/icons/database/C11_Camera.png deleted file mode 100644 index e502227d0..000000000 Binary files a/share/icons/database/C11_Camera.png and /dev/null differ diff --git a/share/icons/database/C11_Camera.svg b/share/icons/database/C11_Camera.svg new file mode 100644 index 000000000..0fc7637cd --- /dev/null +++ b/share/icons/database/C11_Camera.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C12_IRKickFlash.png b/share/icons/database/C12_IRKickFlash.png deleted file mode 100644 index 4041042d3..000000000 Binary files a/share/icons/database/C12_IRKickFlash.png and /dev/null differ diff --git a/share/icons/database/C12_IRKickFlash.svg b/share/icons/database/C12_IRKickFlash.svg new file mode 100644 index 000000000..5a55e2f9c --- /dev/null +++ b/share/icons/database/C12_IRKickFlash.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C13_KGPG_Key3.png b/share/icons/database/C13_KGPG_Key3.png deleted file mode 100644 index db6aa8ec7..000000000 Binary files a/share/icons/database/C13_KGPG_Key3.png and /dev/null differ diff --git a/share/icons/database/C13_KGPG_Key3.svg b/share/icons/database/C13_KGPG_Key3.svg new file mode 100644 index 000000000..b7b9da69a --- /dev/null +++ b/share/icons/database/C13_KGPG_Key3.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C14_Laptop_Power.png b/share/icons/database/C14_Laptop_Power.png deleted file mode 100644 index 8cd59f809..000000000 Binary files a/share/icons/database/C14_Laptop_Power.png and /dev/null differ diff --git a/share/icons/database/C14_Laptop_Power.svg b/share/icons/database/C14_Laptop_Power.svg new file mode 100644 index 000000000..a10c99ff3 --- /dev/null +++ b/share/icons/database/C14_Laptop_Power.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C15_Scanner.png b/share/icons/database/C15_Scanner.png deleted file mode 100644 index 43f52ae8b..000000000 Binary files a/share/icons/database/C15_Scanner.png and /dev/null differ diff --git a/share/icons/database/C15_Scanner.svg b/share/icons/database/C15_Scanner.svg new file mode 100644 index 000000000..8d0f7c2f6 --- /dev/null +++ b/share/icons/database/C15_Scanner.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C16_Mozilla_Firebird.png b/share/icons/database/C16_Mozilla_Firebird.png deleted file mode 100644 index 7f592c673..000000000 Binary files a/share/icons/database/C16_Mozilla_Firebird.png and /dev/null differ diff --git a/share/icons/database/C16_Mozilla_Firebird.svg b/share/icons/database/C16_Mozilla_Firebird.svg new file mode 100644 index 000000000..c05515be8 --- /dev/null +++ b/share/icons/database/C16_Mozilla_Firebird.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C17_CDROM_Unmount.png b/share/icons/database/C17_CDROM_Unmount.png deleted file mode 100644 index 947190374..000000000 Binary files a/share/icons/database/C17_CDROM_Unmount.png and /dev/null differ diff --git a/share/icons/database/C17_CDROM_Unmount.svg b/share/icons/database/C17_CDROM_Unmount.svg new file mode 100644 index 000000000..6ccadf9e9 --- /dev/null +++ b/share/icons/database/C17_CDROM_Unmount.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C18_Display.png b/share/icons/database/C18_Display.png deleted file mode 100644 index 5348b7db2..000000000 Binary files a/share/icons/database/C18_Display.png and /dev/null differ diff --git a/share/icons/database/C18_Display.svg b/share/icons/database/C18_Display.svg new file mode 100644 index 000000000..5feb6a179 --- /dev/null +++ b/share/icons/database/C18_Display.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C19_Mail_Generic.png b/share/icons/database/C19_Mail_Generic.png deleted file mode 100644 index ca7812aeb..000000000 Binary files a/share/icons/database/C19_Mail_Generic.png and /dev/null differ diff --git a/share/icons/database/C19_Mail_Generic.svg b/share/icons/database/C19_Mail_Generic.svg new file mode 100644 index 000000000..e0f27b12c --- /dev/null +++ b/share/icons/database/C19_Mail_Generic.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C20_Misc.png b/share/icons/database/C20_Misc.png deleted file mode 100644 index f428e4f0d..000000000 Binary files a/share/icons/database/C20_Misc.png and /dev/null differ diff --git a/share/icons/database/C20_Misc.svg b/share/icons/database/C20_Misc.svg new file mode 100644 index 000000000..bf4a4219a --- /dev/null +++ b/share/icons/database/C20_Misc.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C21_KOrganizer.png b/share/icons/database/C21_KOrganizer.png deleted file mode 100644 index e66e4aca8..000000000 Binary files a/share/icons/database/C21_KOrganizer.png and /dev/null differ diff --git a/share/icons/database/C21_KOrganizer.svg b/share/icons/database/C21_KOrganizer.svg new file mode 100644 index 000000000..a090bb540 --- /dev/null +++ b/share/icons/database/C21_KOrganizer.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C22_ASCII.png b/share/icons/database/C22_ASCII.png deleted file mode 100644 index dcdfbed30..000000000 Binary files a/share/icons/database/C22_ASCII.png and /dev/null differ diff --git a/share/icons/database/C22_ASCII.svg b/share/icons/database/C22_ASCII.svg new file mode 100644 index 000000000..2c4e5a49b --- /dev/null +++ b/share/icons/database/C22_ASCII.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C23_Icons.png b/share/icons/database/C23_Icons.png deleted file mode 100644 index 0fcc98bd6..000000000 Binary files a/share/icons/database/C23_Icons.png and /dev/null differ diff --git a/share/icons/database/C23_Icons.svg b/share/icons/database/C23_Icons.svg new file mode 100644 index 000000000..796246379 --- /dev/null +++ b/share/icons/database/C23_Icons.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C24_Connect_Established.png b/share/icons/database/C24_Connect_Established.png deleted file mode 100644 index b691fb3fe..000000000 Binary files a/share/icons/database/C24_Connect_Established.png and /dev/null differ diff --git a/share/icons/database/C24_Connect_Established.svg b/share/icons/database/C24_Connect_Established.svg new file mode 100644 index 000000000..6b25c5e3f --- /dev/null +++ b/share/icons/database/C24_Connect_Established.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C25_Folder_Mail.png b/share/icons/database/C25_Folder_Mail.png deleted file mode 100644 index 3ef9fcb60..000000000 Binary files a/share/icons/database/C25_Folder_Mail.png and /dev/null differ diff --git a/share/icons/database/C25_Folder_Mail.svg b/share/icons/database/C25_Folder_Mail.svg new file mode 100644 index 000000000..f8e28f7fb --- /dev/null +++ b/share/icons/database/C25_Folder_Mail.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C26_FileSave.png b/share/icons/database/C26_FileSave.png deleted file mode 100644 index 0d87f2531..000000000 Binary files a/share/icons/database/C26_FileSave.png and /dev/null differ diff --git a/share/icons/database/C26_FileSave.svg b/share/icons/database/C26_FileSave.svg new file mode 100644 index 000000000..404c75b80 --- /dev/null +++ b/share/icons/database/C26_FileSave.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C27_NFS_Unmount.png b/share/icons/database/C27_NFS_Unmount.png deleted file mode 100644 index 4c5238461..000000000 Binary files a/share/icons/database/C27_NFS_Unmount.png and /dev/null differ diff --git a/share/icons/database/C27_NFS_Unmount.svg b/share/icons/database/C27_NFS_Unmount.svg new file mode 100644 index 000000000..0bb535f18 --- /dev/null +++ b/share/icons/database/C27_NFS_Unmount.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C28_QuickTime.png b/share/icons/database/C28_QuickTime.png deleted file mode 100644 index 59a169491..000000000 Binary files a/share/icons/database/C28_QuickTime.png and /dev/null differ diff --git a/share/icons/database/C28_QuickTime.svg b/share/icons/database/C28_QuickTime.svg new file mode 100644 index 000000000..bf2ad5acf --- /dev/null +++ b/share/icons/database/C28_QuickTime.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C29_KGPG_Term.png b/share/icons/database/C29_KGPG_Term.png deleted file mode 100644 index 010d33570..000000000 Binary files a/share/icons/database/C29_KGPG_Term.png and /dev/null differ diff --git a/share/icons/database/C29_KGPG_Term.svg b/share/icons/database/C29_KGPG_Term.svg new file mode 100644 index 000000000..ddbf38493 --- /dev/null +++ b/share/icons/database/C29_KGPG_Term.svg @@ -0,0 +1 @@ +>_ \ No newline at end of file diff --git a/share/icons/database/C30_Konsole.png b/share/icons/database/C30_Konsole.png deleted file mode 100644 index 292df84ce..000000000 Binary files a/share/icons/database/C30_Konsole.png and /dev/null differ diff --git a/share/icons/database/C30_Konsole.svg b/share/icons/database/C30_Konsole.svg new file mode 100644 index 000000000..7a88da621 --- /dev/null +++ b/share/icons/database/C30_Konsole.svg @@ -0,0 +1 @@ +>_ \ No newline at end of file diff --git a/share/icons/database/C31_FilePrint.png b/share/icons/database/C31_FilePrint.png deleted file mode 100644 index 4ff0f127c..000000000 Binary files a/share/icons/database/C31_FilePrint.png and /dev/null differ diff --git a/share/icons/database/C31_FilePrint.svg b/share/icons/database/C31_FilePrint.svg new file mode 100644 index 000000000..53234c85c --- /dev/null +++ b/share/icons/database/C31_FilePrint.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C32_FSView.png b/share/icons/database/C32_FSView.png deleted file mode 100644 index 53dda269a..000000000 Binary files a/share/icons/database/C32_FSView.png and /dev/null differ diff --git a/share/icons/database/C32_FSView.svg b/share/icons/database/C32_FSView.svg new file mode 100644 index 000000000..c0d42f28a --- /dev/null +++ b/share/icons/database/C32_FSView.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C33_Run.png b/share/icons/database/C33_Run.png deleted file mode 100644 index 522b0a3f9..000000000 Binary files a/share/icons/database/C33_Run.png and /dev/null differ diff --git a/share/icons/database/C33_Run.svg b/share/icons/database/C33_Run.svg new file mode 100644 index 000000000..d8375ceff --- /dev/null +++ b/share/icons/database/C33_Run.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C34_Configure.png b/share/icons/database/C34_Configure.png deleted file mode 100644 index 5314140ec..000000000 Binary files a/share/icons/database/C34_Configure.png and /dev/null differ diff --git a/share/icons/database/C34_Configure.svg b/share/icons/database/C34_Configure.svg new file mode 100644 index 000000000..8a3da3fb1 --- /dev/null +++ b/share/icons/database/C34_Configure.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C35_KRFB.png b/share/icons/database/C35_KRFB.png deleted file mode 100644 index b518beebd..000000000 Binary files a/share/icons/database/C35_KRFB.png and /dev/null differ diff --git a/share/icons/database/C35_KRFB.svg b/share/icons/database/C35_KRFB.svg new file mode 100644 index 000000000..3fa748d67 --- /dev/null +++ b/share/icons/database/C35_KRFB.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C36_Ark.png b/share/icons/database/C36_Ark.png deleted file mode 100644 index e30bb09b9..000000000 Binary files a/share/icons/database/C36_Ark.png and /dev/null differ diff --git a/share/icons/database/C36_Ark.svg b/share/icons/database/C36_Ark.svg new file mode 100644 index 000000000..e593d65c7 --- /dev/null +++ b/share/icons/database/C36_Ark.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C37_KPercentage.png b/share/icons/database/C37_KPercentage.png deleted file mode 100644 index 64995d2de..000000000 Binary files a/share/icons/database/C37_KPercentage.png and /dev/null differ diff --git a/share/icons/database/C37_KPercentage.svg b/share/icons/database/C37_KPercentage.svg new file mode 100644 index 000000000..3db85351e --- /dev/null +++ b/share/icons/database/C37_KPercentage.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C38_Samba_Unmount.png b/share/icons/database/C38_Samba_Unmount.png deleted file mode 100644 index 4112a4f63..000000000 Binary files a/share/icons/database/C38_Samba_Unmount.png and /dev/null differ diff --git a/share/icons/database/C38_Samba_Unmount.svg b/share/icons/database/C38_Samba_Unmount.svg new file mode 100644 index 000000000..220ef6d98 --- /dev/null +++ b/share/icons/database/C38_Samba_Unmount.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C39_History.png b/share/icons/database/C39_History.png deleted file mode 100644 index 95e7d6e8e..000000000 Binary files a/share/icons/database/C39_History.png and /dev/null differ diff --git a/share/icons/database/C39_History.svg b/share/icons/database/C39_History.svg new file mode 100644 index 000000000..a50a0f92a --- /dev/null +++ b/share/icons/database/C39_History.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C40_Mail_Find.png b/share/icons/database/C40_Mail_Find.png deleted file mode 100644 index 6dfbb958d..000000000 Binary files a/share/icons/database/C40_Mail_Find.png and /dev/null differ diff --git a/share/icons/database/C40_Mail_Find.svg b/share/icons/database/C40_Mail_Find.svg new file mode 100644 index 000000000..f049a7f2d --- /dev/null +++ b/share/icons/database/C40_Mail_Find.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C41_VectorGfx.png b/share/icons/database/C41_VectorGfx.png deleted file mode 100644 index ec47b76e3..000000000 Binary files a/share/icons/database/C41_VectorGfx.png and /dev/null differ diff --git a/share/icons/database/C41_VectorGfx.svg b/share/icons/database/C41_VectorGfx.svg new file mode 100644 index 000000000..443386055 --- /dev/null +++ b/share/icons/database/C41_VectorGfx.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C42_KCMMemory.png b/share/icons/database/C42_KCMMemory.png deleted file mode 100644 index ee2560a02..000000000 Binary files a/share/icons/database/C42_KCMMemory.png and /dev/null differ diff --git a/share/icons/database/C42_KCMMemory.svg b/share/icons/database/C42_KCMMemory.svg new file mode 100644 index 000000000..6a58fbdaa --- /dev/null +++ b/share/icons/database/C42_KCMMemory.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C43_EditTrash.png b/share/icons/database/C43_EditTrash.png deleted file mode 100644 index d09e07935..000000000 Binary files a/share/icons/database/C43_EditTrash.png and /dev/null differ diff --git a/share/icons/database/C43_EditTrash.svg b/share/icons/database/C43_EditTrash.svg new file mode 100644 index 000000000..7c4d19e08 --- /dev/null +++ b/share/icons/database/C43_EditTrash.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C44_KNotes.png b/share/icons/database/C44_KNotes.png deleted file mode 100644 index f981a9a47..000000000 Binary files a/share/icons/database/C44_KNotes.png and /dev/null differ diff --git a/share/icons/database/C44_KNotes.svg b/share/icons/database/C44_KNotes.svg new file mode 100644 index 000000000..0852fdd1d --- /dev/null +++ b/share/icons/database/C44_KNotes.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C45_Cancel.png b/share/icons/database/C45_Cancel.png deleted file mode 100644 index 443450f09..000000000 Binary files a/share/icons/database/C45_Cancel.png and /dev/null differ diff --git a/share/icons/database/C45_Cancel.svg b/share/icons/database/C45_Cancel.svg new file mode 100644 index 000000000..df1efdc0e --- /dev/null +++ b/share/icons/database/C45_Cancel.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C46_Help.png b/share/icons/database/C46_Help.png deleted file mode 100644 index fc50cff74..000000000 Binary files a/share/icons/database/C46_Help.png and /dev/null differ diff --git a/share/icons/database/C46_Help.svg b/share/icons/database/C46_Help.svg new file mode 100644 index 000000000..6a7bf8193 --- /dev/null +++ b/share/icons/database/C46_Help.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C47_KPackage.png b/share/icons/database/C47_KPackage.png deleted file mode 100644 index ac5d51789..000000000 Binary files a/share/icons/database/C47_KPackage.png and /dev/null differ diff --git a/share/icons/database/C47_KPackage.svg b/share/icons/database/C47_KPackage.svg new file mode 100644 index 000000000..79b06f96c --- /dev/null +++ b/share/icons/database/C47_KPackage.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C48_Folder.png b/share/icons/database/C48_Folder.png deleted file mode 100644 index e648b3fec..000000000 Binary files a/share/icons/database/C48_Folder.png and /dev/null differ diff --git a/share/icons/database/C48_Folder.svg b/share/icons/database/C48_Folder.svg new file mode 100644 index 000000000..5bf47b6e2 --- /dev/null +++ b/share/icons/database/C48_Folder.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C49_Folder_Blue_Open.png b/share/icons/database/C49_Folder_Blue_Open.png deleted file mode 100644 index baba6e00e..000000000 Binary files a/share/icons/database/C49_Folder_Blue_Open.png and /dev/null differ diff --git a/share/icons/database/C49_Folder_Blue_Open.svg b/share/icons/database/C49_Folder_Blue_Open.svg new file mode 100644 index 000000000..917c61f1f --- /dev/null +++ b/share/icons/database/C49_Folder_Blue_Open.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C50_Folder_Tar.png b/share/icons/database/C50_Folder_Tar.png deleted file mode 100644 index 69f1c455d..000000000 Binary files a/share/icons/database/C50_Folder_Tar.png and /dev/null differ diff --git a/share/icons/database/C50_Folder_Tar.svg b/share/icons/database/C50_Folder_Tar.svg new file mode 100644 index 000000000..68ee554ee --- /dev/null +++ b/share/icons/database/C50_Folder_Tar.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C51_Decrypted.png b/share/icons/database/C51_Decrypted.png deleted file mode 100644 index 1e239a7cc..000000000 Binary files a/share/icons/database/C51_Decrypted.png and /dev/null differ diff --git a/share/icons/database/C51_Decrypted.svg b/share/icons/database/C51_Decrypted.svg new file mode 100644 index 000000000..d10c64d23 --- /dev/null +++ b/share/icons/database/C51_Decrypted.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C52_Encrypted.png b/share/icons/database/C52_Encrypted.png deleted file mode 100644 index e1edec451..000000000 Binary files a/share/icons/database/C52_Encrypted.png and /dev/null differ diff --git a/share/icons/database/C52_Encrypted.svg b/share/icons/database/C52_Encrypted.svg new file mode 100644 index 000000000..113e11a07 --- /dev/null +++ b/share/icons/database/C52_Encrypted.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C53_Apply.png b/share/icons/database/C53_Apply.png deleted file mode 100644 index a2ae9cfc7..000000000 Binary files a/share/icons/database/C53_Apply.png and /dev/null differ diff --git a/share/icons/database/C53_Apply.svg b/share/icons/database/C53_Apply.svg new file mode 100644 index 000000000..7ebd41c06 --- /dev/null +++ b/share/icons/database/C53_Apply.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C54_Signature.png b/share/icons/database/C54_Signature.png deleted file mode 100644 index ba5ac29dd..000000000 Binary files a/share/icons/database/C54_Signature.png and /dev/null differ diff --git a/share/icons/database/C54_Signature.svg b/share/icons/database/C54_Signature.svg new file mode 100644 index 000000000..a6adc424a --- /dev/null +++ b/share/icons/database/C54_Signature.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C55_Thumbnail.png b/share/icons/database/C55_Thumbnail.png deleted file mode 100644 index 4c3a26d44..000000000 Binary files a/share/icons/database/C55_Thumbnail.png and /dev/null differ diff --git a/share/icons/database/C55_Thumbnail.svg b/share/icons/database/C55_Thumbnail.svg new file mode 100644 index 000000000..64f174db0 --- /dev/null +++ b/share/icons/database/C55_Thumbnail.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C56_KAddressBook.png b/share/icons/database/C56_KAddressBook.png deleted file mode 100644 index e24b44ad3..000000000 Binary files a/share/icons/database/C56_KAddressBook.png and /dev/null differ diff --git a/share/icons/database/C56_KAddressBook.svg b/share/icons/database/C56_KAddressBook.svg new file mode 100644 index 000000000..cceebf11d --- /dev/null +++ b/share/icons/database/C56_KAddressBook.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C57_View_Text.png b/share/icons/database/C57_View_Text.png deleted file mode 100644 index afaa8132e..000000000 Binary files a/share/icons/database/C57_View_Text.png and /dev/null differ diff --git a/share/icons/database/C57_View_Text.svg b/share/icons/database/C57_View_Text.svg new file mode 100644 index 000000000..aba208d94 --- /dev/null +++ b/share/icons/database/C57_View_Text.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C58_KGPG.png b/share/icons/database/C58_KGPG.png deleted file mode 100644 index a842c7971..000000000 Binary files a/share/icons/database/C58_KGPG.png and /dev/null differ diff --git a/share/icons/database/C58_KGPG.svg b/share/icons/database/C58_KGPG.svg new file mode 100644 index 000000000..aaa0fef8f --- /dev/null +++ b/share/icons/database/C58_KGPG.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C58_KPGP.svg b/share/icons/database/C58_KPGP.svg new file mode 100644 index 000000000..aaa0fef8f --- /dev/null +++ b/share/icons/database/C58_KPGP.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C59_Package_Development.png b/share/icons/database/C59_Package_Development.png deleted file mode 100644 index b740c987b..000000000 Binary files a/share/icons/database/C59_Package_Development.png and /dev/null differ diff --git a/share/icons/database/C59_Package_Development.svg b/share/icons/database/C59_Package_Development.svg new file mode 100644 index 000000000..f989becc3 --- /dev/null +++ b/share/icons/database/C59_Package_Development.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C60_KFM_Home.png b/share/icons/database/C60_KFM_Home.png deleted file mode 100644 index 8076b8e24..000000000 Binary files a/share/icons/database/C60_KFM_Home.png and /dev/null differ diff --git a/share/icons/database/C60_KFM_Home.svg b/share/icons/database/C60_KFM_Home.svg new file mode 100644 index 000000000..7a7bb80c5 --- /dev/null +++ b/share/icons/database/C60_KFM_Home.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C61_Services.png b/share/icons/database/C61_Services.png deleted file mode 100644 index 66478f4ad..000000000 Binary files a/share/icons/database/C61_Services.png and /dev/null differ diff --git a/share/icons/database/C61_Services.svg b/share/icons/database/C61_Services.svg new file mode 100644 index 000000000..3681a83eb --- /dev/null +++ b/share/icons/database/C61_Services.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C62_Tux.png b/share/icons/database/C62_Tux.png deleted file mode 100644 index c22c15e2c..000000000 Binary files a/share/icons/database/C62_Tux.png and /dev/null differ diff --git a/share/icons/database/C62_Tux.svg b/share/icons/database/C62_Tux.svg new file mode 100644 index 000000000..f2e641f31 --- /dev/null +++ b/share/icons/database/C62_Tux.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C63_Feather.png b/share/icons/database/C63_Feather.png deleted file mode 100644 index 307deac8a..000000000 Binary files a/share/icons/database/C63_Feather.png and /dev/null differ diff --git a/share/icons/database/C63_Feather.svg b/share/icons/database/C63_Feather.svg new file mode 100644 index 000000000..c612ffb14 --- /dev/null +++ b/share/icons/database/C63_Feather.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C64_Apple.png b/share/icons/database/C64_Apple.png deleted file mode 100644 index d799fec0a..000000000 Binary files a/share/icons/database/C64_Apple.png and /dev/null differ diff --git a/share/icons/database/C64_Apple.svg b/share/icons/database/C64_Apple.svg new file mode 100644 index 000000000..efca9f4fd --- /dev/null +++ b/share/icons/database/C64_Apple.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C65_W.png b/share/icons/database/C65_W.png deleted file mode 100644 index d3315b36c..000000000 Binary files a/share/icons/database/C65_W.png and /dev/null differ diff --git a/share/icons/database/C65_W.svg b/share/icons/database/C65_W.svg new file mode 100644 index 000000000..4f598e9ea --- /dev/null +++ b/share/icons/database/C65_W.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C66_Money.png b/share/icons/database/C66_Money.png deleted file mode 100644 index 619cea4b2..000000000 Binary files a/share/icons/database/C66_Money.png and /dev/null differ diff --git a/share/icons/database/C66_Money.svg b/share/icons/database/C66_Money.svg new file mode 100644 index 000000000..3fa77413b --- /dev/null +++ b/share/icons/database/C66_Money.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C67_Certificate.png b/share/icons/database/C67_Certificate.png deleted file mode 100644 index ba7a76799..000000000 Binary files a/share/icons/database/C67_Certificate.png and /dev/null differ diff --git a/share/icons/database/C67_Certificate.svg b/share/icons/database/C67_Certificate.svg new file mode 100644 index 000000000..51087b4d5 --- /dev/null +++ b/share/icons/database/C67_Certificate.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/database/C68_BlackBerry.png b/share/icons/database/C68_BlackBerry.png deleted file mode 100644 index 9f7e4db39..000000000 Binary files a/share/icons/database/C68_BlackBerry.png and /dev/null differ diff --git a/share/icons/database/C68_BlackBerry.svg b/share/icons/database/C68_BlackBerry.svg new file mode 100644 index 000000000..6c0b2b43f --- /dev/null +++ b/share/icons/database/C68_BlackBerry.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/icons.qrc b/share/icons/icons.qrc index 4f01feca4..a02106d21 100644 --- a/share/icons/icons.qrc +++ b/share/icons/icons.qrc @@ -18,8 +18,11 @@ application/scalable/actions/dialog-ok.svg application/scalable/actions/document-close.svg application/scalable/actions/document-edit.svg + application/scalable/actions/document-export.svg + application/scalable/actions/document-import.svg application/scalable/actions/document-new.svg application/scalable/actions/document-open.svg + application/scalable/actions/document-open-recent.svg application/scalable/actions/document-properties.svg application/scalable/actions/document-save.svg application/scalable/actions/document-save-as.svg @@ -53,7 +56,7 @@ application/scalable/actions/password-generator.svg application/scalable/actions/password-show-off.svg application/scalable/actions/password-show-on.svg - application/scalable/actions/refresh.svg + application/scalable/actions/refresh.svg application/scalable/actions/reports.svg application/scalable/actions/reports-exclude.svg application/scalable/actions/sort-alphabetical-ascending.svg @@ -87,74 +90,78 @@ application/scalable/status/dialog-warning.svg application/scalable/status/security-high.svg - database/C00_Password.png - database/C01_Package_Network.png - database/C02_MessageBox_Warning.png - database/C03_Server.png - database/C04_Klipper.png - database/C05_Edu_Languages.png - database/C06_KCMDF.png - database/C07_Kate.png - database/C08_Socket.png - database/C09_Identity.png - database/C10_Kontact.png - database/C11_Camera.png - database/C12_IRKickFlash.png - database/C13_KGPG_Key3.png - database/C14_Laptop_Power.png - database/C15_Scanner.png - database/C16_Mozilla_Firebird.png - database/C17_CDROM_Unmount.png - database/C18_Display.png - database/C19_Mail_Generic.png - database/C20_Misc.png - database/C21_KOrganizer.png - database/C22_ASCII.png - database/C23_Icons.png - database/C24_Connect_Established.png - database/C25_Folder_Mail.png - database/C26_FileSave.png - database/C27_NFS_Unmount.png - database/C28_QuickTime.png - database/C29_KGPG_Term.png - database/C30_Konsole.png - database/C31_FilePrint.png - database/C32_FSView.png - database/C33_Run.png - database/C34_Configure.png - database/C35_KRFB.png - database/C36_Ark.png - database/C37_KPercentage.png - database/C38_Samba_Unmount.png - database/C39_History.png - database/C40_Mail_Find.png - database/C41_VectorGfx.png - database/C42_KCMMemory.png - database/C43_EditTrash.png - database/C44_KNotes.png - database/C45_Cancel.png - database/C46_Help.png - database/C47_KPackage.png - database/C48_Folder.png - database/C49_Folder_Blue_Open.png - database/C50_Folder_Tar.png - database/C51_Decrypted.png - database/C52_Encrypted.png - database/C53_Apply.png - database/C54_Signature.png - database/C55_Thumbnail.png - database/C56_KAddressBook.png - database/C57_View_Text.png - database/C58_KGPG.png - database/C59_Package_Development.png - database/C60_KFM_Home.png - database/C61_Services.png - database/C62_Tux.png - database/C63_Feather.png - database/C64_Apple.png - database/C65_W.png - database/C66_Money.png - database/C67_Certificate.png - database/C68_BlackBerry.png + database/C00_Password.svg + database/C01_Package_Network.svg + database/C02_MessageBox_Warning.svg + database/C03_Server.svg + database/C04_Klipper.svg + database/C05_Edu_Languages.svg + database/C06_KCMDF.svg + database/C07_Kate.svg + database/C08_Socket.svg + database/C09_Identity.svg + database/C10_Kontact.svg + database/C11_Camera.svg + database/C12_IRKickFlash.svg + database/C13_KGPG_Key3.svg + database/C14_Laptop_Power.svg + database/C15_Scanner.svg + database/C16_Mozilla_Firebird.svg + database/C17_CDROM_Unmount.svg + database/C18_Display.svg + database/C19_Mail_Generic.svg + database/C20_Misc.svg + database/C21_KOrganizer.svg + database/C22_ASCII.svg + database/C23_Icons.svg + database/C24_Connect_Established.svg + database/C25_Folder_Mail.svg + database/C26_FileSave.svg + database/C27_NFS_Unmount.svg + database/C28_QuickTime.svg + database/C29_KGPG_Term.svg + database/C30_Konsole.svg + database/C31_FilePrint.svg + database/C32_FSView.svg + database/C33_Run.svg + database/C34_Configure.svg + database/C35_KRFB.svg + database/C36_Ark.svg + database/C37_KPercentage.svg + database/C38_Samba_Unmount.svg + database/C39_History.svg + database/C40_Mail_Find.svg + database/C41_VectorGfx.svg + database/C42_KCMMemory.svg + database/C43_EditTrash.svg + database/C44_KNotes.svg + database/C45_Cancel.svg + database/C46_Help.svg + database/C47_KPackage.svg + database/C48_Folder.svg + database/C49_Folder_Blue_Open.svg + database/C50_Folder_Tar.svg + database/C51_Decrypted.svg + database/C52_Encrypted.svg + database/C53_Apply.svg + database/C54_Signature.svg + database/C55_Thumbnail.svg + database/C56_KAddressBook.svg + database/C57_View_Text.svg + database/C58_KGPG.svg + database/C59_Package_Development.svg + database/C60_KFM_Home.svg + database/C61_Services.svg + database/C62_Tux.svg + database/C63_Feather.svg + database/C64_Apple.svg + database/C65_W.svg + database/C66_Money.svg + database/C67_Certificate.svg + database/C68_BlackBerry.svg + + badges/0_ShareActive.svg + badges/1_ShareInactive.svg + badges/2_Expired.svg diff --git a/share/icons/minify.sh b/share/icons/minify.sh new file mode 100644 index 000000000..6286031a8 --- /dev/null +++ b/share/icons/minify.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +NC='\033[0m' +YELLOW='\033[0;33m' + +# Build desktop icon +echo "Creating desktop icon PNG..." +if command -v "inkscape" &> /dev/null; then + inkscape -z -w 256 -h 256 icons/application/scalable/apps/keepassxc.svg -e icons/application/256x256/apps/keepassxc.png +else + echo -e "${YELLOW}Could not find inkscape; keepassxc.png not built!${NC}" +fi + +# Minify SVG's +echo "Minifying SVG's..." +minify -o icons/badges --match=.svg icons/badges +minify -o icons/database --match=.svg icons/database + +# Crush PNG's +echo "Crushing PNG's..." +find "." -iname '*png' -exec pngcrush -ow -brute {} \; diff --git a/share/windows/create-ico.sh b/share/windows/create-ico.sh index 44ae06a04..d78592fe0 100644 --- a/share/windows/create-ico.sh +++ b/share/windows/create-ico.sh @@ -1,7 +1,11 @@ #!/usr/bin/env bash +NC='\033[0m' +RED='\033[0;31m' +YELLOW='\033[0;33m' + if [[ -z "$1" ]]; then - echo "You must include an SVG file to convert!" + echo -e "${RED}You must include an SVG file to convert!${NC}" exit 1 fi @@ -10,6 +14,11 @@ if [[ -z "outfile" ]]; then outfile="logo.ico" fi +if ! command -v "inkscape" &> /dev/null; then + echo -e "${YELLOW}Could not find inkscape; $outfile not built!${NC}" + exit 0 +fi + echo "Generating $outfile from $1..." size_list=(16 24 32 48 64 128 256) for size in ${size_list[@]}; do diff --git a/share/wizard/background-pixmap.png b/share/wizard/background-pixmap.png index e64d87041..0651b38f5 100644 Binary files a/share/wizard/background-pixmap.png and b/share/wizard/background-pixmap.png differ diff --git a/src/core/DatabaseIcons.cpp b/src/core/DatabaseIcons.cpp index 70c5c19c9..2935d98ff 100644 --- a/src/core/DatabaseIcons.cpp +++ b/src/core/DatabaseIcons.cpp @@ -17,128 +17,33 @@ #include "DatabaseIcons.h" +#include "core/Global.h" #include "core/Resources.h" +#include "gui/MainWindow.h" + +#include +#include +#include +#include DatabaseIcons* DatabaseIcons::m_instance(nullptr); -const int DatabaseIcons::IconCount(69); -const int DatabaseIcons::ExpiredIconIndex(45); -const int DatabaseIcons::SharedIconIndex(1); -const int DatabaseIcons::UnsharedIconIndex(45); -// clang-format off -const char* const DatabaseIcons::m_indexToName[] = { - "C00_Password.png", - "C01_Package_Network.png", - "C02_MessageBox_Warning.png", - "C03_Server.png", - "C04_Klipper.png", - "C05_Edu_Languages.png", - "C06_KCMDF.png", - "C07_Kate.png", - "C08_Socket.png", - "C09_Identity.png", - "C10_Kontact.png", - "C11_Camera.png", - "C12_IRKickFlash.png", - "C13_KGPG_Key3.png", - "C14_Laptop_Power.png", - "C15_Scanner.png", - "C16_Mozilla_Firebird.png", - "C17_CDROM_Unmount.png", - "C18_Display.png", - "C19_Mail_Generic.png", - "C20_Misc.png", - "C21_KOrganizer.png", - "C22_ASCII.png", - "C23_Icons.png", - "C24_Connect_Established.png", - "C25_Folder_Mail.png", - "C26_FileSave.png", - "C27_NFS_Unmount.png", - "C28_QuickTime.png", - "C29_KGPG_Term.png", - "C30_Konsole.png", - "C31_FilePrint.png", - "C32_FSView.png", - "C33_Run.png", - "C34_Configure.png", - "C35_KRFB.png", - "C36_Ark.png", - "C37_KPercentage.png", - "C38_Samba_Unmount.png", - "C39_History.png", - "C40_Mail_Find.png", - "C41_VectorGfx.png", - "C42_KCMMemory.png", - "C43_EditTrash.png", - "C44_KNotes.png", - "C45_Cancel.png", - "C46_Help.png", - "C47_KPackage.png", - "C48_Folder.png", - "C49_Folder_Blue_Open.png", - "C50_Folder_Tar.png", - "C51_Decrypted.png", - "C52_Encrypted.png", - "C53_Apply.png", - "C54_Signature.png", - "C55_Thumbnail.png", - "C56_KAddressBook.png", - "C57_View_Text.png", - "C58_KGPG.png", - "C59_Package_Development.png", - "C60_KFM_Home.png", - "C61_Services.png", - "C62_Tux.png", - "C63_Feather.png", - "C64_Apple.png", - "C65_W.png", - "C66_Money.png", - "C67_Certificate.png", - "C68_BlackBerry.png" -}; -// clang-format on - -QImage DatabaseIcons::icon(int index) +namespace { - if (index < 0 || index >= IconCount) { - qWarning("DatabaseIcons::icon: invalid icon index %d", index); - return {}; - } + const QString iconDir = QStringLiteral(":/icons/database/"); + QStringList iconList; - if (!m_iconCache[index].isNull()) { - return m_iconCache[index]; - } - QImage icon(QStringLiteral(":/icons/database/").append(m_indexToName[index])); - m_iconCache[index] = icon; - return icon; -} - -QPixmap DatabaseIcons::iconPixmap(int index) -{ - if (index < 0 || index >= IconCount) { - qWarning("DatabaseIcons::iconPixmap: invalid icon index %d", index); - return QPixmap(); - } - - QPixmap pixmap; - - if (!QPixmapCache::find(m_pixmapCacheKeys[index], &pixmap)) { - pixmap = QPixmap::fromImage(icon(index)); - m_pixmapCacheKeys[index] = QPixmapCache::insert(pixmap); - } - - return pixmap; -} + const QString badgeDir = QStringLiteral(":/icons/badges/"); + QStringList badgeList; +} // namespace DatabaseIcons::DatabaseIcons() { - Q_STATIC_ASSERT(sizeof(m_indexToName) == IconCount * sizeof(m_indexToName[0])); + // Set the pixmap cache limit to 20 MB + QPixmapCache::setCacheLimit(20480); - m_iconCache.reserve(IconCount); - m_iconCache.resize(IconCount); - m_pixmapCacheKeys.reserve(IconCount); - m_pixmapCacheKeys.resize(IconCount); + iconList = QDir(iconDir).entryList(QDir::NoFilter, QDir::Name); + badgeList = QDir(badgeDir).entryList(QDir::NoFilter, QDir::Name); } DatabaseIcons* DatabaseIcons::instance() @@ -149,3 +54,55 @@ DatabaseIcons* DatabaseIcons::instance() return m_instance; } + +QPixmap DatabaseIcons::icon(int index, IconSize size) +{ + if (index < 0 || index >= count()) { + qWarning("DatabaseIcons::icon: invalid icon index %d", index); + return {}; + } + + auto cacheKey = QString::number(index); + auto icon = m_iconCache.value(cacheKey); + if (icon.isNull()) { + icon.addFile(iconDir + iconList[index]); + icon.addPixmap(icon.pixmap(IconSize::Default)); + icon.addPixmap(icon.pixmap(IconSize::Medium)); + icon.addPixmap(icon.pixmap(IconSize::Large)); + m_iconCache.insert(cacheKey, icon); + } + + return icon.pixmap(size); +} + +QPixmap DatabaseIcons::applyBadge(const QPixmap& basePixmap, Badges badgeIndex) +{ + const auto cacheKey = QStringLiteral("badgedicon-%1-%2").arg(basePixmap.cacheKey()).arg(badgeIndex); + QPixmap pixmap = basePixmap; + if (badgeIndex < 0 || badgeIndex >= badgeList.size()) { + qWarning("DatabaseIcons: Out-of-range badge index given to applyBadge: %d", badgeIndex); + } else if (!QPixmapCache::find(cacheKey, &pixmap)) { + int baseSize = basePixmap.width(); + int badgeSize = baseSize <= IconSize::Default * basePixmap.devicePixelRatio() ? baseSize * 0.6 : baseSize * 0.5; + QPoint badgePos(baseSize - badgeSize, baseSize - badgeSize); + badgePos /= basePixmap.devicePixelRatio(); + + QImageReader reader(badgeDir + badgeList[badgeIndex]); + reader.setScaledSize({badgeSize, badgeSize}); + auto badge = QPixmap::fromImageReader(&reader); + badge.setDevicePixelRatio(basePixmap.devicePixelRatio()); + + QPainter painter(&pixmap); + painter.setCompositionMode(QPainter::CompositionMode_SourceOver); + painter.drawPixmap(badgePos, badge); + + QPixmapCache::insert(cacheKey, pixmap); + } + + return pixmap; +} + +int DatabaseIcons::count() +{ + return iconList.size(); +} diff --git a/src/core/DatabaseIcons.h b/src/core/DatabaseIcons.h index ecd38fd8a..9f33644ee 100644 --- a/src/core/DatabaseIcons.h +++ b/src/core/DatabaseIcons.h @@ -18,32 +18,32 @@ #ifndef KEEPASSX_DATABASEICONS_H #define KEEPASSX_DATABASEICONS_H -#include -#include -#include -#include +#include "core/Global.h" +#include class DatabaseIcons { public: - QImage icon(int index); - QPixmap iconPixmap(int index); - static DatabaseIcons* instance(); - static const int IconCount; - static const int ExpiredIconIndex; - static const int SharedIconIndex; - static const int UnsharedIconIndex; + static constexpr int ExpiredIconIndex = 45; + + enum Badges + { + ShareActive = 0, + ShareInactive, + Expired + }; + + QPixmap icon(int index, IconSize size = IconSize::Default); + QPixmap applyBadge(const QPixmap& basePixmap, Badges badgeIndex); + int count(); private: DatabaseIcons(); static DatabaseIcons* m_instance; - - static const char* const m_indexToName[]; - QVector m_iconCache; - QVector m_pixmapCacheKeys; + QHash m_iconCache; Q_DISABLE_COPY(DatabaseIcons) }; diff --git a/src/core/Entry.cpp b/src/core/Entry.cpp index a5e372d07..fc553f9e5 100644 --- a/src/core/Entry.cpp +++ b/src/core/Entry.cpp @@ -163,7 +163,7 @@ const QString Entry::uuidToHex() const QImage Entry::icon() const { if (m_data.customIcon.isNull()) { - return databaseIcons()->icon(m_data.iconNumber); + return databaseIcons()->icon(m_data.iconNumber).toImage(); } else { Q_ASSERT(database()); @@ -175,27 +175,23 @@ QImage Entry::icon() const } } -QPixmap Entry::iconPixmap() const +QPixmap Entry::iconPixmap(IconSize size) const { + QPixmap icon(size, size); if (m_data.customIcon.isNull()) { - return databaseIcons()->iconPixmap(m_data.iconNumber); + icon = databaseIcons()->icon(m_data.iconNumber, size); + } else { + Q_ASSERT(database()); + if (database()) { + icon = database()->metadata()->customIconPixmap(m_data.customIcon, size); + } } - Q_ASSERT(database()); - if (database()) { - return database()->metadata()->customIconPixmap(m_data.customIcon); + if (isExpired()) { + icon = databaseIcons()->applyBadge(icon, DatabaseIcons::Badges::Expired); } - return QPixmap(); -} -QPixmap Entry::iconScaledPixmap() const -{ - if (m_data.customIcon.isNull()) { - // built-in icons are 16x16 so don't need to be scaled - return databaseIcons()->iconPixmap(m_data.iconNumber); - } - Q_ASSERT(database()); - return database()->metadata()->customIconScaledPixmap(m_data.customIcon); + return icon; } int Entry::iconNumber() const @@ -1104,9 +1100,8 @@ void Entry::setGroup(Group* group) m_group->database()->addDeletedObject(m_uuid); // copy custom icon to the new database - if (!iconUuid().isNull() && group->database() - && m_group->database()->metadata()->containsCustomIcon(iconUuid()) - && !group->database()->metadata()->containsCustomIcon(iconUuid())) { + if (!iconUuid().isNull() && group->database() && m_group->database()->metadata()->hasCustomIcon(iconUuid()) + && !group->database()->metadata()->hasCustomIcon(iconUuid())) { group->database()->metadata()->addCustomIcon(iconUuid(), icon()); } } diff --git a/src/core/Entry.h b/src/core/Entry.h index 3d42692c8..cbaf3e2c0 100644 --- a/src/core/Entry.h +++ b/src/core/Entry.h @@ -31,6 +31,7 @@ #include "core/CustomData.h" #include "core/EntryAttachments.h" #include "core/EntryAttributes.h" +#include "core/Global.h" #include "core/TimeInfo.h" class Database; @@ -81,8 +82,7 @@ public: const QUuid& uuid() const; const QString uuidToHex() const; QImage icon() const; - QPixmap iconPixmap() const; - QPixmap iconScaledPixmap() const; + QPixmap iconPixmap(IconSize size = IconSize::Default) const; int iconNumber() const; const QUuid& iconUuid() const; QString foregroundColor() const; diff --git a/src/core/Global.h b/src/core/Global.h index 0821687e3..9cb890299 100644 --- a/src/core/Global.h +++ b/src/core/Global.h @@ -46,6 +46,13 @@ static const auto TRUE_STR = QStringLiteral("true"); static const auto FALSE_STR = QStringLiteral("false"); +enum IconSize +{ + Default = 24, + Medium = 32, + Large = 40 +}; + template struct AddConst { typedef const T Type; diff --git a/src/core/Group.cpp b/src/core/Group.cpp index 7ce795f14..d9782a7cc 100644 --- a/src/core/Group.cpp +++ b/src/core/Group.cpp @@ -17,6 +17,7 @@ */ #include "Group.h" +#include "config-keepassx.h" #include "core/Clock.h" #include "core/Config.h" @@ -25,6 +26,10 @@ #include "core/Metadata.h" #include "core/Tools.h" +#ifdef WITH_XC_KEESHARE +#include "keeshare/KeeShare.h" +#endif + #include const int Group::DefaultIconNumber = 48; @@ -128,10 +133,9 @@ QString Group::notes() const QImage Group::icon() const { if (m_data.customIcon.isNull()) { - return databaseIcons()->icon(m_data.iconNumber); + return databaseIcons()->icon(m_data.iconNumber).toImage(); } else { Q_ASSERT(m_db); - if (m_db) { return m_db->metadata()->customIcon(m_data.customIcon); } else { @@ -140,35 +144,28 @@ QImage Group::icon() const } } -QPixmap Group::iconPixmap() const +QPixmap Group::iconPixmap(IconSize size) const { + QPixmap icon(size, size); if (m_data.customIcon.isNull()) { - return databaseIcons()->iconPixmap(m_data.iconNumber); + icon = databaseIcons()->icon(m_data.iconNumber, size); } else { Q_ASSERT(m_db); - if (m_db) { - return m_db->metadata()->customIconPixmap(m_data.customIcon); - } else { - return QPixmap(); + icon = m_db->metadata()->customIconPixmap(m_data.customIcon, size); } } -} -QPixmap Group::iconScaledPixmap() const -{ - if (m_data.customIcon.isNull()) { - // built-in icons are 16x16 so don't need to be scaled - return databaseIcons()->iconPixmap(m_data.iconNumber); - } else { - Q_ASSERT(m_db); - - if (m_db) { - return m_db->metadata()->customIconScaledPixmap(m_data.customIcon); - } else { - return QPixmap(); - } + if (isExpired()) { + icon = databaseIcons()->applyBadge(icon, DatabaseIcons::Badges::Expired); } +#ifdef WITH_XC_KEESHARE + else if (KeeShare::isShared(this)) { + icon = KeeShare::indicatorBadge(this, icon); + } +#endif + + return icon; } int Group::iconNumber() const @@ -452,8 +449,8 @@ void Group::setParent(Group* parent, int index) recCreateDelObjects(); // copy custom icon to the new database - if (!iconUuid().isNull() && parent->m_db && m_db->metadata()->containsCustomIcon(iconUuid()) - && !parent->m_db->metadata()->containsCustomIcon(iconUuid())) { + if (!iconUuid().isNull() && parent->m_db && m_db->metadata()->hasCustomIcon(iconUuid()) + && !parent->m_db->metadata()->hasCustomIcon(iconUuid())) { parent->m_db->metadata()->addCustomIcon(iconUuid(), icon()); } } diff --git a/src/core/Group.h b/src/core/Group.h index 7adabc8b5..8ff33d8d0 100644 --- a/src/core/Group.h +++ b/src/core/Group.h @@ -21,12 +21,12 @@ #include #include -#include #include #include "core/CustomData.h" #include "core/Database.h" #include "core/Entry.h" +#include "core/Global.h" #include "core/TimeInfo.h" class Group : public QObject @@ -85,8 +85,7 @@ public: QString name() const; QString notes() const; QImage icon() const; - QPixmap iconPixmap() const; - QPixmap iconScaledPixmap() const; + QPixmap iconPixmap(IconSize size = IconSize::Default) const; int iconNumber() const; const QUuid& iconUuid() const; const TimeInfo& timeInfo() const; diff --git a/src/core/IconDownloader.cpp b/src/core/IconDownloader.cpp index 1dccc554c..1cb030c1e 100644 --- a/src/core/IconDownloader.cpp +++ b/src/core/IconDownloader.cpp @@ -20,6 +20,7 @@ #include "core/NetworkManager.h" #include +#include #include #define MAX_REDIRECTS 5 @@ -188,7 +189,7 @@ void IconDownloader::fetchFinished() } } else { // No redirect, and we theoretically have some icon data now. - image.loadFromData(m_bytesReceived); + image = parseImage(m_bytesReceived); } } @@ -206,3 +207,33 @@ void IconDownloader::fetchFinished() emit finished(url, image); } } + +/** + * Parse fetched image bytes. + * + * Parses the given byte array into a QImage. Unlike QImage::loadFromData(), this method + * tries to extract the highest resolution image from .ICO files. + * + * @param imageBytes raw image bytes + * @return parsed image + */ +QImage IconDownloader::parseImage(QByteArray& imageBytes) const +{ + QBuffer buff(&imageBytes); + buff.open(QIODevice::ReadOnly); + QImageReader reader(&buff); + + if (reader.imageCount() <= 0) { + return reader.read(); + } + + QImage img; + for (int i = 0; i < reader.imageCount(); ++i) { + if (img.isNull() || reader.size().width() > img.size().width()) { + img = reader.read(); + } + reader.jumpToNextImage(); + } + + return img; +} diff --git a/src/core/IconDownloader.h b/src/core/IconDownloader.h index e2b8c4f2d..008e57aab 100644 --- a/src/core/IconDownloader.h +++ b/src/core/IconDownloader.h @@ -50,6 +50,7 @@ private slots: private: void fetchFavicon(const QUrl& url); + QImage parseImage(QByteArray& imageBytes) const; QString m_url; QUrl m_fetchUrl; diff --git a/src/core/Merger.cpp b/src/core/Merger.cpp index 2becd8a68..83b1e5a44 100644 --- a/src/core/Merger.cpp +++ b/src/core/Merger.cpp @@ -612,12 +612,11 @@ Merger::ChangeList Merger::mergeMetadata(const MergeContext& context) auto* sourceMetadata = context.m_sourceDb->metadata(); auto* targetMetadata = context.m_targetDb->metadata(); - const auto keys = sourceMetadata->customIcons().keys(); - for (QUuid customIconId : keys) { - if (!targetMetadata->containsCustomIcon(customIconId)) { - QImage customIcon = sourceMetadata->customIcon(customIconId); - targetMetadata->addCustomIcon(customIconId, customIcon); - changes << tr("Adding missing icon %1").arg(QString::fromLatin1(customIconId.toRfc4122().toHex())); + for (const auto& iconUuid : sourceMetadata->customIconsOrder()) { + if (!targetMetadata->hasCustomIcon(iconUuid)) { + QImage customIcon = sourceMetadata->customIcon(iconUuid); + targetMetadata->addCustomIcon(iconUuid, customIcon); + changes << tr("Adding missing icon %1").arg(QString::fromLatin1(iconUuid.toRfc4122().toHex())); } } diff --git a/src/core/Metadata.cpp b/src/core/Metadata.cpp index c0cb9bb6f..67a58b068 100644 --- a/src/core/Metadata.cpp +++ b/src/core/Metadata.cpp @@ -16,6 +16,7 @@ */ #include "Metadata.h" +#include #include #include "core/Clock.h" @@ -64,8 +65,7 @@ void Metadata::clear() { init(); m_customIcons.clear(); - m_customIconCacheKeys.clear(); - m_customIconScaledCacheKeys.clear(); + m_customIconsRaw.clear(); m_customIconsOrder.clear(); m_customIconsHashes.clear(); m_customData->clear(); @@ -178,62 +178,33 @@ bool Metadata::protectNotes() const QImage Metadata::customIcon(const QUuid& uuid) const { - return m_customIcons.value(uuid); + return m_customIconsRaw.value(uuid); } -QPixmap Metadata::customIconPixmap(const QUuid& uuid) const +QPixmap Metadata::customIconPixmap(const QUuid& uuid, IconSize size) const { - QPixmap pixmap; - - if (!m_customIcons.contains(uuid)) { - return pixmap; + if (!hasCustomIcon(uuid)) { + return {}; } - - QPixmapCache::Key& cacheKey = m_customIconCacheKeys[uuid]; - - if (!QPixmapCache::find(cacheKey, &pixmap)) { - pixmap = QPixmap::fromImage(m_customIcons.value(uuid)); - QPixmapCache::insert(pixmap); - } - - return pixmap; + return m_customIcons.value(uuid).pixmap(size); } -QPixmap Metadata::customIconScaledPixmap(const QUuid& uuid, const QSize& size) const -{ - QPixmap pixmap; - - if (!m_customIcons.contains(uuid)) { - return pixmap; - } - - QImage image = m_customIcons.value(uuid).scaled(size, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); - pixmap = QPixmap::fromImage(image); - - return pixmap; -} - -bool Metadata::containsCustomIcon(const QUuid& uuid) const -{ - return m_customIcons.contains(uuid); -} - -QHash Metadata::customIcons() const -{ - return m_customIcons; -} - -QHash Metadata::customIconsScaledPixmaps(const QSize& size) const +QHash Metadata::customIconsPixmaps(IconSize size) const { QHash result; for (const QUuid& uuid : m_customIconsOrder) { - result.insert(uuid, customIconScaledPixmap(uuid, size)); + result.insert(uuid, customIconPixmap(uuid, size)); } return result; } +bool Metadata::hasCustomIcon(const QUuid& uuid) const +{ + return m_customIconsRaw.contains(uuid); +} + QList Metadata::customIconsOrder() const { return m_customIconsOrder; @@ -387,57 +358,54 @@ void Metadata::setProtectNotes(bool value) set(m_data.protectNotes, value); } -void Metadata::addCustomIcon(const QUuid& uuid, const QImage& icon) +void Metadata::addCustomIcon(const QUuid& uuid, const QImage& image) { Q_ASSERT(!uuid.isNull()); - Q_ASSERT(!m_customIcons.contains(uuid)); + Q_ASSERT(!m_customIconsRaw.contains(uuid)); - m_customIcons[uuid] = icon; - // reset cache in case there is also an icon with that uuid - m_customIconCacheKeys[uuid] = QPixmapCache::Key(); - m_customIconScaledCacheKeys[uuid] = QPixmapCache::Key(); + m_customIconsRaw[uuid] = image; // remove all uuids to prevent duplicates in release mode m_customIconsOrder.removeAll(uuid); m_customIconsOrder.append(uuid); // Associate image hash to uuid - QByteArray hash = hashImage(icon); + QByteArray hash = hashImage(image); m_customIconsHashes[hash] = uuid; - Q_ASSERT(m_customIcons.count() == m_customIconsOrder.count()); - emit metadataModified(); -} + Q_ASSERT(m_customIconsRaw.count() == m_customIconsOrder.count()); -void Metadata::addCustomIconScaled(const QUuid& uuid, const QImage& icon) -{ - QImage iconScaled; - - // scale down to 128x128 if icon is larger - if (icon.width() > 128 || icon.height() > 128) { - iconScaled = icon.scaled(QSize(128, 128), Qt::KeepAspectRatio, Qt::SmoothTransformation); + // TODO: This check can go away when we move all QIcon handling outside of core + // On older versions of Qt, loading a QPixmap from QImage outside of a GUI + // environment causes ASAN to fail and crash on nullptr violation + static bool isGui = qApp->inherits("QGuiApplication"); + if (isGui) { + // Generate QIcon with pre-baked resolutions + auto basePixmap = QPixmap::fromImage(image).scaled(128, 128, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); + QIcon icon(basePixmap); + icon.addPixmap(icon.pixmap(IconSize::Default)); + icon.addPixmap(icon.pixmap(IconSize::Medium)); + icon.addPixmap(icon.pixmap(IconSize::Large)); + m_customIcons.insert(uuid, icon); } else { - iconScaled = icon; + m_customIcons.insert(uuid, QIcon()); } - addCustomIcon(uuid, iconScaled); + emit metadataModified(); } void Metadata::removeCustomIcon(const QUuid& uuid) { Q_ASSERT(!uuid.isNull()); - Q_ASSERT(m_customIcons.contains(uuid)); + Q_ASSERT(m_customIconsRaw.contains(uuid)); // Remove hash record only if this is the same uuid - QByteArray hash = hashImage(m_customIcons[uuid]); + QByteArray hash = hashImage(m_customIconsRaw[uuid]); if (m_customIconsHashes.contains(hash) && m_customIconsHashes[hash] == uuid) { m_customIconsHashes.remove(hash); } m_customIcons.remove(uuid); - QPixmapCache::remove(m_customIconCacheKeys.value(uuid)); - m_customIconCacheKeys.remove(uuid); - QPixmapCache::remove(m_customIconScaledCacheKeys.value(uuid)); - m_customIconScaledCacheKeys.remove(uuid); + m_customIconsRaw.remove(uuid); m_customIconsOrder.removeAll(uuid); - Q_ASSERT(m_customIcons.count() == m_customIconsOrder.count()); + Q_ASSERT(m_customIconsRaw.count() == m_customIconsOrder.count()); emit metadataModified(); } @@ -450,9 +418,9 @@ QUuid Metadata::findCustomIcon(const QImage& candidate) void Metadata::copyCustomIcons(const QSet& iconList, const Metadata* otherMetadata) { for (const QUuid& uuid : iconList) { - Q_ASSERT(otherMetadata->containsCustomIcon(uuid)); + Q_ASSERT(otherMetadata->hasCustomIcon(uuid)); - if (!containsCustomIcon(uuid) && otherMetadata->containsCustomIcon(uuid)) { + if (!hasCustomIcon(uuid) && otherMetadata->hasCustomIcon(uuid)) { addCustomIcon(uuid, otherMetadata->customIcon(uuid)); } } diff --git a/src/core/Metadata.h b/src/core/Metadata.h index 0bf591471..c61bfacb2 100644 --- a/src/core/Metadata.h +++ b/src/core/Metadata.h @@ -20,6 +20,7 @@ #include #include +#include #include #include #include @@ -28,6 +29,7 @@ #include #include "core/CustomData.h" +#include "core/Global.h" class Database; class Group; @@ -82,13 +84,11 @@ public: bool protectUrl() const; bool protectNotes() const; QImage customIcon(const QUuid& uuid) const; - QPixmap customIconPixmap(const QUuid& uuid) const; - QPixmap customIconScaledPixmap(const QUuid& uuid, const QSize& size = {16, 16}) const; - bool containsCustomIcon(const QUuid& uuid) const; - QHash customIcons() const; + bool hasCustomIcon(const QUuid& uuid) const; + QPixmap customIconPixmap(const QUuid& uuid, IconSize size = IconSize::Default) const; + QHash customIconsPixmaps(IconSize size = IconSize::Default) const; QList customIconsOrder() const; bool recycleBinEnabled() const; - QHash customIconsScaledPixmaps(const QSize& size = {16, 16}) const; Group* recycleBin(); const Group* recycleBin() const; QDateTime recycleBinChanged() const; @@ -122,8 +122,7 @@ public: void setProtectPassword(bool value); void setProtectUrl(bool value); void setProtectNotes(bool value); - void addCustomIcon(const QUuid& uuid, const QImage& icon); - void addCustomIconScaled(const QUuid& uuid, const QImage& icon); + void addCustomIcon(const QUuid& uuid, const QImage& image); void removeCustomIcon(const QUuid& uuid); void copyCustomIcons(const QSet& iconList, const Metadata* otherMetadata); QUuid findCustomIcon(const QImage& candidate); @@ -161,9 +160,8 @@ private: MetadataData m_data; - QHash m_customIcons; - mutable QHash m_customIconCacheKeys; - mutable QHash m_customIconScaledCacheKeys; + QHash m_customIcons; + QHash m_customIconsRaw; QList m_customIconsOrder; QHash m_customIconsHashes; diff --git a/src/fdosecrets/widgets/SettingsModels.cpp b/src/fdosecrets/widgets/SettingsModels.cpp index 3337ad8c5..1382f1f0e 100644 --- a/src/fdosecrets/widgets/SettingsModels.cpp +++ b/src/fdosecrets/widgets/SettingsModels.cpp @@ -147,8 +147,7 @@ namespace FdoSecrets case Qt::DisplayRole: return group->name(); case Qt::DecorationRole: - return group->isExpired() ? databaseIcons()->iconPixmap(DatabaseIcons::ExpiredIconIndex) - : group->iconScaledPixmap(); + return group->iconPixmap(); case Qt::FontRole: if (group->isExpired()) { QFont font; diff --git a/src/format/HtmlExporter.cpp b/src/format/HtmlExporter.cpp index cd3654e36..812af7868 100644 --- a/src/format/HtmlExporter.cpp +++ b/src/format/HtmlExporter.cpp @@ -21,6 +21,7 @@ #include #include "core/Database.h" +#include "core/Global.h" #include "core/Group.h" #include "core/Metadata.h" @@ -142,7 +143,7 @@ bool HtmlExporter::writeGroup(QIODevice& device, const Group& group, QString pat // Header line auto header = QString("

"); - header.append(PixmapToHTML(group.iconScaledPixmap())); + header.append(PixmapToHTML(group.iconPixmap(IconSize::Medium))); header.append(" "); header.append(path); header.append("

\n"); @@ -166,7 +167,7 @@ bool HtmlExporter::writeGroup(QIODevice& device, const Group& group, QString pat auto item = QString("

"); // Begin formatting this item into HTML - item.append(PixmapToHTML(entry->iconScaledPixmap())); + item.append(PixmapToHTML(entry->iconPixmap(IconSize::Medium))); item.append(" "); item.append(entry->title().toHtmlEscaped()); item.append("

\n" diff --git a/src/format/KdbxXmlReader.cpp b/src/format/KdbxXmlReader.cpp index f4109a4df..4ab5c9d03 100644 --- a/src/format/KdbxXmlReader.cpp +++ b/src/format/KdbxXmlReader.cpp @@ -368,7 +368,7 @@ void KdbxXmlReader::parseIcon() if (uuidSet && iconSet) { // Check for duplicate UUID (corruption) - if (m_meta->containsCustomIcon(uuid)) { + if (m_meta->hasCustomIcon(uuid)) { uuid = QUuid::createUuid(); } m_meta->addCustomIcon(uuid, icon); @@ -513,9 +513,9 @@ Group* KdbxXmlReader::parseGroup() raiseError(tr("Invalid group icon number")); } iconId = 0; - } else if (iconId >= DatabaseIcons::IconCount) { + } else if (iconId >= databaseIcons()->count()) { qWarning("KdbxXmlReader::parseGroup: icon id \"%d\" not supported", iconId); - iconId = DatabaseIcons::IconCount - 1; + iconId = databaseIcons()->count() - 1; } group->setIcon(iconId); diff --git a/src/gui/EditWidgetIcons.cpp b/src/gui/EditWidgetIcons.cpp index c9a0c0310..9ffb80ae5 100644 --- a/src/gui/EditWidgetIcons.cpp +++ b/src/gui/EditWidgetIcons.cpp @@ -132,7 +132,7 @@ void EditWidgetIcons::load(const QUuid& currentUuid, m_currentUuid = currentUuid; setUrl(url); - m_customIconModel->setIcons(database->metadata()->customIconsScaledPixmaps({24, 24}), + m_customIconModel->setIcons(database->metadata()->customIconsPixmaps(IconSize::Default), database->metadata()->customIconsOrder()); QUuid iconUuid = iconStruct.uuid; @@ -294,7 +294,7 @@ bool EditWidgetIcons::addCustomIcon(const QImage& icon) if (uuid.isNull()) { uuid = QUuid::createUuid(); m_db->metadata()->addCustomIcon(uuid, scaledicon); - m_customIconModel->setIcons(m_db->metadata()->customIconsScaledPixmaps({24, 24}), + m_customIconModel->setIcons(m_db->metadata()->customIconsPixmaps(IconSize::Default), m_db->metadata()->customIconsOrder()); added = true; } @@ -378,7 +378,7 @@ void EditWidgetIcons::removeCustomIcon() // Remove the icon from the database m_db->metadata()->removeCustomIcon(iconUuid); - m_customIconModel->setIcons(m_db->metadata()->customIconsScaledPixmaps({24, 24}), + m_customIconModel->setIcons(m_db->metadata()->customIconsPixmaps(IconSize::Default), m_db->metadata()->customIconsOrder()); // Reset the current icon view diff --git a/src/gui/EntryPreviewWidget.cpp b/src/gui/EntryPreviewWidget.cpp index 06152c554..9332bb2d0 100644 --- a/src/gui/EntryPreviewWidget.cpp +++ b/src/gui/EntryPreviewWidget.cpp @@ -162,7 +162,7 @@ void EntryPreviewWidget::updateEntryHeaderLine() Q_ASSERT(m_currentEntry); const QString title = m_currentEntry->resolveMultiplePlaceholders(m_currentEntry->title()); m_ui->entryTitleLabel->setRawText(hierarchy(m_currentEntry->group(), title)); - m_ui->entryIcon->setPixmap(preparePixmap(m_currentEntry->iconPixmap(), 16)); + m_ui->entryIcon->setPixmap(m_currentEntry->iconPixmap(IconSize::Large)); } void EntryPreviewWidget::updateEntryTotp() @@ -315,7 +315,7 @@ void EntryPreviewWidget::updateGroupHeaderLine() { Q_ASSERT(m_currentGroup); m_ui->groupTitleLabel->setRawText(hierarchy(m_currentGroup, {})); - m_ui->groupIcon->setPixmap(preparePixmap(m_currentGroup->iconPixmap(), 32)); + m_ui->groupIcon->setPixmap(m_currentGroup->iconPixmap(IconSize::Large)); } void EntryPreviewWidget::updateGroupGeneralTab() @@ -399,14 +399,6 @@ void EntryPreviewWidget::setTabEnabled(QTabWidget* tabWidget, QWidget* widget, b tabWidget->setTabEnabled(tabIndex, enabled); } -QPixmap EntryPreviewWidget::preparePixmap(const QPixmap& pixmap, int size) -{ - if (pixmap.width() > size || pixmap.height() > size) { - return pixmap.scaled(size, size, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); - } - return pixmap; -} - QString EntryPreviewWidget::hierarchy(const Group* group, const QString& title) { const QString separator("] > ["); diff --git a/src/gui/EntryPreviewWidget.h b/src/gui/EntryPreviewWidget.h index e1a7aff38..17bd62eb6 100644 --- a/src/gui/EntryPreviewWidget.h +++ b/src/gui/EntryPreviewWidget.h @@ -72,7 +72,6 @@ private: void removeTab(QTabWidget* tabWidget, QWidget* widget); void setTabEnabled(QTabWidget* tabWidget, QWidget* widget, bool enabled); - static QPixmap preparePixmap(const QPixmap& pixmap, int size); static QString hierarchy(const Group* group, const QString& title); const QScopedPointer m_ui; diff --git a/src/gui/IconModels.cpp b/src/gui/IconModels.cpp index 098089266..3bdd9a5e6 100644 --- a/src/gui/IconModels.cpp +++ b/src/gui/IconModels.cpp @@ -29,7 +29,7 @@ DefaultIconModel::DefaultIconModel(QObject* parent) int DefaultIconModel::rowCount(const QModelIndex& parent) const { if (!parent.isValid()) { - return DatabaseIcons::IconCount; + return databaseIcons()->count(); } else { return 0; } @@ -41,10 +41,10 @@ QVariant DefaultIconModel::data(const QModelIndex& index, int role) const return QVariant(); } - Q_ASSERT(index.row() < DatabaseIcons::IconCount); + Q_ASSERT(index.row() < databaseIcons()->count()); if (role == Qt::DecorationRole) { - return databaseIcons()->iconPixmap(index.row()); + return databaseIcons()->icon(index.row(), IconSize::Medium); } return QVariant(); diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index eed3a903a..1cf4d46f0 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -327,6 +327,7 @@ MainWindow::MainWindow() m_ui->actionDatabaseNew->setIcon(resources()->icon("document-new")); m_ui->actionDatabaseOpen->setIcon(resources()->icon("document-open")); + m_ui->menuRecentDatabases->setIcon(resources()->icon("document-open-recent")); m_ui->actionDatabaseSave->setIcon(resources()->icon("document-save")); m_ui->actionDatabaseSaveAs->setIcon(resources()->icon("document-save-as")); m_ui->actionDatabaseSaveBackup->setIcon(resources()->icon("document-save-copy")); @@ -337,6 +338,8 @@ MainWindow::MainWindow() m_ui->actionLockDatabases->setIcon(resources()->icon("database-lock")); m_ui->actionQuit->setIcon(resources()->icon("application-exit")); m_ui->actionDatabaseMerge->setIcon(resources()->icon("database-merge")); + m_ui->menuImport->setIcon(resources()->icon("document-import")); + m_ui->menuExport->setIcon(resources()->icon("document-export")); m_ui->actionEntryNew->setIcon(resources()->icon("entry-new")); m_ui->actionEntryClone->setIcon(resources()->icon("entry-clone")); diff --git a/src/gui/entry/AutoTypeMatchModel.cpp b/src/gui/entry/AutoTypeMatchModel.cpp index 4148ccc66..ac2d0f874 100644 --- a/src/gui/entry/AutoTypeMatchModel.cpp +++ b/src/gui/entry/AutoTypeMatchModel.cpp @@ -118,15 +118,11 @@ QVariant AutoTypeMatchModel::data(const QModelIndex& index, int role) const switch (index.column()) { case ParentGroup: if (match.entry->group()) { - return match.entry->group()->iconScaledPixmap(); + return match.entry->group()->iconPixmap(); } break; case Title: - if (match.entry->isExpired()) { - return databaseIcons()->iconPixmap(DatabaseIcons::ExpiredIconIndex); - } else { - return match.entry->iconScaledPixmap(); - } + return match.entry->iconPixmap(); } } else if (role == Qt::FontRole) { QFont font; diff --git a/src/gui/entry/EditEntryWidget.cpp b/src/gui/entry/EditEntryWidget.cpp index 8274968b7..330a9cd6a 100644 --- a/src/gui/entry/EditEntryWidget.cpp +++ b/src/gui/entry/EditEntryWidget.cpp @@ -1103,7 +1103,7 @@ void EditEntryWidget::cancel() return; } - if (!m_entry->iconUuid().isNull() && !m_db->metadata()->containsCustomIcon(m_entry->iconUuid())) { + if (!m_entry->iconUuid().isNull() && !m_db->metadata()->hasCustomIcon(m_entry->iconUuid())) { m_entry->setIcon(Entry::DefaultIconNumber); } diff --git a/src/gui/entry/EntryModel.cpp b/src/gui/entry/EntryModel.cpp index e6311f6b5..6438f8ed1 100644 --- a/src/gui/entry/EntryModel.cpp +++ b/src/gui/entry/EntryModel.cpp @@ -271,14 +271,11 @@ QVariant EntryModel::data(const QModelIndex& index, int role) const switch (index.column()) { case ParentGroup: if (entry->group()) { - return entry->group()->iconScaledPixmap(); + return entry->group()->iconPixmap(); } break; case Title: - if (entry->isExpired()) { - return databaseIcons()->iconPixmap(DatabaseIcons::ExpiredIconIndex); - } - return entry->iconScaledPixmap(); + return entry->iconPixmap(); case Paperclip: if (!entry->attachments()->isEmpty()) { return resources()->icon("paperclip"); diff --git a/src/gui/group/EditGroupWidget.cpp b/src/gui/group/EditGroupWidget.cpp index f77ae92d8..b77e49864 100644 --- a/src/gui/group/EditGroupWidget.cpp +++ b/src/gui/group/EditGroupWidget.cpp @@ -236,7 +236,7 @@ void EditGroupWidget::apply() void EditGroupWidget::cancel() { - if (!m_group->iconUuid().isNull() && !m_db->metadata()->containsCustomIcon(m_group->iconUuid())) { + if (!m_group->iconUuid().isNull() && !m_db->metadata()->hasCustomIcon(m_group->iconUuid())) { m_group->setIcon(Entry::DefaultIconNumber); } diff --git a/src/gui/group/GroupModel.cpp b/src/gui/group/GroupModel.cpp index a9b61315d..beba13774 100644 --- a/src/gui/group/GroupModel.cpp +++ b/src/gui/group/GroupModel.cpp @@ -130,12 +130,7 @@ QVariant GroupModel::data(const QModelIndex& index, int role) const #endif return nameTemplate.arg(group->name()); } else if (role == Qt::DecorationRole) { - QPixmap pixmap = group->isExpired() ? databaseIcons()->iconPixmap(DatabaseIcons::ExpiredIconIndex) - : group->iconScaledPixmap(); -#if defined(WITH_XC_KEESHARE) - pixmap = KeeShare::indicatorBadge(group, pixmap); -#endif - return pixmap; + return group->iconPixmap(); } else if (role == Qt::FontRole) { QFont font; if (group->isExpired()) { @@ -304,7 +299,7 @@ bool GroupModel::dropMimeData(const QMimeData* data, Database* targetDb = parentGroup->database(); QUuid customIcon = entry->iconUuid(); - if (sourceDb != targetDb && !customIcon.isNull() && !targetDb->metadata()->containsCustomIcon(customIcon)) { + if (sourceDb != targetDb && !customIcon.isNull() && !targetDb->metadata()->hasCustomIcon(customIcon)) { targetDb->metadata()->addCustomIcon(customIcon, sourceDb->metadata()->customIcon(customIcon)); } diff --git a/src/keeshare/KeeShare.cpp b/src/keeshare/KeeShare.cpp index beff3d950..31136a5c4 100644 --- a/src/keeshare/KeeShare.cpp +++ b/src/keeshare/KeeShare.cpp @@ -190,15 +190,11 @@ QPixmap KeeShare::indicatorBadge(const Group* group, QPixmap pixmap) if (!isShared(group)) { return pixmap; } - const QPixmap badge = isEnabled(group) ? databaseIcons()->iconPixmap(DatabaseIcons::SharedIconIndex) - : databaseIcons()->iconPixmap(DatabaseIcons::UnsharedIconIndex); - QImage canvas = pixmap.toImage(); - const QRectF target(canvas.width() * 0.4, canvas.height() * 0.4, canvas.width() * 0.6, canvas.height() * 0.6); - QPainter painter(&canvas); - painter.setCompositionMode(QPainter::CompositionMode_SourceOver); - painter.drawPixmap(target, badge, badge.rect()); - pixmap.convertFromImage(canvas); - return pixmap; + + if (isEnabled(group)) { + return databaseIcons()->applyBadge(pixmap, DatabaseIcons::Badges::ShareActive); + } + return databaseIcons()->applyBadge(pixmap, DatabaseIcons::Badges::ShareInactive); } QString KeeShare::referenceTypeLabel(const KeeShareSettings::Reference& reference) diff --git a/src/keeshare/ShareExport.cpp b/src/keeshare/ShareExport.cpp index c17c5052c..1f7180d04 100644 --- a/src/keeshare/ShareExport.cpp +++ b/src/keeshare/ShareExport.cpp @@ -77,7 +77,7 @@ namespace targetEntry->setGroup(targetRoot); targetEntry->setUpdateTimeinfo(updateTimeinfo); const auto iconUuid = targetEntry->iconUuid(); - if (!iconUuid.isNull() && !targetMetadata->containsCustomIcon(iconUuid)) { + if (!iconUuid.isNull() && !targetMetadata->hasCustomIcon(iconUuid)) { targetMetadata->addCustomIcon(iconUuid, sourceEntry->icon()); } } diff --git a/tests/TestEntryModel.cpp b/tests/TestEntryModel.cpp index 26cb0dfec..5df4b9ed9 100644 --- a/tests/TestEntryModel.cpp +++ b/tests/TestEntryModel.cpp @@ -230,7 +230,7 @@ void TestEntryModel::testDefaultIconModel() DefaultIconModel* model = new DefaultIconModel(this); ModelTest* modelTest = new ModelTest(model, this); - QCOMPARE(model->rowCount(), DatabaseIcons::IconCount); + QCOMPARE(model->rowCount(), databaseIcons()->count()); delete modelTest; delete model; diff --git a/tests/TestGroup.cpp b/tests/TestGroup.cpp index a9acb3dcc..28a9f7ec4 100644 --- a/tests/TestGroup.cpp +++ b/tests/TestGroup.cpp @@ -336,12 +336,12 @@ void TestGroup::testCopyCustomIcon() QScopedPointer dbTarget(new Database()); group->setParent(dbTarget->rootGroup()); - QVERIFY(dbTarget->metadata()->containsCustomIcon(groupIconUuid)); + QVERIFY(dbTarget->metadata()->hasCustomIcon(groupIconUuid)); QCOMPARE(dbTarget->metadata()->customIcon(groupIconUuid), groupIcon); QCOMPARE(group->icon(), groupIcon); entry->setGroup(dbTarget->rootGroup()); - QVERIFY(dbTarget->metadata()->containsCustomIcon(entryIconUuid)); + QVERIFY(dbTarget->metadata()->hasCustomIcon(entryIconUuid)); QCOMPARE(dbTarget->metadata()->customIcon(entryIconUuid), entryIcon); QCOMPARE(entry->icon(), entryIcon); } @@ -462,11 +462,11 @@ void TestGroup::testCopyCustomIcons() Metadata* metaTarget = dbTarget->metadata(); - QCOMPARE(metaTarget->customIcons().size(), 4); - QVERIFY(metaTarget->containsCustomIcon(group1Icon)); - QVERIFY(metaTarget->containsCustomIcon(group2Icon)); - QVERIFY(metaTarget->containsCustomIcon(entry1IconOld)); - QVERIFY(metaTarget->containsCustomIcon(entry1IconNew)); + QCOMPARE(metaTarget->customIconsOrder().size(), 4); + QVERIFY(metaTarget->hasCustomIcon(group1Icon)); + QVERIFY(metaTarget->hasCustomIcon(group2Icon)); + QVERIFY(metaTarget->hasCustomIcon(entry1IconOld)); + QVERIFY(metaTarget->hasCustomIcon(entry1IconNew)); QCOMPARE(metaTarget->customIcon(group1Icon).pixel(0, 0), qRgb(1, 2, 3)); QCOMPARE(metaTarget->customIcon(group2Icon).pixel(0, 0), qRgb(4, 5, 6)); diff --git a/tests/TestKeePass1Reader.cpp b/tests/TestKeePass1Reader.cpp index 30f744e28..cf0aa414e 100644 --- a/tests/TestKeePass1Reader.cpp +++ b/tests/TestKeePass1Reader.cpp @@ -112,7 +112,7 @@ void TestKeePass1Reader::testMasterKey() void TestKeePass1Reader::testCustomIcons() { - QCOMPARE(m_db->metadata()->customIcons().size(), 1); + QCOMPARE(m_db->metadata()->customIconsOrder().size(), 1); Entry* entry = m_db->rootGroup()->children().at(1)->entries().at(0); diff --git a/tests/TestKeePass2Format.cpp b/tests/TestKeePass2Format.cpp index df414f5c0..f58d0a885 100644 --- a/tests/TestKeePass2Format.cpp +++ b/tests/TestKeePass2Format.cpp @@ -110,9 +110,9 @@ void TestKeePass2Format::testXmlMetadata() void TestKeePass2Format::testXmlCustomIcons() { - QCOMPARE(m_xmlDb->metadata()->customIcons().size(), 1); + QCOMPARE(m_xmlDb->metadata()->customIconsOrder().size(), 1); QUuid uuid = QUuid::fromRfc4122(QByteArray::fromBase64("++vyI+daLk6omox4a6kQGA==")); - QVERIFY(m_xmlDb->metadata()->customIcons().contains(uuid)); + QVERIFY(m_xmlDb->metadata()->hasCustomIcon(uuid)); QImage icon = m_xmlDb->metadata()->customIcon(uuid); QCOMPARE(icon.width(), 16); QCOMPARE(icon.height(), 16); diff --git a/tests/TestMerge.cpp b/tests/TestMerge.cpp index 4f96d3e6d..7c9c3cc65 100644 --- a/tests/TestMerge.cpp +++ b/tests/TestMerge.cpp @@ -1117,14 +1117,14 @@ void TestMerge::testMergeCustomIcons() dbSource->metadata()->addCustomIcon(customIconId, customIcon); // Sanity check. - QVERIFY(dbSource->metadata()->containsCustomIcon(customIconId)); + QVERIFY(dbSource->metadata()->hasCustomIcon(customIconId)); m_clock->advanceSecond(1); Merger merger(dbSource.data(), dbDestination.data()); merger.merge(); - QVERIFY(dbDestination->metadata()->containsCustomIcon(customIconId)); + QVERIFY(dbDestination->metadata()->hasCustomIcon(customIconId)); } /** @@ -1143,16 +1143,16 @@ void TestMerge::testMergeDuplicateCustomIcons() dbSource->metadata()->addCustomIcon(customIconId, customIcon); dbDestination->metadata()->addCustomIcon(customIconId, customIcon); // Sanity check. - QVERIFY(dbSource->metadata()->containsCustomIcon(customIconId)); - QVERIFY(dbDestination->metadata()->containsCustomIcon(customIconId)); + QVERIFY(dbSource->metadata()->hasCustomIcon(customIconId)); + QVERIFY(dbDestination->metadata()->hasCustomIcon(customIconId)); m_clock->advanceSecond(1); Merger merger(dbSource.data(), dbDestination.data()); merger.merge(); - QVERIFY(dbDestination->metadata()->containsCustomIcon(customIconId)); - QCOMPARE(dbDestination->metadata()->customIcons().count(), 1); + QVERIFY(dbDestination->metadata()->hasCustomIcon(customIconId)); + QCOMPARE(dbDestination->metadata()->customIconsOrder().count(), 1); } void TestMerge::testMetadata() diff --git a/tests/gui/TestGuiPixmaps.cpp b/tests/gui/TestGuiPixmaps.cpp index c5754ba84..a6644f547 100644 --- a/tests/gui/TestGuiPixmaps.cpp +++ b/tests/gui/TestGuiPixmaps.cpp @@ -28,117 +28,55 @@ void TestGuiPixmaps::initTestCase() void TestGuiPixmaps::testDatabaseIcons() { - QImage image; - QPixmap pixmap; - QPixmap pixmapCached; - - image = databaseIcons()->icon(0); - pixmap = databaseIcons()->iconPixmap(0); - compareImages(pixmap, image); // check if the cache works correctly - pixmapCached = databaseIcons()->iconPixmap(0); - compareImages(pixmapCached, image); - QCOMPARE(pixmapCached.cacheKey(), pixmap.cacheKey()); - - pixmap = databaseIcons()->iconPixmap(1); - image = databaseIcons()->icon(1); - compareImages(pixmap, image); - pixmapCached = databaseIcons()->iconPixmap(1); - compareImages(pixmapCached, image); + auto pixmap = databaseIcons()->icon(0); + auto pixmapCached = databaseIcons()->icon(0); QCOMPARE(pixmapCached.cacheKey(), pixmap.cacheKey()); } void TestGuiPixmaps::testEntryIcons() { - Database* db = new Database(); + QScopedPointer db(new Database()); Entry* entry = new Entry(); entry->setGroup(db->rootGroup()); - QImage icon; - QImage image; - QPixmap pixmap; - QPixmap pixmapCached1; - QPixmap pixmapCached2; - - icon = databaseIcons()->icon(10); + // Test setting standard icon entry->setIcon(10); - image = entry->icon(); - pixmap = entry->iconPixmap(); - QCOMPARE(image, icon); - compareImages(pixmap, icon); - pixmapCached1 = entry->iconPixmap(); - pixmapCached2 = databaseIcons()->iconPixmap(10); - compareImages(pixmapCached1, icon); - compareImages(pixmapCached2, icon); - QCOMPARE(pixmapCached1.cacheKey(), pixmap.cacheKey()); - QCOMPARE(pixmapCached2.cacheKey(), pixmap.cacheKey()); + auto pixmap = entry->iconPixmap(); + QCOMPARE(pixmap.cacheKey(), databaseIcons()->icon(10).cacheKey()); + // Test setting custom icon QUuid iconUuid = QUuid::createUuid(); - icon = QImage(2, 1, QImage::Format_RGB32); + QImage icon(2, 1, QImage::Format_RGB32); icon.setPixel(0, 0, qRgb(0, 0, 0)); icon.setPixel(1, 0, qRgb(0, 0, 50)); db->metadata()->addCustomIcon(iconUuid, icon); + entry->setIcon(iconUuid); - - image = entry->icon(); pixmap = entry->iconPixmap(); - - QCOMPARE(image, icon); - compareImages(pixmap, icon); - pixmapCached1 = entry->iconPixmap(); - compareImages(pixmapCached1, icon); - QCOMPARE(pixmapCached1.cacheKey(), pixmap.cacheKey()); - - delete db; + QCOMPARE(pixmap.cacheKey(), db->metadata()->customIconPixmap(iconUuid).cacheKey()); } void TestGuiPixmaps::testGroupIcons() { - Database* db = new Database(); + QScopedPointer db(new Database()); Group* group = db->rootGroup(); - QImage icon; - QImage image; - QPixmap pixmap; - QPixmap pixmapCached1; - QPixmap pixmapCached2; - - icon = databaseIcons()->icon(10); + // Test setting standard icon group->setIcon(10); - image = group->icon(); - pixmap = group->iconPixmap(); - QCOMPARE(image, icon); - compareImages(pixmap, icon); - pixmapCached1 = group->iconPixmap(); - pixmapCached2 = databaseIcons()->iconPixmap(10); - compareImages(pixmapCached1, icon); - compareImages(pixmapCached2, icon); - QCOMPARE(pixmapCached1.cacheKey(), pixmap.cacheKey()); - QCOMPARE(pixmapCached2.cacheKey(), pixmap.cacheKey()); + auto pixmap = group->iconPixmap(); + QCOMPARE(pixmap.cacheKey(), databaseIcons()->icon(10).cacheKey()); + // Test setting custom icon QUuid iconUuid = QUuid::createUuid(); - icon = QImage(2, 1, QImage::Format_RGB32); + QImage icon(2, 1, QImage::Format_RGB32); icon.setPixel(0, 0, qRgb(0, 0, 0)); icon.setPixel(1, 0, qRgb(0, 0, 50)); db->metadata()->addCustomIcon(iconUuid, icon); + group->setIcon(iconUuid); - - image = group->icon(); pixmap = group->iconPixmap(); - - QCOMPARE(image, icon); - compareImages(pixmap, icon); - pixmapCached1 = group->iconPixmap(); - compareImages(pixmapCached1, icon); - QCOMPARE(pixmapCached1.cacheKey(), pixmap.cacheKey()); - - delete db; -} - -void TestGuiPixmaps::compareImages(const QPixmap& pixmap, const QImage& image) -{ - QCOMPARE(pixmap.toImage().convertToFormat(QImage::Format_ARGB32_Premultiplied), - image.convertToFormat(QImage::Format_ARGB32_Premultiplied)); + QCOMPARE(pixmap.cacheKey(), db->metadata()->customIconPixmap(iconUuid).cacheKey()); } QTEST_MAIN(TestGuiPixmaps) diff --git a/tests/gui/TestGuiPixmaps.h b/tests/gui/TestGuiPixmaps.h index 6e649c0f7..da55643a4 100644 --- a/tests/gui/TestGuiPixmaps.h +++ b/tests/gui/TestGuiPixmaps.h @@ -31,9 +31,6 @@ private slots: void testDatabaseIcons(); void testEntryIcons(); void testGroupIcons(); - -private: - void compareImages(const QPixmap& pixmap, const QImage& image); }; #endif // KEEPASSX_TESTGUIPIXMAPS_H diff --git a/utils/makeicons.sh b/utils/makeappicons.sh similarity index 83% rename from utils/makeicons.sh rename to utils/makeappicons.sh index feb2d25fe..707a24b21 100644 --- a/utils/makeicons.sh +++ b/utils/makeappicons.sh @@ -38,22 +38,27 @@ # # Material icons: https://materialdesignicons.com/ +NC='\033[0m' +RED='\033[0;31m' +YELLOW='\033[0;33m' + if [ $# != 1 ];then echo "Usage: $0 MATERIAL" - echo "MATERIAL is the check-out directory of the material icons repository" + echo "MATERIAL is the directory containing the material icons repository" echo "(git clone https://github.com/Templarian/MaterialDesign.git)". exit fi MATERIAL="$1" if [ ! -d "$MATERIAL" ];then - echo "Material check-out directory doesn't exist: $MATERIAL" + echo -e "${RED}Material Icons directory does not exist: ${MATERIAL}${NC}" exit 1 fi -if [ ! -d application ];then - echo "Please run this script from within the share/icons directory" - echo "of the KeePassXC source distribution." +# Check destination dir +DSTDIR=share/icons/application +if [ ! -d "$DSTDIR" ];then + echo -e "${RED}Please invoke this script from the KeePassXC source root directory.${NC}" exit 1 fi @@ -65,24 +70,28 @@ fi # If the icon name is unknown, outputs nothing. map() { case "$1" in - application-exit) echo exit-to-app ;; + application-exit) echo exit-run ;; auto-type) echo keyboard-variant ;; bugreport) echo bug-outline ;; chronometer) echo clock-outline ;; - configure) echo settings-outline ;; + clipboard-text) echo clipboard-text-outline ;; + configure) echo cog-outline ;; database-change-key) echo key ;; database-close) echo close ;; database-lock) echo lock-outline ;; database-merge) echo merge ;; dialog-close) echo close ;; - dialog-error) echo alert-octagon ;; + dialog-error) echo alert-circle-outline ;; dialog-information) echo information-outline ;; dialog-ok) echo checkbox-marked-circle ;; dialog-warning) echo alert-outline ;; document-close) echo close ;; document-edit) echo pencil ;; + document-export) echo export ;; + document-import) echo import ;; document-new) echo plus ;; document-open) echo folder-open-outline ;; + document-open-recent) echo folder-clock-outline ;; document-properties) echo file-edit-outline ;; document-save) echo content-save-outline ;; document-save-as) echo content-save-all-outline ;; @@ -90,12 +99,11 @@ map() { donate) echo gift-outline ;; edit-clear-locationbar-ltr) echo backspace-reverse-outline ;; edit-clear-locationbar-rtl) echo backspace-outline ;; - entry-clone) echo comment-multiple-outline ;; - entry-delete) echo comment-remove-outline ;; - entry-edit) echo comment-edit-outline ;; - entry-new) echo comment-plus-outline ;; + entry-clone) echo plus-circle-multiple-outline ;; + entry-delete) echo close-circle-outline ;; + entry-edit) echo pencil-circle-outline ;; + entry-new) echo plus-circle-outline ;; favicon-download) echo download ;; - freedesktop) echo freedesktop-dot-org ;; getting-started) echo lightbulb-on-outline ;; group-delete) echo folder-remove-outline ;; group-edit) echo folder-edit-outline ;; @@ -104,8 +112,8 @@ map() { health) echo heart-pulse ;; help-about) echo information-outline ;; internet-web-browser) echo web ;; - key-enter) echo keyboard-variant ;; keyboard-shortcuts) echo apple-keyboard-command ;; + key-enter) echo keyboard-variant ;; message-close) echo close ;; move-down) echo chevron-double-down ;; move-up) echo chevron-double-up ;; @@ -117,9 +125,10 @@ map() { password-generator) echo dice-3-outline ;; password-show-off) echo eye-off-outline ;; password-show-on) echo eye-outline ;; - preferences-other) echo file-document-edit-outline ;; preferences-desktop-icons) echo emoticon-happy-outline ;; + preferences-other) echo file-document-edit-outline ;; preferences-system-network-sharing) echo lan ;; + refresh) echo refresh ;; reports) echo lightbulb-on-outline ;; reports-exclude) echo lightbulb-off-outline ;; security-high) echo shield-outline ;; @@ -139,7 +148,7 @@ map() { } # Now do the actual work -find application -type f -name "*.svg" | while read -r DST;do +find $DSTDIR -type f -name "*.svg" | while read -r DST;do # Find the icon name (base name without extender) NAME=$(basename $DST .svg) @@ -147,18 +156,19 @@ find application -type f -name "*.svg" | while read -r DST;do # Find the base name of the svg file for this icon MAT=$(map $NAME) if [[ -z $MAT ]];then - echo "Warning: Don't know about $NAME" + echo -e "${YELLOW}Warning: No MaterialDesign mapping for ${NAME}${NC}" continue fi # So the source file is: SRC="$MATERIAL/svg/$MAT.svg" if [ ! -f "$SRC" ];then - echo "Error: Source for $NAME doesn't exist: $SRC" - exit 1 + echo -e "${RED}Error: Source for ${NAME} doesn't exist: ${SRC}${NC}" + continue fi # Replace the icon file with the source file cp "$SRC" "$DST" || exit + echo "Copied icon for ${NAME}" done diff --git a/utils/makedbicons.sh b/utils/makedbicons.sh new file mode 100644 index 000000000..2e49b9110 --- /dev/null +++ b/utils/makedbicons.sh @@ -0,0 +1,123 @@ +#!/bin/bash +# Assemble database icons from the icons8 collection +# by Wolfram Rösler 2020-04-30 + +NC='\033[0m' +RED='\033[0;31m' +YELLOW='\033[0;33m' + +# Check parameters +if [[ $# != 1 ]];then + echo "Usage: $0 ICONS8" + echo "ICONS8 is the directory containing the Icons8 flat-color-icons repository" + echo "(git clone https://github.com/icons8/flat-color-icons)". + exit +fi + +# Check source directory +SRCDIR="$1" +if [ ! -d "$SRCDIR" ];then + echo -e "${RED}icons8 directory doesn't exist: ${SRCDIR}${NC}" + exit 1 +fi + +# Check destination directory +DSTDIR=share/icons/database +if [ ! -d "$DSTDIR" ];then + echo -e "${RED}Please invoke this script from the KeePassXC source root directory.${NC}" + exit 1 +fi + +# Copy one icon from the icons8 collection. +# +# Usage: copy I8NAME Cnn +# I8NAME is the file name (without extender and without +# the "icon8-" prefix) in the icons8 directory. +# Cnn is C plus the number of the database icon. +# +# Example: copy key C00 +copy() { + # The source file is: + SRC="${SRCDIR}/svg/${1}.svg" + if [ ! -f "$SRC" ];then + echo -e "${RED}Cannot find source icon for ${2} (${SRC})${NC}" + return + fi + + # Copy the source file to the destination, keeping + # the source file's extension + DST="$DSTDIR/${2}.svg" + cp $SRC $DST + echo "Copied icon for ${1} to ${DST}" +} + +# Now do the actual work +#copy key C00_Password # Derivative work from key +copy globe C01_Package_Network +copy high_priority C02_MessageBox_Warning +copy data_protection C03_Server # No exact match +copy survey C04_Klipper +copy businessman C05_Edu_Languages +copy services C06_KCMDF +#copy notepad C07_Kate # Provided by paomedia/small-n-flat +copy external C08_Socket +copy business_contact C09_Identity +copy address_book C10_Kontact +copy old_time_camera C11_Camera +copy entering_heaven_alive C12_IRKickFlash # No exact match +#copy keys-holder C13_KGPG_Key3 # Derivative work from key +copy crystal_oscillator C14_Laptop_Power +copy video_projector C15_Scanner +copy bookmark C16_Mozilla_Firebird +#copy cd C17_CDROM_Unmount # Provided by paomedia/small-n-flat +#copy monitor C18_Display # Provided by paomedia/small-n-flat +#copy feedback C19_Mail_Generic # Derivative work from feedback +copy settings C20_Misc +copy inspection C21_KOrganizer +copy file C22_ASCII +copy template C23_Icons +copy flash_on C24_Connect_Established +copy safe C25_Folder_Mail # No exact match +#copy save C26_FileSave # Provided by paomedia/small-n-flat +#copy cloud-storage C27_NFS_Unmount # Provided by paomedia/small-n-flat +copy film_reel C28_QuickTime +#copy C29_KGPG_Term # Derivative work from command_line and key +#copy command_line C30_Konsole # Derivative work from command_line +copy print C31_FilePrint +copy org_unit C32_FSView +copy cloth C33_Run +copy support C34_Configure +#copy vpn C35_KRFB # Derivative work from paomedia/small-n-flat +#copy archive-folder C36_Ark # Derivative work from folder +#copy percentage C37_KPercentage # Original work +#copy windows-client C38_Samba_Unmount # Derivative work from paomedia/small-n-flat +copy clock C39_History +copy search C40_Mail_Find +copy landscape C41_VectorGfx +copy electronics C42_KCMMemory +copy empty_trash C43_EditTrash +#copy C44_KNotes # Provided by paomedia/small-n-flat +#copy C45_Cancel # Original work +#copy C46_Help # Original work +copy package C47_KPackage +copy folder C48_Folder +copy opened_folder C49_Folder_Blue_Open +copy data_encryption C50_Folder_Tar +#copy unlock C51_Decrypted # Provided by paomedia/small-n-flat +#copy lock C52_Encrypted # Provided by paomedia/small-n-flat +#copy C53_Apply # Original work +#copy pencil C54_Signature # Provided by paomedia/small-n-flat +copy image_file C55_Thumbnail +copy contacts C56_KAddressBook +copy data_sheet C57_View_Text +copy podium_with_speaker C58_KPGP # No exact match +#copy hammer C59_Package_Development # Provided by paomedia/small-n-flat +copy home C60_KFM_Home +#copy C61_Services # Original work +copy linux C62_Tux +copy android_os C63_Feather +#copy C64_Apple # Derivative work created from simple-icons apple.svg +copy wikipedia C65_W +#copy currency_exchange C66_Money # Provided by paomedia/small-n-flat +copy diploma_1 C67_Certificate +copy smartphone_tablet C68_Blackberry