Skip to content

Instantly share code, notes, and snippets.

@minorsecond
Created January 31, 2021 17:28
Show Gist options
  • Save minorsecond/5952c4723cb7b68335d6cdda9fabe8d7 to your computer and use it in GitHub Desktop.
Save minorsecond/5952c4723cb7b68335d6cdda9fabe8d7 to your computer and use it in GitHub Desktop.
QtTermTCP macOS Compat
#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