mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-04-01 14:50:24 +00:00
Use Q_OS_UNIX instead of Q_OS_LINUX since linux-specific code can be used also on *BSD/Haiku
This commit is contained in:
parent
56de3194ef
commit
dbad9fa73a
@ -254,7 +254,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
QByteArray inner = f.readAll();
|
||||
stream << name << quint32(inner.size()) << inner;
|
||||
#if defined Q_OS_MAC || defined Q_OS_LINUX
|
||||
#ifdef Q_OS_UNIX
|
||||
stream << (QFileInfo(fullName).isExecutable() ? true : false);
|
||||
#endif
|
||||
}
|
||||
@ -467,10 +467,12 @@ int main(int argc, char *argv[])
|
||||
QString outName(QString("tupdate%1").arg(AlphaVersion ? AlphaVersion : version));
|
||||
#elif defined Q_OS_MAC
|
||||
QString outName((targetosx ? QString("tosxupd%1") : QString("tmacupd%1")).arg(AlphaVersion ? AlphaVersion : version));
|
||||
#elif defined Q_OS_LINUX32
|
||||
#elif defined Q_OS_UNIX
|
||||
#ifndef _LP64
|
||||
QString outName(QString("tlinux32upd%1").arg(AlphaVersion ? AlphaVersion : version));
|
||||
#elif defined Q_OS_LINUX64
|
||||
#else
|
||||
QString outName(QString("tlinuxupd%1").arg(AlphaVersion ? AlphaVersion : version));
|
||||
#endif
|
||||
#else
|
||||
#error Unknown platform!
|
||||
#endif
|
||||
|
@ -773,11 +773,11 @@ void Application::notifyFileDialogShown(bool shown) {
|
||||
}
|
||||
|
||||
QWidget *Application::getModalParent() {
|
||||
#ifdef Q_OS_LINUX
|
||||
#if defined Q_OS_UNIX && !defined Q_OS_MAC
|
||||
return Platform::IsWayland()
|
||||
? App::wnd()
|
||||
: nullptr;
|
||||
#endif // Q_OS_LINUX
|
||||
#endif // Q_OS_UNIX && !Q_OS_MAC
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "client/crashpad_client.h"
|
||||
#endif // else for MAC_USE_BREAKPAD
|
||||
|
||||
#elif defined Q_OS_LINUX64 || defined Q_OS_LINUX32 // Q_OS_MAC
|
||||
#elif defined Q_OS_UNIX // Q_OS_MAC
|
||||
|
||||
#include <execinfo.h>
|
||||
#include <signal.h>
|
||||
@ -47,7 +47,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
|
||||
#include "client/linux/handler/exception_handler.h"
|
||||
|
||||
#endif // Q_OS_LINUX64 || Q_OS_LINUX32
|
||||
#endif // Q_OS_UNIX
|
||||
|
||||
#endif // !DESKTOP_APP_DISABLE_CRASH_REPORTS
|
||||
|
||||
@ -140,7 +140,7 @@ QMutex ReportingMutex;
|
||||
const char *BreakpadDumpPath = nullptr;
|
||||
const wchar_t *BreakpadDumpPathW = nullptr;
|
||||
|
||||
#if defined Q_OS_MAC || defined Q_OS_LINUX32 || defined Q_OS_LINUX64
|
||||
#ifdef Q_OS_UNIX
|
||||
struct sigaction SIG_def[32];
|
||||
|
||||
void SignalHandler(int signum, siginfo_t *info, void *ucontext) {
|
||||
@ -148,9 +148,9 @@ void SignalHandler(int signum, siginfo_t *info, void *ucontext) {
|
||||
sigaction(signum, &SIG_def[signum], 0);
|
||||
}
|
||||
|
||||
#else // Q_OS_MAC || Q_OS_LINUX32 || Q_OS_LINUX64
|
||||
#else // Q_OS_UNIX
|
||||
void SignalHandler(int signum) {
|
||||
#endif // else for Q_OS_MAC || Q_OS_LINUX || Q_OS_LINUX64
|
||||
#endif // else for Q_OS_UNIX
|
||||
|
||||
const char* name = 0;
|
||||
switch (signum) {
|
||||
@ -212,7 +212,7 @@ void SignalHandler(int signum) {
|
||||
}
|
||||
|
||||
// see https://github.com/benbjohnson/bandicoot
|
||||
#if defined Q_OS_MAC || defined Q_OS_LINUX32 || defined Q_OS_LINUX64
|
||||
#ifdef Q_OS_UNIX
|
||||
ucontext_t *uc = (ucontext_t*)ucontext;
|
||||
|
||||
void *caller = 0;
|
||||
@ -276,9 +276,9 @@ void SignalHandler(int signum) {
|
||||
|
||||
backtrace_symbols_fd(addresses, size, ReportFileNo);
|
||||
|
||||
#else // Q_OS_MAC || Q_OS_LINUX32 || Q_OS_LINUX64
|
||||
#else // Q_OS_UNIX
|
||||
dump() << "\nBacktrace omitted.\n";
|
||||
#endif // else for Q_OS_MAC || Q_OS_LINUX32 || Q_OS_LINUX64
|
||||
#endif // else for Q_OS_UNIX
|
||||
|
||||
dump() << "\n";
|
||||
|
||||
@ -294,9 +294,9 @@ google_breakpad::ExceptionHandler* BreakpadExceptionHandler = 0;
|
||||
bool DumpCallback(const wchar_t* _dump_dir, const wchar_t* _minidump_id, void* context, EXCEPTION_POINTERS* exinfo, MDRawAssertionInfo* assertion, bool success)
|
||||
#elif defined Q_OS_MAC // Q_OS_WIN
|
||||
bool DumpCallback(const char* _dump_dir, const char* _minidump_id, void *context, bool success)
|
||||
#elif defined Q_OS_LINUX64 || defined Q_OS_LINUX32 // Q_OS_MAC
|
||||
#elif defined Q_OS_UNIX // Q_OS_MAC
|
||||
bool DumpCallback(const google_breakpad::MinidumpDescriptor &md, void *context, bool success)
|
||||
#endif // Q_OS_LINUX64 || Q_OS_LINUX32
|
||||
#endif // Q_OS_UNIX
|
||||
{
|
||||
if (CrashLogged) return success;
|
||||
CrashLogged = true;
|
||||
@ -392,7 +392,7 @@ void StartCatching(not_null<Core::Launcher*> launcher) {
|
||||
crashpad_client.UseHandler();
|
||||
}
|
||||
#endif // else for MAC_USE_BREAKPAD
|
||||
#elif defined Q_OS_LINUX64 || defined Q_OS_LINUX32
|
||||
#elif defined Q_OS_UNIX
|
||||
BreakpadExceptionHandler = new google_breakpad::ExceptionHandler(
|
||||
google_breakpad::MinidumpDescriptor(QFile::encodeName(dumpspath).toStdString()),
|
||||
/*FilterCallback*/ 0,
|
||||
@ -401,7 +401,7 @@ void StartCatching(not_null<Core::Launcher*> launcher) {
|
||||
true,
|
||||
-1
|
||||
);
|
||||
#endif // Q_OS_LINUX64 || Q_OS_LINUX32
|
||||
#endif // Q_OS_UNIX
|
||||
#endif // !DESKTOP_APP_DISABLE_CRASH_REPORTS
|
||||
}
|
||||
|
||||
|
@ -291,7 +291,7 @@ void Launcher::init() {
|
||||
|
||||
QApplication::setApplicationName(qsl("TelegramDesktop"));
|
||||
|
||||
#if defined(Q_OS_LINUX) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
|
||||
#if defined Q_OS_UNIX && !defined Q_OS_MAC && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
|
||||
QApplication::setDesktopFileName(Platform::GetLauncherFilename());
|
||||
#endif
|
||||
|
||||
|
@ -409,9 +409,9 @@ bool UnpackUpdate(const QString &filepath) {
|
||||
bool executable = false;
|
||||
|
||||
stream >> relativeName >> fileSize >> fileInnerData;
|
||||
#if defined Q_OS_MAC || defined Q_OS_LINUX
|
||||
#ifdef Q_OS_UNIX
|
||||
stream >> executable;
|
||||
#endif // Q_OS_MAC || Q_OS_LINUX
|
||||
#endif // Q_OS_UNIX
|
||||
if (stream.status() != QDataStream::Ok) {
|
||||
LOG(("Update Error: cant read file from downloaded stream, status: %1").arg(stream.status()));
|
||||
return false;
|
||||
@ -1509,10 +1509,10 @@ bool checkReadyUpdate() {
|
||||
#elif defined Q_OS_MAC // Q_OS_WIN
|
||||
QString curUpdater = (cExeDir() + cExeName() + qsl("/Contents/Frameworks/Updater"));
|
||||
QFileInfo updater(cWorkingDir() + qsl("tupdates/temp/Telegram.app/Contents/Frameworks/Updater"));
|
||||
#elif defined Q_OS_LINUX // Q_OS_MAC
|
||||
#elif defined Q_OS_UNIX // Q_OS_MAC
|
||||
QString curUpdater = (cExeDir() + qsl("Updater"));
|
||||
QFileInfo updater(cWorkingDir() + qsl("tupdates/temp/Updater"));
|
||||
#endif // Q_OS_LINUX
|
||||
#endif // Q_OS_UNIX
|
||||
if (!updater.exists()) {
|
||||
QFileInfo current(curUpdater);
|
||||
if (!current.exists()) {
|
||||
@ -1546,12 +1546,12 @@ bool checkReadyUpdate() {
|
||||
ClearAll();
|
||||
return false;
|
||||
}
|
||||
#elif defined Q_OS_LINUX // Q_OS_MAC
|
||||
#elif defined Q_OS_UNIX // Q_OS_MAC
|
||||
if (!linuxMoveFile(QFile::encodeName(updater.absoluteFilePath()).constData(), QFile::encodeName(curUpdater).constData())) {
|
||||
ClearAll();
|
||||
return false;
|
||||
}
|
||||
#endif // Q_OS_LINUX
|
||||
#endif // Q_OS_UNIX
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
Platform::RemoveQuarantine(QFileInfo(curUpdater).absolutePath());
|
||||
|
@ -1617,10 +1617,10 @@ bool IsExecutableName(const QString &filepath) {
|
||||
qsl("\
|
||||
applescript action app bin command csh osx workflow terminal url caction \
|
||||
mpkg pkg scpt scptd xhtm webarchive");
|
||||
#elif defined Q_OS_LINUX // Q_OS_MAC
|
||||
#elif defined Q_OS_UNIX // Q_OS_MAC
|
||||
qsl("bin csh deb desktop ksh out pet pkg pup rpm run sh shar \
|
||||
slp zsh");
|
||||
#else // Q_OS_MAC || Q_OS_LINUX
|
||||
#else // Q_OS_MAC || Q_OS_UNIX
|
||||
qsl("\
|
||||
ad ade adp app application appref-ms asp asx bas bat bin cdxml cer cfg chi \
|
||||
chm cmd cnt com cpl crt csh der diagcab dll drv eml exe fon fxp gadget grp \
|
||||
@ -1633,7 +1633,7 @@ psm1 pssc pst py py3 pyc pyd pyi pyo pyw pywz pyz rb reg rgs scf scr sct \
|
||||
search-ms settingcontent-ms shb shs slk sys t tmp u3p url vb vbe vbp vbs \
|
||||
vbscript vdx vsmacros vsd vsdm vsdx vss vssm vssx vst vstm vstx vsw vsx vtx \
|
||||
website ws wsc wsf wsh xbap xll xnk xs");
|
||||
#endif // !Q_OS_MAC && !Q_OS_LINUX
|
||||
#endif // !Q_OS_MAC && !Q_OS_UNIX
|
||||
const auto list = joined.split(' ');
|
||||
return base::flat_set<QString>(list.begin(), list.end());
|
||||
}();
|
||||
|
@ -1484,13 +1484,13 @@ void InnerWidget::mouseActionFinish(const QPoint &screenPos, Qt::MouseButton but
|
||||
_mouseSelectType = TextSelectType::Letters;
|
||||
//_widget->noSelectingScroll(); // TODO
|
||||
|
||||
#if defined Q_OS_LINUX32 || defined Q_OS_LINUX64
|
||||
#if defined Q_OS_UNIX && !defined Q_OS_MAC
|
||||
if (_selectedItem && _selectedText.from != _selectedText.to) {
|
||||
TextUtilities::SetClipboardText(
|
||||
_selectedItem->selectedText(_selectedText),
|
||||
QClipboard::Selection);
|
||||
}
|
||||
#endif // Q_OS_LINUX32 || Q_OS_LINUX64
|
||||
#endif // Q_OS_UNIX && !Q_OS_MAC
|
||||
}
|
||||
|
||||
void InnerWidget::updateSelected() {
|
||||
|
@ -1427,7 +1427,7 @@ void HistoryInner::mouseActionFinish(
|
||||
_widget->noSelectingScroll();
|
||||
_widget->updateTopBarSelection();
|
||||
|
||||
#if defined Q_OS_LINUX32 || defined Q_OS_LINUX64
|
||||
#if defined Q_OS_UNIX && !defined Q_OS_MAC
|
||||
if (!_selected.empty() && _selected.cbegin()->second != FullSelection) {
|
||||
const auto [item, selection] = *_selected.cbegin();
|
||||
if (const auto view = item->mainView()) {
|
||||
@ -1436,7 +1436,7 @@ void HistoryInner::mouseActionFinish(
|
||||
QClipboard::Selection);
|
||||
}
|
||||
}
|
||||
#endif // Q_OS_LINUX32 || Q_OS_LINUX64
|
||||
#endif // Q_OS_UNIX && !Q_OS_MAC
|
||||
}
|
||||
|
||||
void HistoryInner::mouseReleaseEvent(QMouseEvent *e) {
|
||||
|
@ -2085,7 +2085,7 @@ void ListWidget::mouseActionFinish(
|
||||
_mouseSelectType = TextSelectType::Letters;
|
||||
//_widget->noSelectingScroll(); // #TODO select scroll
|
||||
|
||||
#if defined Q_OS_LINUX32 || defined Q_OS_LINUX64
|
||||
#if defined Q_OS_UNIX && !defined Q_OS_MAC
|
||||
if (_selectedTextItem
|
||||
&& _selectedTextRange.from != _selectedTextRange.to) {
|
||||
if (const auto view = viewForItem(_selectedTextItem)) {
|
||||
@ -2094,7 +2094,7 @@ void ListWidget::mouseActionFinish(
|
||||
QClipboard::Selection);
|
||||
}
|
||||
}
|
||||
#endif // Q_OS_LINUX32 || Q_OS_LINUX64
|
||||
#endif // Q_OS_UNIX && !Q_OS_MAC
|
||||
}
|
||||
|
||||
void ListWidget::mouseActionUpdate() {
|
||||
|
@ -2107,11 +2107,11 @@ void ListWidget::mouseActionFinish(
|
||||
//_widget->noSelectingScroll(); // #TODO scroll by drag
|
||||
//_widget->updateTopBarSelection();
|
||||
|
||||
#if defined Q_OS_LINUX32 || defined Q_OS_LINUX64
|
||||
#if defined Q_OS_UNIX && !defined Q_OS_MAC
|
||||
//if (hasSelectedText()) { // #TODO linux clipboard
|
||||
// TextUtilities::SetClipboardText(_selected.cbegin()->first->selectedText(_selected.cbegin()->second), QClipboard::Selection);
|
||||
//}
|
||||
#endif // Q_OS_LINUX32 || Q_OS_LINUX64
|
||||
#endif // Q_OS_UNIX && !Q_OS_MAC
|
||||
}
|
||||
|
||||
void ListWidget::applyDragSelection() {
|
||||
|
@ -343,7 +343,7 @@ void start(not_null<Core::Launcher*> launcher) {
|
||||
workingDirChosen = true;
|
||||
} else {
|
||||
|
||||
#if defined Q_OS_MAC || defined Q_OS_LINUX
|
||||
#ifdef Q_OS_UNIX
|
||||
|
||||
if (!cWorkingDir().isEmpty()) {
|
||||
// This value must come from TelegramForcePortable
|
||||
@ -358,16 +358,16 @@ void start(not_null<Core::Launcher*> launcher) {
|
||||
}
|
||||
workingDirChosen = true;
|
||||
|
||||
#if defined Q_OS_LINUX && !defined _DEBUG // fix first version
|
||||
#if !defined Q_OS_MAC && !defined _DEBUG // fix first version
|
||||
moveOldDataFrom = initialWorkingDir;
|
||||
#endif // Q_OS_LINUX && !_DEBUG
|
||||
#endif // !Q_OS_MAC && !_DEBUG
|
||||
|
||||
#elif defined Q_OS_WINRT // Q_OS_MAC || Q_OS_LINUX
|
||||
#elif defined Q_OS_WINRT // Q_OS_UNIX
|
||||
|
||||
cForceWorkingDir(psAppDataPath());
|
||||
workingDirChosen = true;
|
||||
|
||||
#elif defined OS_WIN_STORE // Q_OS_MAC || Q_OS_LINUX || Q_OS_WINRT
|
||||
#elif defined OS_WIN_STORE // Q_OS_UNIX || Q_OS_WINRT
|
||||
|
||||
#ifdef _DEBUG
|
||||
cForceWorkingDir(cExeDir());
|
||||
@ -385,7 +385,7 @@ void start(not_null<Core::Launcher*> launcher) {
|
||||
workingDirChosen = true;
|
||||
}
|
||||
|
||||
#endif // Q_OS_MAC || Q_OS_LINUX || Q_OS_WINRT || OS_WIN_STORE
|
||||
#endif // Q_OS_UNIX || Q_OS_WINRT || OS_WIN_STORE
|
||||
|
||||
}
|
||||
|
||||
@ -561,7 +561,7 @@ void writeDebug(const char *file, int32 line, const QString &v) {
|
||||
//OutputDebugString(reinterpret_cast<const wchar_t *>(msg.utf16()));
|
||||
#elif defined Q_OS_MAC
|
||||
//objc_outputDebugString(msg);
|
||||
#elif defined Q_OS_LINUX && defined _DEBUG
|
||||
#elif defined Q_OS_UNIX && defined _DEBUG
|
||||
//std::cout << msg.toUtf8().constData();
|
||||
#endif
|
||||
}
|
||||
|
@ -353,11 +353,11 @@ OverlayWidget::OverlayWidget()
|
||||
}
|
||||
}, lifetime());
|
||||
|
||||
#ifdef Q_OS_LINUX
|
||||
#if defined Q_OS_UNIX && !defined Q_OS_MAC
|
||||
setWindowFlags(Qt::FramelessWindowHint | Qt::MaximizeUsingFullscreenGeometryHint);
|
||||
#else // Q_OS_LINUX
|
||||
#else // Q_OS_UNIX && !Q_OS_MAC
|
||||
setWindowFlags(Qt::FramelessWindowHint);
|
||||
#endif // Q_OS_LINUX
|
||||
#endif // Q_OS_UNIX && !Q_OS_MAC
|
||||
moveToScreen();
|
||||
setAttribute(Qt::WA_NoSystemBackground, true);
|
||||
setAttribute(Qt::WA_TranslucentBackground, true);
|
||||
@ -2141,11 +2141,11 @@ void OverlayWidget::displayFinished() {
|
||||
updateControls();
|
||||
if (isHidden()) {
|
||||
Ui::Platform::UpdateOverlayed(this);
|
||||
#ifdef Q_OS_LINUX
|
||||
#if defined Q_OS_UNIX && !defined Q_OS_MAC
|
||||
showFullScreen();
|
||||
#else // Q_OS_LINUX
|
||||
#else // Q_OS_UNIX && !Q_OS_MAC
|
||||
show();
|
||||
#endif // Q_OS_LINUX
|
||||
#endif // Q_OS_UNIX && !Q_OS_MAC
|
||||
Ui::Platform::ShowOverAll(this);
|
||||
activateWindow();
|
||||
QApplication::setActiveWindow(this);
|
||||
|
@ -19,7 +19,9 @@ void DeInit();
|
||||
|
||||
// Platform dependent implementations.
|
||||
|
||||
#if defined Q_OS_MAC || defined Q_OS_LINUX
|
||||
#if defined Q_OS_WINRT || defined Q_OS_WIN
|
||||
#include "platform/win/audio_win.h"
|
||||
#else // Q_OS_WINRT || Q_OS_WIN
|
||||
namespace Platform {
|
||||
namespace Audio {
|
||||
|
||||
@ -31,6 +33,4 @@ inline void DeInit() {
|
||||
|
||||
} // namespace Audio
|
||||
} // namespace Platform
|
||||
#elif defined Q_OS_WINRT || defined Q_OS_WIN // Q_OS_MAC || Q_OS_LINUX
|
||||
#include "platform/win/audio_win.h"
|
||||
#endif // Q_OS_MAC || Q_OS_LINUX || Q_OS_WINRT || Q_OS_WIN
|
||||
#endif // Q_OS_WINRT || Q_OS_WIN
|
||||
|
@ -46,8 +46,8 @@ bool Get(
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
#include "platform/mac/file_utilities_mac.h"
|
||||
#elif defined Q_OS_LINUX // Q_OS_MAC
|
||||
#elif defined Q_OS_UNIX // Q_OS_MAC
|
||||
#include "platform/linux/file_utilities_linux.h"
|
||||
#elif defined Q_OS_WINRT || defined Q_OS_WIN // Q_OS_MAC || Q_OS_LINUX
|
||||
#elif defined Q_OS_WINRT || defined Q_OS_WIN // Q_OS_MAC || Q_OS_UNIX
|
||||
#include "platform/win/file_utilities_win.h"
|
||||
#endif // Q_OS_MAC || Q_OS_LINUX || Q_OS_WINRT || Q_OS_WIN
|
||||
#endif // Q_OS_MAC || Q_OS_UNIX || Q_OS_WINRT || Q_OS_WIN
|
||||
|
@ -23,8 +23,8 @@ namespace Platform {
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
#include "platform/mac/launcher_mac.h"
|
||||
#elif defined Q_OS_LINUX // Q_OS_MAC
|
||||
#elif defined Q_OS_UNIX // Q_OS_MAC
|
||||
#include "platform/linux/launcher_linux.h"
|
||||
#elif defined Q_OS_WINRT || defined Q_OS_WIN // Q_OS_MAC || Q_OS_LINUX
|
||||
#elif defined Q_OS_WINRT || defined Q_OS_WIN // Q_OS_MAC || Q_OS_UNIX
|
||||
#include "platform/win/launcher_win.h"
|
||||
#endif // Q_OS_MAC || Q_OS_LINUX || Q_OS_WINRT || Q_OS_WIN
|
||||
#endif // Q_OS_MAC || Q_OS_UNIX || Q_OS_WINRT || Q_OS_WIN
|
||||
|
@ -19,8 +19,8 @@ class MainWindow;
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
#include "platform/mac/main_window_mac.h"
|
||||
#elif defined Q_OS_LINUX // Q_OS_MAC
|
||||
#elif defined Q_OS_UNIX // Q_OS_MAC
|
||||
#include "platform/linux/main_window_linux.h"
|
||||
#elif defined Q_OS_WIN // Q_OS_MAC || Q_OS_LINUX
|
||||
#elif defined Q_OS_WIN // Q_OS_MAC || Q_OS_UNIX
|
||||
#include "platform/win/main_window_win.h"
|
||||
#endif // Q_OS_MAC || Q_OS_LINUX || Q_OS_WIN
|
||||
#endif // Q_OS_MAC || Q_OS_UNIX || Q_OS_WIN
|
||||
|
@ -27,8 +27,8 @@ namespace Notifications {
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
#include "platform/mac/notifications_manager_mac.h"
|
||||
#elif defined Q_OS_LINUX // Q_OS_MAC
|
||||
#elif defined Q_OS_UNIX // Q_OS_MAC
|
||||
#include "platform/linux/notifications_manager_linux.h"
|
||||
#elif defined Q_OS_WIN // Q_OS_MAC || Q_OS_LINUX
|
||||
#elif defined Q_OS_WIN // Q_OS_MAC || Q_OS_UNIX
|
||||
#include "platform/win/notifications_manager_win.h"
|
||||
#endif // Q_OS_MAC || Q_OS_LINUX || Q_OS_WIN
|
||||
#endif // Q_OS_MAC || Q_OS_UNIX || Q_OS_WIN
|
||||
|
@ -52,8 +52,8 @@ void finish();
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
#include "platform/mac/specific_mac.h"
|
||||
#elif defined Q_OS_LINUX // Q_OS_MAC
|
||||
#elif defined Q_OS_UNIX // Q_OS_MAC
|
||||
#include "platform/linux/specific_linux.h"
|
||||
#elif defined Q_OS_WIN // Q_OS_MAC || Q_OS_LINUX
|
||||
#elif defined Q_OS_WIN // Q_OS_MAC || Q_OS_UNIX
|
||||
#include "platform/win/specific_win.h"
|
||||
#endif // Q_OS_MAC || Q_OS_LINUX || Q_OS_WIN
|
||||
#endif // Q_OS_MAC || Q_OS_UNIX || Q_OS_WIN
|
||||
|
@ -26,7 +26,7 @@ void PreviewWindowFramePaint(QImage &preview, const style::palette &palette, QRe
|
||||
#include "platform/mac/window_title_mac.h"
|
||||
#elif defined Q_OS_WIN // Q_OS_MAC
|
||||
#include "platform/win/window_title_win.h"
|
||||
#elif defined Q_OS_WINRT || defined Q_OS_LINUX // Q_OS_MAC || Q_OS_WIN
|
||||
#elif defined Q_OS_WINRT || defined Q_OS_UNIX // Q_OS_MAC || Q_OS_WIN
|
||||
|
||||
namespace Platform {
|
||||
|
||||
@ -44,4 +44,4 @@ inline void PreviewWindowFramePaint(QImage &preview, const style::palette &palet
|
||||
|
||||
} // namespace Platform
|
||||
|
||||
#endif // Q_OS_MAC || Q_OS_WIN || Q_OS_WINRT || Q_OS_LINUX
|
||||
#endif // Q_OS_MAC || Q_OS_WIN || Q_OS_WINRT || Q_OS_UNIX
|
||||
|
@ -20,7 +20,7 @@ Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)
|
||||
#elif defined Q_OS_MAC // Q_OS_WIN
|
||||
Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin)
|
||||
Q_IMPORT_PLUGIN(QGenericEnginePlugin)
|
||||
#elif defined Q_OS_LINUX // Q_OS_WIN | Q_OS_MAC
|
||||
#elif defined Q_OS_UNIX // Q_OS_WIN | Q_OS_MAC
|
||||
Q_IMPORT_PLUGIN(ShmServerBufferPlugin)
|
||||
Q_IMPORT_PLUGIN(DmaBufServerBufferPlugin)
|
||||
Q_IMPORT_PLUGIN(DrmEglServerBufferPlugin)
|
||||
@ -44,10 +44,10 @@ Q_IMPORT_PLUGIN(QNetworkManagerEnginePlugin)
|
||||
Q_IMPORT_PLUGIN(QIbusPlatformInputContextPlugin)
|
||||
Q_IMPORT_PLUGIN(QXdgDesktopPortalThemePlugin)
|
||||
#endif // !TDESKTOP_DISABLE_DBUS_INTEGRATION
|
||||
#endif // Q_OS_WIN | Q_OS_MAC | Q_OS_LINUX
|
||||
#endif // Q_OS_WIN | Q_OS_MAC | Q_OS_UNIX
|
||||
#endif // !DESKTOP_APP_USE_PACKAGED
|
||||
|
||||
#ifdef Q_OS_LINUX
|
||||
#if defined Q_OS_UNIX && !defined Q_OS_MAC
|
||||
#if !defined DESKTOP_APP_USE_PACKAGED || defined DESKTOP_APP_USE_PACKAGED_LAZY
|
||||
Q_IMPORT_PLUGIN(QWaylandMaterialDecorationPlugin)
|
||||
Q_IMPORT_PLUGIN(NimfInputContextPlugin)
|
||||
@ -69,4 +69,4 @@ Q_IMPORT_PLUGIN(Qt5CTStylePlugin)
|
||||
Q_IMPORT_PLUGIN(LXQtPlatformThemePlugin)
|
||||
#endif // !TDESKTOP_DISABLE_DBUS_INTEGRATION
|
||||
#endif // DESKTOP_APP_USE_PACKAGED_LAZY_PLATFORMTHEMES
|
||||
#endif // Q_OS_LINUX
|
||||
#endif // Q_OS_UNIX && !Q_OS_MAC
|
||||
|
@ -499,11 +499,11 @@ void NotificationsCount::SampleWidget::destroyDelayed() {
|
||||
_deleted = true;
|
||||
|
||||
// Ubuntu has a lag if deleteLater() called immediately.
|
||||
#if defined Q_OS_LINUX32 || defined Q_OS_LINUX64
|
||||
#if defined Q_OS_UNIX && !defined Q_OS_MAC
|
||||
QTimer::singleShot(1000, [this] { delete this; });
|
||||
#else // Q_OS_LINUX32 || Q_OS_LINUX64
|
||||
#else // Q_OS_UNIX && !Q_OS_MAC
|
||||
deleteLater();
|
||||
#endif // Q_OS_LINUX32 || Q_OS_LINUX64
|
||||
#endif // Q_OS_UNIX && !Q_OS_MAC
|
||||
}
|
||||
|
||||
void SetupAdvancedNotifications(
|
||||
|
@ -79,9 +79,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#endif // OS_MAC_OLD
|
||||
|
||||
// Fix Google Breakpad build for Mac App Store and Linux version
|
||||
#if defined Q_OS_MAC || defined Q_OS_LINUX
|
||||
#ifdef Q_OS_UNIX
|
||||
#define __STDC_FORMAT_MACROS
|
||||
#endif // Q_OS_MAC || Q_OS_LINUX
|
||||
#endif // Q_OS_UNIX
|
||||
|
||||
#include <array>
|
||||
#include <vector>
|
||||
|
@ -117,7 +117,7 @@ QIcon CreateOfficialIcon(Main::Account *account) {
|
||||
|
||||
QIcon CreateIcon(Main::Account *account) {
|
||||
auto result = CreateOfficialIcon(account);
|
||||
#ifdef Q_OS_LINUX
|
||||
#if defined Q_OS_UNIX && !defined Q_OS_MAC
|
||||
return QIcon::fromTheme(Platform::GetIconName(), result);
|
||||
#endif
|
||||
return result;
|
||||
@ -603,7 +603,7 @@ bool MainWindow::minimizeToTray() {
|
||||
}
|
||||
|
||||
void MainWindow::reActivateWindow() {
|
||||
#if defined Q_OS_LINUX32 || defined Q_OS_LINUX64
|
||||
#if defined Q_OS_UNIX && !defined Q_OS_MAC
|
||||
const auto reActivate = [=] {
|
||||
if (const auto w = App::wnd()) {
|
||||
if (auto f = QApplication::focusWidget()) {
|
||||
@ -618,7 +618,7 @@ void MainWindow::reActivateWindow() {
|
||||
};
|
||||
crl::on_main(this, reActivate);
|
||||
base::call_delayed(200, this, reActivate);
|
||||
#endif // Q_OS_LINUX32 || Q_OS_LINUX64
|
||||
#endif // Q_OS_UNIX && !Q_OS_MAC
|
||||
}
|
||||
|
||||
void MainWindow::showRightColumn(object_ptr<TWidget> widget) {
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 486003d41751c1c775513598c8a4154cd294a136
|
||||
Subproject commit 18868e1634d4f12727af93da1500108fc689981c
|
@ -1 +1 @@
|
||||
Subproject commit 48865e514979b4e2610fe6ca22bbb145bcfab4ea
|
||||
Subproject commit 1357837771a8b237c8a6ce90060f5a4f0fd5e339
|
@ -1 +1 @@
|
||||
Subproject commit 5d2cb6bda4d24887a336caacf835b9143319f4eb
|
||||
Subproject commit 538a72e5d3aedb660d3a399cc883067ada16e9cf
|
2
cmake
2
cmake
@ -1 +1 @@
|
||||
Subproject commit eb97b772a330ee370ea37c753a54c6862ca96644
|
||||
Subproject commit 03bde956c59b5344177f9ec9780058a9ba7304c8
|
Loading…
Reference in New Issue
Block a user