Skip to content

Commit

Permalink
Some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
wurzer committed Jun 2, 2024
1 parent f419061 commit bb9545c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 22 deletions.
2 changes: 1 addition & 1 deletion AppGrid.qml
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ LauncherPage {
appLauncher.appGroups = new Array
appLauncher.createAppGroups(groupedApps)
// Workaround, if users didn't update the os version
if (!appsString.contains("org.fossify.gallery")) mainView.galleryApp = "com.simplemobiletools.gallery.pro"
if (!appsString.includes("org.fossify.gallery")) mainView.galleryApp = "com.simplemobiletools.gallery.pro"
} else {
console.log("AppLauncher | Need to retrieve apps from system")
mainView.updateSpinner(true)
Expand Down
9 changes: 0 additions & 9 deletions fileio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,15 +139,6 @@ QString FileIO::readPresets()
{
QString mDataPath = "/system/etc/com.volla.launcher/volla_properties.json";
qDebug() << "Data Path: " << mDataPath;
QDir myDir(mDataPath);
if (!myDir.exists()) {
bool ok = myDir.mkpath(mDataPath);
if(!ok) {
qWarning() << "Couldn't create dir. " << mDataPath;
}
qDebug() << "created directory path" << mDataPath;
}

QFile file(mDataPath);
QString fileContent;
if ( file.open(QIODevice::ReadOnly) ) {
Expand Down
26 changes: 14 additions & 12 deletions main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -1067,30 +1067,32 @@ ApplicationWindow {
property double lastContactsCheck: 0.0

function checkCustomParameters() {
console.log("AppWindow | Presets: " + presets.readPresets())

var rawPresets = presets.readPresets()

for (var i = 0; i < rawPresets.split("\n").length; i++) {
console.debug("AppWindow | presets " + rawPresets.split("\n")[i])
}

if (rawPresets !== undefined && rawPresets.length > 0) {
var presetDict = JSON.parse(rawPresets)

if (presetDict.color !== undefined && presetDict.color.accent !== undefined) {
console.debug("AppWindow | Set accent color from "+ Universal.accent + " to " + presetDict.color.accent)
mainView.accentColor = presetDict.color.accent
console.debug("AppWindow | Accent color is " + Universal.accent)
}
if (presetDict.feeds !== undefined && presetDict.feeds.length > 0) {
console.debug("AppWindow | Set feeds to " + presetDict.feeds)
console.debug("AppWindow | Set default feeds to " + presetDict.feeds)
mainView.defaultFeeds = presetDict.feeds
if (settings.firstStart()) mainView.resetFeeds()
if (settings.firstStart) mainView.resetFeeds()
}
if (presets.quickMenu !== undefined && presets.quickMenu.length > 0) {
console.debug("AppWindow | Set default actions to " + presetDict.quickMenu)
mainView.defaultActions = presets.quickMenu
if (presetDict.firstStart()) mainView.resetActions()
if (presetDict.quickmenu !== undefined && presetDict.quickmenu.length > 0) {
console.debug("AppWindow | Set default actions to " + presetDict.quickmenu)
mainView.defaultActions = presets.quickmenu
if (presetDict.firstStart) mainView.resetActions()
}
if (presets.theme !== undefined && settings.firstStart) {
console.debug("AppWindow | Set theme to " + presetDict.theme)
presetDict.theme = presetDict.theme
if (presetDict.theme !== undefined) { // && settings.firstStart) {
console.debug("AppWindow | Set default theme to " + presetDict.theme)
settings.theme = presetDict.theme
}
}
}
Expand Down

0 comments on commit bb9545c

Please sign in to comment.