23

I have a project in the QGIS Recent Projects list that doesn't exist anymore, but it keeps being listed (greyed out and without thumbnail image). Is there any way to remove it from the list? Perhaps by manually editing a history file or something like that?

I've found a feature request for this, and a related discussion, but I'm wondering if there's anything I can do now in QGIS 2.14.

35
  • To delete specific projects, from the toolbar go to Settings > Options > Advanced:

    Advanced options

    Make a solemn promise that you will be careful and click. Locate the UI folder and find the recentProjects. Here you will see an index of recent projects:

    Recent projects

    You can widen the Value column to see more details on your projects. Identify the project you want removed and note the folder number (eg. 2). Then in the Python Console, enter:

    from PyQt4.QtCore import QSettings
    QSettings().remove('UI/recentProjects/2')
    

    Restart QGIS and the project should be removed from the list.


  • To delete the entire Recent Projects list, you can enter the following in the Python Console:

    from PyQt4.QtCore import QSettings
    QSettings().remove('UI/recentProjects')
    

    Restart QGIS and you should see the list has cleared.

  • 8
    Think it's time to raise a feature request to automate this. I've got the same issue with redundant projects...and I cannot promise that I'd be careful! – Andrew Tice Jun 21 '16 at 21:45
  • 3
    It would be 'nice' to have some other features associated with this function. I'd like to increase the number of recent projects that I can see. I'd also like to be able to choose whether I see a large thumbnail or a smaller one (as I do if I haven't re saved the project) and perhaps a grid of recent projects rather than the list (seeing that I have a wide screen and there's lots of white space to the right of the thumbnail). – Johanna Jun 21 '16 at 22:50
  • @AndrewTice - I also have reduntant projects but I tend to ignore them. Feel free to add a feature request though! ...and if you can't promise to be careful, perhaps also add another feature request for an "undo" button =) – Joseph Jun 22 '16 at 8:41
  • @Johanna - Those features sound quite useful to have, especially when using widescreen monitors or high resolution. Again consider adding a feature request :) – Joseph Jun 22 '16 at 8:44
  • 1
    @Joseph - I've post an additional answer with a pure Python solution. – Stefan Mar 23 '18 at 13:10
2

You could also try

Settings -> Options -> System -> QSettings -> Reset

which might reset the recent list.

2

If you are using a Windows machine, the easiest way to clear projects from the list is to delete them from the registry with Regedit.

Hit Win+R and type "regedit", then navigate to:

HKEY_CURRENT_USER\Software\QGIS\QGIS2\UI\recentProjects

The recent projects key will have a subkey for each project and they will have names from 1 to 10 based on the order of when they were last opened (1 being most recent). You may wish to bookmark this key for later convenience (File Menu>Favorites>Add to Favorites) and you may wish to export the recent projects key too because Regedit has no undo function (right-click>Export, then select file name and location).

You can see the details for each project in their substring values (CRS, project path, preview image and title). From there it is a simple issue of deleting the keys for the projects you don't want. You could even copy one of these keys and configure the strings to point to a project and custom png preview image to add one if you wanted to.

One other note: Doing it this way doesn't delete any files. The project files and data files should be easy enough to find if you want to get rid of them as well but doing it this way will also leave the png preview images orphaned in an obscure data folder until the Earth crashes into the sun. If you want to get rid of them too, you you can find them in C:\Users\User folder\.qgis2\previewImages or comparable folder depending on your OS and configuration.

Happy Mapping!.

2

In addition to Josephs answer I want to post here a pure Python solution to get information of all recent projects in the QGIS Python console. I asked this in a comment on Josephs answer and don't want to ask an extra question.

from PyQt4.QtCore import QSettings
for key in QSettings().allKeys():
    if 'recentProjects' in key:
    #if 'recentProjects' and 'title' in key:  # if only the title is wanted
        print key + ' - ' + QSettings().value(key)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.