Commit 2880990c authored by Armin Felder's avatar Armin Felder
Browse files

desktop fileupload

 Please enter the commit message for your changes. Lines starting
parent 8b0061bf
......@@ -25,7 +25,7 @@
FileUploader::FileUploader( QObject *parent, RocketChatServerData *pServer, const QUrl &pUri, const QString &pChannelId ): QObject( parent ),
mUri( pUri ), mChannelId( pChannelId ), mServer( pServer )
{
auto file = QSharedPointer<QFile>::create( pUri.path() );
auto file = QSharedPointer<QFile>::create( pUri.toLocalFile() );
if ( file->isOpen() ) {
file->close();
......
......@@ -431,24 +431,27 @@ void RocketChat::openFileDialog( const QString &pChannelId )
#ifdef Q_OS_ANDROID
openAndroidFileDialog( pChannelId );
#endif
}
void RocketChat::openFileExternally( const QString &pPath )
{
#ifdef Q_OS_LINUX
Q_UNUSED( pPath );
#endif
#ifdef Q_OS_ANDROID
#if defined( Q_OS_ANDROID)
QString q = pPath;
QAndroidJniObject jniObject = QAndroidJniObject::fromString(q);
jstring j = jniObject.object<jstring>();
QtAndroid::androidActivity().callObjectMethod("openFile","(Ljava/lang/String;)Ljava/lang/String;",j);
#endif
#ifdef Q_OS_IOS
#elif defined(Q_OS_LINUX)
QDesktopServices::openUrl(pPath);
#elif defined (Q_OS_IOS)
emit openIOSFileDialog( pPath );
#elif defined(Q_OS_WIN)
QDesktopServices::openUrl(pPath);
#elif defined(Q_OS_MACOS)
QDesktopServices::openUrl(pPath);
#endif
}
bool RocketChat::hasCameraPermission()
......
......@@ -156,7 +156,7 @@ class RocketChat : public QObject
int getUserStatus();
protected:
private:
QMutex newServerMutex;
//TODO: switch from shared pointer to normal ones, to avoid these hacks
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment