Skip to content

Commit

Permalink
fix: in portable version,the default content dir lost recursive att…
Browse files Browse the repository at this point in the history
…ribute. (#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>
  • Loading branch information
xiaoyifang and autofix-ci[bot] authored Mar 20, 2024
1 parent e8f3a94 commit be22cb2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
5 changes: 5 additions & 0 deletions src/config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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() ) {
Expand Down
7 changes: 0 additions & 7 deletions src/dict/sources.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit be22cb2

Please sign in to comment.