File: qgsuserprofilemanager.sip.in

package info (click to toggle)
qgis 3.40.11%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,183,800 kB
  • sloc: cpp: 1,595,841; python: 372,637; xml: 23,474; sh: 3,761; perl: 3,664; ansic: 2,257; sql: 2,137; yacc: 1,068; lex: 577; javascript: 540; lisp: 411; makefile: 154
file content (265 lines) | stat: -rw-r--r-- 7,799 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/core/qgsuserprofilemanager.h                                     *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/





class QgsUserProfileManager : QObject
{
%Docstring(signature="appended")
User profile manager is used to manager list, and manage user profiles
on the users machine.

In QGIS 3 all settings, plugins, etc were moved into a
%APPDATA%/profiles folder for each platform. This allows for manage
different user profiles per machine vs the single default one that was
allowed in the past.

A user profile is all settings and anything that used to be found in
.qgis3 in the users home folder.
%End

%TypeHeaderCode
#include "qgsuserprofilemanager.h"
%End
  public:

    QgsUserProfileManager( const QString &rootLocation = QString(), QObject *parent = 0 );
%Docstring
User profile manager used to manage user profiles for the instance of
QGIS.
%End

    static QString resolveProfilesFolder( const QString &basePath = QString() );
%Docstring
Resolves the profiles folder for the given path. Path will have
\\profiles appended to the path

:param basePath: The base path to resolve the path from to append the
                 \\profiles folder to.

:return: The root path to store user profiles.
%End

    QgsUserProfile *getProfile( const QString &defaultProfile = "default", bool createNew = true, bool initSettings = true ) /Factory/;
%Docstring
Returns the profile from the given root profile location. If no name is
given it returns a profile called "default". By default will create the
profile folder if not found. By default will init the user settings.

:param defaultProfile: The profile name to find. Empty profile name will
                       return "default" for the name.
:param createNew: Create the profile folder if it doesn't exist.
:param initSettings: if the settings should be initialized

:return: The user profile

.. note::

   Returns a new :py:class:`QgsUserProfile`. Ownership transferred to caller.
%End

    void setRootLocation( const QString &rootProfileLocation );
%Docstring
Set the root profile location for the profile manager. All profiles are
loaded from this location. Will also contain a profiles.ini for holding
profile settings.

:param rootProfileLocation: Path to the top level profile folder which
                            contains folders for each profile.
%End

    QString rootLocation();
%Docstring
Returns the path to the root profiles location.

:return: The root path to the profiles folder.
%End

    void setNewProfileNotificationEnabled( bool enabled );
%Docstring
Sets whether the manager should watch for the creation of new user
profiles and emit the :py:func:`~QgsUserProfileManager.profilesChanged`
signal when this occurs. By default new profile notification is
disabled.

Before calling this, ensure that the correct root location has been set
via calling :py:func:`~QgsUserProfileManager.setRootLocation`.

.. seealso:: :py:func:`isNewProfileNotificationEnabled`
%End

    bool isNewProfileNotificationEnabled() const;
%Docstring
Returns whether the manager is watching for the creation of new user
profiles and emitting the
:py:func:`~QgsUserProfileManager.profilesChanged` signal when this
occurs. By default new profile notification is disabled.

.. seealso:: :py:func:`setNewProfileNotificationEnabled`
%End

    bool rootLocationIsSet() const;
%Docstring
Check if the root location has been set for the manager.

:return: ``True`` if the root location has been set.
%End

    QStringList allProfiles() const;
%Docstring
Returns a list of all found profile names.
%End

    bool profileExists( const QString &name ) const;
%Docstring
Check if a profile exists.

:return: ``False`` if the profile can't be found.
%End

    QString defaultProfileName() const;
%Docstring
Returns the name of the default profile that has been set in .default.
First checks profile.ini in \\profiles folder Then checks defaultProfile
in global settings Finally returns "default" if all else fails

:return: The name of the default profile.

.. note::

   Setting overrideLocalProfile in global settings will always ignore profiles.ini
%End

    void setDefaultProfileName( const QString &name );
%Docstring
Sets the default profile name. The default profile name is used when
loading QGIS with no arguments.

:param name: The name of the profile to save.
%End

    void setDefaultFromActive();
%Docstring
Set the default profile name from the current active profile.
%End

    QString lastProfileName() const;
%Docstring
Returns the name of the most recently closed profile. Empty if it is the
first time QGIS is run.

.. versionadded:: 3.32
%End


    Qgis::UserProfileSelectionPolicy userProfileSelectionPolicy() const;
%Docstring
Returns the user profile selection policy.

.. versionadded:: 3.32
%End

    void setUserProfileSelectionPolicy( Qgis::UserProfileSelectionPolicy policy );
%Docstring
Sets the user profile selection policy.

:param policy: The policy to use when selecting a user profile.

.. versionadded:: 3.32
%End

    QgsUserProfile *profileForName( const QString &name ) const /Factory/;
%Docstring
Returns the profile found for a given name.

:param name: The name of the profile to return.

:return: A :py:class:`QgsUserprofile` pointing to the location of the
         user profile.
%End

    QgsError createUserProfile( const QString &name );
%Docstring
Create a user profile given by the name

:param name: 

:return: A :py:class:`QgsError` which report if there was any error
         creating the user profile.
%End

    QgsError deleteProfile( const QString &name );
%Docstring
Deletes a profile from the root profiles folder.

:param name: The name of the profile to delete.

:return: A :py:class:`QgsError` with a message if the profile failed to
         be deleted.

.. note::

   There is no undo on this as it deletes the folder from the machine.
%End

    QgsUserProfile *userProfile();
%Docstring
The currently active user profile.

:return: The currently active user profile.
%End

    void setActiveUserProfile( const QString &profile );
%Docstring
Sets the active profile in the manager. This can only be set once.
Setting this again does nothing.

:param profile: The name of the active profile
%End

    void loadUserProfile( const QString &name );
%Docstring
Starts a new instance of QGIS for the given profile.

:param name: The profile to start QGIS with.
%End

    QSettings *settings();
%Docstring
Returns the settings for the profile manager.

.. versionadded:: 3.32
%End

  signals:

    void profilesChanged();
%Docstring
Emitted when the list of profiles is changed.

This signal will only be emitted when
:py:func:`~QgsUserProfileManager.isNewProfileNotificationEnabled` is
``True``. By default new profile notification is disabled.

.. seealso:: :py:func:`isNewProfileNotificationEnabled`

.. seealso:: :py:func:`setNewProfileNotificationEnabled`
%End

};


/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/core/qgsuserprofilemanager.h                                     *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/