Created
January 31, 2021 17:28
-
-
Save minorsecond/5952c4723cb7b68335d6cdda9fabe8d7 to your computer and use it in GitHub Desktop.
QtTermTCP macOS Compat
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <QStandardPaths> | |
#include <sys/stat.h> | |
#include <sys/types.h> | |
QString GetConfPath() { | |
// Get configuration path for MacOS. | |
std::string directory = QStandardPaths::standardLocations(QStandardPaths::AppDataLocation).at(0).toStdString(); | |
std::string conf_path = directory + "/QtTermTCP.ini"; | |
mkdir(directory.c_str(), 0775); | |
std::cout << "Conf path: " << directory; | |
return QString::fromUtf8(conf_path.c_str()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment