You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

WBItem.cpp 584B

1234567891011121314151617181920
  1. #include "WBItem.h"
  2. #include <QFileInfo>
  3. #include <QDir>
  4. QString itemPath(QString item)
  5. {
  6. if (item.front() == '/')
  7. item.remove(0, 1);
  8. QString itemPath = "/usr/share/WineBottle/resources/" + item;
  9. QString itemLocalPath = "/usr/local/share/WineBottle/resources/" + item;
  10. QString itemHomePath = QDir::homePath() + ".local/share/WineBottle/resources/" + item;
  11. if (QFileInfo::exists(itemPath))
  12. return itemPath;
  13. else if (QFileInfo::exists(itemLocalPath))
  14. return itemLocalPath;
  15. else if (QFileInfo::exists(itemHomePath))
  16. return itemHomePath;
  17. return ":/resources/" + item;
  18. }