2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-10-01 11:22:20 +00:00

Merge remote-tracking branch 'tdesktop/dev' into dev

This commit is contained in:
RadRussianRus
2020-07-01 05:43:07 +03:00
502 changed files with 24144 additions and 18457 deletions

View File

@@ -519,11 +519,25 @@ QString GetIconName() {
return Result;
}
bool GtkClipboardSupported() {
return (Libs::gtk_clipboard_get != nullptr)
&& (Libs::gtk_clipboard_wait_for_contents != nullptr)
&& (Libs::gtk_clipboard_wait_for_image != nullptr)
&& (Libs::gtk_selection_data_targets_include_image != nullptr)
&& (Libs::gtk_selection_data_free != nullptr)
&& (Libs::gdk_pixbuf_get_pixels != nullptr)
&& (Libs::gdk_pixbuf_get_width != nullptr)
&& (Libs::gdk_pixbuf_get_height != nullptr)
&& (Libs::gdk_pixbuf_get_rowstride != nullptr)
&& (Libs::gdk_pixbuf_get_has_alpha != nullptr)
&& (Libs::gdk_atom_intern != nullptr);
}
QImage GetImageFromClipboard() {
QImage data;
#ifndef TDESKTOP_DISABLE_GTK_INTEGRATION
if (!App::wnd()->gtkClipboard()) {
if (!GtkClipboardSupported() || !App::wnd()->gtkClipboard()) {
return data;
}
@@ -545,7 +559,7 @@ QImage GetImageFromClipboard() {
? QImage::Format_RGBA8888
: QImage::Format_RGB888).copy();
Libs::g_object_unref(img);
g_object_unref(img);
}
}
@@ -879,9 +893,9 @@ bool OpenSystemSettings(SystemSettingsType type) {
add("pavucontrol-qt");
add("pavucontrol");
add("alsamixergui");
return ranges::find_if(options, [](const QString &command) {
return ranges::any_of(options, [](const QString &command) {
return QProcess::startDetached(command);
}) != end(options);
});
}
return true;
}