Skip to content

Commit

Permalink
dealing with no-existent file
Browse files Browse the repository at this point in the history
  • Loading branch information
VitorVieiraZ committed Apr 23, 2024
1 parent 99aaa6f commit 5c0bf4b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/inpututils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,12 @@

#include "imageutils.h"
#include "variablesmanager.h"
#include "notificationmodel.h"

#include <Qt>
#include <QDir>
#include <QFile>
#include <QMessageBox>
#include <QFileInfo>
#include <QDesktopServices>
#include <QUrl>
Expand Down Expand Up @@ -2163,6 +2165,11 @@ void InputUtils::openLink( const QString &homePath, const QString &link )
{
QString relativePath = link.mid( QString( "project://" ).length() );
QString absoluteLinkPath = homePath + QDir::separator() + relativePath;
if (!fileExists(absoluteLinkPath)){
QString errorMessage = tr("The specified file does not exist: %1").arg(relativePath);
QMessageBox::warning(nullptr, "File Not Found", errorMessage);
return;
}
#ifdef Q_OS_ANDROID
mAndroidUtils->openFile( absoluteLinkPath );
#elif defined(Q_OS_IOS)
Expand Down

0 comments on commit 5c0bf4b

Please sign in to comment.