file_utilities_linux.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. This file is part of Telegram Desktop,
  3. the official desktop application for the Telegram messaging service.
  4. For license and copyright information please follow this link:
  5. https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
  6. */
  7. #pragma once
  8. #include "platform/platform_file_utilities.h"
  9. namespace Platform {
  10. namespace File {
  11. inline QString UrlToLocal(const QUrl &url) {
  12. return ::File::internal::UrlToLocalDefault(url);
  13. }
  14. inline void UnsafeOpenUrl(const QString &url) {
  15. return ::File::internal::UnsafeOpenUrlDefault(url);
  16. }
  17. inline void UnsafeOpenEmailLink(const QString &email) {
  18. return ::File::internal::UnsafeOpenEmailLinkDefault(email);
  19. }
  20. inline bool UnsafeShowOpenWithDropdown(const QString &filepath) {
  21. return false;
  22. }
  23. inline void UnsafeLaunch(const QString &filepath) {
  24. return ::File::internal::UnsafeLaunchDefault(filepath);
  25. }
  26. inline void PostprocessDownloaded(const QString &filepath) {
  27. }
  28. } // namespace File
  29. namespace FileDialog {
  30. inline void InitLastPath() {
  31. ::FileDialog::internal::InitLastPathDefault();
  32. }
  33. inline bool Get(
  34. QPointer<QWidget> parent,
  35. QStringList &files,
  36. QByteArray &remoteContent,
  37. const QString &caption,
  38. const QString &filter,
  39. ::FileDialog::internal::Type type,
  40. QString startFile) {
  41. return ::FileDialog::internal::GetDefault(
  42. parent,
  43. files,
  44. remoteContent,
  45. caption,
  46. filter,
  47. type,
  48. startFile);
  49. }
  50. } // namespace FileDialog
  51. } // namespace Platform