2015-02-25 17:19:33 +00:00
|
|
|
/*
|
2024-09-17 19:00:25 +00:00
|
|
|
* Deskflow -- mouse and keyboard sharing utility
|
2024-10-29 20:52:34 +00:00
|
|
|
* Copyright (C) 2024 Chris Rizzitello <sithlord48@gmail.com>
|
2024-07-26 22:53:52 +00:00
|
|
|
* Copyright (C) 2015 Symless Ltd.
|
2015-02-25 17:19:33 +00:00
|
|
|
*
|
|
|
|
|
* This package is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU General Public License
|
2015-05-03 02:33:52 +00:00
|
|
|
* found in the file LICENSE that should have accompanied this file.
|
2015-02-25 17:19:33 +00:00
|
|
|
*
|
|
|
|
|
* This package 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/>.
|
|
|
|
|
*/
|
|
|
|
|
|
2024-08-07 14:05:18 +00:00
|
|
|
#include "gui/core/CoreTool.h"
|
2015-02-25 17:19:33 +00:00
|
|
|
|
2024-10-29 20:52:34 +00:00
|
|
|
#if defined(Q_OS_UNIX)
|
|
|
|
|
#include "arch/unix/ArchFileUnix.h"
|
|
|
|
|
#include "arch/unix/ArchSystemUnix.h"
|
|
|
|
|
#elif defined(Q_OS_WIN)
|
|
|
|
|
#include "arch/win32/ArchFileWindows.h"
|
|
|
|
|
#include "arch/win32/ArchSystemWindows.h"
|
|
|
|
|
#endif
|
2015-10-29 18:42:16 +00:00
|
|
|
|
2024-07-02 19:07:06 +00:00
|
|
|
#include <QDir>
|
2016-10-13 13:49:53 +00:00
|
|
|
|
2024-10-17 18:04:35 +00:00
|
|
|
QString CoreTool::getProfileDir() const
|
|
|
|
|
{
|
2024-10-29 20:52:34 +00:00
|
|
|
#if defined Q_OS_UNIX
|
|
|
|
|
ArchFileUnix sysInfo;
|
|
|
|
|
#elif defined Q_OS_WIN
|
|
|
|
|
ArchFileWindows sysInfo;
|
|
|
|
|
#endif
|
|
|
|
|
return QDir::cleanPath(QString::fromUtf8(sysInfo.getProfileDirectory()));
|
2015-02-25 17:19:33 +00:00
|
|
|
}
|
|
|
|
|
|
2024-10-17 18:04:35 +00:00
|
|
|
QString CoreTool::getInstalledDir() const
|
|
|
|
|
{
|
2024-10-29 20:52:34 +00:00
|
|
|
#if defined Q_OS_UNIX
|
|
|
|
|
ArchFileUnix sysInfo;
|
|
|
|
|
#elif defined Q_OS_WIN
|
|
|
|
|
ArchFileWindows sysInfo;
|
|
|
|
|
#endif
|
|
|
|
|
return QDir::cleanPath(QString::fromUtf8(sysInfo.getInstalledDirectory()));
|
2015-06-01 23:43:57 +00:00
|
|
|
}
|
|
|
|
|
|
2024-10-17 18:04:35 +00:00
|
|
|
QString CoreTool::getArch() const
|
|
|
|
|
{
|
2024-10-29 20:52:34 +00:00
|
|
|
#if defined Q_OS_UNIX
|
|
|
|
|
ArchSystemUnix sysInfo;
|
|
|
|
|
#elif defined Q_OS_WIN
|
|
|
|
|
ArchSystemWindows sysInfo;
|
|
|
|
|
#endif
|
|
|
|
|
return QString::fromUtf8(sysInfo.getPlatformName());
|
2015-02-25 17:19:33 +00:00
|
|
|
}
|