In Where does QGIS Plugin "Customize Toolbar" save its changes? it was pointed out, that "Customize Toolbars" saves the changes in a file called ".CustomToolBars". This file is stored in the home directory of the user, so the path is something like "c:\users\xyz"
I am running a mobile version of QGIS and I would like to change the location of this file to the current directory where the plugin is installed (or any other directory on the USB drive). I use this mobile version for teaching and need to have the path set dynamically so the file will be found no matter of the path of the mobile QGIS.
I have only very little knowledge of programming (and especially Python), but I had a look at the python code and I think that the code lines for defining the location are to be found in line 50 and 51 of "CustomToolbar.py":
 self.userhome = os.path.expanduser('~')  self.filepath = self.userhome + '//.CustomToolBars'
In order to set the location dynamically to the current directory of the plugin I changed it as follows:
 self.userhome = os.path.dirname(__file__)
But when starting QGIS it fails to load the plugin and gives the following errors:
Traceback (most recent call last): File "H:/GIS/usbgis/apps/qgis2/apps/qgis-ltr/./python\qgis\utils.py", line 219, in startPlugin plugins[packageName] = package.classFactory(iface) File "H:\GIS\usbgis\config_lite/python/plugins\CustomToolBar\__init__.py", line 10, in classFactory from CustomToolbar import CustomToolbar File "H:/GIS/usbgis/apps/qgis2/apps/qgis-ltr/./python\qgis\utils.py", line 478, in _import mod = _builtin_import(name, globals, locals, fromlist, level) File "H:\GIS\usbgis\config_lite/python/plugins\CustomToolBar\CustomToolbar.py", line 52 self.userhome = os.path.dirname(__file__) ^ IndentationError: unexpected indent
Actually, I am a bit lost and don't quite know how proceed further.