Home>

Good day.

In linux 20.2(uma), in the file manager -Nemo

When working with a python file (linux.py), it incorrectly recognizes the file although the extension is .py, but it recognizes it as qml, Before changing this line, everything is valid:

self.tabWidget.setStyleSheet("background-color: #22222e")

after replacing it with this line file manager starts recognizing the file as qml(Qt Murkup Language):

self.tabWidget.setStyleSheet("QTabBar::tab:selected {\n"
"background-color:rgb(121, 193, 162);\n"
"color: white;\n"
"}\n"
"QTabBar::tab:!selected {\n"
"background-color:rgb(34, 34, 46);\n"
"color: white;\n"
"}\n"
"")

even though the code was written using the pyqt5 library, but the extension was set to .py, but the file manager starts thinking.

Everything works correctly and there are no errors in the application itself. But the file manager is very annoying because it does not understand that this is a .py file.

Is there any way to make it so that the type is chosen by extension and not as it does now?

also tried to set the program to be executed by default on /usr/bin/python3 -didn't help.

Thank you in advance :D

The complete code for setting the interface to the application:

#!/usr/bin/python3
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtWidgets import QApplication
from PyQt5.QtGui import QClipboard
import os
import string
from random import randint, choice
import sys
from datetime import datetime as dt
class Ui_MainWindow(object):
    def setupUi(self, MainWindow):
        self.main_path= os.getcwd()
        MainWindow.setWindowIcon(QtGui.QIcon(os.path.join(os.getcwd() + "/log/lock.ico")))
        MainWindow.setObjectName("MainWindow")
        MainWindow.setFixedSize(750, 650)
        MainWindow.setStyle(QtWidgets.QStyleFactory.create("oxygen"))
        font= QtGui.QFont()
        font.setFamily("URW Gothic L")
        MainWindow.setFont(font)
        MainWindow.setStyleSheet("background-color: rgb(34, 34, 46)")
        self.centralwidget= QtWidgets.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")
        self.tabWidget= QtWidgets.QTabWidget(self.centralwidget)
        self.tabWidget.setGeometry(QtCore.QRect(0, 0, 750, 650))
        font= QtGui.QFont()
        font.setFamily("URW Gothic [UKWN]")
        font.setPointSize(14)
        font.setBold(False)
        font.setItalic(False)
        fontsetWeight(50)
        self.tabWidget.setFont(font)
        self.tabWidget.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor))
        self.tabWidget.setAcceptDrops(False)
        self.tabWidget.setStyleSheet("QTabBar::tab:selected{background-color:rgb(121, 193, 162);color: white;}QTabBar::tab:!selected{background-color:rgb(34, 34, 46);color: white;}")
        self.tabWidget.setTabsClosable(False)
        self.tabWidget.setMovable(True)
        self.tabWidget.setObjectName("tabWidget")
        self.tab_check= QtWidgets.QWidget()
        self.tab_check.setStyleSheet("")
        self.tab_check.setObjectName("tab_check")
        self.frame_main= QtWidgets.QFrame(self.tab_check)
        self.frame_main.setGeometry(QtCore.QRect(-5, 0, 760, 150))
        self.frame_main.setStyleSheet("background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1, stop:0 rgba(125, 200, 167, 255), stop:1 rgba(34, 34, 46, 255))")
        self.frame_main.setFrameShape(QtWidgets.QFrame.StyledPanel)self.frame_main.setFrameShadow(QtWidgets.QFrame.Raised) self.frame_main.setObjectName("frame_main")
        self.main_check= QtWidgets.QLabel(self.frame_main)
        self.main_check.setGeometry(QtCore.QRect(30, 20, 691, 70))
        font= QtGui.QFont()
        font.setFamily("URW Gothic [UKWN]")
        font.setPointSize(36)
        font.setBold(False)
        font.setItalic(False)
        fontsetWeight(50)
        self.main_check.setFont(font)
        self.main_check.setStyleSheet("background-color: rgba(0,0,0,0);\n""color: white;")
        self.main_check.setObjectName("main_check")
        self.inp_check= QtWidgets.QLineEdit(self.tab_check)
        self.inp_check.setGeometry(QtCore.QRect(75, 300, 600, 60))
        font= QtGui.QFont()
        font.setFamily("URW Gothic [urw]")
        font.setPointSize(16)
        font.setBold(False)
        font.setItalic(False)
        fontsetWeight(50)
        self.inp_check.setFont(font)
        self.inp_check.setStyleSheet("background-color: #22222e;\n""border: 2px solid rgb(125, 200, 167);\n""border-radius: 30;\n""color: white;\ n""padding-left:10px;\n""padding-right: 10px;")
        self.inp_check.setText("")
        self.inp_check.setClearButtonEnabled(False)
        self.inp_check.setObjectName("inp_check")
        self.but_check= QtWidgets.QPushButton(self.tab_check)
        self.but_check.setGeometry(QtCore.QRect(225, 380, 300, 60))
        font= QtGui.QFont()
        font.setFamily("URW Gothic [urw]")
        font.setPointSize(16)
        font.setBold(True)
        font.setItalic(True)
        fontsetWeight(75)
        self.but_check.setFont(font)
        self.but_check.setStyleSheet("QPushButton{\n"" color: white;\n"" background-color: rgb(125, 200, 167);\n"" border-radius: 30;\n"" outline: 0;\n""}\n""\n""QPushButton:pressed {\n"" \n"" background-color: rgb(255, 255, 255);\n"" color: rgb(125, 200, 167);\n"" outline: 0;\n""}")
        self.but_check.setObjectName("but_check")
        self.lab_check= QtWidgets.QLabel(self.tab_check)
        self.lab_check.setGeometry(QtCore.QRect(75, 250, 591, 41))
        font= QtGui.QFont()
        font.setFamily("URW Gothic [urw]")
        font.setPointSize(22)
        self.lab_check.setFont(font)
        self.lab_check.setStyleSheet("color: white;")
        self.lab_check.setObjectName("lab_check")
        self.tabWidget.addTab(self.tab_check, "")
        self.tab_make= QtWidgets.QWidget()
        self.tab_make.setObjectName("tab_make")
        self.frame_make= QtWidgets.QFrame(self.tab_make)
        self.frame_make.setGeometry(QtCore.QRect(0, 0, 750, 150))
        self.frame_make.setStyleSheet("background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1, stop:0 rgba(125, 200, 167, 255), stop:1 rgba(34, 34, 46, 255))")
        self.frame_make.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.frame_make.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frame_make.setObjectName("frame_make")
        self.main_make= QtWidgets.QLabel(self.tab_make)
        self.main_make.setGeometry(QtCore.QRect(30, 20, 661, 70))
        font= QtGui.QFont()
        font.setFamily("URW Gothic [UKWN]")
        font.setPointSize(36)
        font.setBold(False)
        font.setItalic(False)
        fontsetWeight(50)
        self.main_make.setFont(font)
        self.main_make.setStyleSheet("background-color: rgba(0,0,0,0);\n""color: white;")
        self.main_make.setObjectName("main_make")
        self.lab_make= QtWidgets.QLabel(self.tab_make)
        self.lab_make.setGeometry(QtCore.QRect(75, 250, 600, 40))
        font= QtGui.QFont()
        font.setFamily("URW Gothic [urw]")
        font.setPointSize(16)
        self.lab_make.setFont(font)
        self.lab_make.setStyleSheet("border-bottom: 2px solid rgb(125, 200, 167);\n""padding-bottom: 0;\n""margin: 0;\n""color: white;")
        self.lab_make.setObjectName("lab_make")
        self.but_make= QtWidgets.QPushButton(self.tab_make)
        self.but_make.setGeometry(QtCore.QRect(250, 300, 250, 50))
        font= QtGui.QFont()
        font.setFamily("URW Gothic [urw]")
        font.setPointSize(14)
        font.setBold(True)font.setItalic(True) font.setWeight(75)
        self.but_make.setFont(font)
        self.but_make.setStyleSheet("QPushButton{\n"" color: white;\n"" background-color: rgb(125, 200, 167);\n"" border-radius: 25;\n"" outline: 0;\n""}\n""\n""QPushButton:pressed {\n"" \n"" background-color: rgb(255, 255, 255);\n"" color: rgb(125, 200, 167);\n"" outline: 0;\n""}")
        self.but_make.setObjectName("but_make")
        self.frame_save_make= QtWidgets.QFrame(self.tab_make)
        self.frame_save_make.setGeometry(QtCore.QRect(10, 470, 360, 121))
        self.frame_save_make.setStyleSheet("\n""QFrame{\n"" border: 2px solid rgb(125, 200, 167);\n"" border-radius: 30;\n""}")
        self.frame_save_make.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.frame_save_make.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frame_save_make.setObjectName("frame_save_make")
        self.radio_save_make= QtWidgets.QRadioButton(self.frame_save_make)
        self.radio_save_make.setGeometry(QtCore.QRect(20, 20, 320, 50))
        font= QtGui.QFont()
        font.setFamily("URW Gothic [urw]")
        font.setPointSize(16)
        self.radio_save_make.setFont(font)
        self.radio_save_make.setStyleSheet("QRadioButton{\n"" color: white;\n"" background-color: rgb(125, 200, 167);\n"" border-radius: 25;\n"" outline: 0;\n"" padding-left: 30px;\n""}\n""QRadioButton::indicator{\n"" height: 0;\n"" width: 0;\n""}\n" "QRadioButton::checked{\n"" color: rgb(125, 200, 167);\n"" background-color: white;\n""} \n""")
        self.radio_save_make.setObjectName("radio_save_make")
        self.lab_umolch= QtWidgets.QLabel(self.frame_save_make)
        self.lab_umolch.setGeometry(QtCore.QRect(25, 80, 312, 22))
        font= QtGui.QFont()
        font.setFamily("URW Gothic L")
        font.setPointSize(14)
        font.setItalic(True)
        self.lab_umolch.setFont(font)
        self.lab_umolch.setStyleSheet("color: white;\n""border:none\n""")
        self.lab_umolch.setObjectName("lab_umolch")
        self.frame_prim_make= QtWidgets.QFrame(self.tab_make)
        self.frame_prim_make.setGeometry(QtCore.QRect(380, 470, 360, 121))
        self.frame_prim_make.setStyleSheet("border: 2px solid rgb(125, 200, 167);\n""border-radius: 30; color: white;")
        self.frame_prim_make.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.frame_prim_make.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frame_prim_make.setObjectName("frame_prim_make")
        self.label= QtWidgets.QLabel(self.frame_prim_make)
        self.label.setGeometry(QtCore.QRect(20, 20, 321, 31))
        font= QtGui.QFont()
        font.setFamily("URW Gothic L")
        font.setPointSize(14)
        font.setBold(False)
        font.setItalic(True)
        fontsetWeight(50)
        self.label.setFont(font)
        self.label.setStyleSheet("border:none;")
        self.label.setObjectName("label")
        self.primech_inp_make= QtWidgets.QLineEdit(self.frame_prim_make)
        self.primech_inp_make.setGeometry(QtCore.QRect(10, 60, 341, 41))
        font= QtGui.QFont()
        font.setFamily("URW Gothic [urw]")
        font.setPointSize(12)
        font.setItalic(True)
        self.primech_inp_make.setFont(font)
        self.primech_inp_make.setStyleSheet("border:2px solid rgb(125, 200, 167);;;\n""border-radius: 20;\n""color: white;\n""padding-left: 7px;\ n""padding-right: 7px;")
        self.primech_inp_make.setText("")
        self.primech_inp_make.setObjectName("primech_inp_make")
        self.dop_lab_make= QtWidgets.QLabel(self.tab_make)
        self.dop_lab_make.setGeometry(QtCore.QRect(30, 430, 551, 31))
        font= QtGui.QFont()
        font.setFamily("URW Gothic [UKWN]")
        font.setPointSize(18)
        self.dop_lab_make.setStyleSheet("color: white")
        self.dop_lab_make.setFont(font)
        self.dop_lab_make.setObjectName("dop_lab_make")
        self.frame_save_make.raise_()
        self.frame_make.raise_()
        self.main_make.raise_()
        self.lab_make.raise_()
        self.but_make.raise_()
        self.frame_prim_make.raise_()
        self.dop_lab_make.raise_()self.tabWidget.addTab(self.tab_make, "") self.tab_opt= QtWidgets.QWidget()
        self.tab_opt.setObjectName("tab_opt")
        self.frame_opt= QtWidgets.QFrame(self.tab_opt)
        self.frame_opt.setGeometry(QtCore.QRect(0, 0, 750, 150))
        self.frame_opt.setStyleSheet("background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1, stop:0 rgba(125, 200, 167, 255), stop:1 rgba(34, 34, 46, 255))")
        self.frame_opt.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.frame_opt.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frame_opt.setObjectName("frame_opt")
        self.main_opt= QtWidgets.QLabel(self.frame_opt)
        self.main_opt.setGeometry(QtCore.QRect(30, 20, 320, 70))
        font= QtGui.QFont()
        font.setFamily("URW Gothic [UKWN]")
        font.setPointSize(36)
        font.setBold(False)
        font.setItalic(False)
        fontsetWeight(50)
        self.main_opt.setFont(font)
        self.main_opt.setStyleSheet("color: white;\n""background-color: none;")
        self.main_opt.setObjectName("main_opt")
        self.frame_lang= QtWidgets.QFrame(self.tab_opt)
        self.frame_lang.setGeometry(QtCore.QRect(420, 520, 280, 60))
        self.frame_lang.setStyleSheet("QFrame{\n"" background-color: rgb(34, 34, 46);\n"" border: 2px solid rgb(125, 200, 167);\n"" border-radius : 30;\n""}\n""QLabel{\n"" border: none\n""}")
        self.frame_lang.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.frame_lang.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frame_lang.setObjectName("frame_lang")
        self.lang= QtWidgets.QComboBox(self.frame_lang)
        self.lang.setGeometry(QtCore.QRect(205, 10, 50, 40))
        font= QtGui.QFont()
        font.setFamily("URW Gothic [urw]")
        font.setPointSize(14)
        font.setBold(True)
        font.setItalic(False)
        fontsetWeight(75)
        self.lang.setFont(font)
        self.lang.setStyleSheet("QComboBox{\n"" background-color: rgba(0,0,0,0);\n"" border: 2px solid rgb(125, 200, 167);\n"" border -radius: 4;\n"" color: white;\n""}\n""QComboBox::drop-down{\n"" width:0px;\n"" :0px;\n"" border: 0px;\n""}\n""QComboBox QAbstractItemView{\n"" color: rgb(125, 200, 167);\n"" padding: 10p;\n"" selection-background-color: rgb(143 , 230, 191);\n"" background-color: rgb(34, 34, 46);\n"" border: 2px solid rgb(125, 200, 167);\n"" border-radius: 5; \n""}")
        self.lang.setObjectName("lang")
        self.lang.addItem("")
        self.lang.addItem("")
        self.lab_lang= QtWidgets.QLabel(self.frame_lang)
        self.lab_lang.setGeometry(QtCore.QRect(20, 10, 180, 40))
        font= QtGui.QFont()
        font.setFamily("URW Gothic [UKWN]")
        font.setPointSize(14)
        font.setBold(False)
        font.setItalic(True)
        fontsetWeight(50)
        self.lab_lang.setFont(font)
        self.lab_lang.setStyleSheet("color: white;")
        self.lab_lang.setObjectName("lab_lang")
        self.but_path_opt= QtWidgets.QPushButton(self.tab_opt)
        self.but_path_opt.setGeometry(QtCore.QRect(40, 245, 250, 50))
        font= QtGui.QFont()
        font.setFamily("URW Gothic [urw]")
        font.setPointSize(14)
        font.setBold(True)
        font.setItalic(True)
        fontsetWeight(75)
        self.but_path_opt.setFont(font)
        self.but_path_opt.setStyleSheet("QPushButton{\n"" color: white;\n"" background-color: rgb(125, 200, 167);\n"" border-radius: 25;\n"" outline: 0;\n""}\n""\n""QPushButton:pressed { \n"" margin: 0; \n"" padding: 40px;\n""\n"" background-color: rgb(255 , 255, 255);\n"" color: rgb(125, 200, 167);\n"" outline: 0;\n""}")
        self.but_path_opt.setObjectName("but_path_opt")
        self.lab_where_save_opt= QtWidgets.QLabel(self.tab_opt)
        self.lab_where_save_opt.setGeometry(QtCore.QRect(40, 210, 661, 31))
        font= QtGui.QFont()
        font.setFamily("URW Gothic [urw]")
        font.setPointSize(18)
        self.lab_where_save_opt.setFont(font)
        self.lab_where_save_opt.setStyleSheet("color: white;")
        self.lab_where_save_opt.setObjectName("lab_where_save_opt")self.radio_hiden_opt= QtWidgets.QRadioButton(self.tab_opt) self.radio_hiden_opt.setGeometry(QtCore.QRect(350, 245, 250, 50))
        font= QtGui.QFont()
        font.setFamily("URW Gothic [urw]")
        font.setPointSize(14)
        font.setBold(True)
        font.setItalic(True)
        fontsetWeight(75)
        self.radio_hiden_opt.setFont(font)
        self.radio_hiden_opt.setStyleSheet("QRadioButton{\n"" background-color: rgb(125, 200, 167);\n"" border-radius:25;\n"" color: white;\n"" outline: 0;\n"" padding-left: 50px;\n""}\n""QRadioButton::indicator{\n"" height: 0;\n"" width: 0;\n""}\n" "QRadioButton::checked{\n"" color: rgb(125, 200, 167);\n"" background-color: white;\n""}")
        self.radio_hiden_opt.setObjectName("radio_hiden_opt")
        self.frame_path= QtWidgets.QFrame(self.tab_opt)
        self.frame_path.setGeometry(QtCore.QRect(10, 200, 720, 201))
        font= QtGui.QFont()
        font.setFamily("URW Gothic [urw]")
        self.frame_path.setFont(font)
        self.frame_path.setStyleSheet("border: 2px solid rgb(125, 200, 167);\n""border-radius: 30;")
        self.frame_path.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.frame_path.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frame_path.setObjectName("frame_path")
        self.lab_name_opt= QtWidgets.QLabel(self.frame_path)
        self.lab_name_opt.setGeometry(QtCore.QRect(30, 110, 611, 16))
        font= QtGui.QFont()
        font.setFamily("URW Gothic L")
        font.setPointSize(14)
        font.setBold(False)
        font.setItalic(False)
        fontsetWeight(50)
        self.lab_name_opt.setFont(font)
        self.lab_name_opt.setStyleSheet("border: 0px solid rgba(0,0,0,0) ;\n""color: white;")
        self.lab_name_opt.setObjectName("lab_name_opt")
        self.set_name_opt= QtWidgets.QLineEdit(self.frame_path)
        self.set_name_opt.setGeometry(QtCore.QRect(30, 137, 521, 41))
        font= QtGui.QFont()
        font.setFamily("URW Gothic [urw]")
        font.setPointSize(12)
        font.setItalic(True)
        self.set_name_opt.setFont(font)
        self.set_name_opt.setStyleSheet("border-radius: 20;\n""color: white;\n""padding-left: 5px;")
        self.set_name_opt.setObjectName("set_name_opt")
        self.frame_path.raise_()
        self.frame_lang.raise_()
        self.frame_opt.raise_()
        self.but_path_opt.raise_()
        self.lab_where_save_opt.raise_()
        self.radio_hiden_opt.raise_()
        self.tabWidget.addTab(self.tab_opt, "")
        MainWindow.setCentralWidget(self.centralwidget)
        self.retranslateUi(MainWindow)
        self.tabWidget.setCurrentIndex(0)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)
        self.download_folder= os.path.join(os.path.expanduser('~'))
        self.lang.currentTextChanged.connect(lambda: self.retranslateUi(MainWindow))
        self.but_check.clicked.connect(self.pas_check)
        self.but_path_opt.clicked.connect(self.get_folder)
        self.but_make.clicked.connect(self.create)

The comments are not meant to be extended discussion; conversation moved to chat.

Grundy2022-02-13 19:18:08
  • Answer # 1

    This is a bug at the intersection of two projects: Gnome gliband FDO's shared-mime-info:

    • shared-mime-info has a value that is too broad for its file type autodetection magic constants, which gives false positives.
    • glib attributepriorityfrom the mime database, assuming high priority means certainty that the file is of a particular type.

    The minimum file to play, which is a valid Python script:

    from PyQt5 import QtCore
    # {
    

    What to do

    Submit a bug for both to fix:

    • inglibask that high priority guesses not override the type determined by the file extension.
    • inshared-mime-infoask them to try and fix their type guesser, or at least lower the priority for that particular entry, to make glib happy. You can just write in an old discussion here.

    You need to be prepared for the fact that they will not answer immediately /will ask additional questions

    What can be done right now

    Decrease the priority on your machine, i.e. v/usr/share/mime/packages/freedesktop.org.xmlfind entry:

    <mime-type type="text/x-qml">    <!--... -->    <magic priority="80">    <!--... -->      <match type="string" value="import Qt" offset="0:3000">        <match type="string" value="{" offset="9:3009"/>      </match>    <!--... -->    </magic> </mime-type>

    and replace80anything less than79

    And then execute

    update-mime-database /usr/share/mime
    

    When updating a packageshared-mime-infothese changes will be lost.

    Is it possible right now to make it set the type only by the file extension?

    Alex alexeev2022-02-13 19:38:58

    @Alexalexeev in general, "only by extension and always" by reasonable means -you can’t ... only change the behavior in glib (by patching it and rebuilding it) ... to solve this particular problem, see under the heading "What can be done right now"

    Fat-Zer2022-02-13 19:52:19

    and if you change everything in freedesktop.org.xml to zero? (possibly a very stupid idea)

    Alex alexeev2022-02-13 19:54:34

    @Alexalexeev, see Reporting bugs in the README... in short, just create problems in issues and specify everything you need... you can also refer to the FDO's spec that priorities over 80 do not have any kind of exclusivity...

    Fat-Zer2022-02-13 20:37:39

    @Alexalexeev, that's not a very good idea... you can change all values ​​to <80, then the content-based classification won't override what's obtained from the extension... but content-based subtyping will still happen... but that's just glossing over a bug in glib...

    Fat-Zer2022-02-13 20:45:47
  • Answer # 2

    This is a bug at the intersection of two projects: Gnome gliband FDO's shared-mime-info:

    • shared-mime-info has a value that is too broad for its file type autodetection magic constants, which gives false positives.
    • glib attributepriorityfrom the mime database, assuming high priority means certainty that the file is of a particular type.

    The minimum file to play, which is a valid Python script:

    from PyQt5 import QtCore
    # {
    

    What to do

    Submit a bug for both to fix:

    • inglibask that high priority guesses not override the type determined by the file extension.
    • inshared-mime-infoask them to try and fix their type guesser, or at least lower the priority for that particular entry, to make glib happy. You can just write in an old discussion here.

    You need to be prepared for the fact that they will not answer immediately /will ask additional questions

    What can be done right now

    Decrease the priority on your machine, i.e. v/usr/share/mime/packages/freedesktop.org.xmlfind entry:

    &lt;mime-type type="text/x-qml"&gt;    &lt;!--... --&gt;    &lt;magic priority="80"&gt;    &lt;!--... --&gt;      &lt;match type="string" value="import Qt" offset="0:3000"&gt;        &lt;match type="string" value="{" offset="9:3009"/&gt;      &lt;/match&gt;    &lt;!--... --&gt;    &lt;/magic&gt; &lt;/mime-type&gt;

    and replace80anything less than79

    And then execute

    update-mime-database /usr/share/mime
    

    When updating a packageshared-mime-infothese changes will be lost.

    Is it possible right now to make it set the type only by the file extension?

    Alex alexeev2022-02-13 19:38:58

    @Alexalexeev in general, "only by extension and always" by reasonable means -you can’t ... only change the behavior in glib (by patching it and rebuilding it) ... to solve this particular problem, see under the heading "What can be done right now"

    Fat-Zer2022-02-13 19:52:19

    and if you change everything in freedesktop.org.xml to zero? (possibly a very stupid idea)

    Alex alexeev2022-02-13 19:54:34

    @Alexalexeev, see Reporting bugs in the README... in short, just create problems in issues and specify everything you need... you can also refer to the FDO's spec that priorities over 80 do not have any kind of exclusivity...

    Fat-Zer2022-02-13 20:37:39

    @Alexalexeev, that's not a very good idea... you can change all values ​​to <80, then the content-based classification won't override what's obtained from the extension... but content-based subtyping will still happen... but that's just glossing over a bug in glib...

    Fat-Zer2022-02-13 20:45:47