mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-02-12 01:57:25 +00:00
Fixed Linux build. Alpha version 0.9.54.
This commit is contained in:
parent
cbde6e1ee9
commit
12c20faa44
@ -249,9 +249,9 @@ void MainWindow::psSetupTrayIcon() {
|
|||||||
trayIcon = new QSystemTrayIcon(this);
|
trayIcon = new QSystemTrayIcon(this);
|
||||||
|
|
||||||
QIcon icon;
|
QIcon icon;
|
||||||
QFileInfo f(_trayIconImageFile());
|
QFileInfo iconFile(_trayIconImageFile());
|
||||||
if (f.exists()) {
|
if (iconFile.exists()) {
|
||||||
QByteArray path = QFile::encodeName(f.absoluteFilePath());
|
QByteArray path = QFile::encodeName(iconFile.absoluteFilePath());
|
||||||
icon = QIcon(path.constData());
|
icon = QIcon(path.constData());
|
||||||
} else {
|
} else {
|
||||||
icon = QIcon(QPixmap::fromImage(App::wnd()->iconLarge(), Qt::ColorOnly));
|
icon = QIcon(QPixmap::fromImage(App::wnd()->iconLarge(), Qt::ColorOnly));
|
||||||
@ -303,9 +303,9 @@ void MainWindow::psUpdateWorkmode() {
|
|||||||
void MainWindow::psUpdateIndicator() {
|
void MainWindow::psUpdateIndicator() {
|
||||||
_psUpdateIndicatorTimer.stop();
|
_psUpdateIndicatorTimer.stop();
|
||||||
_psLastIndicatorUpdate = getms();
|
_psLastIndicatorUpdate = getms();
|
||||||
QFileInfo f(_trayIconImageFile());
|
QFileInfo iconFile(_trayIconImageFile());
|
||||||
if (f.exists()) {
|
if (iconFile.exists()) {
|
||||||
QByteArray path = QFile::encodeName(f.absoluteFilePath()), name = QFile::encodeName(f.fileName());
|
QByteArray path = QFile::encodeName(iconFile.absoluteFilePath()), name = QFile::encodeName(iconFile.fileName());
|
||||||
name = name.mid(0, name.size() - 4);
|
name = name.mid(0, name.size() - 4);
|
||||||
Libs::app_indicator_set_icon_full(_trayIndicator, path.constData(), name);
|
Libs::app_indicator_set_icon_full(_trayIndicator, path.constData(), name);
|
||||||
} else {
|
} else {
|
||||||
@ -338,7 +338,7 @@ void MainWindow::psUpdateCounter() {
|
|||||||
} else if (useStatusIcon && trayIconChecked) {
|
} else if (useStatusIcon && trayIconChecked) {
|
||||||
QFileInfo iconFile(_trayIconImageFile());
|
QFileInfo iconFile(_trayIconImageFile());
|
||||||
if (iconFile.exists()) {
|
if (iconFile.exists()) {
|
||||||
QByteArray path = QFile::encodeName(f.absoluteFilePath());
|
QByteArray path = QFile::encodeName(iconFile.absoluteFilePath());
|
||||||
Libs::gtk_status_icon_set_from_file(_trayIcon, path.constData());
|
Libs::gtk_status_icon_set_from_file(_trayIcon, path.constData());
|
||||||
} else {
|
} else {
|
||||||
loadPixbuf(_trayIconImageGen());
|
loadPixbuf(_trayIconImageGen());
|
||||||
@ -347,9 +347,9 @@ void MainWindow::psUpdateCounter() {
|
|||||||
}
|
}
|
||||||
} else if (trayIcon) {
|
} else if (trayIcon) {
|
||||||
QIcon icon;
|
QIcon icon;
|
||||||
QFileInfo f(_trayIconImageFile());
|
QFileInfo iconFile(_trayIconImageFile());
|
||||||
if (f.exists()) {
|
if (iconFile.exists()) {
|
||||||
QByteArray path = QFile::encodeName(f.absoluteFilePath());
|
QByteArray path = QFile::encodeName(iconFile.absoluteFilePath());
|
||||||
icon = QIcon(path.constData());
|
icon = QIcon(path.constData());
|
||||||
} else {
|
} else {
|
||||||
int32 counter = App::histories().unreadBadge();
|
int32 counter = App::histories().unreadBadge();
|
||||||
@ -524,9 +524,9 @@ void MainWindow::psCreateTrayIcon() {
|
|||||||
_trayMenu = Libs::gtk_menu_new();
|
_trayMenu = Libs::gtk_menu_new();
|
||||||
if (_trayMenu) {
|
if (_trayMenu) {
|
||||||
DEBUG_LOG(("Created gtk menu for appindicator!"));
|
DEBUG_LOG(("Created gtk menu for appindicator!"));
|
||||||
QFileInfo f(_trayIconImageFile());
|
QFileInfo iconFile(_trayIconImageFile());
|
||||||
if (f.exists()) {
|
if (iconFile.exists()) {
|
||||||
QByteArray path = QFile::encodeName(f.absoluteFilePath());
|
QByteArray path = QFile::encodeName(iconFile.absoluteFilePath());
|
||||||
_trayIndicator = Libs::app_indicator_new("Telegram Desktop", path.constData(), APP_INDICATOR_CATEGORY_APPLICATION_STATUS);
|
_trayIndicator = Libs::app_indicator_new("Telegram Desktop", path.constData(), APP_INDICATOR_CATEGORY_APPLICATION_STATUS);
|
||||||
if (_trayIndicator) {
|
if (_trayIndicator) {
|
||||||
DEBUG_LOG(("Created appindicator!"));
|
DEBUG_LOG(("Created appindicator!"));
|
||||||
|
Loading…
Reference in New Issue
Block a user