Krita Source Code Documentation
Loading...
Searching...
No Matches
KisAndroidFileProxy Class Reference

#include <KisAndroidFileProxy.h>

Static Public Member Functions

static QString getFileFromContentUri (QString contentUri)
 

Detailed Description

Definition at line 13 of file KisAndroidFileProxy.h.

Member Function Documentation

◆ 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 // if the file already exists, delete it
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;
31 qWarning() << " " << ppVar(file.error()) << ppVar(file.errorString());
32 return "";
33 }
34 return savePath + "/" + filename;
35}
#define ppVar(var)
Definition kis_debug.h:155

References ppVar.


The documentation for this class was generated from the following files: