gui: PreviewGenerator: Make previews for all text files
Dieser Commit ist enthalten in:
Ursprung
26c7cdbc5f
Commit
145cd150b1
@ -1,3 +1,4 @@
|
||||
#include "../shared/common.h"
|
||||
#include "previewgenerator.h"
|
||||
#include "previewgeneratorpdf.h"
|
||||
#include "previewgeneratorplaintext.h"
|
||||
@ -11,5 +12,13 @@ static QMap<QString, PreviewGenerator *> generators{
|
||||
|
||||
PreviewGenerator *PreviewGenerator::get(QFileInfo &info)
|
||||
{
|
||||
return generators.value(info.suffix(), nullptr);
|
||||
PreviewGenerator *result = generators.value(info.suffix(), nullptr);
|
||||
if(result == nullptr)
|
||||
{
|
||||
if(Common::isTextFile(info))
|
||||
{
|
||||
return plainTextGenerator;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren