View | Details | Raw Unified | Return to bug 265193
Collapse All | Expand All

(-)blockfilesystem.cpp (-5 / +15 lines)
Lines 1-5 Link Here
1
/*
1
/*
2
    Copyright 2016 Gleb Popov <6yearold@gmail.com>
2
    Copyright 2016-2022 Gleb Popov <6yearold@gmail.com>
3
3
4
    Redistribution and use in source and binary forms, with or without modification,
4
    Redistribution and use in source and binary forms, with or without modification,
5
    are permitted provided that the following conditions are met:
5
    are permitted provided that the following conditions are met:
Lines 32-37 Link Here
32
#include <QDBusConnectionInterface>
32
#include <QDBusConnectionInterface>
33
#include <QDBusMessage>
33
#include <QDBusMessage>
34
#include <QProcess>
34
#include <QProcess>
35
#include <QStandardPaths>
35
#include <QDir>
36
#include <QDir>
36
37
37
#include <sys/param.h>
38
#include <sys/param.h>
Lines 143-149 Link Here
143
    }
144
    }
144
    else if(filesystem == "ntfs")
145
    else if(filesystem == "ntfs")
145
    {
146
    {
146
        mountProg = QStringLiteral("ntfs-3g");
147
        mountProg = QStandardPaths::findExecutable("ntfs-3g");
147
    }
148
    }
148
    else if(filesystem == "cd9660")
149
    else if(filesystem == "cd9660")
149
    {
150
    {
Lines 151-160 Link Here
151
    }
152
    }
152
    else if(filesystem == "ext2fs")
153
    else if(filesystem == "ext2fs")
153
    {
154
    {
154
        mountProg = QStringLiteral("fuse2fs");
155
        mountProg = QStandardPaths::findExecutable("fuse2fs");
155
156
156
        args << QStringLiteral("-o") << (QStringLiteral("uid=") + QString::number(uid));
157
        if (BsdisksConfig::get().PreferNativeExt2 || mountProg.isEmpty())
157
        args << QStringLiteral("-o") << QStringLiteral("allow_other");
158
        {
159
            mountProg = QStringLiteral("/sbin/mount");
160
            args << QStringLiteral("-t") << QStringLiteral("ext2fs");
161
            args << QStringLiteral("-o") << QStringLiteral("async");
162
        }
163
        else
164
        {
165
            args << QStringLiteral("-o") << (QStringLiteral("uid=") + QString::number(uid));
166
            args << QStringLiteral("-o") << QStringLiteral("allow_other");
167
        }
158
    }
168
    }
159
    else if(filesystem == "exfat")
169
    else if(filesystem == "exfat")
160
    {
170
    {
(-)bsdisks.conf.sample (+3 lines)
Lines 2-4 Link Here
2
# Widely used value for Russia:
2
# Widely used value for Russia:
3
# mount_msdosfs_flags = -D cp1251 -L ru_RU.UTF-8
3
# mount_msdosfs_flags = -D cp1251 -L ru_RU.UTF-8
4
mount_msdosfs_flags =
4
mount_msdosfs_flags =
5
6
# Whether to prefer FreeBSD native ext2 support over FUSE-provided one
7
prefer_native_ext2 = false
(-)bsdisks.h (+1 lines)
Lines 36-41 Link Here
36
{
36
{
37
public:
37
public:
38
    QString MountMsdosfsFlags;
38
    QString MountMsdosfsFlags;
39
    bool PreferNativeExt2;
39
40
40
    static BsdisksConfig& get();
41
    static BsdisksConfig& get();
41
};
42
};
(-)main.cpp (+3 lines)
Lines 122-127 Link Here
122
122
123
            if(parsed[0].trimmed() == QStringLiteral("mount_msdosfs_flags"))
123
            if(parsed[0].trimmed() == QStringLiteral("mount_msdosfs_flags"))
124
                BsdisksConfig::get().MountMsdosfsFlags = parsed[1].trimmed();
124
                BsdisksConfig::get().MountMsdosfsFlags = parsed[1].trimmed();
125
126
            else if(parsed[0].trimmed() == QStringLiteral("prefer_native_ext2"))
127
                BsdisksConfig::get().PreferNativeExt2 = parsed[1] != "false";
125
        } while(!line.isEmpty());
128
        } while(!line.isEmpty());
126
    }
129
    }
127
    configFile.close();
130
    configFile.close();

Return to bug 265193