mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 14:38:15 +00:00
Use KUrlMimeData for clipboard xdg-desktop-portal integration
This commit is contained in:
@@ -17,10 +17,15 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include <crl/crl_time.h>
|
||||
#include <QtCore/QReadWriteLock>
|
||||
#include <QtCore/QRegularExpression>
|
||||
#include <QtCore/QMimeData>
|
||||
#include <QtNetwork/QNetworkProxy>
|
||||
#include <cmath>
|
||||
#include <set>
|
||||
|
||||
#if __has_include(<KUrlMimeData>)
|
||||
#include <KUrlMimeData>
|
||||
#endif
|
||||
|
||||
#define qsl(s) QStringLiteral(s)
|
||||
|
||||
namespace base {
|
||||
@@ -30,6 +35,16 @@ inline bool in_range(Value &&value, From &&from, Till &&till) {
|
||||
return (value >= from) && (value < till);
|
||||
}
|
||||
|
||||
inline auto GetMimeUrls(const QMimeData *data) {
|
||||
#if __has_include(<KUrlMimeData>)
|
||||
return KUrlMimeData::urlsFromMimeData(
|
||||
data,
|
||||
KUrlMimeData::PreferLocalUrls);
|
||||
#else
|
||||
return data->urls();
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace base
|
||||
|
||||
static const int32 ScrollMax = INT_MAX;
|
||||
|
Reference in New Issue
Block a user