LCOV - code coverage report
Current view: top level - core - qgsuserprofile.h (source / functions) Hit Total Coverage
Test: coverage.info.cleaned Lines: 1 1 100.0 %
Date: 2021-04-10 08:29:14 Functions: 0 0 -
Branches: 0 0 -

           Branch data     Line data    Source code
       1                 :            : /***************************************************************************
       2                 :            :                         qgsuserprofile.h
       3                 :            :      --------------------------------------
       4                 :            :     Date                 :  Jul-2017
       5                 :            :     Copyright            : (C) 2017 by Nathan Woodrow
       6                 :            :     Email                : woodrow.nathan at gmail dot com
       7                 :            :  ***************************************************************************
       8                 :            :  *                                                                         *
       9                 :            :  *   This program is free software; you can redistribute it and/or modify  *
      10                 :            :  *   it under the terms of the GNU General Public License as published by  *
      11                 :            :  *   the Free Software Foundation; either version 2 of the License, or     *
      12                 :            :  *   (at your option) any later version.                                   *
      13                 :            :  *                                                                         *
      14                 :            :  ***************************************************************************/
      15                 :            : 
      16                 :            : #ifndef QGSUSERPROFILE_H
      17                 :            : #define QGSUSERPROFILE_H
      18                 :            : 
      19                 :            : #include "qgis_core.h"
      20                 :            : #include "qgserror.h"
      21                 :            : #include <QIcon>
      22                 :            : 
      23                 :            : /**
      24                 :            :  * \ingroup core
      25                 :            :  * \brief User profile contains information about the user profile folders on the machine.
      26                 :            :  * In QGIS 3 all settings, plugins, etc were moved into a %APPDATA%/profiles folder for each platform.
      27                 :            :  * This allows for manage different user profiles per machine vs the single default one that was allowed in the
      28                 :            :  * past.
      29                 :            :  *
      30                 :            :  * A user profile is all settings and anything that used to be found in .qgis3 in the users home folder.
      31                 :            :  *
      32                 :            :  * \since QGIS 3.0
      33                 :            :  */
      34                 :          7 : class CORE_EXPORT QgsUserProfile
      35                 :            : {
      36                 :            :   public:
      37                 :            : 
      38                 :            :     /**
      39                 :            :      * Reference to a existing user profile folder.
      40                 :            :      * Profile folder should be created using QgsProfileManager.
      41                 :            :      * \param folder An existing profile folder as the base of the user profile.
      42                 :            :      */
      43                 :            :     QgsUserProfile( const QString &folder );
      44                 :            : 
      45                 :            :     /**
      46                 :            :      * The base folder for the user profile.
      47                 :            :      */
      48                 :            :     const QString folder() const;
      49                 :            : 
      50                 :            :     /**
      51                 :            :      * Check of the profile is in a valid state.
      52                 :            :      */
      53                 :            :     QgsError validate() const;
      54                 :            : 
      55                 :            :     /**
      56                 :            :      * The name for the user profile.
      57                 :            :      */
      58                 :            :     const QString name() const;
      59                 :            : 
      60                 :            :     /**
      61                 :            :      * Init the settings from the user folder.
      62                 :            :      */
      63                 :            :     void initSettings() const;
      64                 :            : 
      65                 :            :     /**
      66                 :            :      * Returns the alias for the user profile.
      67                 :            :      * \return If no alias is set name() is returned.
      68                 :            :      */
      69                 :            :     const QString alias() const;
      70                 :            : 
      71                 :            :     /**
      72                 :            :      * Set the alias of the profile. The alias is a user friendly name.
      73                 :            :      * \param alias A user friendly name for the profile.
      74                 :            :      * \return TRUE of setting the alias was successful.
      75                 :            :      */
      76                 :            :     QgsError setAlias( const QString &alias );
      77                 :            : 
      78                 :            :     /**
      79                 :            :      * The icon for the user profile.
      80                 :            :      * \return A QIcon for the users
      81                 :            :      */
      82                 :            :     const QIcon icon() const;
      83                 :            : 
      84                 :            :   private:
      85                 :            :     QString qgisDB() const;
      86                 :            :     QString mProfileFolder;
      87                 :            : };
      88                 :            : 
      89                 :            : #endif

Generated by: LCOV version 1.14