Remove files from Settings::recentFileList(), if they fail to open. (#268)
- i.e. they no longer exist or have been moved - update recent file menu in StartupView as Settings change
This commit is contained in:
@@ -358,6 +358,20 @@ namespace glabels
|
||||
}
|
||||
|
||||
|
||||
void Settings::removeFromRecentFileList( const QString& filePath )
|
||||
{
|
||||
mInstance->beginGroup( "Recent" );
|
||||
|
||||
QStringList list = mInstance->value( "files" ).toStringList();
|
||||
list.removeAll( filePath );
|
||||
mInstance->setValue( "files", list );
|
||||
|
||||
mInstance->endGroup();
|
||||
|
||||
emit mInstance->changed();
|
||||
}
|
||||
|
||||
|
||||
QString Settings::recentPrinter()
|
||||
{
|
||||
mInstance->beginGroup( "Recent" );
|
||||
|
||||
@@ -101,6 +101,7 @@ namespace glabels
|
||||
static int maxRecentFiles();
|
||||
static QStringList recentFileList();
|
||||
static void addToRecentFileList( const QString& filePath );
|
||||
static void removeFromRecentFileList( const QString& filePath );
|
||||
|
||||
static QString recentPrinter();
|
||||
static void setRecentPrinter( const QString& printer );
|
||||
|
||||
Reference in New Issue
Block a user