mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 22:54:01 +02:00
Get rid of unneeded QT_VERSION_CHECK in linux platform code
This commit is contained in:
parent
15d18077b8
commit
6932d859c9
4 changed files with 2 additions and 20 deletions
|
@ -49,10 +49,7 @@ Launcher::Launcher(int argc, char *argv[])
|
|||
}
|
||||
|
||||
void Launcher::initHook() {
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
|
||||
QApplication::setAttribute(Qt::AA_DisableSessionManager, true);
|
||||
#endif // Qt >= 5.14
|
||||
|
||||
QApplication::setDesktopFileName(GetLauncherFilename());
|
||||
}
|
||||
|
||||
|
|
|
@ -590,11 +590,7 @@ void NotificationData::setImage(const QString &imagePath) {
|
|||
g_variant_new_from_data(
|
||||
G_VARIANT_TYPE("ay"),
|
||||
_image.constBits(),
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0)
|
||||
_image.byteCount(),
|
||||
#else // Qt < 5.10.0
|
||||
_image.sizeInBytes(),
|
||||
#endif // Qt >= 5.10.0
|
||||
true,
|
||||
nullptr,
|
||||
nullptr)));
|
||||
|
|
|
@ -36,17 +36,11 @@ void PreviewWindowFramePaint(QImage &preview, const style::palette &palette, QRe
|
|||
namespace Platform {
|
||||
|
||||
inline bool AllowNativeWindowFrameToggle() {
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) || defined DESKTOP_APP_QT_PATCHED
|
||||
return true;
|
||||
#else // Qt >= 5.15 || DESKTOP_APP_QT_PATCHED
|
||||
return false;
|
||||
#endif // Qt >= 5.15 || DESKTOP_APP_QT_PATCHED
|
||||
}
|
||||
|
||||
inline object_ptr<Window::TitleWidget> CreateTitleWidget(QWidget *parent) {
|
||||
return AllowNativeWindowFrameToggle()
|
||||
? object_ptr<Window::TitleWidgetQt>(parent)
|
||||
: object_ptr<Window::TitleWidgetQt>{ nullptr };
|
||||
return object_ptr<Window::TitleWidgetQt>(parent);
|
||||
}
|
||||
|
||||
inline bool NativeTitleRequiresShadow() {
|
||||
|
|
|
@ -333,12 +333,7 @@ IconPixmapList StatusNotifierItem::iconToPixmapList(const QIcon& icon)
|
|||
if (image.format() != QImage::Format_ARGB32)
|
||||
image = image.convertToFormat(QImage::Format_ARGB32);
|
||||
|
||||
pix.bytes = QByteArray((char *) image.bits(),
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0)
|
||||
image.byteCount());
|
||||
#else
|
||||
image.sizeInBytes());
|
||||
#endif
|
||||
pix.bytes = QByteArray((char *) image.bits(), image.sizeInBytes());
|
||||
|
||||
// swap to network byte order if we are little endian
|
||||
if (QSysInfo::ByteOrder == QSysInfo::LittleEndian)
|
||||
|
|
Loading…
Add table
Reference in a new issue