#include <KisAndroidFileProxy.h>
Definition at line 13 of file KisAndroidFileProxy.h.
◆ getFileFromContentUri()
| QString KisAndroidFileProxy::getFileFromContentUri |
( |
QString | contentUri | ) |
|
|
static |
This clones the file to internal storage so we can return it. This is useful for APIs which don't work on file descriptors.
Definition at line 15 of file KisAndroidFileProxy.cpp.
16{
17 QFile
file(contentUri);
18 const QString savePath = QStandardPaths::writableLocation(QStandardPaths::CacheLocation);
19
20 QDir dirPath = savePath;
21
22 QString filename =
file.fileName();
23 if (dirPath.exists(filename)) {
24
25 dirPath.remove(filename);
26 }
27
28 bool copyResult =
file.copy(savePath +
"/" + filename);
29 if (!copyResult) {
30 qWarning() << "Failed to copy file from content uri" << contentUri << "to" << savePath + "/" + filename;
32 return "";
33 }
34 return savePath + "/" + filename;
35}
References ppVar.
The documentation for this class was generated from the following files: