Skip to content

Commit

Permalink
android manifest update and code layout fix
Browse files Browse the repository at this point in the history
  • Loading branch information
VitorVieiraZ committed May 15, 2024
1 parent 829c476 commit cc302b8
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 34 deletions.
52 changes: 26 additions & 26 deletions app/inpututils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2180,37 +2180,37 @@ QString InputUtils::getDeviceModel()

bool InputUtils::openLink( const QString &homePath, const QString &link )
{
if ( link.startsWith( LOCAL_FILE_PREFIX ) )
if ( link.startsWith( LOCAL_FILE_PREFIX ) )
{
QString relativePath = link.mid( QString( LOCAL_FILE_PREFIX ).length() );
QString absoluteLinkPath = homePath + QDir::separator() + relativePath;
if ( !fileExists( absoluteLinkPath ) )
{
QString relativePath = link.mid( QString( LOCAL_FILE_PREFIX ).length() );
QString absoluteLinkPath = homePath + QDir::separator() + relativePath;
if ( !fileExists( absoluteLinkPath ) )
{
return false;
}
return false;
}
#ifdef Q_OS_ANDROID
if ( !mAndroidUtils->openFile( absoluteLinkPath ) )
{
return false;
}
if ( !mAndroidUtils->openFile( absoluteLinkPath ) )
{
return false;
}
#elif defined(Q_OS_IOS)
if ( ! IosUtils::openFile( absoluteLinkPath ) )
{
return false;
}
#else
// Desktop environments
QUrl fileUrl = QUrl::fromLocalFile( absoluteLinkPath );
if ( !QDesktopServices::openUrl( fileUrl ) )
{
return false;
}
#endif
if ( ! IosUtils::openFile( absoluteLinkPath ) )
{
return false;
}
else
#else
// Desktop environments
QUrl fileUrl = QUrl::fromLocalFile( absoluteLinkPath );
if ( !QDesktopServices::openUrl( fileUrl ) )
{
QDesktopServices::openUrl( QUrl( link ) );
return false;
}
#endif
}
else
{
QDesktopServices::openUrl( QUrl( link ) );
}

return true;
return true;
}
2 changes: 1 addition & 1 deletion app/ios/iosutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ QString IosUtils::getDeviceModel()
bool IosUtils::openFile( const QString &filePath )
{
#ifdef Q_OS_IOS
return openFileImpl( filePath );
return openFileImpl( filePath );
#else
return false;
#endif
Expand Down
8 changes: 4 additions & 4 deletions app/ios/iosutils.mm
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@
***************************************************************************/

#include <UIKit/UIKit.h>
<<<<<<< HEAD
<<< <<< < HEAD
#include <sys/utsname.h>
=======
== == == =
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#include <QString>
>>>>>>> 05801f46 (ios pdf viewing)
>>> >>> > 05801f46( ios pdf viewing )
#include "iosutils.h"

void IosUtils::setIdleTimerDisabled()
void IosUtils::setIdleTimerDisabled()
{
[[UIApplication sharedApplication] setIdleTimerDisabled:YES];
}
Expand Down
11 changes: 8 additions & 3 deletions cmake_templates/AndroidManifest.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,15 @@
<service android:process=":trackingThread" android:name=".PositionTrackingService" android:foregroundServiceType="location" android:stopWithTask="true"/>
</application>

<!-- Explicitly mention that we need to use external app for capturing an image -->
<!-- Explicitly mention that we need to use external app for capturing an image and open file-->
<queries>
<intent>
<intent>
<action android:name="android.media.action.IMAGE_CAPTURE" />
</intent>
</intent>
<intent>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
</intent>
</queries>
</manifest>

0 comments on commit cc302b8

Please sign in to comment.