Skip to content

Commit

Permalink
Merge pull request #632 from telegramdesktop/dev
Browse files Browse the repository at this point in the history
Create a new pull request by comparing changes across two branches
  • Loading branch information
GulajavaMinistudio authored Jul 20, 2023
2 parents 0f643ba + 59bb46a commit 3a85216
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 29 deletions.
4 changes: 1 addition & 3 deletions Telegram/SourceFiles/platform/linux/integration_linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,7 @@ void LinuxIntegration::initInhibit() {
}

void LinuxIntegration::LaunchNativeApplication() {
const auto appId = QGuiApplication::desktopFileName()
.chopped(8)
.toStdString();
const auto appId = QGuiApplication::desktopFileName().toStdString();

const auto app = Glib::wrap(
G_APPLICATION(
Expand Down
7 changes: 3 additions & 4 deletions Telegram/SourceFiles/platform/linux/main_window_linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,7 @@ void XCBSetDesktopFileName(QWindow *window) {
base::Platform::XCB::GetAtom(connection, "_KDE_NET_WM_DESKTOP_FILE"),
};

const auto filename = QGuiApplication::desktopFileName()
.chopped(8)
.toUtf8();
const auto filename = QGuiApplication::desktopFileName().toUtf8();

for (const auto atom : filenameAtoms) {
if (atom.has_value()) {
Expand Down Expand Up @@ -244,7 +242,8 @@ void MainWindow::updateUnityCounter() {

const auto launcherUrl = Glib::ustring(
"application://"
+ QGuiApplication::desktopFileName().toStdString());
+ QGuiApplication::desktopFileName().toStdString()
+ ".desktop");
const auto counterSlice = std::min(Core::App().unreadBadge(), 9999);
std::map<Glib::ustring, Glib::VariantBase> dbusUnityProperties;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ bool NotificationData::init(
_hints["category"] = Glib::Variant<Glib::ustring>::create("im.received");

_hints["desktop-entry"] = Glib::Variant<Glib::ustring>::create(
QGuiApplication::desktopFileName().chopped(8).toStdString());
QGuiApplication::desktopFileName().toStdString());

_notificationClosedSignalId = _dbusConnection->signal_subscribe(
signalEmitted,
Expand Down
24 changes: 13 additions & 11 deletions Telegram/SourceFiles/platform/linux/specific_linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,9 @@ bool GenerateDesktopFile(
if (!QDir(targetPath).exists()) QDir().mkpath(targetPath);

const auto sourceFile = kDesktopFile.utf16();
const auto targetFile = targetPath + QGuiApplication::desktopFileName();
const auto targetFile = targetPath
+ QGuiApplication::desktopFileName()
+ u".desktop"_q;

const auto sourceText = [&] {
QFile source(sourceFile);
Expand Down Expand Up @@ -332,7 +334,7 @@ bool GenerateServiceFile(bool silent = false) {
QStandardPaths::GenericDataLocation) + u"/dbus-1/services/"_q;

const auto targetFile = targetPath
+ QGuiApplication::desktopFileName().chopped(8)
+ QGuiApplication::desktopFileName()
+ u".service"_q;

DEBUG_LOG(("App Info: placing .service file to %1").arg(targetPath));
Expand All @@ -344,7 +346,7 @@ bool GenerateServiceFile(bool silent = false) {
target->set_string(
group,
"Name",
QGuiApplication::desktopFileName().chopped(8).toStdString());
QGuiApplication::desktopFileName().toStdString());

target->set_string(
group,
Expand Down Expand Up @@ -455,7 +457,9 @@ void AutostartToggle(bool enabled, Fn<void(bool)> done) {

if (!enabled) {
return QFile::remove(
autostart + QGuiApplication::desktopFileName());
autostart
+ QGuiApplication::desktopFileName()
+ u".desktop"_q);
}

return GenerateDesktopFile(
Expand Down Expand Up @@ -557,14 +561,13 @@ void start() {

QGuiApplication::setDesktopFileName([&] {
if (KSandbox::isFlatpak()) {
return qEnvironmentVariable("FLATPAK_ID") + u".desktop"_q;
return qEnvironmentVariable("FLATPAK_ID");
}

if (KSandbox::isSnap()) {
return qEnvironmentVariable("SNAP_INSTANCE_NAME")
+ '_'
+ cExeName()
+ u".desktop"_q;
+ cExeName();
}

if (!Core::UpdaterDisabled()) {
Expand All @@ -579,14 +582,13 @@ void start() {
md5Hash.data());
}

return u"org.telegram.desktop._%1.desktop"_q.arg(
md5Hash.constData());
return u"org.telegram.desktop._%1"_q.arg(md5Hash.constData());
}

return u"org.telegram.desktop.desktop"_q;
return u"org.telegram.desktop"_q;
}());

LOG(("Launcher filename: %1").arg(QGuiApplication::desktopFileName()));
LOG(("App ID: %1").arg(QGuiApplication::desktopFileName()));

if (!qEnvironmentVariableIsSet("XDG_ACTIVATION_TOKEN")
&& qEnvironmentVariableIsSet("DESKTOP_STARTUP_ID")) {
Expand Down
12 changes: 6 additions & 6 deletions Telegram/build/docker/centos_env/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{%- set GIT = "https://github.com" -%}
{%- set GIT_FREEDESKTOP = GIT ~ "/gitlab-freedesktop-mirrors" -%}
{%- set QT = "6.5.1" -%}
{%- set QT = "6.5.2" -%}
{%- set QT_TAG = "v" ~ QT -%}
{%- set QT_PREFIX = "/usr/local/desktop-app/Qt-" ~ QT -%}
{%- set OPENSSL_VER = "1_1_1" -%}
Expand Down Expand Up @@ -59,7 +59,7 @@ FROM builder AS patches
RUN git init patches \
&& cd patches \
&& git remote add origin {{ GIT }}/desktop-app/patches.git \
&& git fetch --depth=1 origin 963f5b0c2a57f7e90239e64c9e14ed5f043e637e \
&& git fetch --depth=1 origin 523b061671d4dd2f29979c982a2d03c2cc8eaf4f \
&& git reset --hard FETCH_HEAD \
&& rm -rf .git

Expand Down Expand Up @@ -196,7 +196,7 @@ RUN git clone -b v1.3.1 --depth=1 {{ GIT }}/xiph/opus.git \
FROM builder AS dav1d
COPY --link --from=nasm {{ LibrariesPath }}/nasm-cache /

RUN git clone -b 1.0.0 --depth=1 {{ GIT }}/videolan/dav1d.git \
RUN git clone -b 1.2.1 --depth=1 {{ GIT }}/videolan/dav1d.git \
&& cd dav1d \
&& meson build \
--buildtype=plain \
Expand All @@ -209,7 +209,7 @@ RUN git clone -b 1.0.0 --depth=1 {{ GIT }}/videolan/dav1d.git \
&& rm -rf dav1d

FROM builder AS libde265
RUN git clone -b v1.0.11 --depth=1 {{ GIT }}/strukturag/libde265.git \
RUN git clone -b v1.0.12 --depth=1 {{ GIT }}/strukturag/libde265.git \
&& cd libde265 \
&& cmake -GNinja . \
-DCMAKE_BUILD_TYPE=None \
Expand Down Expand Up @@ -254,7 +254,7 @@ RUN git clone -b v0.11.1 --depth=1 {{ GIT }}/AOMediaCodec/libavif.git \
FROM builder AS libheif
COPY --link --from=libde265 {{ LibrariesPath }}/libde265-cache /

RUN git clone -b v1.15.1 --depth=1 {{ GIT }}/strukturag/libheif.git \
RUN git clone -b v1.16.2 --depth=1 {{ GIT }}/strukturag/libheif.git \
&& cd libheif \
&& cmake -GNinja -B build . \
-DCMAKE_BUILD_TYPE=None \
Expand All @@ -279,7 +279,7 @@ COPY --link --from=lcms2 {{ LibrariesPath }}/lcms2-cache /
COPY --link --from=brotli {{ LibrariesPath }}/brotli-cache /
COPY --link --from=highway {{ LibrariesPath }}/highway-cache /

RUN git clone -b v0.8.1 --depth=1 {{ GIT }}/libjxl/libjxl.git \
RUN git clone -b v0.8.2 --depth=1 {{ GIT }}/libjxl/libjxl.git \
&& cd libjxl \
&& cmake -GNinja -B build . \
-DCMAKE_BUILD_TYPE=None \
Expand Down
2 changes: 1 addition & 1 deletion Telegram/lib_webview
4 changes: 2 additions & 2 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ parts:
libjxl:
source: https://github.com/libjxl/libjxl.git
source-depth: 1
source-tag: v0.8.1
source-tag: v0.8.2
plugin: cmake
build-environment:
- LDFLAGS: ${LDFLAGS:+$LDFLAGS} -s
Expand Down Expand Up @@ -461,7 +461,7 @@ parts:
- libxkbcommon-x11-0
- zlib1g
override-pull: |
QT=6.5.1
QT=6.5.2
git clone -b v${QT} --depth=1 https://code.qt.io/qt/qt5.git .
git submodule update --init --recursive --depth=1 qtbase qtdeclarative qtwayland qtimageformats qtsvg qtshadertools
Expand Down

0 comments on commit 3a85216

Please sign in to comment.