Open Source Snapmatic picture and Savegame viewer/editor for GTA V https://gta5view.syping.de/

StandardPaths.cpp 3.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. /*****************************************************************************
  2. * gta5view Grand Theft Auto V Profile Viewer
  3. * Copyright (C) 2016-2017 Syping
  4. *
  5. * This program is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. *****************************************************************************/
  18. #include "StandardPaths.h"
  19. #if QT_VERSION >= 0x050000
  20. #include <QStandardPaths>
  21. #else
  22. #include <QDesktopServices>
  23. #endif
  24. StandardPaths::StandardPaths()
  25. {
  26. }
  27. QString StandardPaths::applicationsLocation()
  28. {
  29. #if QT_VERSION >= 0x050000
  30. return QStandardPaths::writableLocation(QStandardPaths::ApplicationsLocation);
  31. #else
  32. return QDesktopServices::storageLocation(QDesktopServices::ApplicationsLocation);
  33. #endif
  34. }
  35. QString StandardPaths::cacheLocation()
  36. {
  37. #if QT_VERSION >= 0x050000
  38. return QStandardPaths::writableLocation(QStandardPaths::CacheLocation);
  39. #else
  40. return QDesktopServices::storageLocation(QDesktopServices::CacheLocation);
  41. #endif
  42. }
  43. QString StandardPaths::dataLocation()
  44. {
  45. #if QT_VERSION >= 0x050000
  46. return QStandardPaths::writableLocation(QStandardPaths::DataLocation);
  47. #else
  48. return QDesktopServices::storageLocation(QDesktopServices::DataLocation);
  49. #endif
  50. }
  51. QString StandardPaths::desktopLocation()
  52. {
  53. #if QT_VERSION >= 0x050000
  54. return QStandardPaths::writableLocation(QStandardPaths::DesktopLocation);
  55. #else
  56. return QDesktopServices::storageLocation(QDesktopServices::DesktopLocation);
  57. #endif
  58. }
  59. QString StandardPaths::documentsLocation()
  60. {
  61. #if QT_VERSION >= 0x050000
  62. return QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation);
  63. #else
  64. return QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation);
  65. #endif
  66. }
  67. QString StandardPaths::moviesLocation()
  68. {
  69. #if QT_VERSION >= 0x050000
  70. return QStandardPaths::writableLocation(QStandardPaths::MoviesLocation);
  71. #else
  72. return QDesktopServices::storageLocation(QDesktopServices::MoviesLocation);
  73. #endif
  74. }
  75. QString StandardPaths::picturesLocation()
  76. {
  77. #if QT_VERSION >= 0x050000
  78. return QStandardPaths::writableLocation(QStandardPaths::PicturesLocation);
  79. #else
  80. return QDesktopServices::storageLocation(QDesktopServices::PicturesLocation);
  81. #endif
  82. }
  83. QString StandardPaths::fontsLocation()
  84. {
  85. #if QT_VERSION >= 0x050000
  86. return QStandardPaths::writableLocation(QStandardPaths::FontsLocation);
  87. #else
  88. return QDesktopServices::storageLocation(QDesktopServices::FontsLocation);
  89. #endif
  90. }
  91. QString StandardPaths::homeLocation()
  92. {
  93. #if QT_VERSION >= 0x050000
  94. return QStandardPaths::writableLocation(QStandardPaths::HomeLocation);
  95. #else
  96. return QDesktopServices::storageLocation(QDesktopServices::HomeLocation);
  97. #endif
  98. }
  99. QString StandardPaths::musicLocation()
  100. {
  101. #if QT_VERSION >= 0x050000
  102. return QStandardPaths::writableLocation(QStandardPaths::MusicLocation);
  103. #else
  104. return QDesktopServices::storageLocation(QDesktopServices::MusicLocation);
  105. #endif
  106. }
  107. QString StandardPaths::tempLocation()
  108. {
  109. #if QT_VERSION >= 0x050000
  110. return QStandardPaths::writableLocation(QStandardPaths::TempLocation);
  111. #else
  112. return QDesktopServices::storageLocation(QDesktopServices::TempLocation);
  113. #endif
  114. }