Can send image to conversations

This commit is contained in:
2018-12-19 08:26:11 +01:00
parent 0148f7aaa5
commit 9100c14dfd
13 changed files with 224 additions and 12 deletions

View File

@ -1,4 +1,5 @@
#include <QDir>
#include <QMimeDatabase>
#include "filesutils.h"
@ -17,3 +18,8 @@ bool FilesUtils::CreateDirectoryIfNotExists(const QString &path)
return dir.mkpath(".");
}
QString FilesUtils::GetFileMimeType(const QString &filePath)
{
return (QMimeDatabase()).mimeTypeForFile(filePath).name();
}

View File

@ -23,6 +23,14 @@ public:
* FALSE else
*/
static bool CreateDirectoryIfNotExists(const QString &path);
/**
* Get the mime type of a file
*
* @param filePath The path of the file to determine
* @return File type
*/
static QString GetFileMimeType(const QString &filePath);
};
#endif // FILESUTILS_H