From b9de8a17e8205d5d902de4b9b424b8d47fe9d276 Mon Sep 17 00:00:00 2001 From: haanhvu Date: Tue, 15 Oct 2024 15:49:52 +0700 Subject: [PATCH] Clean up --- .../com/igalia/wolvic/ui/widgets/WindowWidget.java | 13 ------------- .../com/igalia/wolvic/ui/widgets/Windows.java | 2 -- .../ui/widgets/settings/DisplayOptionsView.java | 4 ++-- app/src/main/res/values/strings.xml | 2 +- 4 files changed, 3 insertions(+), 18 deletions(-) diff --git a/app/src/common/shared/com/igalia/wolvic/ui/widgets/WindowWidget.java b/app/src/common/shared/com/igalia/wolvic/ui/widgets/WindowWidget.java index 66013730d9..33cd40ab58 100644 --- a/app/src/common/shared/com/igalia/wolvic/ui/widgets/WindowWidget.java +++ b/app/src/common/shared/com/igalia/wolvic/ui/widgets/WindowWidget.java @@ -404,10 +404,8 @@ public void loadHome() { } else { if (mSession.getHomeUri() == "") { - Log.e(LOGTAG, "Empty home URI in WindowWidget => Show bookmarks"); showPanel(Windows.BOOKMARKS); } else { - Log.e(LOGTAG, "Non-empty home URI in WindowWidget => Load homepage"); mSession.loadUri(SettingsStore.getInstance(getContext()).getHomepage()); } } @@ -531,16 +529,13 @@ public void showPanel(@Windows.PanelType int panelType) { public void showPanel(@Windows.PanelType int panelType, boolean switchSurface) { if (mLibrary != null) { - Log.e(LOGTAG, "mLibrary is not null => Function USED"); if (mView == null) { - Log.e(LOGTAG, "mView is null => First case"); setView(mLibrary, switchSurface); mLibrary.selectPanel(panelType); mLibrary.onShow(); mViewModel.setIsFindInPage(false); mViewModel.setIsPanelVisible(true); //if (mRestoreFirstPaint == null && !isFirstPaintReady() && (mFirstDrawCallback != null) && (mSurface != null)) { - Log.e(LOGTAG, "if is executed"); final Runnable firstDrawCallback = mFirstDrawCallback; onFirstContentfulPaint(mSession.getWSession()); mRestoreFirstPaint = () -> { @@ -550,18 +545,10 @@ public void showPanel(@Windows.PanelType int panelType, boolean switchSurface) { mWidgetManager.updateWidget(WindowWidget.this); } }; - //} else { - //Log.e(LOGTAG, "if is not executed"); - //} } else if (mView == mLibrary) { - Log.e(LOGTAG, "mView == mLibrary => Second case"); mLibrary.selectPanel(panelType); - } else { - Log.e(LOGTAG, "mView is other case => Function NOT USED"); } - } else { - Log.e(LOGTAG, "mLibrary is null => Function NOT USED"); } } diff --git a/app/src/common/shared/com/igalia/wolvic/ui/widgets/Windows.java b/app/src/common/shared/com/igalia/wolvic/ui/widgets/Windows.java index 22fe907917..1c1c71aefe 100644 --- a/app/src/common/shared/com/igalia/wolvic/ui/widgets/Windows.java +++ b/app/src/common/shared/com/igalia/wolvic/ui/widgets/Windows.java @@ -1520,10 +1520,8 @@ public void addTab(@NonNull WindowWidget targetWindow, @Nullable String aUri) { targetWindow.setSession(session, WindowWidget.DEACTIVATE_CURRENT_SESSION); if (aUri == null || aUri.isEmpty()) { if (session.getHomeUri() == "") { - Log.e(LOGTAG, "Empty home URI in Windows => Show bookmarks"); targetWindow.showPanel(Windows.BOOKMARKS); } else { - Log.e(LOGTAG, "Non-empty home URI in Windows => Load homepage"); session.loadHomePage(); } } diff --git a/app/src/common/shared/com/igalia/wolvic/ui/widgets/settings/DisplayOptionsView.java b/app/src/common/shared/com/igalia/wolvic/ui/widgets/settings/DisplayOptionsView.java index 02c16218a4..eb30fc6d24 100644 --- a/app/src/common/shared/com/igalia/wolvic/ui/widgets/settings/DisplayOptionsView.java +++ b/app/src/common/shared/com/igalia/wolvic/ui/widgets/settings/DisplayOptionsView.java @@ -407,9 +407,9 @@ private void setHomepage(int checkedId, boolean doApply) { private int getHomepageId() { String homepage = SettingsStore.getInstance(getContext()).getHomepage(); - if (homepage == mDefaultHomepageUrl) { + if (homepage == getContext().getString(R.string.HOMEPAGE_URL)) { return 0; - } else if (homepage == "New Tab") { + } else if (homepage == "") { return 1; } else { return 2; diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index dcfaab0126..f2903c6d75 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -609,7 +609,7 @@ Wolvic - New tab + Bookmarks Other