Announcement

Collapse
No announcement yet.

Dolphin no longer recognizing plain text files without extension

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [RESOLVED] Dolphin no longer recognizing plain text files without extension

    Previously to sometime this month, Dolphin did not need a file extension to recognize a plain text file. Now apparently it does and I am unable to fix it by setting a new mimetype:

    Click image for larger version  Name:	Screenshot_20240720_131801.jpg Views:	0 Size:	10.2 KB ID:	681364

    Please Read Me

    #2
    In my case now, with or without extension,txt, files open in open office writer with a single click.

    Comment


      #3
      Originally posted by marco07 View Post
      In my case now, with or without extension,txt, files open in open office writer with a single click.
      Right click on the file, select "Properties" then next to "Open With" click "Change" and select "Kate" and then "Move Up" until it's at the top. Open Office probably set itself as default when you installed it.

      Please Read Me

      Comment


        #4
        Originally posted by oshunluvr View Post
        Previously to sometime this month, Dolphin did not need a file extension to recognize a plain text file. Now apparently it does and I am unable to fix it by setting a new mimetype:

        Click image for larger version Name:	Screenshot_20240720_131801.jpg Views:	0 Size:	10.2 KB ID:	681364
        I'm not seeing this on my system.

        Comment


          #5
          What's weird is I really can't fix it. I'm waiting for the re-base to 24.04 then I'm moving to a clean install and home. I've been updating/upgrading this one since 2018. Time for a "clean house"

          I'm also having other problems with Dolphin - screen not refreshing, file highlights messed up, etc. I reinstalled it but no change. I have to close it after a few file moves or whatever just to refresh the screen.

          Please Read Me

          Comment


            #6
            Originally posted by oshunluvr View Post

            Right click on the file, select "Properties" then next to "Open With" click "Change" and select "Kate" and then "Move Up" until it's at the top. Open Office probably set itself as default when you installed it.
            Thank you. I already had done it through system settings>Default Application.

            Comment


              #7
              Getting weirder now...

              New behavior: text files without an extension are opened by "Subtitle Composer" even though the "Properties" show a ".sub" extension for Subtitle Composer.

              Further testing reveals that the text file (without an extension) is detected as a subtitle file by Dolphin if there are mac addresses in the file - which there were in this case. Deleting the mac addresses resulted in the file being opened by Kate instead.

              I suspect Dolphin scans the text file if it has no extension and tries to "guess" what the file contains.

              One plus to this discovery is I found that if you click the middle button on a text file with no extension, it opens in Kate. I also discovered if you attempt the middle-click on a .desktop file it opens with Kwrite instead of Kate. Kwrite was the second option listed in "Preferences".

              Still, for whatever reason, Dolphin assumes a file with mac addresses in it and has no extension is a subtitle file. Preferences on the file with mac addresses in it says it's a ".sub" file even though it has no extension.
              Last edited by oshunluvr; Jul 24, 2024, 08:39 AM.

              Please Read Me

              Comment


                #8
                Originally posted by oshunluvr View Post
                Dolphin assumes a file with mac addresses in it and has no extension is a subtitle file.
                Not the case with the no extension plain text file I just created that contains the output (on my 24.04 desktop PC) of ip addr show Double-clicking on it from Dolphin opens the file with Kate.
                Windows no longer obstructs my view.
                Using Kubuntu Linux since March 23, 2007.
                "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                Comment


                  #9
                  Here's the content of the file:
                  Click image for larger version  Name:	Screenshot_20240724_165153.jpg Views:	0 Size:	38.5 KB ID:	681459


                  Here's the content as viewed from Subtitle composer:

                  Click image for larger version  Name:	Screenshot_20240724_165129.jpg Views:	0 Size:	60.1 KB ID:	681460


                  Note the contents match.

                  If I delete these two four lines:

                  Code:
                  ethernet 60:45:cb:74:ee:a4 yes
                  wifi e8:d1:1b:6c:96:9b no
                  
                  ~~~
                  
                  monster=01:12:46:82:ab:4f
                  ghost=01:1a:d2:56:6b:e6​
                  ​(Edit: I left out the other 2 MAC lines)

                  The file opens with Kate by default.

                  I deleted one line at a time until Kate was the default and these two four lines cause the mis-match.

                  These lines resemble subtitle file (.srt) content but I am unfamiliar with ".sub" format. Some text from an srt file:

                  Code:
                  1
                  00:01:40,857 --> 00:01:42,620
                  There was me.
                  
                  2
                  00:01:43,026 --> 00:01:45,756
                  That is, Alex, and my three droogs.
                  
                  3
                  00:01:46,029 --> 00:01:49,658
                  That is, Pete, Georgie and Dim.

                  I think Dolphin must think the MAC addresses are time codes. You can see Subtitle Composer i only 49% sure it's a subtitle file.
                  Last edited by oshunluvr; Jul 24, 2024, 03:16 PM.

                  Please Read Me

                  Comment


                    #10
                    I looked up "sub" files and this is the format:
                    Code:
                    {0}{100}Subtitle line 1
                    {150}{300}Subtitle line 2
                    {350}{550}Subtitle line 3
                    so MAC addresses are not really at all like SUB format.

                    Please Read Me

                    Comment


                      #11
                      For additional conformation of what's actually happening, I delete all the lines except each of the 4 MAC lines and either (any) of them cause the false file type identification.

                      Please Read Me

                      Comment


                        #12
                        So I decided to "solve" it myself with this work-around. I simply changed the preferences for ".sub" files to use Kate as the primary editor and Subtitle Composer as the secondary. That way when I click on a text file with no extension but has MAC addresses in it's content, it will open with Kate.

                        If I ever actually encounter a .sub file, I will hit the middle mouse button to open it.

                        Still, poor behavior on Dolphins part, but a very small vector in my world so moving on...

                        Please Read Me

                        Comment


                          #13
                          On the plus side, whatever was causing the initial problem in the first post seems to have gone away. An update and/or me force re-installing Dolphin probably solved it.

                          Please Read Me

                          Comment


                            #14
                            You keep ascribing the problems to dolphin, but I think deciding the type of files is done by another level or service, dolphin is just invoking that.

                            The MIME spec implies that KDE implements the spec, but I don't know where to look for the details; I kept getting lost looking through the repository.

                            One can use xdg-open in a konsole to open files, and get slightly more info about what is going on, for example:
                            Code:
                            $ cat foo
                            A plain text file.
                            ALfa bravo charlie delta.
                            $ xdg-open foo
                            kf.service.services: KApplicationTrader: mimeType "x-scheme-handler/file" not found
                            and foo is opened in my editor.
                            Regards, John Little

                            Comment

                            Working...
                            X