Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packed resources #17339

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions Telegram/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@ if (WIN32)
endif()

set_target_properties(Telegram PROPERTIES AUTOMOC ON)
target_prepare_qrc(Telegram)
if (LINUX)
# Do not repeat app name in path of a resource archive.
target_prepare_qrc(Telegram tresources.rcc)
else()
target_prepare_qrc(Telegram)
endif()

target_link_libraries(Telegram
PRIVATE
Expand Down Expand Up @@ -1657,7 +1662,11 @@ if (LINUX AND DESKTOP_APP_USE_PACKAGED)
include(GNUInstallDirs)
configure_file("../lib/xdg/telegramdesktop.metainfo.xml.in" "${CMAKE_CURRENT_BINARY_DIR}/telegramdesktop.metainfo.xml" @ONLY)
generate_appdata_changelog(Telegram "${CMAKE_SOURCE_DIR}/changelog.txt" "${CMAKE_CURRENT_BINARY_DIR}/telegramdesktop.metainfo.xml")
install(TARGETS Telegram RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" BUNDLE DESTINATION "${CMAKE_INSTALL_BINDIR}")
install(TARGETS Telegram
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
BUNDLE DESTINATION "${CMAKE_INSTALL_BINDIR}"
RESOURCE DESTINATION "${CMAKE_INSTALL_DATADIR}/TelegramDesktop"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use lowercase directory name here: ${CMAKE_INSTALL_DATADIR}/telegram-desktop.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, the name is not arbitrary here. It should match application name as known to Qt.

https://github.com/telegramdesktop/tdesktop/blob/v3.3.0/Telegram/SourceFiles/core/launcher.cpp#L288

)
install(FILES "Resources/art/icon16.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/16x16/apps" RENAME "telegram.png")
install(FILES "Resources/art/icon32.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/32x32/apps" RENAME "telegram.png")
install(FILES "Resources/art/icon48.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/48x48/apps" RENAME "telegram.png")
Expand Down
2 changes: 2 additions & 0 deletions Telegram/SourceFiles/platform/linux/launcher_linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ For license and copyright information please follow this link:
*/
#include "platform/linux/launcher_linux.h"

#include "base/base_file_utilities.h"
#include "core/crash_reports.h"
#include "core/update_checker.h"
#include "webview/platform/linux/webview_linux_webkit2gtk.h"
Expand Down Expand Up @@ -64,6 +65,7 @@ int Launcher::exec() {

void Launcher::initHook() {
QApplication::setAttribute(Qt::AA_DisableSessionManager, true);
base::RegisterResourceArchive(u"tresources.rcc"_q);
}

bool Launcher::launchUpdater(UpdaterLaunch action) {
Expand Down
3 changes: 1 addition & 2 deletions Telegram/SourceFiles/platform/mac/launcher_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
void Launcher::initHook() {
// macOS Retina display support is working fine, others are not.
QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling, false);

base::RegisterBundledResources(u"Telegram.rcc"_q);
base::RegisterResourceArchive(u"Telegram.rcc"_q);
}

bool Launcher::launchUpdater(UpdaterLaunch action) {
Expand Down