gui: PreviewGenerator: Make previews for all text files
Cette révision appartient à :
Parent
26c7cdbc5f
révision
145cd150b1
@ -1,3 +1,4 @@
|
|||||||
|
#include "../shared/common.h"
|
||||||
#include "previewgenerator.h"
|
#include "previewgenerator.h"
|
||||||
#include "previewgeneratorpdf.h"
|
#include "previewgeneratorpdf.h"
|
||||||
#include "previewgeneratorplaintext.h"
|
#include "previewgeneratorplaintext.h"
|
||||||
@ -11,5 +12,13 @@ static QMap<QString, PreviewGenerator *> generators{
|
|||||||
|
|
||||||
PreviewGenerator *PreviewGenerator::get(QFileInfo &info)
|
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;
|
||||||
}
|
}
|
||||||
|
Chargement…
Référencer dans un nouveau ticket
Block a user