Skip to content

Commit

Permalink
Fix(folder provider): display pojav version
Browse files Browse the repository at this point in the history
This allows the sort to be stable when listing pojav versions in the file app.
  • Loading branch information
Mathias-Boulay committed Dec 11, 2024
1 parent f1cb9e6 commit e71be1e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import androidx.annotation.Nullable;

import net.kdt.pojavlaunch.BuildConfig;
import net.kdt.pojavlaunch.R;
import net.kdt.pojavlaunch.Tools;

Expand Down Expand Up @@ -76,10 +77,15 @@ public Cursor queryRoots(String[] projection) {
final MatrixCursor result = new MatrixCursor(projection != null ? projection : DEFAULT_ROOT_PROJECTION);
final String applicationName = getContext().getString(R.string.app_short_name);

String summary = BuildConfig.VERSION_NAME;
if (BuildConfig.DEBUG) {
summary = "(" + getContext().getString(R.string.generic_debug) + ") " + summary;
}

final MatrixCursor.RowBuilder row = result.newRow();
row.add(Root.COLUMN_ROOT_ID, getDocIdForFile(BASE_DIR));
row.add(Root.COLUMN_DOCUMENT_ID, getDocIdForFile(BASE_DIR));
row.add(Root.COLUMN_SUMMARY, null);
row.add(Root.COLUMN_SUMMARY, summary);
row.add(Root.COLUMN_FLAGS, Root.FLAG_SUPPORTS_CREATE | Root.FLAG_SUPPORTS_SEARCH | Root.FLAG_SUPPORTS_IS_CHILD);
row.add(Root.COLUMN_TITLE, applicationName);
row.add(Root.COLUMN_MIME_TYPES, ALL_MIME_TYPES);
Expand Down
1 change: 1 addition & 0 deletions app_pojavlauncher/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@

<string name="generic_install">Install</string>
<string name="generic_apply">Apply</string>
<string name="generic_debug">Debug</string>

<string name="search_modpack_no_result">No modpacks found</string>
<string name="search_modpack_error">Failed to find modpacks</string>
Expand Down

0 comments on commit e71be1e

Please sign in to comment.