MCPcopy Create free account
hub / github.com/ElyPrismLauncher/Launcher / set

Method set

launcher/settings/SettingsObject.cpp:101–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99}
100
101bool SettingsObject::set(const QString& id, QVariant value)
102{
103 auto setting = getSetting(id);
104 if (!setting) {
105 qCritical() << QString("Error changing setting %1. Setting doesn't exist.").arg(id);
106 return false;
107 }
108
109#ifdef Q_OS_MACOS
110 // for macOS, keep a security scoped bookmark for the paths
111 if (value.userType() == QMetaType::QString && id.endsWith("Dir")) {
112 setPathWithBookmark(id, value.toString());
113 }
114#endif
115
116 setting->set(std::move(value));
117 return true;
118}
119
120#ifdef Q_OS_MACOS
121QString SettingsObject::getPathFromBookmark(const QString& id)

Callers 3

getPathFromBookmarkMethod · 0.45
setPathWithBookmarkMethod · 0.45
reloadMethod · 0.45

Calls 3

moveFunction · 0.85
QStringClass · 0.50
toStringMethod · 0.45

Tested by

no test coverage detected