diff --git a/Telegram/SourceFiles/_other/packer.cpp b/Telegram/SourceFiles/_other/packer.cpp index 40e672f7c..69e73fcbd 100644 --- a/Telegram/SourceFiles/_other/packer.cpp +++ b/Telegram/SourceFiles/_other/packer.cpp @@ -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 diff --git a/Telegram/SourceFiles/core/application.cpp b/Telegram/SourceFiles/core/application.cpp index f1730efc3..fb79b7325 100644 --- a/Telegram/SourceFiles/core/application.cpp +++ b/Telegram/SourceFiles/core/application.cpp @@ -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; } diff --git a/Telegram/SourceFiles/core/crash_reports.cpp b/Telegram/SourceFiles/core/crash_reports.cpp index b88c62edd..e95f3cb71 100644 --- a/Telegram/SourceFiles/core/crash_reports.cpp +++ b/Telegram/SourceFiles/core/crash_reports.cpp @@ -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 #include @@ -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 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 launcher) { true, -1 ); -#endif // Q_OS_LINUX64 || Q_OS_LINUX32 +#endif // Q_OS_UNIX #endif // !DESKTOP_APP_DISABLE_CRASH_REPORTS } diff --git a/Telegram/SourceFiles/core/launcher.cpp b/Telegram/SourceFiles/core/launcher.cpp index 99e22169b..b15a25c40 100644 --- a/Telegram/SourceFiles/core/launcher.cpp +++ b/Telegram/SourceFiles/core/launcher.cpp @@ -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 diff --git a/Telegram/SourceFiles/core/update_checker.cpp b/Telegram/SourceFiles/core/update_checker.cpp index 588bf0573..644cb9e4f 100644 --- a/Telegram/SourceFiles/core/update_checker.cpp +++ b/Telegram/SourceFiles/core/update_checker.cpp @@ -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()); diff --git a/Telegram/SourceFiles/data/data_document.cpp b/Telegram/SourceFiles/data/data_document.cpp index ff09a5a08..76d270c19 100644 --- a/Telegram/SourceFiles/data/data_document.cpp +++ b/Telegram/SourceFiles/data/data_document.cpp @@ -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(list.begin(), list.end()); }(); diff --git a/Telegram/SourceFiles/history/admin_log/history_admin_log_inner.cpp b/Telegram/SourceFiles/history/admin_log/history_admin_log_inner.cpp index c71150adb..99cc4458a 100644 --- a/Telegram/SourceFiles/history/admin_log/history_admin_log_inner.cpp +++ b/Telegram/SourceFiles/history/admin_log/history_admin_log_inner.cpp @@ -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() { diff --git a/Telegram/SourceFiles/history/history_inner_widget.cpp b/Telegram/SourceFiles/history/history_inner_widget.cpp index 6db197773..d220157a4 100644 --- a/Telegram/SourceFiles/history/history_inner_widget.cpp +++ b/Telegram/SourceFiles/history/history_inner_widget.cpp @@ -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) { diff --git a/Telegram/SourceFiles/history/view/history_view_list_widget.cpp b/Telegram/SourceFiles/history/view/history_view_list_widget.cpp index 2aec84380..8a36d9fc7 100644 --- a/Telegram/SourceFiles/history/view/history_view_list_widget.cpp +++ b/Telegram/SourceFiles/history/view/history_view_list_widget.cpp @@ -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() { diff --git a/Telegram/SourceFiles/info/media/info_media_list_widget.cpp b/Telegram/SourceFiles/info/media/info_media_list_widget.cpp index 3202b95ec..b39d4c15d 100644 --- a/Telegram/SourceFiles/info/media/info_media_list_widget.cpp +++ b/Telegram/SourceFiles/info/media/info_media_list_widget.cpp @@ -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() { diff --git a/Telegram/SourceFiles/logs.cpp b/Telegram/SourceFiles/logs.cpp index f7479b725..cfbc69a84 100644 --- a/Telegram/SourceFiles/logs.cpp +++ b/Telegram/SourceFiles/logs.cpp @@ -343,7 +343,7 @@ void start(not_null 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 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 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(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 } diff --git a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp index eb86dbd0f..e6ecdb20b 100644 --- a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp +++ b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp @@ -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); diff --git a/Telegram/SourceFiles/platform/platform_audio.h b/Telegram/SourceFiles/platform/platform_audio.h index 7705b2ef7..6ec8ec6dd 100644 --- a/Telegram/SourceFiles/platform/platform_audio.h +++ b/Telegram/SourceFiles/platform/platform_audio.h @@ -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 diff --git a/Telegram/SourceFiles/platform/platform_file_utilities.h b/Telegram/SourceFiles/platform/platform_file_utilities.h index b78adf552..cd70b78a6 100644 --- a/Telegram/SourceFiles/platform/platform_file_utilities.h +++ b/Telegram/SourceFiles/platform/platform_file_utilities.h @@ -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 diff --git a/Telegram/SourceFiles/platform/platform_launcher.h b/Telegram/SourceFiles/platform/platform_launcher.h index 27180d00b..d79aea65c 100644 --- a/Telegram/SourceFiles/platform/platform_launcher.h +++ b/Telegram/SourceFiles/platform/platform_launcher.h @@ -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 diff --git a/Telegram/SourceFiles/platform/platform_main_window.h b/Telegram/SourceFiles/platform/platform_main_window.h index 33277c901..4bdb93981 100644 --- a/Telegram/SourceFiles/platform/platform_main_window.h +++ b/Telegram/SourceFiles/platform/platform_main_window.h @@ -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 diff --git a/Telegram/SourceFiles/platform/platform_notifications_manager.h b/Telegram/SourceFiles/platform/platform_notifications_manager.h index f0cdb152e..4afeadf97 100644 --- a/Telegram/SourceFiles/platform/platform_notifications_manager.h +++ b/Telegram/SourceFiles/platform/platform_notifications_manager.h @@ -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 diff --git a/Telegram/SourceFiles/platform/platform_specific.h b/Telegram/SourceFiles/platform/platform_specific.h index db963f599..06689ea05 100644 --- a/Telegram/SourceFiles/platform/platform_specific.h +++ b/Telegram/SourceFiles/platform/platform_specific.h @@ -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 diff --git a/Telegram/SourceFiles/platform/platform_window_title.h b/Telegram/SourceFiles/platform/platform_window_title.h index 6aea66396..d8d57cbb3 100644 --- a/Telegram/SourceFiles/platform/platform_window_title.h +++ b/Telegram/SourceFiles/platform/platform_window_title.h @@ -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 diff --git a/Telegram/SourceFiles/qt_static_plugins.cpp b/Telegram/SourceFiles/qt_static_plugins.cpp index 4174957d3..82a4cdb6b 100644 --- a/Telegram/SourceFiles/qt_static_plugins.cpp +++ b/Telegram/SourceFiles/qt_static_plugins.cpp @@ -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 diff --git a/Telegram/SourceFiles/settings/settings_notifications.cpp b/Telegram/SourceFiles/settings/settings_notifications.cpp index 7cc4e4fc6..3c0e7f42b 100644 --- a/Telegram/SourceFiles/settings/settings_notifications.cpp +++ b/Telegram/SourceFiles/settings/settings_notifications.cpp @@ -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( diff --git a/Telegram/SourceFiles/stdafx.h b/Telegram/SourceFiles/stdafx.h index 5e5d6ead2..c92c010c2 100644 --- a/Telegram/SourceFiles/stdafx.h +++ b/Telegram/SourceFiles/stdafx.h @@ -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 #include diff --git a/Telegram/SourceFiles/window/main_window.cpp b/Telegram/SourceFiles/window/main_window.cpp index 88ffe6e48..d90294d3a 100644 --- a/Telegram/SourceFiles/window/main_window.cpp +++ b/Telegram/SourceFiles/window/main_window.cpp @@ -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 widget) { diff --git a/Telegram/lib_base b/Telegram/lib_base index 486003d41..18868e163 160000 --- a/Telegram/lib_base +++ b/Telegram/lib_base @@ -1 +1 @@ -Subproject commit 486003d41751c1c775513598c8a4154cd294a136 +Subproject commit 18868e1634d4f12727af93da1500108fc689981c diff --git a/Telegram/lib_spellcheck b/Telegram/lib_spellcheck index 48865e514..135783777 160000 --- a/Telegram/lib_spellcheck +++ b/Telegram/lib_spellcheck @@ -1 +1 @@ -Subproject commit 48865e514979b4e2610fe6ca22bbb145bcfab4ea +Subproject commit 1357837771a8b237c8a6ce90060f5a4f0fd5e339 diff --git a/Telegram/lib_storage b/Telegram/lib_storage index 5d2cb6bda..538a72e5d 160000 --- a/Telegram/lib_storage +++ b/Telegram/lib_storage @@ -1 +1 @@ -Subproject commit 5d2cb6bda4d24887a336caacf835b9143319f4eb +Subproject commit 538a72e5d3aedb660d3a399cc883067ada16e9cf diff --git a/cmake b/cmake index eb97b772a..03bde956c 160000 --- a/cmake +++ b/cmake @@ -1 +1 @@ -Subproject commit eb97b772a330ee370ea37c753a54c6862ca96644 +Subproject commit 03bde956c59b5344177f9ec9780058a9ba7304c8