/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
- /***************************************************************************
- * Copyright (C) 2007 by Thomas Keller *
- * me@thomaskeller.biz *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation, either version 3 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program. If not, see <http://www.gnu.org/licenses/>. *
- ***************************************************************************/
- #ifndef PLATFORM_H
- #define PLATFORM_H
- #include <QString>
- #include <QDir>
- class Platform
- {
- public:
- /**
- * Opens a file or URL with the default registered handler
- * The URL is assumed to be valid. No security checks are performed.
- */
- static void openFile(const QString & filename, bool isSymlink = false);
- /**
- * Returns the name of the currently logged in user of the system
- */
- static QString getUsername();
- /**
- * Safely tries to create the directory path from the argument and if
- * the path already exists, ensures that its valid and writable
- */
- static QDir safeMakePath(const QString & path);
- /**
- * Executes rm -rf on the path
- */
- static void removeRecursively(const QString & path);
- };
- #endif