| 1 | // SPDX-License-Identifier: GPL-3.0-or-latercxx . . $ `<file>/src/core/profilemanagerui.cpp`/ |
| 2 | // Copyright 2019 Juan Palacios <[email protected]> |
| 3 | |
| 4 | #include "profilemanagerui.h"cxx . . $ `<file>/src/core/profilemanagerui.h`/ |
| 5 | |
| 6 | #include "iprofile.h"cxx . . $ `<file>/src/core/iprofile.h`/ |
| 7 | #include "iprofilemanager.h"cxx . . $ `<file>/src/core/iprofilemanager.h`/ |
| 8 | #include "isession.h"cxx . . $ `<file>/src/core/isession.h`/ |
| 9 | #include "isysmodelui.h"cxx . . $ `<file>/src/core/isysmodelui.h`/ |
| 10 | #include "qmlcomponentregistry.h"cxx . . $ `<file>/src/core/qmlcomponentregistry.h`/ |
| 11 | #include <QQmlApplicationEngine> |
| 12 | #include <QtGlobal> |
| 13 | #include <QtQml> |
| 14 | #include <algorithm> |
| 15 | #include <utility> |
| 16 | |
| 17 | char const *const ProfileManagerUIcxx . . $ ProfileManagerUI#::trStringscxx . . $ ProfileManagerUI#trStrings.[] = { |
| 18 | QT_TRANSLATE_NOOPcxx . . $ `<external>/7871922715575640492/qttranslation.h:21:9`!("ProfileManagerUI", "_global_"), |
| 19 | }; |
| 20 | |
| 21 | class ProfileManagerUIcxx . . $ ProfileManagerUI#::ProfileManagerObservercxx . . $ ProfileManagerUI#ProfileManagerObserver# : public IProfileManagercxx . . $ IProfileManager#::Observercxx . . $ IProfileManager#Observer# |
| 22 | { |
| 23 | public: |
| 24 | ProfileManagerObservercxx . . $ ProfileManagerUI#ProfileManagerObserver#ProfileManagerObserver(3440ee3348f9df4e).(ProfileManagerUIcxx . . $ ProfileManagerUI# &outer) noexcept |
| 25 | : outer_cxx . . $ ProfileManagerUI#ProfileManagerObserver#outer_.(outer) |
| 26 | { |
| 27 | } |
| 28 | |
| 29 | void profileAddedcxx . . $ ProfileManagerUI#ProfileManagerObserver#profileAdded(9c546c94e5fcce4e).(stdcxx . . $ std/::stringcxx . . $ std/string# const &profileName) override; |
| 30 | void profileRemovedcxx . . $ ProfileManagerUI#ProfileManagerObserver#profileRemoved(9c546c94e5fcce4e).(stdcxx . . $ std/::stringcxx . . $ std/string# const &profileName) override; |
| 31 | void profileChangedcxx . . $ ProfileManagerUI#ProfileManagerObserver#profileChanged(9c546c94e5fcce4e).(stdcxx . . $ std/::stringcxx . . $ std/string# const &profileName) override; |
| 32 | void profileActiveChangedcxx . . $ ProfileManagerUI#ProfileManagerObserver#profileActiveChanged(a3b17e0268c60856).(stdcxx . . $ std/::stringcxx . . $ std/string# const &profileName, bool active) override; |
| 33 | void profileSavedcxx . . $ ProfileManagerUI#ProfileManagerObserver#profileSaved(9c546c94e5fcce4e).(stdcxx . . $ std/::stringcxx . . $ std/string# const &profileName) override; |
| 34 | void profileInfoChangedcxx . . $ ProfileManagerUI#ProfileManagerObserver#profileInfoChanged(1acf29b044426ccc).(IProfilecxx . . $ IProfile#::Infocxx . . $ IProfile#Info# const &oldInfo, |
| 35 | IProfilecxx . . $ IProfile#::Infocxx . . $ IProfile#Info# const &newInfo) override; |
| 36 | |
| 37 | private: |
| 38 | ProfileManagerUIcxx . . $ ProfileManagerUI# &outer_cxx . . $ ProfileManagerUI#ProfileManagerObserver#outer_.; |
| 39 | }; |
| 40 | |
| 41 | void ProfileManagerUIcxx . . $ ProfileManagerUI#::ProfileManagerObservercxx . . $ ProfileManagerUI#ProfileManagerObserver#::profileAddedcxx . . $ ProfileManagerUI#ProfileManagerObserver#profileAdded(9c546c94e5fcce4e).( |
| 42 | stdcxx . . $ std/::stringcxx . . $ std/string# const &profileName) |
| 43 | { |
| 44 | outer_cxx . . $ ProfileManagerUI#ProfileManagerObserver#outer_..addProfileComponetcxx . . $ ProfileManagerUI#addProfileComponet(9c546c94e5fcce4e).(profileName); |
| 45 | } |
| 46 | |
| 47 | void ProfileManagerUIcxx . . $ ProfileManagerUI#::ProfileManagerObservercxx . . $ ProfileManagerUI#ProfileManagerObserver#::profileRemovedcxx . . $ ProfileManagerUI#ProfileManagerObserver#profileRemoved(9c546c94e5fcce4e).( |
| 48 | stdcxx . . $ std/::stringcxx . . $ std/string# const &profileName) |
| 49 | { |
| 50 | emitcxx . . $ `<external>/4830994369567095248/qtmetamacros.h:51:10`! outer_cxx . . $ ProfileManagerUI#ProfileManagerObserver#outer_..profileRemovedcxx . . $ ProfileManagerUI#profileRemoved(3520e46b33348bf6).(QStringcxx . . $ QString#::fromStdStringcxx . . $ QString#fromStdString(24a2e9bdf24626eb).(profileName)); |
| 51 | } |
| 52 | |
| 53 | void ProfileManagerUIcxx . . $ ProfileManagerUI#::ProfileManagerObservercxx . . $ ProfileManagerUI#ProfileManagerObserver#::profileChangedcxx . . $ ProfileManagerUI#ProfileManagerObserver#profileChanged(9c546c94e5fcce4e).( |
| 54 | stdcxx . . $ std/::stringcxx . . $ std/string# const &profileName) |
| 55 | { |
| 56 | emitcxx . . $ `<external>/4830994369567095248/qtmetamacros.h:51:10`! outer_cxx . . $ ProfileManagerUI#ProfileManagerObserver#outer_..profileChangedcxx . . $ ProfileManagerUI#profileChanged(3520e46b33348bf6).(QStringcxx . . $ QString#::fromStdStringcxx . . $ QString#fromStdString(24a2e9bdf24626eb).(profileName)); |
| 57 | } |
| 58 | |
| 59 | void ProfileManagerUIcxx . . $ ProfileManagerUI#::ProfileManagerObservercxx . . $ ProfileManagerUI#ProfileManagerObserver#::profileActiveChangedcxx . . $ ProfileManagerUI#ProfileManagerObserver#profileActiveChanged(a3b17e0268c60856).( |
| 60 | stdcxx . . $ std/::stringcxx . . $ std/string# const &profileName, bool active) |
| 61 | { |
| 62 | emitcxx . . $ `<external>/4830994369567095248/qtmetamacros.h:51:10`! outer_cxx . . $ ProfileManagerUI#ProfileManagerObserver#outer_..profileActiveChangedcxx . . $ ProfileManagerUI#profileActiveChanged(37c160c81b6367f7).(QStringcxx . . $ QString#::fromStdStringcxx . . $ QString#fromStdString(24a2e9bdf24626eb).(profileName), active); |
| 63 | } |
| 64 | |
| 65 | void ProfileManagerUIcxx . . $ ProfileManagerUI#::ProfileManagerObservercxx . . $ ProfileManagerUI#ProfileManagerObserver#::profileSavedcxx . . $ ProfileManagerUI#ProfileManagerObserver#profileSaved(9c546c94e5fcce4e).( |
| 66 | stdcxx . . $ std/::stringcxx . . $ std/string# const &profileName) |
| 67 | { |
| 68 | emitcxx . . $ `<external>/4830994369567095248/qtmetamacros.h:51:10`! outer_cxx . . $ ProfileManagerUI#ProfileManagerObserver#outer_..profileSavedcxx . . $ ProfileManagerUI#profileSaved(3520e46b33348bf6).(QStringcxx . . $ QString#::fromStdStringcxx . . $ QString#fromStdString(24a2e9bdf24626eb).(profileName)); |
| 69 | } |
| 70 | |
| 71 | void ProfileManagerUIcxx . . $ ProfileManagerUI#::ProfileManagerObservercxx . . $ ProfileManagerUI#ProfileManagerObserver#::profileInfoChangedcxx . . $ ProfileManagerUI#ProfileManagerObserver#profileInfoChanged(1acf29b044426ccc).( |
| 72 | IProfilecxx . . $ IProfile#::Infocxx . . $ IProfile#Info# const &oldInfo, IProfilecxx . . $ IProfile#::Infocxx . . $ IProfile#Info# const &newInfo) |
| 73 | { |
| 74 | outer_cxx . . $ ProfileManagerUI#ProfileManagerObserver#outer_..addProfileUsedNamescxx . . $ ProfileManagerUI#addProfileUsedNames(9c546c94e5fcce4e).(newInfo.namecxx . . $ IProfile#Info#name.); |
| 75 | auto profile = outer_cxx . . $ ProfileManagerUI#ProfileManagerObserver#outer_..profileManager_cxx . . $ ProfileManagerUI#profileManager_.->profilecxx . . $ IProfileManager#profile(f84880c9a777ebac).(newInfo.namecxx . . $ IProfile#Info#name.); |
| 76 | emitcxx . . $ `<external>/4830994369567095248/qtmetamacros.h:51:10`! outer_cxx . . $ ProfileManagerUI#ProfileManagerObserver#outer_..profileInfoChangedcxx . . $ ProfileManagerUI#profileInfoChanged(d16393eab9ce24f1).( |
| 77 | QStringcxx . . $ QString#::fromStdStringcxx . . $ QString#fromStdString(24a2e9bdf24626eb).(oldInfo.namecxx . . $ IProfile#Info#name.), QStringcxx . . $ QString#::fromStdStringcxx . . $ QString#fromStdString(24a2e9bdf24626eb).(newInfo.namecxx . . $ IProfile#Info#name.), |
| 78 | newInfo.execxx . . $ IProfile#Info#exe. != IProfilecxx . . $ std/basic_string_view#basic_string_view(b419d9def655ef02).::Infocxx . . $ IProfile#Info#::ManualIDcxx . . $ IProfile#Info#ManualID. |
| 79 | ? QStringcxx . . $ QString#::fromStdStringcxx . . $ QString#fromStdString(24a2e9bdf24626eb).(newInfo.execxx . . $ IProfile#Info#exe.) |
| 80 | : QLatin1Stringcxx . . $ QString#QString(4641beeb24e75d60).(""), |
| 81 | outer_cxx . . $ ProfileManagerUI#ProfileManagerObserver#outer_..toQMLIconPathcxx . . $ ProfileManagerUI#toQMLIconPath(f19053a6d670cfb9).(newInfo.iconURLcxx . . $ IProfile#Info#iconURL.), newInfo.hasCustomIconcxx . . $ IProfile#Info#hasCustomIcon(50ce9a9e25b4a850).(), |
| 82 | profile->cxx . . $ std/optional#`operator->`(258ee1c9e0a18a5c).getcxx . . $ std/reference_wrapper#get(d426bc7b625886b7).().activecxx . . $ IProfile#active(50ce9a9e25b4a850).()); |
| 83 | } |
| 84 | |
| 85 | class ProfileManagerUIcxx . . $ ProfileManagerUI#::ManualProfileObservercxx . . $ ProfileManagerUI#ManualProfileObserver# |
| 86 | : public ISessioncxx . . $ ISession#::ManualProfileObservercxx . . $ ISession#ManualProfileObserver# |
| 87 | { |
| 88 | public: |
| 89 | ManualProfileObservercxx . . $ ProfileManagerUI#ManualProfileObserver#ManualProfileObserver(3440ee3348f9df4e).(ProfileManagerUIcxx . . $ ProfileManagerUI# &outer) noexcept |
| 90 | : outer_cxx . . $ ProfileManagerUI#ManualProfileObserver#outer_.(outer) |
| 91 | { |
| 92 | } |
| 93 | |
| 94 | void toggledcxx . . $ ProfileManagerUI#ManualProfileObserver#toggled(a3b17e0268c60856).(stdcxx . . $ std/::stringcxx . . $ std/string# const &profileName, bool active) override; |
| 95 | |
| 96 | private: |
| 97 | ProfileManagerUIcxx . . $ ProfileManagerUI# &outer_cxx . . $ ProfileManagerUI#ManualProfileObserver#outer_.; |
| 98 | }; |
| 99 | |
| 100 | void ProfileManagerUIcxx . . $ ProfileManagerUI#::ManualProfileObservercxx . . $ ProfileManagerUI#ManualProfileObserver#::toggledcxx . . $ ProfileManagerUI#ManualProfileObserver#toggled(a3b17e0268c60856).( |
| 101 | const stdcxx . . $ std/::stringcxx . . $ std/string# &profileName, bool active) |
| 102 | { |
| 103 | emitcxx . . $ `<external>/4830994369567095248/qtmetamacros.h:51:10`! outer_cxx . . $ ProfileManagerUI#ManualProfileObserver#outer_..manualProfileToggledcxx . . $ ProfileManagerUI#manualProfileToggled(37c160c81b6367f7).(QStringcxx . . $ QString#::fromStdStringcxx . . $ QString#fromStdString(24a2e9bdf24626eb).(profileName), active); |
| 104 | } |
| 105 | |
| 106 | ProfileManagerUIcxx . . $ ProfileManagerUI#::ProfileManagerUIcxx . . $ ProfileManagerUI#ProfileManagerUI(cc6a52b634b3d446).(QObjectcxx . . $ QObject# *parent) noexcept |
| 107 | : QObjectcxx . . $ QObject#QObject(749de1b6ae65bddd).(parent) |
| 108 | , profileManagerObserver_cxx . . $ ProfileManagerUI#profileManagerObserver_.( |
| 109 | stdcxx . . $ std/::make_sharedcxx . . $ std/make_shared(25752750ef11e821).<ProfileManagerUIcxx . . $ ProfileManagerUI#::ProfileManagerObservercxx . . $ ProfileManagerUI#ProfileManagerObserver#>(*this)) |
| 110 | , manualProfileObserver_cxx . . $ ProfileManagerUI#manualProfileObserver_.( |
| 111 | stdcxx . . $ std/::make_sharedcxx . . $ std/make_shared(25752750ef11e821).<ProfileManagerUIcxx . . $ ProfileManagerUI#::ManualProfileObservercxx . . $ ProfileManagerUI#ManualProfileObserver#>(*this)) |
| 112 | { |
| 113 | usedExecutableNames_cxx . . $ ProfileManagerUI#usedExecutableNames_..insertcxx . . $ QSet#insert(4907ccb143c064df).( |
| 114 | QStringcxx . . $ QString#::fromLatin1cxx . . $ QString#fromLatin1(c74cc94e20614dc9).(IProfilecxx . . $ QByteArrayView#QByteArrayView(80d8335016fb1bdc).::Infocxx . . $ IProfile#Info#::ManualIDcxx . . $ IProfile#Info#ManualID..datacxx . . $ std/basic_string_view#data(8e614c7de0b1573e).())); |
| 115 | } |
| 116 | |
| 117 | void ProfileManagerUIcxx . . $ ProfileManagerUI#::initcxx . . $ ProfileManagerUI#init(4ab9ddb9f0ca45f2).(ISessioncxx . . $ ISession# *session, ISysModelUIcxx . . $ ISysModelUI# *sysModelUI) |
| 118 | { |
| 119 | sysModelUI_cxx . . $ ProfileManagerUI#sysModelUI_. = sysModelUI; |
| 120 | session_cxx . . $ ProfileManagerUI#session_. = session; |
| 121 | session_cxx . . $ ProfileManagerUI#session_.->addManualProfileObservercxx . . $ ISession#addManualProfileObserver(b6a8fcfa605ca162).(manualProfileObserver_cxx . . $ std/shared_ptr#shared_ptr(d70455e50ed85f60).); |
| 122 | profileManager_cxx . . $ ProfileManagerUI#profileManager_. = &session_cxx . . $ ProfileManagerUI#session_.->profileManagercxx . . $ ISession#profileManager(4cba1b6c4fb53c57).(); |
| 123 | profileManager_cxx . . $ ProfileManagerUI#profileManager_.->addObservercxx . . $ IProfileManager#addObserver(bd1477ff1de9e2eb).(profileManagerObserver_cxx . . $ std/shared_ptr#shared_ptr(d70455e50ed85f60).); |
| 124 | |
| 125 | // create profile components |
| 126 | auto profileNames = profileManager_cxx . . $ ProfileManagerUI#profileManager_.->profilescxx . . $ IProfileManager#profiles(491c255a7e496038).(); |
| 127 | |
| 128 | // short profile names |
| 129 | stdcxx . . $ std/::sortcxx . . $ std/sort(249673c20e2b8d5).(profileNames.begincxx . . $ std/vector#begin(55a6de06420d4903).(), profileNames.endcxx . . $ std/vector#end(55a6de06420d4903).()); |
| 130 | |
| 131 | // the global profile must be the first element |
| 132 | auto globalIt = stdcxx . . $ std/::find_ifcxx . . $ std/find_if(f0a0a4f94ee5cb00).( |
| 133 | profileNames.begincxx . . $ std/vector#begin(55a6de06420d4903).(), profileNames.endcxx . . $ std/vector#end(55a6de06420d4903).(), |
| 134 | [](auto const &profile) { return profile ==cxx . . $ `operator==`(e06d507c3174a850). IProfilecxx . . $ IProfile#::Infocxx . . $ IProfile#Info#::GlobalIDcxx . . $ IProfile#Info#GlobalID.; }); |
| 135 | if (globalIt != profileNames.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).()) |
| 136 | stdcxx . . $ std/::rotatecxx . . $ std/_V2/rotate(5eb09607cedc971b).(profileNames.begincxx . . $ std/vector#begin(55a6de06420d4903).(), globalIt, globalIt +cxx . . $ __gnu_cxx/__normal_iterator#operator+(192bf940fa7bb3b2). 1); |
| 137 | |
| 138 | QVariantListcxx . . $ QVariantList# listcxx . . $ QList#QList(ced63f7c635d850d).; |
| 139 | for (auto const &profileName : profileNames) { |
| 140 | addProfileUsedNamescxx . . $ ProfileManagerUI#addProfileUsedNames(9c546c94e5fcce4e).(profileName); |
| 141 | |
| 142 | auto profile = profileManager_cxx . . $ ProfileManagerUI#profileManager_.->profilecxx . . $ IProfileManager#profile(f84880c9a777ebac).(profileName); |
| 143 | auto &info = profile->cxx . . $ std/optional#`operator->`(258ee1c9e0a18a5c).getcxx . . $ std/reference_wrapper#get(d426bc7b625886b7).().infocxx . . $ IProfile#info(ad075d653bfbbbea).(); |
| 144 | |
| 145 | list.appendcxx . . $ QList#append(1262c8661f7a27a7).(QStringcxx . . $ QVariant#QVariant(132dd6869045752b).::fromStdStringcxx . . $ QString#fromStdString(24a2e9bdf24626eb).(info.namecxx . . $ IProfile#Info#name.)); |
| 146 | list.appendcxx . . $ QList#append(1262c8661f7a27a7).(infocxx . . $ QVariant#QVariant(132dd6869045752b)..execxx . . $ IProfile#Info#exe. != IProfilecxx . . $ std/basic_string_view#basic_string_view(b419d9def655ef02).::Infocxx . . $ IProfile#Info#::ManualIDcxx . . $ IProfile#Info#ManualID. |
| 147 | ? QStringcxx . . $ QString#::fromStdStringcxx . . $ QString#fromStdString(24a2e9bdf24626eb).(info.execxx . . $ IProfile#Info#exe.) |
| 148 | : QLatin1Stringcxx . . $ QString#QString(4641beeb24e75d60).("")); |
| 149 | list.appendcxx . . $ QList#append(1262c8661f7a27a7).(toQMLIconPathcxx . . $ QVariant#QVariant(132dd6869045752b).(info.iconURLcxx . . $ IProfile#Info#iconURL.)); |
| 150 | list.appendcxx . . $ QList#append(1262c8661f7a27a7).(profilecxx . . $ QVariant#QVariant(9f0ba574c1c44ffc).->cxx . . $ std/optional#`operator->`(258ee1c9e0a18a5c).getcxx . . $ std/reference_wrapper#get(d426bc7b625886b7).().activecxx . . $ IProfile#active(50ce9a9e25b4a850).()); |
| 151 | list.appendcxx . . $ QList#append(1262c8661f7a27a7).(infocxx . . $ QVariant#QVariant(9f0ba574c1c44ffc)..hasCustomIconcxx . . $ IProfile#Info#hasCustomIcon(50ce9a9e25b4a850).()); |
| 152 | } |
| 153 | |
| 154 | emitcxx . . $ `<external>/4830994369567095248/qtmetamacros.h:51:10`! initProfilescxx . . $ ProfileManagerUI#initProfiles(2f4009bfc0c7e161).(list); |
| 155 | } |
| 156 | |
| 157 | QStringcxx . . $ QString# ProfileManagerUIcxx . . $ ProfileManagerUI#::defaultIconcxx . . $ ProfileManagerUI#defaultIcon(6ef7b6c27b00b43d).() const |
| 158 | { |
| 159 | return toQMLIconPathcxx . . $ ProfileManagerUI#toQMLIconPath(f19053a6d670cfb9).(IProfilecxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).::Infocxx . . $ IProfile#Info#::DefaultIconURLcxx . . $ IProfile#Info#DefaultIconURL..datacxx . . $ std/basic_string_view#data(8e614c7de0b1573e).()); |
| 160 | } |
| 161 | |
| 162 | bool ProfileManagerUIcxx . . $ ProfileManagerUI#::isProfileNameInUsecxx . . $ ProfileManagerUI#isProfileNameInUse(e1defb592416720d).(QStringcxx . . $ QString# const &profileName) |
| 163 | { |
| 164 | return usedProfileNames_cxx . . $ ProfileManagerUI#usedProfileNames_..containscxx . . $ QSet#contains(8877ebe272b9620d).(profileName); |
| 165 | } |
| 166 | |
| 167 | bool ProfileManagerUIcxx . . $ ProfileManagerUI#::isExecutableNameInUsecxx . . $ ProfileManagerUI#isExecutableNameInUse(e1defb592416720d).(QStringcxx . . $ QString# const &executableName) |
| 168 | { |
| 169 | return usedExecutableNames_cxx . . $ ProfileManagerUI#usedExecutableNames_..containscxx . . $ QSet#contains(8877ebe272b9620d).(executableName); |
| 170 | } |
| 171 | |
| 172 | bool ProfileManagerUIcxx . . $ ProfileManagerUI#::isProfileUnsavedcxx . . $ ProfileManagerUI#isProfileUnsaved(e1defb592416720d).(QStringcxx . . $ QString# const &profileName) |
| 173 | { |
| 174 | return profileManager_cxx . . $ ProfileManagerUI#profileManager_.->unsavedcxx . . $ IProfileManager#unsaved(13a55b95a0133754).(profileName.toStdStringcxx . . $ QString#toStdString(219584694fe2b248).()); |
| 175 | } |
| 176 | |
| 177 | bool ProfileManagerUIcxx . . $ ProfileManagerUI#::isProfileActivecxx . . $ ProfileManagerUI#isProfileActive(e1defb592416720d).(QStringcxx . . $ QString# const &profileName) |
| 178 | { |
| 179 | auto profile = profileManager_cxx . . $ ProfileManagerUI#profileManager_.->profilecxx . . $ IProfileManager#profile(f84880c9a777ebac).(profileName.toStdStringcxx . . $ QString#toStdString(219584694fe2b248).()); |
| 180 | if (profile.has_valuecxx . . $ std/optional#has_value(3482b152b9333168).()) |
| 181 | return profile->cxx . . $ std/optional#`operator->`(258ee1c9e0a18a5c).getcxx . . $ std/reference_wrapper#get(d426bc7b625886b7).().activecxx . . $ IProfile#active(50ce9a9e25b4a850).(); |
| 182 | |
| 183 | return false; |
| 184 | } |
| 185 | |
| 186 | void ProfileManagerUIcxx . . $ ProfileManagerUI#::addcxx . . $ ProfileManagerUI#add(6d8ce341bc76c5ea).(QStringcxx . . $ QString# const &name, QStringcxx . . $ QString# const &exe, |
| 187 | QStringcxx . . $ QString# const &icon, QStringcxx . . $ QString# const &base) |
| 188 | { |
| 189 | IProfilecxx . . $ IProfile#::Infocxx . . $ IProfile#Info# infocxx . . $ IProfile#Info#Info(b078d394f433f1d4).(name.toStdStringcxx . . $ QString#toStdString(219584694fe2b248).(), |
| 190 | exe.lengthcxx . . $ QString#length(6b0412d51016192f).() > 0 ? exe.toStdStringcxx . . $ QString#toStdString(219584694fe2b248).() |
| 191 | : stdcxx . . $ std/::stringcxx . . $ std/string#(IProfilecxx . . $ IProfile#::Infocxx . . $ IProfile#Info#::ManualIDcxx . . $ IProfile#Info#ManualID.)); |
| 192 | info.iconURLcxx . . $ IProfile#Info#iconURL. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). cleanIconFilePathcxx . . $ ProfileManagerUI#cleanIconFilePath(a5d9afeefb59deef).(iconcxx . . $ QString#QString(132dd6869045752b).); |
| 193 | |
| 194 | if (base ==cxx . . $ `operator==`(94dc9d443ef00688). "defaultProfile") |
| 195 | profileManager_cxx . . $ ProfileManagerUI#profileManager_.->addcxx . . $ IProfileManager#add(7a3f345cc6258353).(stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(info)); |
| 196 | else |
| 197 | profileManager_cxx . . $ ProfileManagerUI#profileManager_.->clonecxx . . $ IProfileManager#clone(7d57608c21e2500c).(stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(info), base.toStdStringcxx . . $ QString#toStdString(219584694fe2b248).()); |
| 198 | } |
| 199 | |
| 200 | void ProfileManagerUIcxx . . $ ProfileManagerUI#::removecxx . . $ ProfileManagerUI#remove(3520e46b33348bf6).(QStringcxx . . $ QString# const &name) |
| 201 | { |
| 202 | auto profileName = name.toStdStringcxx . . $ QString#toStdString(219584694fe2b248).(); |
| 203 | removeProfileUsedNamescxx . . $ ProfileManagerUI#removeProfileUsedNames(9c546c94e5fcce4e).(profileName); |
| 204 | profileManager_cxx . . $ ProfileManagerUI#profileManager_.->removecxx . . $ IProfileManager#remove(9c546c94e5fcce4e).(profileName); |
| 205 | } |
| 206 | |
| 207 | void ProfileManagerUIcxx . . $ ProfileManagerUI#::updateInfocxx . . $ ProfileManagerUI#updateInfo(6d8ce341bc76c5ea).(QStringcxx . . $ QString# const &oldName, QStringcxx . . $ QString# const &newName, |
| 208 | QStringcxx . . $ QString# const &exe, QStringcxx . . $ QString# const &icon) |
| 209 | { |
| 210 | auto profileName = oldName.toStdStringcxx . . $ QString#toStdString(219584694fe2b248).(); |
| 211 | removeProfileUsedNamescxx . . $ ProfileManagerUI#removeProfileUsedNames(9c546c94e5fcce4e).(profileName); |
| 212 | IProfilecxx . . $ IProfile#::Infocxx . . $ IProfile#Info# infocxx . . $ IProfile#Info#Info(b078d394f433f1d4).(newName.toStdStringcxx . . $ QString#toStdString(219584694fe2b248).(), |
| 213 | exe.lengthcxx . . $ QString#length(6b0412d51016192f).() > 0 ? exe.toStdStringcxx . . $ QString#toStdString(219584694fe2b248).() |
| 214 | : stdcxx . . $ std/::stringcxx . . $ std/string#(IProfilecxx . . $ IProfile#::Infocxx . . $ IProfile#Info#::ManualIDcxx . . $ IProfile#Info#ManualID.), |
| 215 | cleanIconFilePathcxx . . $ ProfileManagerUI#cleanIconFilePath(a5d9afeefb59deef).(iconcxx . . $ QString#QString(132dd6869045752b).)); |
| 216 | profileManager_cxx . . $ ProfileManagerUI#profileManager_.->updatecxx . . $ IProfileManager#update(eb2b9ce3c3c58e35).(profileName, info); |
| 217 | } |
| 218 | |
| 219 | void ProfileManagerUIcxx . . $ ProfileManagerUI#::activatecxx . . $ ProfileManagerUI#activate(37c160c81b6367f7).(QStringcxx . . $ QString# const &name, bool active) |
| 220 | { |
| 221 | profileManager_cxx . . $ ProfileManagerUI#profileManager_.->activatecxx . . $ IProfileManager#activate(a3b17e0268c60856).(name.toStdStringcxx . . $ QString#toStdString(219584694fe2b248).(), active); |
| 222 | } |
| 223 | |
| 224 | void ProfileManagerUIcxx . . $ ProfileManagerUI#::toggleManualProfilecxx . . $ ProfileManagerUI#toggleManualProfile(3520e46b33348bf6).(QStringcxx . . $ QString# const &name) |
| 225 | { |
| 226 | session_cxx . . $ ProfileManagerUI#session_.->toggleManualProfilecxx . . $ ISession#toggleManualProfile(7c222eea44a24d43).(name.toStdStringcxx . . $ QString#toStdString(219584694fe2b248).()); |
| 227 | } |
| 228 | |
| 229 | void ProfileManagerUIcxx . . $ ProfileManagerUI#::loadSettingscxx . . $ ProfileManagerUI#loadSettings(3520e46b33348bf6).(QStringcxx . . $ QString# const &name) |
| 230 | { |
| 231 | auto profile = profileManager_cxx . . $ ProfileManagerUI#profileManager_.->profilecxx . . $ IProfileManager#profile(f84880c9a777ebac).(name.toStdStringcxx . . $ QString#toStdString(219584694fe2b248).()); |
| 232 | if (profile.has_valuecxx . . $ std/optional#has_value(3482b152b9333168).()) |
| 233 | profile->cxx . . $ std/optional#`operator->`(258ee1c9e0a18a5c).getcxx . . $ std/reference_wrapper#get(d426bc7b625886b7).().exportWithcxx . . $ Exportable#exportWith(5b5c94ff60635419).(*sysModelUI_cxx . . $ ProfileManagerUI#sysModelUI_.); |
| 234 | } |
| 235 | |
| 236 | bool ProfileManagerUIcxx . . $ ProfileManagerUI#::loadSettingscxx . . $ ProfileManagerUI#loadSettings(f4a1dd5527cb2081).(QStringcxx . . $ QString# const &name, QUrlcxx . . $ QUrl# const &path) |
| 237 | { |
| 238 | if (profileManager_cxx . . $ ProfileManagerUI#profileManager_.->loadFromcxx . . $ IProfileManager#loadFrom(19973e5c5433fa0c).( |
| 239 | name.toStdStringcxx . . $ QString#toStdString(219584694fe2b248).(), pathcxx . . $ std/filesystem/__cxx11/path#path(2f6c7066048c5333)..toStringcxx . . $ QUrl#toString(632475ebea3355f1).(QUrlcxx . . $ QUrlTwoFlags#QUrlTwoFlags(9b289cee16747614).::RemoveSchemecxx . . $ QUrl#RemoveScheme.).toStdStringcxx . . $ QString#toStdString(219584694fe2b248).())) { |
| 240 | loadSettingscxx . . $ ProfileManagerUI#loadSettings(3520e46b33348bf6).(name); |
| 241 | |
| 242 | return true; |
| 243 | } |
| 244 | |
| 245 | return false; |
| 246 | } |
| 247 | |
| 248 | void ProfileManagerUIcxx . . $ ProfileManagerUI#::applySettingscxx . . $ ProfileManagerUI#applySettings(3520e46b33348bf6).(QStringcxx . . $ QString# const &name) |
| 249 | { |
| 250 | profileManager_cxx . . $ ProfileManagerUI#profileManager_.->updatecxx . . $ IProfileManager#update(1a91c228bd4123e9).(name.toStdStringcxx . . $ QString#toStdString(219584694fe2b248).(), *sysModelUI_cxx . . $ ProfileManagerUI#sysModelUI_.); |
| 251 | } |
| 252 | |
| 253 | void ProfileManagerUIcxx . . $ ProfileManagerUI#::resetSettingscxx . . $ ProfileManagerUI#resetSettings(3520e46b33348bf6).(QStringcxx . . $ QString# const &name) |
| 254 | { |
| 255 | profileManager_cxx . . $ ProfileManagerUI#profileManager_.->resetcxx . . $ IProfileManager#reset(9c546c94e5fcce4e).(name.toStdStringcxx . . $ QString#toStdString(219584694fe2b248).()); |
| 256 | loadSettingscxx . . $ ProfileManagerUI#loadSettings(3520e46b33348bf6).(name); |
| 257 | } |
| 258 | |
| 259 | void ProfileManagerUIcxx . . $ ProfileManagerUI#::restoreSettingscxx . . $ ProfileManagerUI#restoreSettings(3520e46b33348bf6).(QStringcxx . . $ QString# const &name) |
| 260 | { |
| 261 | profileManager_cxx . . $ ProfileManagerUI#profileManager_.->restorecxx . . $ IProfileManager#restore(9c546c94e5fcce4e).(name.toStdStringcxx . . $ QString#toStdString(219584694fe2b248).()); |
| 262 | loadSettingscxx . . $ ProfileManagerUI#loadSettings(3520e46b33348bf6).(name); |
| 263 | } |
| 264 | |
| 265 | void ProfileManagerUIcxx . . $ ProfileManagerUI#::saveSettingscxx . . $ ProfileManagerUI#saveSettings(3520e46b33348bf6).(QStringcxx . . $ QString# const &name) |
| 266 | { |
| 267 | profileManager_cxx . . $ ProfileManagerUI#profileManager_.->savecxx . . $ IProfileManager#save(9c546c94e5fcce4e).(name.toStdStringcxx . . $ QString#toStdString(219584694fe2b248).()); |
| 268 | } |
| 269 | |
| 270 | bool ProfileManagerUIcxx . . $ ProfileManagerUI#::exportProfilecxx . . $ ProfileManagerUI#exportProfile(f4a1dd5527cb2081).(QStringcxx . . $ QString# const &name, QUrlcxx . . $ QUrl# const &path) |
| 271 | { |
| 272 | return profileManager_cxx . . $ ProfileManagerUI#profileManager_.->exportTocxx . . $ IProfileManager#exportTo(19973e5c5433fa0c).( |
| 273 | name.toStdStringcxx . . $ QString#toStdString(219584694fe2b248).(), pathcxx . . $ std/filesystem/__cxx11/path#path(2f6c7066048c5333)..toStringcxx . . $ QUrl#toString(632475ebea3355f1).(QUrlcxx . . $ QUrlTwoFlags#QUrlTwoFlags(9b289cee16747614).::RemoveSchemecxx . . $ QUrl#RemoveScheme.).toStdStringcxx . . $ QString#toStdString(219584694fe2b248).()); |
| 274 | } |
| 275 | |
| 276 | stdcxx . . $ std/::stringcxx . . $ std/string# ProfileManagerUIcxx . . $ ProfileManagerUI#::cleanIconFilePathcxx . . $ ProfileManagerUI#cleanIconFilePath(a5d9afeefb59deef).(QStringcxx . . $ QString# iconPath) const |
| 277 | { |
| 278 | if (iconPath.startsWithcxx . . $ QString#startsWith(8cce4688c16f48f3).("file://"cxx . . $ QString#QString(85c52e162fed56f9).)) |
| 279 | iconPath.removecxx . . $ QString#remove(d7c3fdecc68f03c6).("file://"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 280 | else if (iconPath.startsWithcxx . . $ QString#startsWith(8cce4688c16f48f3).("qrc:"cxx . . $ QString#QString(85c52e162fed56f9).)) |
| 281 | iconPath.removecxx . . $ QString#remove(46445e9b47196666).(0, 3); |
| 282 | |
| 283 | return iconPath.toStdStringcxx . . $ QString#toStdString(219584694fe2b248).(); |
| 284 | } |
| 285 | |
| 286 | QStringcxx . . $ QString# ProfileManagerUIcxx . . $ ProfileManagerUI#::toQMLIconPathcxx . . $ ProfileManagerUI#toQMLIconPath(f19053a6d670cfb9).(stdcxx . . $ std/::stringcxx . . $ std/string# const &iconPath) const |
| 287 | { |
| 288 | auto qtIconPath = QStringcxx . . $ QString#::fromStdStringcxx . . $ QString#fromStdString(24a2e9bdf24626eb).(iconPath); |
| 289 | if (qtIconPath.startsWithcxx . . $ QString#startsWith(8cce4688c16f48f3).(":/"cxx . . $ QString#QString(85c52e162fed56f9).)) |
| 290 | qtIconPath.prependcxx . . $ QString#prepend(d02845eef0c33901).("qrc"); |
| 291 | else |
| 292 | qtIconPath.prependcxx . . $ QString#prepend(d02845eef0c33901).("file://"); |
| 293 | |
| 294 | return qtIconPathcxx . . $ QString#QString(28715ad661ad3cec).; |
| 295 | } |
| 296 | |
| 297 | void ProfileManagerUIcxx . . $ ProfileManagerUI#::addProfileComponetcxx . . $ ProfileManagerUI#addProfileComponet(9c546c94e5fcce4e).(stdcxx . . $ std/::stringcxx . . $ std/string# const &profileName) |
| 298 | { |
| 299 | addProfileUsedNamescxx . . $ ProfileManagerUI#addProfileUsedNames(9c546c94e5fcce4e).(profileName); |
| 300 | |
| 301 | auto profile = profileManager_cxx . . $ ProfileManagerUI#profileManager_.->profilecxx . . $ IProfileManager#profile(f84880c9a777ebac).(profileName); |
| 302 | auto &info = profile->cxx . . $ std/optional#`operator->`(258ee1c9e0a18a5c).getcxx . . $ std/reference_wrapper#get(d426bc7b625886b7).().infocxx . . $ IProfile#info(ad075d653bfbbbea).(); |
| 303 | emitcxx . . $ `<external>/4830994369567095248/qtmetamacros.h:51:10`! profileAddedcxx . . $ ProfileManagerUI#profileAdded(c483c13b107e5b24).(QStringcxx . . $ QString#::fromStdStringcxx . . $ QString#fromStdString(24a2e9bdf24626eb).(info.namecxx . . $ IProfile#Info#name.), |
| 304 | info.execxx . . $ IProfile#Info#exe. != IProfilecxx . . $ std/basic_string_view#basic_string_view(b419d9def655ef02).::Infocxx . . $ IProfile#Info#::ManualIDcxx . . $ IProfile#Info#ManualID. |
| 305 | ? QStringcxx . . $ QString#::fromStdStringcxx . . $ QString#fromStdString(24a2e9bdf24626eb).(info.execxx . . $ IProfile#Info#exe.) |
| 306 | : QLatin1Stringcxx . . $ QString#QString(4641beeb24e75d60).(""), |
| 307 | toQMLIconPathcxx . . $ ProfileManagerUI#toQMLIconPath(f19053a6d670cfb9).(info.iconURLcxx . . $ IProfile#Info#iconURL.), info.hasCustomIconcxx . . $ IProfile#Info#hasCustomIcon(50ce9a9e25b4a850).(), |
| 308 | profile->cxx . . $ std/optional#`operator->`(258ee1c9e0a18a5c).getcxx . . $ std/reference_wrapper#get(d426bc7b625886b7).().activecxx . . $ IProfile#active(50ce9a9e25b4a850).()); |
| 309 | } |
| 310 | |
| 311 | void ProfileManagerUIcxx . . $ ProfileManagerUI#::addProfileUsedNamescxx . . $ ProfileManagerUI#addProfileUsedNames(9c546c94e5fcce4e).(stdcxx . . $ std/::stringcxx . . $ std/string# const &profileName) |
| 312 | { |
| 313 | auto profile = profileManager_cxx . . $ ProfileManagerUI#profileManager_.->profilecxx . . $ IProfileManager#profile(f84880c9a777ebac).(profileName); |
| 314 | auto &profileInfo = profile->cxx . . $ std/optional#`operator->`(258ee1c9e0a18a5c).getcxx . . $ std/reference_wrapper#get(d426bc7b625886b7).().infocxx . . $ IProfile#info(ad075d653bfbbbea).(); |
| 315 | |
| 316 | auto name = QStringcxx . . $ QString#::fromStdStringcxx . . $ QString#fromStdString(24a2e9bdf24626eb).(profileName); |
| 317 | usedProfileNames_cxx . . $ ProfileManagerUI#usedProfileNames_..insertcxx . . $ QSet#insert(b1720532d625d779).(name); |
| 318 | |
| 319 | if (profileInfo.execxx . . $ IProfile#Info#exe. != IProfilecxx . . $ std/basic_string_view#basic_string_view(b419d9def655ef02).::Infocxx . . $ IProfile#Info#::ManualIDcxx . . $ IProfile#Info#ManualID.) { |
| 320 | auto exe = QStringcxx . . $ QString#::fromStdStringcxx . . $ QString#fromStdString(24a2e9bdf24626eb).(profileInfo.execxx . . $ IProfile#Info#exe.); |
| 321 | usedExecutableNames_cxx . . $ ProfileManagerUI#usedExecutableNames_..insertcxx . . $ QSet#insert(b1720532d625d779).(exe); |
| 322 | } |
| 323 | } |
| 324 | |
| 325 | void ProfileManagerUIcxx . . $ ProfileManagerUI#::removeProfileUsedNamescxx . . $ ProfileManagerUI#removeProfileUsedNames(9c546c94e5fcce4e).(stdcxx . . $ std/::stringcxx . . $ std/string# const &profileName) |
| 326 | { |
| 327 | auto profile = profileManager_cxx . . $ ProfileManagerUI#profileManager_.->profilecxx . . $ IProfileManager#profile(f84880c9a777ebac).(profileName); |
| 328 | auto &profileInfo = profile->cxx . . $ std/optional#`operator->`(258ee1c9e0a18a5c).getcxx . . $ std/reference_wrapper#get(d426bc7b625886b7).().infocxx . . $ IProfile#info(ad075d653bfbbbea).(); |
| 329 | |
| 330 | auto name = QStringcxx . . $ QString#::fromStdStringcxx . . $ QString#fromStdString(24a2e9bdf24626eb).(profileName); |
| 331 | usedProfileNames_cxx . . $ ProfileManagerUI#usedProfileNames_..removecxx . . $ QSet#remove(fe1ba53999e710f3).(name); |
| 332 | |
| 333 | if (profileInfo.execxx . . $ IProfile#Info#exe. != IProfilecxx . . $ std/basic_string_view#basic_string_view(b419d9def655ef02).::Infocxx . . $ IProfile#Info#::ManualIDcxx . . $ IProfile#Info#ManualID.) { |
| 334 | auto exe = QStringcxx . . $ QString#::fromStdStringcxx . . $ QString#fromStdString(24a2e9bdf24626eb).(profileInfo.execxx . . $ IProfile#Info#exe.); |
| 335 | usedExecutableNames_cxx . . $ ProfileManagerUI#usedExecutableNames_..removecxx . . $ QSet#remove(fe1ba53999e710f3).(exe); |
| 336 | } |
| 337 | } |
| 338 | |
| 339 | bool const ProfileManagerUIcxx . . $ ProfileManagerUI#::registered_cxx . . $ ProfileManagerUI#registered_. = |
| 340 | QMLComponentRegistrycxx . . $ QMLComponentRegistry#::addQMLTypeRegisterercxx . . $ QMLComponentRegistry#addQMLTypeRegisterer(9f2ee88c4f5f1585).([cxx . . $ std/function#function(bdc3712e480e4d04).]() { |
| 341 | qmlRegisterTypecxx . . $ qmlRegisterType(f18a5d83a8a5ac9a).<ProfileManagerUIcxx . . $ ProfileManagerUI#>("CoreCtrl.UIComponents", 1, 0, |
| 342 | ProfileManagerUIcxx . . $ ProfileManagerUI#::QMLComponentIDcxx . . $ ProfileManagerUI#QMLComponentID..datacxx . . $ std/basic_string_view#data(8e614c7de0b1573e).()); |
| 343 | }); |