mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-07 15:43:55 +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() {
|
void Launcher::initHook() {
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
|
|
||||||
QApplication::setAttribute(Qt::AA_DisableSessionManager, true);
|
QApplication::setAttribute(Qt::AA_DisableSessionManager, true);
|
||||||
#endif // Qt >= 5.14
|
|
||||||
|
|
||||||
QApplication::setDesktopFileName(GetLauncherFilename());
|
QApplication::setDesktopFileName(GetLauncherFilename());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -590,11 +590,7 @@ void NotificationData::setImage(const QString &imagePath) {
|
||||||
g_variant_new_from_data(
|
g_variant_new_from_data(
|
||||||
G_VARIANT_TYPE("ay"),
|
G_VARIANT_TYPE("ay"),
|
||||||
_image.constBits(),
|
_image.constBits(),
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0)
|
|
||||||
_image.byteCount(),
|
|
||||||
#else // Qt < 5.10.0
|
|
||||||
_image.sizeInBytes(),
|
_image.sizeInBytes(),
|
||||||
#endif // Qt >= 5.10.0
|
|
||||||
true,
|
true,
|
||||||
nullptr,
|
nullptr,
|
||||||
nullptr)));
|
nullptr)));
|
||||||
|
|
|
@ -36,17 +36,11 @@ void PreviewWindowFramePaint(QImage &preview, const style::palette &palette, QRe
|
||||||
namespace Platform {
|
namespace Platform {
|
||||||
|
|
||||||
inline bool AllowNativeWindowFrameToggle() {
|
inline bool AllowNativeWindowFrameToggle() {
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) || defined DESKTOP_APP_QT_PATCHED
|
|
||||||
return true;
|
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) {
|
inline object_ptr<Window::TitleWidget> CreateTitleWidget(QWidget *parent) {
|
||||||
return AllowNativeWindowFrameToggle()
|
return object_ptr<Window::TitleWidgetQt>(parent);
|
||||||
? object_ptr<Window::TitleWidgetQt>(parent)
|
|
||||||
: object_ptr<Window::TitleWidgetQt>{ nullptr };
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool NativeTitleRequiresShadow() {
|
inline bool NativeTitleRequiresShadow() {
|
||||||
|
|
|
@ -333,12 +333,7 @@ IconPixmapList StatusNotifierItem::iconToPixmapList(const QIcon& icon)
|
||||||
if (image.format() != QImage::Format_ARGB32)
|
if (image.format() != QImage::Format_ARGB32)
|
||||||
image = image.convertToFormat(QImage::Format_ARGB32);
|
image = image.convertToFormat(QImage::Format_ARGB32);
|
||||||
|
|
||||||
pix.bytes = QByteArray((char *) image.bits(),
|
pix.bytes = QByteArray((char *) image.bits(), image.sizeInBytes());
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0)
|
|
||||||
image.byteCount());
|
|
||||||
#else
|
|
||||||
image.sizeInBytes());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// swap to network byte order if we are little endian
|
// swap to network byte order if we are little endian
|
||||||
if (QSysInfo::ByteOrder == QSysInfo::LittleEndian)
|
if (QSysInfo::ByteOrder == QSysInfo::LittleEndian)
|
||||||
|
|
Loading…
Add table
Reference in a new issue