PageRenderTime 44ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/guitone-1.0rc5/src/util/Platform.h

#
C Header | 49 lines | 13 code | 5 blank | 31 comment | 0 complexity | 4daa05b99f70c85c60829e83f40c7978 MD5 | raw file
Possible License(s): GPL-3.0
  1. /***************************************************************************
  2. * Copyright (C) 2007 by Thomas Keller *
  3. * me@thomaskeller.biz *
  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. #ifndef PLATFORM_H
  19. #define PLATFORM_H
  20. #include <QString>
  21. #include <QDir>
  22. class Platform
  23. {
  24. public:
  25. /**
  26. * Opens a file or URL with the default registered handler
  27. * The URL is assumed to be valid. No security checks are performed.
  28. */
  29. static void openFile(const QString & filename, bool isSymlink = false);
  30. /**
  31. * Returns the name of the currently logged in user of the system
  32. */
  33. static QString getUsername();
  34. /**
  35. * Safely tries to create the directory path from the argument and if
  36. * the path already exists, ensures that its valid and writable
  37. */
  38. static QDir safeMakePath(const QString & path);
  39. /**
  40. * Executes rm -rf on the path
  41. */
  42. static void removeRecursively(const QString & path);
  43. };
  44. #endif