fix: in portable version,the default content dir lost recursive attribute. (#1430)

* fix: allow edit the content path

* fix: portable version ,add default item

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
xiaoyifang 2024-03-20 22:07:58 +08:00 committed by GitHub
parent e8f3a94541
commit be22cb22b6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 7 deletions

View file

@ -632,6 +632,11 @@ Class load()
Path( nl.item( x ).toElement().text(), nl.item( x ).toElement().attribute( "recursive" ) == "1" ) );
}
if ( Config::isPortableVersion() && c.paths.empty() ) {
// For portable version, hardcode some settings
c.paths.push_back( Config::Path( Config::getPortableVersionDictionaryDir(), true ) );
}
QDomNode soundDirs = root.namedItem( "sounddirs" );
if ( !soundDirs.isNull() ) {

View file

@ -1115,13 +1115,6 @@ Qt::ItemFlags PathsModel::flags( QModelIndex const & index ) const
{
Qt::ItemFlags result = QAbstractItemModel::flags( index );
if ( Config::isPortableVersion() ) {
if ( index.isValid() && index.row() == 0 ) {
result &= ~Qt::ItemIsSelectable;
result &= ~Qt::ItemIsEnabled;
}
}
if ( index.isValid() && index.column() == 1 )
result |= Qt::ItemIsUserCheckable;