Skip to content

Commit

Permalink
add different text for multiple projects
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasMizera committed May 26, 2020
1 parent 42a12e4 commit da63359
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 4 additions & 1 deletion app/localprojectsmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ static QString findQgisProjectFile( const QString &projectDir )
{
return foundProjectFiles.first();
}
return QString();
else if ( foundProjectFiles.count() > 1 ) // multiple projects
return QString( "ERR:-2" );
else // no projects
return QString( "ERR:-1" );
}


Expand Down
8 changes: 6 additions & 2 deletions app/projectsmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,18 @@ void ProjectModel::findProjectFiles()
projectFile.projectName = project.projectName;
projectFile.projectNamespace = project.projectNamespace;
QDateTime created = fi.created().toUTC(); // TODO: why UTC ???
if ( !project.qgisProjectFilePath.isEmpty() )
if ( !project.qgisProjectFilePath.startsWith( "ERR" ) )
{
projectFile.info = QString( created.toString() );
projectFile.isValid = true;
}
else
{
projectFile.info = tr( "Missing QGIS project file" );
if ( project.qgisProjectFilePath.contains( "-1" ) )
projectFile.info = tr( "Missing QGIS project file" );
else if ( project.qgisProjectFilePath.contains( "-2" ) )
projectFile.info = tr( "Error: Multiple QGIS project files" );

projectFile.isValid = false;
}
mProjectFiles << projectFile;
Expand Down

5 comments on commit da63359

@inputapp-bot
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ios-1.4.200526153755 (SDK: ios-4)

@inputapp-bot
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

win-apk: x86_64 (SDK: win-7)

@inputapp-bot
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

signed apk: armeabi-v7a (SDK: android-13)

@inputapp-bot
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

signed apk: arm64-v8a (SDK: android-13)

@saberraz
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do you think of having those validation on the server side (too)?

Please sign in to comment.