Version: (using KDE KDE 3.5.4) This is really strange to restrict files to "supported" ones. Word processor should at least read plain text file, and you can treat almost anything as plain file, right? So what is the point of "supported" file? "Not supported" file example: ================== FILENAME: 0000003.out =================== [ pomysł ] [ myśl($|[^nieę]), myślę($|[^c]), myśle($|[^n]), myśli($|[^sbw]) ] [ wolne, wolni([^u]|$), wolno$, woln[ąay], wolnoś ] [ dzieł ] [ zdoln ] [ talen[tc] ] [ osiągn[ią] ] [ wynal[ae] ] [ wizj[^e], wizje($|[^rż]) ] [ twoż[^y], twoży($|[^w]) ] [ odkry[ćc], odkryw[^k] ] [ czas[aeiuyóu], czaso[mw]($|[^n]) ] [ portal ] [ fantazj ] [ wyobra[źż] ] [ twurcz ] [ podruż ] [ pżyszłoś ] [ pżestże[ńn] ] [ możliw ] [ nieograni ] [ niesko[ńn] ] --bam=bam.out --bond-limit=1e-2 --config=.config --create --dict=dict.out --edit-distance=1 --encodings=p --flat-priming=1 --freq --lcs --length=7 --limit-on=cut-off --limit-results=200 --matrix=matrix.out --model=ngram,sgram --norm-block=3 --norm-max=2 --norm-sum=1 --out=results --plotter --pos --priming=focus-ideo.txt --use-markers ## =================== END OF FILE ============================= Joe can edit it, MCedit too, Kate too, OOWriter too and I think plenty of editors can too. KWord maybe can but it refuses to open it, so in the effect I can't do anything with it.
On Monday 09 October 2006 21:34, Maciej Pilichowski wrote: > plain text file Yes but this file doesn't get detected as text, it gets detected as "unknown", due to unknown extension and unknown kind of contents... file(1) gets it right, though, so I guess it's a KMimeMagic bug.
> Yes but this file doesn't get detected as text, it gets detected > as "unknown", due to unknown extension and unknown kind of contents... Not true. I have ~25 files like that, all *.out and ~7 seem to be supported, the rest not.
On Tuesday 10 October 2006 07:51, Maciej Pilichowski wrote: > Not true. I have ~25 files like that, all *.out and ~7 seem to be supported, the rest not. Exactly, it all depends on the "detection from the contents of the file". Sometimes it finds that it's text, and sometimes it sees too many non-ascii chars to be sure. Mimetype determination from the contents of the file is definitely unreliable, but it's all we can do when the extension is unknown.
There are only ASCII>32 inside. But David, I am not talking about better recognition. Please, remove this "supported formats" item, and add "all files". With Kate I could try to open even movie file, it doesn't matter. If the format is not "recognized" treat it like plain text file.
On Tuesday 10 October 2006 13:06, Maciej Pilichowski wrote: > There are only ASCII>32 inside. Yes but >127 too, so it might not be text, as far as mimetype determination is concerned. > But David, I am not talking about better recognition. Please, remove this "supported formats" item, and add "all files". > With Kate I could try to open even movie file, it doesn't matter. If the format is not "recognized" treat it like plain text file. It's easy for kate to do that, they can only open plain text. But in koffice, how would we know which import filter to use if the file has an unknown mimetype? It could be text, it could be a msword document, it could be a csv file, how do we know if all we got was "unknown"? In your case you could simply edit file associations in konqueror (or type "keditfiletype text/plain") and add *.out as an extension for text/plain.
> It's easy for kate to do that, they can only open plain text. > But in koffice, The user probably treat as "better-Kate" and could be pretty puzzled why an easy task in Kate is impossible in KWord. > how would we know which import filter to use > if the file has an unknown mimetype? Well, it is better "we don't know" than "we forbid". > It could be text, it could be a msword document, it could be a csv file, how > do we know if all we got was "unknown"? Fall for default-guess (let's say, set in preferences) or... simply ask the user (you do it after all -- choosing encoding for text file and format of lines). Finally the last safe choice is -- plain text. I hope you agree it is better just to load it than to refuse to work with user documents. > In your case you could simply edit file associations in konqueror (or > type "keditfiletype text/plain") and add *.out as an extension for > text/plain. I like the "you could _simply_" part ;-))) Sorry, I couldn't resist :-D I use .out extension as an output from all my apps (for exclusion from the backup), not all of them are text files. I think it is faster to load it to kate and copy & paste to Kword. Of course, thank you for the hint, however it is workaround -- it is hard to expect for the user to add all extensions in Konq. just to work with KWord.
SVN commit 594578 by dfaure: When a file has an unknown mimetype, don't error out, offer the user the filter chooser dialog instead. BUG: 135366 M +2 -11 KoDocument.cpp M +0 -5 KoFilterManager.cpp --- branches/koffice/1.6/koffice/lib/kofficecore/KoDocument.cpp #594577:594578 @@ -1442,15 +1442,6 @@ QString importedFile = m_file; - if ( typeName == KMimeType::defaultMimeType() ) { - kdError(30003) << "No mimetype found for " << m_file << endl; - QApplication::restoreOverrideCursor(); - if ( d->m_autoErrorHandlingEnabled ) - KMessageBox::error( 0L, i18n( "Could not open\n%1" ).arg( url().prettyURL( 0, KURL::StripFileProtocol ) ) ); - d->m_bLoading = false; - return false; - } - if ( !isNativeFormat( typeName.latin1() ) ) { if ( !d->filterManager ) d->filterManager = new KoFilterManager( this ); @@ -1689,7 +1680,7 @@ in.reset(); // Remove spaces do { - if ( in.readBlock( buf , 1 ) < 1 ) + if ( in.readBlock( buf , 1 ) < 1 ) { QApplication::restoreOverrideCursor(); in.close(); @@ -1698,7 +1689,7 @@ } } while ( QChar( buf[0] ).isSpace() ); if ( buf[0] == '<' ) { // First not-space character - if ( in.readBlock( buf , 4 ) < 4 ) + if ( in.readBlock( buf , 4 ) < 4 ) { QApplication::restoreOverrideCursor(); in.close(); --- branches/koffice/1.6/koffice/lib/kofficecore/KoFilterManager.cpp #594577:594578 @@ -144,11 +144,6 @@ KURL u; u.setPath( url ); KMimeType::Ptr t = KMimeType::findByURL( u, 0, true ); - if ( t->name() == KMimeType::defaultMimeType() ) { - kdError(s_area) << "No mimetype found for " << url << endl; - status = KoFilter::BadMimeType; - return QString::null; - } m_graph.setSourceMimeType( t->name().latin1() ); // .latin1() is okay here (Werner) if ( !m_graph.isValid() ) {
You need to log in before you can comment on or make changes to this bug.